@hipay/hipay-material-ui 1.0.0-beta.13 → 1.0.0-beta.15
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/HiBreadcrumb/HiBreadcrumb.js +28 -22
- package/HiBreadcrumb/HiStep.js +96 -60
- package/HiBreadcrumb/HiStepConnector.js +91 -26
- package/HiBreadcrumb/HiStepContent.js +122 -0
- package/HiBreadcrumb/HiStepIcon.js +86 -29
- package/HiBreadcrumb/HiStepLabel.js +128 -62
- package/HiBreadcrumb/HiStepper.js +5 -24
- package/HiDatePicker/HiDateRangePicker.js +69 -28
- package/HiDatePicker/HiDateRangeSelector.js +14 -6
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +3 -1
- package/HiDatePicker/Overlays/Overlay.js +22 -4
- package/HiDatePicker/stylesheet.js +7 -0
- package/HiForm/HiInput.js +24 -11
- package/HiForm/HiSlider.js +399 -0
- package/HiForm/index.js +9 -0
- package/HiSelect/HiSelect.js +1 -1
- package/HiTable/BodyCellBuilder.js +3 -0
- package/HiTable/BodyCells/CellIcon.js +26 -19
- package/HiTable/BodyCells/CellImage.js +17 -13
- package/HiTable/BodyCells/CellNumeric.js +7 -2
- package/HiTable/BodyCells/CellSentinel.js +14 -13
- package/HiTable/BodyCells/CellThirdPartySecurity.js +43 -19
- package/HiTable/HeaderCell.js +3 -2
- package/es/HiBreadcrumb/HiBreadcrumb.js +27 -19
- package/es/HiBreadcrumb/HiStep.js +55 -54
- package/es/HiBreadcrumb/HiStepConnector.js +86 -26
- package/es/HiBreadcrumb/HiStepContent.js +63 -0
- package/es/HiBreadcrumb/HiStepIcon.js +103 -35
- package/es/HiBreadcrumb/HiStepLabel.js +106 -63
- package/es/HiBreadcrumb/HiStepper.js +5 -21
- package/es/HiDatePicker/HiDateRangePicker.js +65 -27
- package/es/HiDatePicker/HiDateRangeSelector.js +15 -7
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +3 -1
- package/es/HiDatePicker/Overlays/Overlay.js +18 -4
- package/es/HiDatePicker/stylesheet.js +7 -0
- package/es/HiForm/HiInput.js +19 -10
- package/es/HiForm/HiSlider.js +309 -0
- package/es/HiForm/index.js +1 -0
- package/es/HiSelect/HiSelect.js +1 -1
- package/es/HiTable/BodyCellBuilder.js +3 -0
- package/es/HiTable/BodyCells/CellIcon.js +15 -8
- package/es/HiTable/BodyCells/CellImage.js +16 -14
- package/es/HiTable/BodyCells/CellNumeric.js +6 -2
- package/es/HiTable/BodyCells/CellSentinel.js +8 -5
- package/es/HiTable/BodyCells/CellThirdPartySecurity.js +40 -15
- package/es/HiTable/HeaderCell.js +3 -2
- package/es/utils/hiHelpers.js +4 -3
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +43 -43
- package/umd/hipay-material-ui.development.js +7680 -7171
- package/umd/hipay-material-ui.production.min.js +5 -5
- package/utils/hiHelpers.js +4 -2
@@ -191,11 +191,11 @@ var HiDateRangeSelector = function (_React$Component) {
|
|
191
191
|
if (selectedOption) {
|
192
192
|
_this.props.onChange('from', selectedOption.from.toDate());
|
193
193
|
_this.props.onChange('to', selectedOption.to.toDate());
|
194
|
-
if (_this.props.returnSelectValue === true) {
|
195
|
-
_this.props.onChange('period', value);
|
196
|
-
}
|
197
194
|
}
|
198
195
|
}
|
196
|
+
if (_this.props.returnSelectValue === true) {
|
197
|
+
_this.props.onChange('period', value);
|
198
|
+
}
|
199
199
|
};
|
200
200
|
};
|
201
201
|
|
@@ -252,7 +252,8 @@ var HiDateRangeSelector = function (_React$Component) {
|
|
252
252
|
translations = _props.translations,
|
253
253
|
classes = _props.classes,
|
254
254
|
selectProps = _props.selectProps,
|
255
|
-
|
255
|
+
staticPosition = _props.staticPosition,
|
256
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['disabled', 'enableTime', 'error', 'errorText', 'helperIcon', 'helperText', 'idRange', 'idSelect', 'label', 'from', 'onChange', 'required', 'to', 'translations', 'classes', 'selectProps', 'staticPosition']);
|
256
257
|
var selectedPreset = this.state.selectedPreset;
|
257
258
|
|
258
259
|
|
@@ -284,7 +285,8 @@ var HiDateRangeSelector = function (_React$Component) {
|
|
284
285
|
translations: translations,
|
285
286
|
value: selectedPreset,
|
286
287
|
containerWidth: this.state.containerWidth,
|
287
|
-
classes: { root: classes.dateSelect }
|
288
|
+
classes: { root: classes.dateSelect },
|
289
|
+
staticPosition: staticPosition
|
288
290
|
}, selectProps))
|
289
291
|
),
|
290
292
|
_react2.default.createElement(
|
@@ -299,7 +301,8 @@ var HiDateRangeSelector = function (_React$Component) {
|
|
299
301
|
onChange: onChange,
|
300
302
|
onReset: this.handleReset,
|
301
303
|
disabled: disabled || selectedPreset !== 'custom',
|
302
|
-
translations: translations
|
304
|
+
translations: translations,
|
305
|
+
staticPosition: staticPosition
|
303
306
|
}, props))
|
304
307
|
)
|
305
308
|
);
|
@@ -313,6 +316,7 @@ HiDateRangeSelector.defaultProps = {
|
|
313
316
|
defaultPreset: 'cd',
|
314
317
|
enableTime: false,
|
315
318
|
returnSelectValue: false,
|
319
|
+
staticPosition: false,
|
316
320
|
locale: 'fr-FR',
|
317
321
|
format: 'YYYY-DD-MM',
|
318
322
|
translations: {
|
@@ -414,6 +418,10 @@ HiDateRangeSelector.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
414
418
|
* Props passées au HiSelectField
|
415
419
|
*/
|
416
420
|
selectProps: _propTypes2.default.object,
|
421
|
+
/**
|
422
|
+
* Si true, le calendrier sera dans une div static plutot que dans une popper absolute
|
423
|
+
*/
|
424
|
+
staticPosition: _propTypes2.default.bool,
|
417
425
|
/**
|
418
426
|
* Date de fin sélectionnée
|
419
427
|
*/
|
@@ -98,9 +98,11 @@ var CustomOverlayLayout = function CustomOverlayLayout(_ref) {
|
|
98
98
|
|
99
99
|
var paperClass = (0, _classnames2.default)(classes.paper, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.left, side === 'from'), (0, _defineProperty3.default)(_classNames, classes.right, side === 'to'), _classNames));
|
100
100
|
|
101
|
+
var paperProps = (0, _extends3.default)({}, props);
|
102
|
+
|
101
103
|
return _react2.default.createElement(
|
102
104
|
_Paper2.default,
|
103
|
-
{ className: paperClass },
|
105
|
+
{ className: paperClass, onBlur: paperProps.onBlur, onFocus: paperProps.onFocus },
|
104
106
|
_react2.default.createElement(
|
105
107
|
'div',
|
106
108
|
{ className: classes.overlay },
|
@@ -5,10 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.styles = undefined;
|
7
7
|
|
8
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
9
|
+
|
10
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
11
|
+
|
8
12
|
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
9
13
|
|
10
14
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
11
15
|
|
16
|
+
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
17
|
+
|
18
|
+
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
19
|
+
|
12
20
|
var _react = require('react');
|
13
21
|
|
14
22
|
var _react2 = _interopRequireDefault(_react);
|
@@ -34,10 +42,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
34
42
|
var styles = exports.styles = function styles() {
|
35
43
|
return {
|
36
44
|
paper: {
|
37
|
-
position: 'absolute',
|
38
45
|
width: '100%',
|
39
46
|
zIndex: 10
|
40
47
|
},
|
48
|
+
absolute: {
|
49
|
+
position: 'absolute'
|
50
|
+
},
|
51
|
+
relative: {
|
52
|
+
position: 'relative'
|
53
|
+
},
|
41
54
|
left: {
|
42
55
|
width: '200%',
|
43
56
|
left: 0
|
@@ -57,13 +70,18 @@ var Overlay = function Overlay(_ref) {
|
|
57
70
|
|
58
71
|
var classes = _ref.classes,
|
59
72
|
children = _ref.children,
|
60
|
-
side = _ref.side
|
73
|
+
side = _ref.side,
|
74
|
+
staticPosition = _ref.staticPosition,
|
75
|
+
props = (0, _objectWithoutProperties3.default)(_ref, ['classes', 'children', 'side', 'staticPosition']);
|
76
|
+
|
77
|
+
|
78
|
+
var paperClass = (0, _classnames2.default)(classes.paper, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.left, side === 'from'), (0, _defineProperty3.default)(_classNames, classes.right, side === 'to'), (0, _defineProperty3.default)(_classNames, classes.absolute, staticPosition !== true), (0, _defineProperty3.default)(_classNames, classes.relative, staticPosition === true), _classNames));
|
61
79
|
|
62
|
-
var
|
80
|
+
var paperProps = (0, _extends3.default)({}, props);
|
63
81
|
|
64
82
|
return _react2.default.createElement(
|
65
83
|
_Paper2.default,
|
66
|
-
{ className: paperClass },
|
84
|
+
{ onBlur: paperProps.onBlur, onFocus: paperProps.onFocus, className: paperClass },
|
67
85
|
_react2.default.createElement(
|
68
86
|
'div',
|
69
87
|
{ className: classes.overlay },
|
@@ -31,6 +31,13 @@ exports.default = function (theme) {
|
|
31
31
|
width: 'calc(50% - 4px)',
|
32
32
|
marginLeft: 4
|
33
33
|
},
|
34
|
+
absolute: {
|
35
|
+
position: 'absolute'
|
36
|
+
},
|
37
|
+
dayPickerMargin: {
|
38
|
+
top: -337,
|
39
|
+
width: 'calc(100% - 4px)'
|
40
|
+
},
|
34
41
|
// The container element
|
35
42
|
container: {
|
36
43
|
width: '100%',
|
package/HiForm/HiInput.js
CHANGED
@@ -238,20 +238,29 @@ var HiInput = function (_React$PureComponent) {
|
|
238
238
|
}, {
|
239
239
|
key: 'handleFocus',
|
240
240
|
value: function handleFocus(event) {
|
241
|
-
if (
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
|
-
|
241
|
+
if (this.endAdornmentNode && this.endAdornmentNode.contains(event.target)) {
|
242
|
+
event.stopPropagation();
|
243
|
+
} else {
|
244
|
+
if (!this.state.focused) {
|
245
|
+
this.setState({ focused: true });
|
246
|
+
}
|
247
|
+
if (this.props.onFocus) {
|
248
|
+
this.props.onFocus(event);
|
249
|
+
}
|
250
|
+
this.inputElement.focus();
|
246
251
|
}
|
247
252
|
}
|
248
253
|
}, {
|
249
254
|
key: 'handleDivClick',
|
250
|
-
value: function handleDivClick() {
|
251
|
-
if (
|
252
|
-
|
255
|
+
value: function handleDivClick(event) {
|
256
|
+
if (this.endAdornmentNode && this.endAdornmentNode.contains(event.target)) {
|
257
|
+
event.stopPropagation();
|
258
|
+
} else {
|
259
|
+
if (!this.state.focused) {
|
260
|
+
this.setState({ focused: true });
|
261
|
+
}
|
262
|
+
this.inputElement.focus();
|
253
263
|
}
|
254
|
-
this.inputElement.focus();
|
255
264
|
}
|
256
265
|
}, {
|
257
266
|
key: 'handleMouseEnter',
|
@@ -278,7 +287,9 @@ var HiInput = function (_React$PureComponent) {
|
|
278
287
|
}, {
|
279
288
|
key: 'render',
|
280
289
|
value: function render() {
|
281
|
-
var _classNames,
|
290
|
+
var _classNames,
|
291
|
+
_this2 = this,
|
292
|
+
_classNames4;
|
282
293
|
|
283
294
|
var _props = this.props,
|
284
295
|
value = _props.value,
|
@@ -369,7 +380,9 @@ var HiInput = function (_React$PureComponent) {
|
|
369
380
|
startAdornment: leftIcon,
|
370
381
|
endAdornment: _react2.default.createElement(
|
371
382
|
'div',
|
372
|
-
{ className: classes.endAdornment
|
383
|
+
{ className: classes.endAdornment, ref: function ref(el) {
|
384
|
+
return _this2.endAdornmentNode = el;
|
385
|
+
} },
|
373
386
|
eraseIcon,
|
374
387
|
endAdornment
|
375
388
|
),
|
@@ -0,0 +1,399 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.styles = undefined;
|
7
|
+
|
8
|
+
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
9
|
+
|
10
|
+
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
11
|
+
|
12
|
+
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
13
|
+
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
15
|
+
|
16
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
17
|
+
|
18
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
19
|
+
|
20
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
21
|
+
|
22
|
+
var _createClass3 = _interopRequireDefault(_createClass2);
|
23
|
+
|
24
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
25
|
+
|
26
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
27
|
+
|
28
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
29
|
+
|
30
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
31
|
+
|
32
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
33
|
+
|
34
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
35
|
+
|
36
|
+
var _react = require('react');
|
37
|
+
|
38
|
+
var _react2 = _interopRequireDefault(_react);
|
39
|
+
|
40
|
+
var _propTypes = require('prop-types');
|
41
|
+
|
42
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
43
|
+
|
44
|
+
var _classnames = require('classnames');
|
45
|
+
|
46
|
+
var _classnames2 = _interopRequireDefault(_classnames);
|
47
|
+
|
48
|
+
var _withStyles = require('../styles/withStyles');
|
49
|
+
|
50
|
+
var _withStyles2 = _interopRequireDefault(_withStyles);
|
51
|
+
|
52
|
+
var _HiIconBuilder = require('../utils/HiIconBuilder');
|
53
|
+
|
54
|
+
var _HiIconBuilder2 = _interopRequireDefault(_HiIconBuilder);
|
55
|
+
|
56
|
+
var _HiFormControl = require('../HiForm/HiFormControl');
|
57
|
+
|
58
|
+
var _HiFormControl2 = _interopRequireDefault(_HiFormControl);
|
59
|
+
|
60
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
61
|
+
|
62
|
+
var styles = exports.styles = function styles(theme) {
|
63
|
+
return {
|
64
|
+
barContainer: {
|
65
|
+
width: '100%',
|
66
|
+
position: 'relative',
|
67
|
+
margin: '0 7px'
|
68
|
+
},
|
69
|
+
barHidden: {
|
70
|
+
width: '100%',
|
71
|
+
opacity: 0,
|
72
|
+
position: 'absolute',
|
73
|
+
top: '7px',
|
74
|
+
zIndex: '2'
|
75
|
+
},
|
76
|
+
mainContainer: (0, _extends3.default)({}, theme.typography.body1, {
|
77
|
+
display: 'flex',
|
78
|
+
flexWrap: 'nowrap',
|
79
|
+
alignItems: 'center'
|
80
|
+
}),
|
81
|
+
topContainer: {
|
82
|
+
display: 'flex',
|
83
|
+
flexWrap: 'nowrap',
|
84
|
+
height: '18px'
|
85
|
+
},
|
86
|
+
bottomContainer: {
|
87
|
+
display: 'flex',
|
88
|
+
flexWrap: 'nowrap',
|
89
|
+
height: '18px'
|
90
|
+
},
|
91
|
+
barValue: {
|
92
|
+
display: 'flex',
|
93
|
+
width: '100%',
|
94
|
+
height: '4px',
|
95
|
+
borderRadius: '2px',
|
96
|
+
backgroundColor: theme.palette.business.primary.normal,
|
97
|
+
position: 'absolute',
|
98
|
+
zIndex: '2'
|
99
|
+
},
|
100
|
+
arrow: {
|
101
|
+
position: 'absolute',
|
102
|
+
zIndex: '1',
|
103
|
+
color: theme.palette.business.primary.normal,
|
104
|
+
transform: 'translate(-50%,-25%)',
|
105
|
+
transition: 'transform 300ms cubic-bezier(0.4, 0, 0.2, 1)',
|
106
|
+
transitionProperty: 'transform color'
|
107
|
+
},
|
108
|
+
focused: {
|
109
|
+
transform: 'scale(1.7) translate(-29%, -11%)',
|
110
|
+
color: theme.palette.business.primary.dark
|
111
|
+
},
|
112
|
+
leftLabel: {
|
113
|
+
color: theme.palette.business.primary.normal,
|
114
|
+
left: '0px',
|
115
|
+
position: 'absolute',
|
116
|
+
fontSize: '11px',
|
117
|
+
alignSelf: 'flex-end'
|
118
|
+
},
|
119
|
+
rightLabel: {
|
120
|
+
color: '#737373',
|
121
|
+
right: '0px',
|
122
|
+
position: 'absolute',
|
123
|
+
fontSize: '11px',
|
124
|
+
alignSelf: 'flex-end'
|
125
|
+
},
|
126
|
+
textValue: {
|
127
|
+
position: 'absolute',
|
128
|
+
zIndex: '2'
|
129
|
+
}
|
130
|
+
};
|
131
|
+
};
|
132
|
+
|
133
|
+
/**
|
134
|
+
* HiSlider component
|
135
|
+
*/
|
136
|
+
|
137
|
+
var HiSlider = function (_React$Component) {
|
138
|
+
(0, _inherits3.default)(HiSlider, _React$Component);
|
139
|
+
|
140
|
+
function HiSlider(props) {
|
141
|
+
(0, _classCallCheck3.default)(this, HiSlider);
|
142
|
+
|
143
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, (HiSlider.__proto__ || (0, _getPrototypeOf2.default)(HiSlider)).call(this, props));
|
144
|
+
|
145
|
+
_this.leftLabelWidth = 0;
|
146
|
+
_this.rightLabelWidth = 0;
|
147
|
+
_this.textValueWidth = 0;
|
148
|
+
_this.barContainerWidth = 0;
|
149
|
+
|
150
|
+
_this.handleFocus = function (isFocused) {
|
151
|
+
return function () {
|
152
|
+
_this.setState({ focused: isFocused });
|
153
|
+
};
|
154
|
+
};
|
155
|
+
|
156
|
+
_this.state = {
|
157
|
+
focused: false
|
158
|
+
};
|
159
|
+
|
160
|
+
_this.leftLabel;
|
161
|
+
_this.rightLabel;
|
162
|
+
_this.textValue;
|
163
|
+
_this.barContainer;
|
164
|
+
|
165
|
+
_this.handleChange = _this.handleChange.bind(_this);
|
166
|
+
_this.handleFocus = _this.handleFocus.bind(_this);
|
167
|
+
return _this;
|
168
|
+
}
|
169
|
+
|
170
|
+
(0, _createClass3.default)(HiSlider, [{
|
171
|
+
key: 'componentDidMount',
|
172
|
+
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Measures several components once they are mounted.
|
176
|
+
* If the value and a label (left or right) are hovered,
|
177
|
+
* we hide this label.
|
178
|
+
*/
|
179
|
+
value: function componentDidMount() {
|
180
|
+
this.leftLabelWidth = this.leftLabel.offsetWidth;
|
181
|
+
this.rightLabelWidth = this.rightLabel.offsetWidth;
|
182
|
+
this.textValueWidth = this.textValue.offsetWidth;
|
183
|
+
this.barContainerWidth = this.barContainer.offsetWidth;
|
184
|
+
|
185
|
+
var _getHovering = this.getHovering(),
|
186
|
+
hoveringLeft = _getHovering.hoveringLeft,
|
187
|
+
hoveringRight = _getHovering.hoveringRight;
|
188
|
+
|
189
|
+
if (hoveringLeft || hoveringRight) {
|
190
|
+
this.forceUpdate();
|
191
|
+
}
|
192
|
+
}
|
193
|
+
}, {
|
194
|
+
key: 'handleChange',
|
195
|
+
value: function handleChange(event) {
|
196
|
+
this.props.onChange(parseFloat(event.target.value));
|
197
|
+
this.textValueWidth = this.textValue.offsetWidth;
|
198
|
+
}
|
199
|
+
}, {
|
200
|
+
key: 'getHovering',
|
201
|
+
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Calculates if the labels are hovered.
|
205
|
+
*/
|
206
|
+
value: function getHovering() {
|
207
|
+
var ratio = (this.props.value - this.props.min) / (this.props.max - this.props.min);
|
208
|
+
var hoveringLeft = this.leftLabelWidth - (ratio * this.barContainerWidth - ratio * this.textValueWidth) > 0;
|
209
|
+
var hoveringRight = this.barContainerWidth - ratio * this.barContainerWidth - this.rightLabelWidth - (1 - ratio) * this.textValueWidth < 0;
|
210
|
+
return { hoveringLeft: hoveringLeft, hoveringRight: hoveringRight };
|
211
|
+
}
|
212
|
+
}, {
|
213
|
+
key: 'render',
|
214
|
+
value: function render() {
|
215
|
+
var _this2 = this;
|
216
|
+
|
217
|
+
var _props = this.props,
|
218
|
+
classes = _props.classes,
|
219
|
+
className = _props.className,
|
220
|
+
min = _props.min,
|
221
|
+
max = _props.max,
|
222
|
+
leftLabel = _props.leftLabel,
|
223
|
+
rightLabel = _props.rightLabel,
|
224
|
+
step = _props.step,
|
225
|
+
suffix = _props.suffix,
|
226
|
+
id = _props.id,
|
227
|
+
label = _props.label,
|
228
|
+
theme = _props.theme,
|
229
|
+
value = _props.value;
|
230
|
+
var focused = this.state.focused;
|
231
|
+
|
232
|
+
var ratio = (value - min) / (max - min);
|
233
|
+
var percentage = ratio * 100;
|
234
|
+
|
235
|
+
var _getHovering2 = this.getHovering(),
|
236
|
+
hoveringLeft = _getHovering2.hoveringLeft,
|
237
|
+
hoveringRight = _getHovering2.hoveringRight;
|
238
|
+
|
239
|
+
var barColor = focused ? theme.palette.business.primary.dark : theme.palette.business.primary.normal;
|
240
|
+
return (
|
241
|
+
// HiFormControl pour l'affichage du label
|
242
|
+
_react2.default.createElement(
|
243
|
+
_HiFormControl2.default,
|
244
|
+
{
|
245
|
+
id: id,
|
246
|
+
label: label,
|
247
|
+
className: className,
|
248
|
+
onFocus: this.handleFocus(true),
|
249
|
+
onBlur: this.handleFocus(false)
|
250
|
+
},
|
251
|
+
_react2.default.createElement(
|
252
|
+
'div',
|
253
|
+
{ className: classes.mainContainer },
|
254
|
+
_react2.default.createElement(
|
255
|
+
'div',
|
256
|
+
null,
|
257
|
+
min,
|
258
|
+
suffix
|
259
|
+
),
|
260
|
+
_react2.default.createElement(
|
261
|
+
'div',
|
262
|
+
{ className: classes.barContainer, ref: function ref(div) {
|
263
|
+
return _this2.barContainer = div;
|
264
|
+
} },
|
265
|
+
_react2.default.createElement(
|
266
|
+
'div',
|
267
|
+
{ className: classes.topContainer },
|
268
|
+
!hoveringLeft && _react2.default.createElement(
|
269
|
+
'div',
|
270
|
+
{
|
271
|
+
className: classes.leftLabel,
|
272
|
+
ref: function ref(div) {
|
273
|
+
return _this2.leftLabel = div;
|
274
|
+
}
|
275
|
+
},
|
276
|
+
leftLabel
|
277
|
+
),
|
278
|
+
_react2.default.createElement(
|
279
|
+
'div',
|
280
|
+
{
|
281
|
+
className: classes.textValue,
|
282
|
+
style: {
|
283
|
+
left: percentage + '%',
|
284
|
+
transform: 'translate(-' + percentage + '%)'
|
285
|
+
},
|
286
|
+
ref: function ref(div) {
|
287
|
+
return _this2.textValue = div;
|
288
|
+
}
|
289
|
+
},
|
290
|
+
value,
|
291
|
+
suffix
|
292
|
+
),
|
293
|
+
!hoveringRight && _react2.default.createElement(
|
294
|
+
'div',
|
295
|
+
{
|
296
|
+
className: classes.rightLabel,
|
297
|
+
ref: function ref(div) {
|
298
|
+
return _this2.rightLabel = div;
|
299
|
+
}
|
300
|
+
},
|
301
|
+
rightLabel
|
302
|
+
)
|
303
|
+
),
|
304
|
+
_react2.default.createElement('div', {
|
305
|
+
className: classes.barValue,
|
306
|
+
style: {
|
307
|
+
background: 'linear-gradient(to right, ' + barColor + ', ' + barColor + ' ' + percentage + '%, #E0E0E0 ' + percentage + '%, #E0E0E0)'
|
308
|
+
}
|
309
|
+
}),
|
310
|
+
_react2.default.createElement('input', {
|
311
|
+
type: 'range',
|
312
|
+
min: min,
|
313
|
+
max: max,
|
314
|
+
value: value,
|
315
|
+
onChange: this.handleChange,
|
316
|
+
className: classes.barHidden,
|
317
|
+
step: step
|
318
|
+
}),
|
319
|
+
_react2.default.createElement(
|
320
|
+
'div',
|
321
|
+
{ className: classes.bottomContainer },
|
322
|
+
_react2.default.createElement(_HiIconBuilder2.default, {
|
323
|
+
className: (0, _classnames2.default)(classes.arrow, (0, _defineProperty3.default)({}, classes.focused, focused)),
|
324
|
+
icon: 'menu_up',
|
325
|
+
size: 24,
|
326
|
+
style: { left: percentage + '%' }
|
327
|
+
})
|
328
|
+
)
|
329
|
+
),
|
330
|
+
_react2.default.createElement(
|
331
|
+
'div',
|
332
|
+
null,
|
333
|
+
max,
|
334
|
+
suffix
|
335
|
+
)
|
336
|
+
)
|
337
|
+
)
|
338
|
+
);
|
339
|
+
}
|
340
|
+
}]);
|
341
|
+
return HiSlider;
|
342
|
+
}(_react2.default.Component);
|
343
|
+
|
344
|
+
HiSlider.propTypes = process.env.NODE_ENV !== "production" ? {
|
345
|
+
/**
|
346
|
+
* Useful to extend the style applied to components.
|
347
|
+
*/
|
348
|
+
classes: _propTypes2.default.object,
|
349
|
+
/**
|
350
|
+
* Classes CSS appliquées.
|
351
|
+
*/
|
352
|
+
className: _propTypes2.default.string,
|
353
|
+
/**
|
354
|
+
* Id de l'élément input
|
355
|
+
*/
|
356
|
+
id: _propTypes2.default.string.isRequired,
|
357
|
+
/**
|
358
|
+
* Label du champ
|
359
|
+
*/
|
360
|
+
label: _propTypes2.default.string,
|
361
|
+
/**
|
362
|
+
* The label to show on the left.
|
363
|
+
*/
|
364
|
+
leftLabel: _propTypes2.default.string,
|
365
|
+
/**
|
366
|
+
* The Maximum value for the slider.
|
367
|
+
*/
|
368
|
+
max: _propTypes2.default.number.isRequired,
|
369
|
+
/**
|
370
|
+
* The Minimum value for the slider.
|
371
|
+
*/
|
372
|
+
min: _propTypes2.default.number.isRequired,
|
373
|
+
/**
|
374
|
+
* Fonction de callback appelée lorsqu'on change la valeur du slider.
|
375
|
+
*/
|
376
|
+
onChange: _propTypes2.default.func,
|
377
|
+
/**
|
378
|
+
* The label to show on the right
|
379
|
+
*/
|
380
|
+
rightLabel: _propTypes2.default.string,
|
381
|
+
/**
|
382
|
+
* The step between two selectable values.
|
383
|
+
*/
|
384
|
+
step: _propTypes2.default.number,
|
385
|
+
/**
|
386
|
+
* The suffix to show after each number.
|
387
|
+
*/
|
388
|
+
suffix: _propTypes2.default.string,
|
389
|
+
/**
|
390
|
+
* @ignore
|
391
|
+
*/
|
392
|
+
theme: _propTypes2.default.object,
|
393
|
+
/**
|
394
|
+
* The
|
395
|
+
* value of the input.
|
396
|
+
*/
|
397
|
+
value: _propTypes2.default.number
|
398
|
+
} : {};
|
399
|
+
exports.default = (0, _withStyles2.default)(styles, { name: 'HmuiHiSlider', withTheme: true })(HiSlider);
|
package/HiForm/index.js
CHANGED
@@ -67,6 +67,15 @@ Object.defineProperty(exports, 'HiSearchField', {
|
|
67
67
|
}
|
68
68
|
});
|
69
69
|
|
70
|
+
var _HiSlider = require('./HiSlider');
|
71
|
+
|
72
|
+
Object.defineProperty(exports, 'HiSlider', {
|
73
|
+
enumerable: true,
|
74
|
+
get: function get() {
|
75
|
+
return _interopRequireDefault(_HiSlider).default;
|
76
|
+
}
|
77
|
+
});
|
78
|
+
|
70
79
|
var _HiAddressField = require('./HiAddressField');
|
71
80
|
|
72
81
|
Object.defineProperty(exports, 'HiAddressField', {
|
package/HiSelect/HiSelect.js
CHANGED
@@ -485,7 +485,7 @@ HiSelect.defaultProps = {
|
|
485
485
|
var _initialiseProps = function _initialiseProps() {
|
486
486
|
var _this3 = this;
|
487
487
|
|
488
|
-
this.handleClick = function (
|
488
|
+
this.handleClick = function () {
|
489
489
|
if (_this3.state.open) {
|
490
490
|
_this3.handleClose();
|
491
491
|
} else {
|
@@ -206,6 +206,7 @@ var BodyCellBuilder = function (_React$PureComponent) {
|
|
206
206
|
cellElement = _react2.default.createElement(_BodyCells.CellIcon, {
|
207
207
|
value: data.label ? data.label : data.value,
|
208
208
|
icon: data.icon,
|
209
|
+
color: data.color,
|
209
210
|
view: view,
|
210
211
|
sticky: sticky
|
211
212
|
});
|
@@ -215,6 +216,7 @@ var BodyCellBuilder = function (_React$PureComponent) {
|
|
215
216
|
cellElement = _react2.default.createElement(_BodyCells.CellImage, {
|
216
217
|
value: data.label ? data.label : data.value,
|
217
218
|
path: data.img,
|
219
|
+
size: this.props.size,
|
218
220
|
view: view,
|
219
221
|
sticky: sticky
|
220
222
|
});
|
@@ -224,6 +226,7 @@ var BodyCellBuilder = function (_React$PureComponent) {
|
|
224
226
|
cellElement = _react2.default.createElement(_BodyCells.CellNumeric, {
|
225
227
|
value: data.value,
|
226
228
|
currency: data.currency,
|
229
|
+
precision: data.precision,
|
227
230
|
locale: numberLocale,
|
228
231
|
view: view,
|
229
232
|
sticky: sticky
|