@hipay/hipay-material-ui 2.0.0-beta.52 → 2.0.0-beta.54
Sign up to get free protection for your applications and to get access to all the features.
- package/HiCell/CellSentinel.js +33 -109
- package/HiCell/CellSentinelScore.js +100 -0
- package/HiChip/HiChip.js +11 -4
- package/HiColoredLabel/HiColoredLabel.js +14 -4
- package/HiDatePicker/HiDatePicker.js +1 -1
- package/HiDatePicker/HiDateRangePicker.js +339 -420
- package/HiDatePicker/HiDateRangeSelector.js +81 -61
- package/HiDatePicker/NavBar.js +2 -1
- package/HiDatePicker/Overlays/TimePickerOverlay.js +1 -1
- package/HiDatePicker/Overlays/YearPickerOverlay.js +3 -3
- package/HiForm/HiFormControl.js +5 -4
- package/HiPin/HiPin.js +1 -1
- package/HiSelectNew/HiSelect.js +4 -1
- package/HiSelectableList/HiSelectableListItem.js +9 -1
- package/HiSwitch/HiSwitch.js +2 -1
- package/HiTable/HiCellBuilder.js +14 -7
- package/HiTable/constants.js +7 -5
- package/es/HiCell/CellSentinel.js +32 -108
- package/es/HiCell/CellSentinelScore.js +60 -0
- package/es/HiChip/HiChip.js +11 -4
- package/es/HiColoredLabel/HiColoredLabel.js +14 -3
- package/es/HiDatePicker/HiDatePicker.js +1 -1
- package/es/HiDatePicker/HiDateRangePicker.js +304 -364
- package/es/HiDatePicker/HiDateRangeSelector.js +71 -55
- package/es/HiDatePicker/NavBar.js +2 -1
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +1 -1
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +3 -3
- package/es/HiForm/HiFormControl.js +5 -4
- package/es/HiPin/HiPin.js +1 -1
- package/es/HiSelectNew/HiSelect.js +4 -1
- package/es/HiSelectableList/HiSelectableListItem.js +9 -1
- package/es/HiSwitch/HiSwitch.js +2 -1
- package/es/HiTable/HiCellBuilder.js +13 -7
- package/es/HiTable/constants.js +8 -1
- package/es/styles/createPalette.js +3 -3
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +3 -2
- package/styles/createPalette.js +3 -3
- package/umd/hipay-material-ui.development.js +919 -1136
- package/umd/hipay-material-ui.production.min.js +2 -2
package/HiCell/CellSentinel.js
CHANGED
@@ -26,59 +26,17 @@ var _HiColoredLabel = _interopRequireDefault(require("../HiColoredLabel"));
|
|
26
26
|
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
27
27
|
|
28
28
|
var styles = {
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
minWidth: 18
|
29
|
+
flexContent: {
|
30
|
+
display: 'flex',
|
31
|
+
justifyContent: 'flex-end'
|
33
32
|
},
|
34
|
-
label: {
|
35
|
-
marginLeft: 2
|
36
|
-
},
|
37
|
-
nowrap: {
|
38
|
-
whiteSpace: 'nowrap'
|
39
|
-
}
|
33
|
+
label: {}
|
40
34
|
};
|
41
|
-
/**
|
42
|
-
* Get Theme color from fraudResult
|
43
|
-
* @param fraudResult
|
44
|
-
* @returns {*}
|
45
|
-
*/
|
46
|
-
|
47
|
-
exports.styles = styles;
|
48
|
-
|
49
|
-
function getColorFromFraudResult(fraudResult) {
|
50
|
-
var color;
|
51
|
-
|
52
|
-
switch (fraudResult.toUpperCase()) {
|
53
|
-
case 'ACCEPTED':
|
54
|
-
color = 'positive';
|
55
|
-
break;
|
56
|
-
|
57
|
-
case 'BLOCKED':
|
58
|
-
color = 'negative';
|
59
|
-
break;
|
60
|
-
|
61
|
-
case 'CHALLENGED':
|
62
|
-
color = 'middle';
|
63
|
-
break;
|
64
|
-
|
65
|
-
case 'PENDING':
|
66
|
-
color = 'primary';
|
67
|
-
break;
|
68
|
-
|
69
|
-
case 'FORCE_AUTHENTICATE':
|
70
|
-
case 'ASK_AUTHENTICATE':
|
71
|
-
default:
|
72
|
-
color = 'neutral';
|
73
|
-
break;
|
74
|
-
}
|
75
|
-
|
76
|
-
return color;
|
77
|
-
}
|
78
35
|
/**
|
79
36
|
* Cette cellule permet d'afficher le résultat de Sentinel (score & fraudResult & smartDecision)
|
80
37
|
*/
|
81
38
|
|
39
|
+
exports.styles = styles;
|
82
40
|
|
83
41
|
var CellSentinel =
|
84
42
|
/*#__PURE__*/
|
@@ -94,83 +52,49 @@ function (_React$PureComponent) {
|
|
94
52
|
key: "render",
|
95
53
|
value: function render() {
|
96
54
|
var _this$props = this.props,
|
55
|
+
active = _this$props.active,
|
97
56
|
classes = _this$props.classes,
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
57
|
+
color = _this$props.color,
|
58
|
+
label = _this$props.label,
|
59
|
+
letter = _this$props.letter,
|
60
|
+
outlined = _this$props.outlined,
|
61
|
+
reviewer = _this$props.reviewer,
|
62
|
+
value = _this$props.value;
|
63
|
+
|
64
|
+
var _label = label ? label : value;
|
65
|
+
|
66
|
+
var _letter = letter ? letter : _label[0];
|
67
|
+
|
105
68
|
return _react.default.createElement("div", {
|
106
|
-
|
107
|
-
|
108
|
-
minWidth: '100px'
|
109
|
-
}
|
69
|
+
className: classes.flexContent,
|
70
|
+
title: reviewer ? "".concat(_label, "\n").concat(reviewer) : _label
|
110
71
|
}, _react.default.createElement(_HiColoredLabel.default, {
|
111
|
-
|
112
|
-
color: getColorFromFraudResult(fraudResult),
|
72
|
+
active: active,
|
113
73
|
classes: {
|
114
74
|
root: classes.label
|
115
75
|
},
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
classes: {
|
121
|
-
root: classes.label
|
122
|
-
},
|
123
|
-
active: pendingManualAction
|
124
|
-
}), !!smartDecision && _react.default.createElement("div", {
|
125
|
-
className: classes.smartDecision
|
126
|
-
}, automaticFraudReviewResult && _react.default.createElement(_HiColoredLabel.default, {
|
127
|
-
label: automaticFraudReviewResult.toUpperCase().substr(0, 1),
|
128
|
-
color: getColorFromFraudResult(automaticFraudReviewResult),
|
129
|
-
active: pendingManualAction
|
130
|
-
})));
|
76
|
+
color: color,
|
77
|
+
label: _letter,
|
78
|
+
outlined: outlined
|
79
|
+
}));
|
131
80
|
}
|
132
81
|
}]);
|
133
82
|
return CellSentinel;
|
134
83
|
}(_react.default.PureComponent);
|
135
84
|
|
136
85
|
CellSentinel.defaultProps = {
|
137
|
-
|
86
|
+
active: false,
|
87
|
+
outlined: false
|
138
88
|
};
|
139
89
|
CellSentinel.propTypes = process.env.NODE_ENV !== "production" ? {
|
140
|
-
/**
|
141
|
-
* Résultat de l'automaticFraudReview si la transaction est passée par SmartDecision
|
142
|
-
*/
|
143
|
-
automaticFraudReviewResult: _propTypes.default.string,
|
144
|
-
|
145
|
-
/**
|
146
|
-
* Useful to extend the style applied to components.
|
147
|
-
*/
|
148
90
|
classes: _propTypes.default.object,
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
* Si true le fraudResult ne sera pas affiché
|
157
|
-
*/
|
158
|
-
hideFraudResult: _propTypes.default.bool,
|
159
|
-
|
160
|
-
/**
|
161
|
-
* Signal qu'il attend une réponse manuelle
|
162
|
-
*/
|
163
|
-
pendingManualAction: _propTypes.default.bool,
|
164
|
-
|
165
|
-
/**
|
166
|
-
* Score de la fraude
|
167
|
-
*/
|
168
|
-
score: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
169
|
-
|
170
|
-
/**
|
171
|
-
* Active le SmartDecision (ajoute l'indicateur ou blanc)
|
172
|
-
*/
|
173
|
-
smartDecision: _propTypes.default.bool
|
91
|
+
value: _propTypes.default.string,
|
92
|
+
color: _propTypes.default.string,
|
93
|
+
label: _propTypes.default.string,
|
94
|
+
letter: _propTypes.default.string,
|
95
|
+
active: _propTypes.default.bool,
|
96
|
+
reviewer: _propTypes.default.string,
|
97
|
+
outlined: _propTypes.default.bool
|
174
98
|
} : {};
|
175
99
|
|
176
100
|
var _default = (0, _withStyles.default)(styles, {
|
@@ -0,0 +1,100 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.default = exports.sentinelColorById = exports.styles = void 0;
|
9
|
+
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
11
|
+
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
13
|
+
|
14
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
15
|
+
|
16
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
17
|
+
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
19
|
+
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
21
|
+
|
22
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
23
|
+
|
24
|
+
var _HiColoredLabel = _interopRequireDefault(require("../HiColoredLabel"));
|
25
|
+
|
26
|
+
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
27
|
+
|
28
|
+
var styles = {
|
29
|
+
flexContent: {
|
30
|
+
display: 'flex',
|
31
|
+
justifyContent: 'flex-end'
|
32
|
+
},
|
33
|
+
label: {}
|
34
|
+
};
|
35
|
+
exports.styles = styles;
|
36
|
+
var sentinelColorById = {
|
37
|
+
NOT_LAUNCHED: '#737373',
|
38
|
+
ACCEPTED: '#00AF01',
|
39
|
+
AUTHENTICATE: '#484A4B',
|
40
|
+
FORCE_AUTHENTICATE: '#20272B',
|
41
|
+
PENDING: '#3987AD',
|
42
|
+
TO_BE_REVIEWED: '#FF8F01',
|
43
|
+
CHALLENGED: '#FF8F01',
|
44
|
+
BLOCKED: '#D50000',
|
45
|
+
ALLOWED: '#00AF01',
|
46
|
+
DENIED: '#D50000'
|
47
|
+
};
|
48
|
+
/**
|
49
|
+
* Cette cellule permet d'afficher le résultat de Sentinel (score & fraudResult & smartDecision)
|
50
|
+
*/
|
51
|
+
|
52
|
+
exports.sentinelColorById = sentinelColorById;
|
53
|
+
|
54
|
+
var CellSentinelScore =
|
55
|
+
/*#__PURE__*/
|
56
|
+
function (_React$PureComponent) {
|
57
|
+
(0, _inherits2.default)(CellSentinelScore, _React$PureComponent);
|
58
|
+
|
59
|
+
function CellSentinelScore() {
|
60
|
+
(0, _classCallCheck2.default)(this, CellSentinelScore);
|
61
|
+
return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(CellSentinelScore).apply(this, arguments));
|
62
|
+
}
|
63
|
+
|
64
|
+
(0, _createClass2.default)(CellSentinelScore, [{
|
65
|
+
key: "render",
|
66
|
+
value: function render() {
|
67
|
+
var _this$props = this.props,
|
68
|
+
classes = _this$props.classes,
|
69
|
+
result = _this$props.result,
|
70
|
+
value = _this$props.value;
|
71
|
+
return _react.default.createElement("div", {
|
72
|
+
className: classes.flexContent
|
73
|
+
}, _react.default.createElement(_HiColoredLabel.default, {
|
74
|
+
active: result === 'TO_BE_REVIEWED',
|
75
|
+
classes: {
|
76
|
+
root: classes.label
|
77
|
+
},
|
78
|
+
color: sentinelColorById[result],
|
79
|
+
label: value > 0 ? "+".concat(value) : "".concat(value)
|
80
|
+
}));
|
81
|
+
}
|
82
|
+
}]);
|
83
|
+
return CellSentinelScore;
|
84
|
+
}(_react.default.PureComponent);
|
85
|
+
|
86
|
+
CellSentinelScore.defaultProps = {
|
87
|
+
active: false,
|
88
|
+
outlined: false
|
89
|
+
};
|
90
|
+
CellSentinelScore.propTypes = process.env.NODE_ENV !== "production" ? {
|
91
|
+
classes: _propTypes.default.object,
|
92
|
+
result: _propTypes.default.string,
|
93
|
+
value: _propTypes.default.number
|
94
|
+
} : {};
|
95
|
+
|
96
|
+
var _default = (0, _withStyles.default)(styles, {
|
97
|
+
name: 'HmuiCellSentinelScore'
|
98
|
+
})(CellSentinelScore);
|
99
|
+
|
100
|
+
exports.default = _default;
|
package/HiChip/HiChip.js
CHANGED
@@ -71,7 +71,7 @@ var styles = function styles(theme) {
|
|
71
71
|
position: 'relative',
|
72
72
|
cursor: 'pointer',
|
73
73
|
'&:hover, &:focus': {
|
74
|
-
color: theme.palette.
|
74
|
+
color: theme.palette.neutral.dark
|
75
75
|
}
|
76
76
|
},
|
77
77
|
label: {
|
@@ -97,7 +97,8 @@ var styles = function styles(theme) {
|
|
97
97
|
'&:hover, &:focus': {
|
98
98
|
backgroundColor: theme.palette.primary.main,
|
99
99
|
color: theme.palette.grey[300]
|
100
|
-
}
|
100
|
+
},
|
101
|
+
position: 'relative'
|
101
102
|
},
|
102
103
|
badge: {
|
103
104
|
height: 16,
|
@@ -119,7 +120,7 @@ var handleKeyDown = function handleKeyDown(e, fn) {
|
|
119
120
|
function HiChip(props) {
|
120
121
|
var _classNames;
|
121
122
|
|
122
|
-
var
|
123
|
+
var className = props.className,
|
123
124
|
classes = props.classes,
|
124
125
|
fallbackImage = props.fallbackImage,
|
125
126
|
icon = props.icon,
|
@@ -127,6 +128,7 @@ function HiChip(props) {
|
|
127
128
|
iconSize = _props$iconSize === void 0 ? 20 : _props$iconSize,
|
128
129
|
id = props.id,
|
129
130
|
img = props.img,
|
131
|
+
label = props.label,
|
130
132
|
onPrevious = props.onPrevious,
|
131
133
|
onNext = props.onNext,
|
132
134
|
onDelete = props.onDelete,
|
@@ -140,7 +142,7 @@ function HiChip(props) {
|
|
140
142
|
titlePrevious = props.titlePrevious;
|
141
143
|
return _react.default.createElement("div", {
|
142
144
|
id: id,
|
143
|
-
className: (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.leftNavigation, onPrevious), (0, _defineProperty2.default)(_classNames, classes.rightNavigation, onNext), (0, _defineProperty2.default)(_classNames, classes.deletable, onDelete), (0, _defineProperty2.default)(_classNames, classes.leftIcon, icon), _classNames)),
|
145
|
+
className: (0, _classnames.default)(classes.root, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.leftNavigation, onPrevious), (0, _defineProperty2.default)(_classNames, classes.rightNavigation, onNext), (0, _defineProperty2.default)(_classNames, classes.deletable, onDelete), (0, _defineProperty2.default)(_classNames, classes.leftIcon, icon), _classNames)),
|
144
146
|
title: title
|
145
147
|
}, icon && _react.default.createElement(_HiIcon.default, {
|
146
148
|
className: (0, _classnames.default)(classes.icon, (0, _defineProperty2.default)({}, classes.iconClickable, onIconClick)),
|
@@ -209,6 +211,11 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
209
211
|
*/
|
210
212
|
classes: _propTypes.default.object,
|
211
213
|
|
214
|
+
/**
|
215
|
+
* Surcharge les classes du composant
|
216
|
+
*/
|
217
|
+
className: _propTypes.default.object,
|
218
|
+
|
212
219
|
/**
|
213
220
|
* Chemin vers l'image à afficher par défaut si une image n'est pas trouvée
|
214
221
|
*/
|
@@ -115,6 +115,9 @@ var styles = function styles(theme) {
|
|
115
115
|
activeColorNeutral: {
|
116
116
|
color: theme.palette.neutral.contrastText,
|
117
117
|
backgroundColor: theme.palette.neutral.main
|
118
|
+
},
|
119
|
+
outlined: {
|
120
|
+
border: '1px solid'
|
118
121
|
}
|
119
122
|
};
|
120
123
|
};
|
@@ -135,14 +138,15 @@ function HiColoredLabel(props) {
|
|
135
138
|
label = props.label,
|
136
139
|
color = props.color,
|
137
140
|
active = props.active,
|
141
|
+
outlined = props.outlined,
|
138
142
|
fontWeight = props.fontWeight,
|
139
143
|
style = props.style,
|
140
144
|
theme = props.theme,
|
141
|
-
other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "label", "color", "active", "fontWeight", "style", "theme"]);
|
145
|
+
other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "label", "color", "active", "outlined", "fontWeight", "style", "theme"]);
|
142
146
|
var isHiColor = ['primary', 'secondary', 'positive', 'negative', 'middle', 'neutral'].includes(color);
|
143
147
|
var isHexColor = !isHiColor && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color);
|
144
148
|
return _react.default.createElement("div", (0, _extends2.default)({
|
145
|
-
className: (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.color, !active), (0, _defineProperty2.default)(_classNames, classes.activeColor, active), (0, _defineProperty2.default)(_classNames, classes["activeColor".concat((0, _helpers.capitalize)(color))], active && isHiColor), (0, _defineProperty2.default)(_classNames, classes["color".concat((0, _helpers.capitalize)(color))], !active && isHiColor), _classNames), className),
|
149
|
+
className: (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.color, !active), (0, _defineProperty2.default)(_classNames, classes.activeColor, active), (0, _defineProperty2.default)(_classNames, classes.outlined, outlined), (0, _defineProperty2.default)(_classNames, classes["activeColor".concat((0, _helpers.capitalize)(color))], active && isHiColor), (0, _defineProperty2.default)(_classNames, classes["color".concat((0, _helpers.capitalize)(color))], !active && isHiColor), _classNames), className),
|
146
150
|
style: (0, _extends2.default)({}, style, isHexColor && {
|
147
151
|
backgroundColor: active ? color : (0, _colorManipulator.fade)(color, 0.08),
|
148
152
|
color: active ? theme.palette.getContrastText(color) : color
|
@@ -182,11 +186,17 @@ HiColoredLabel.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
182
186
|
/**
|
183
187
|
* Label à afficher
|
184
188
|
*/
|
185
|
-
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.node]).isRequired
|
189
|
+
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.node]).isRequired,
|
190
|
+
|
191
|
+
/**
|
192
|
+
* Ajoute une bordure
|
193
|
+
*/
|
194
|
+
outlined: _propTypes.default.bool
|
186
195
|
} : {};
|
187
196
|
HiColoredLabel.defaultProps = {
|
188
197
|
active: false,
|
189
|
-
color: 'primary'
|
198
|
+
color: 'primary',
|
199
|
+
outlined: false
|
190
200
|
};
|
191
201
|
|
192
202
|
var _default = (0, _withStyles.default)(styles, {
|
@@ -270,7 +270,7 @@ function (_React$Component) {
|
|
270
270
|
todayButton: translations.today,
|
271
271
|
onTodayButtonClick: this.handleCurrentMonthChange,
|
272
272
|
weekdayElement: _Weekday.default,
|
273
|
-
|
273
|
+
navbarElement: function navbarElement(props2) {
|
274
274
|
return _react.default.createElement(_NavBar.default, (0, _extends2.default)({
|
275
275
|
showClockButton: enableTime,
|
276
276
|
onClockClick: _this2.handleClockClick
|