@hipay/hipay-material-ui 2.0.0-beta.52 → 2.0.0-beta.54
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/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
@@ -1,14 +1,14 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
-
// @inheritedComponent HiDateRangePicker
|
4
3
|
import React from 'react';
|
5
4
|
import PropTypes from 'prop-types';
|
6
5
|
import moment from 'moment';
|
7
6
|
import { findDOMNode } from 'react-dom';
|
8
7
|
import Grid from '@material-ui/core/Grid';
|
9
8
|
import withStyles from '../styles/withStyles';
|
10
|
-
import HiSelectField from '../
|
9
|
+
import HiSelectField from '../HiSelectNew/HiSelectField';
|
11
10
|
import HiDateRangePicker from './HiDateRangePicker';
|
11
|
+
import HiFormControl from '../HiForm/HiFormControl';
|
12
12
|
export function buildDateRangeOptionByKey(key, t, format) {
|
13
13
|
let from;
|
14
14
|
let label;
|
@@ -24,6 +24,8 @@ export function buildDateRangeOptionByKey(key, t, format) {
|
|
24
24
|
switch (key) {
|
25
25
|
case 'custom':
|
26
26
|
label = t.custom_period;
|
27
|
+
from = moment().subtract(15, 'day').startOf('day');
|
28
|
+
to = moment().endOf('day');
|
27
29
|
type = 'primary-highlight';
|
28
30
|
break;
|
29
31
|
|
@@ -59,35 +61,35 @@ export function buildDateRangeOptionByKey(key, t, format) {
|
|
59
61
|
label = t.current_month;
|
60
62
|
from = moment().startOf('month');
|
61
63
|
to = moment();
|
62
|
-
info = `${from.format(format)} ${t.to_now}, ${to.diff(from, 'days')} ${t.days}`;
|
64
|
+
info = `${from.format(format)} ${t.to_now}, ${to.diff(from, 'days') + 1} ${t.days}`;
|
63
65
|
break;
|
64
66
|
|
65
67
|
case 'pm':
|
66
68
|
label = t.previous_month;
|
67
69
|
from = moment().subtract(1, 'month').startOf('month');
|
68
70
|
to = moment().subtract(1, 'month').endOf('month');
|
69
|
-
info = `${from.format(
|
71
|
+
info = `${from.format(t.yearAndMonth)}, ${from.daysInMonth()} ${t.days}`;
|
70
72
|
break;
|
71
73
|
|
72
74
|
case 'cq':
|
73
75
|
label = t.current_quarter;
|
74
76
|
from = moment().startOf('quarter');
|
75
77
|
to = moment();
|
76
|
-
info = `${from.format(format)} ${t.to_now}, ${to.diff(from, 'days')} ${t.days}`;
|
78
|
+
info = `${from.format(t.yearAndQuarter)}, ${from.format(format)} ${t.to_now}, ${to.diff(from, 'days') + 1} ${t.days}`;
|
77
79
|
break;
|
78
80
|
|
79
81
|
case 'pq':
|
80
82
|
label = t.previous_quarter;
|
81
83
|
from = moment().subtract(1, 'quarter').startOf('quarter');
|
82
84
|
to = moment().subtract(1, 'quarter').endOf('quarter');
|
83
|
-
info = `${from.format(
|
85
|
+
info = `${from.format(t.yearAndQuarter)}, ${to.diff(from, 'days') + 1} ${t.days}`;
|
84
86
|
break;
|
85
87
|
|
86
88
|
case 'cy':
|
87
89
|
label = t.current_year;
|
88
90
|
from = moment().startOf('year');
|
89
91
|
to = moment();
|
90
|
-
info = `${from.format(format)} ${t.to_now}, ${to.diff(from, 'days')} ${t.days}`;
|
92
|
+
info = `${from.format(format)} ${t.to_now}, ${to.diff(from, 'days') + 1} ${t.days}`;
|
91
93
|
break;
|
92
94
|
|
93
95
|
default:
|
@@ -125,23 +127,24 @@ class HiDateRangeSelector extends React.Component {
|
|
125
127
|
super();
|
126
128
|
this.options = [];
|
127
129
|
|
130
|
+
this.onBlur = event => {
|
131
|
+
if (event instanceof Object && this.props.onblur) {
|
132
|
+
this.props.onBlur(event);
|
133
|
+
}
|
134
|
+
};
|
135
|
+
|
128
136
|
this.handleSelectChange = name => (event, value) => {
|
129
137
|
this.setState({
|
130
|
-
[name]: value
|
138
|
+
[name]: value,
|
139
|
+
key: this.state.key === 1 ? 2 : 1
|
131
140
|
});
|
141
|
+
const selectedOption = this.options.find(option => option.id === value);
|
132
142
|
|
133
|
-
if (
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
this.props.onChange('to', selectedOption.to.toDate());
|
139
|
-
}
|
140
|
-
} else {
|
141
|
-
this.setState({
|
142
|
-
defaultFrom: undefined,
|
143
|
-
defaultTo: undefined
|
144
|
-
});
|
143
|
+
if (selectedOption) {
|
144
|
+
this.props.onChange('from', selectedOption.from.toDate());
|
145
|
+
this.props.onChange('to', selectedOption.to.toDate());
|
146
|
+
this.props.onChange('fromError', false);
|
147
|
+
this.props.onChange('toError', false);
|
145
148
|
}
|
146
149
|
|
147
150
|
if (this.props.returnSelectValue === true) {
|
@@ -152,23 +155,9 @@ class HiDateRangeSelector extends React.Component {
|
|
152
155
|
this.handleReset = this.handleReset.bind(this);
|
153
156
|
this.handleSelectChange = this.handleSelectChange.bind(this);
|
154
157
|
this.options = props.availableOptionKeys.map(key => buildDateRangeOptionByKey(key, props.translations, props.format));
|
155
|
-
let from;
|
156
|
-
let to;
|
157
|
-
|
158
|
-
if (props.defaultPreset !== 'custom') {
|
159
|
-
const selectedOption = this.options.find(option => option.id === props.defaultPreset);
|
160
|
-
|
161
|
-
if (selectedOption) {
|
162
|
-
from = selectedOption.from.toDate();
|
163
|
-
to = selectedOption.to.toDate();
|
164
|
-
}
|
165
|
-
}
|
166
|
-
|
167
158
|
this.state = {
|
168
159
|
selectedPreset: props.defaultPreset,
|
169
|
-
containerWidth: 0
|
170
|
-
defaultFrom: from,
|
171
|
-
defaultTo: to
|
160
|
+
containerWidth: 0
|
172
161
|
};
|
173
162
|
}
|
174
163
|
|
@@ -185,8 +174,9 @@ class HiDateRangeSelector extends React.Component {
|
|
185
174
|
componentDidMount() {
|
186
175
|
if (this.container) {
|
187
176
|
this.setState({
|
188
|
-
containerWidth: findDOMNode(this.container).clientWidth
|
177
|
+
containerWidth: findDOMNode(this.container).clientWidth - 5
|
189
178
|
});
|
179
|
+
this.handleSelectChange('selectedPreset')(undefined, this.state.selectedPreset);
|
190
180
|
}
|
191
181
|
}
|
192
182
|
|
@@ -196,6 +186,7 @@ class HiDateRangeSelector extends React.Component {
|
|
196
186
|
|
197
187
|
handleReset(name) {
|
198
188
|
this.props.onChange(name, undefined);
|
189
|
+
this.props.onChange(`${name}Error`, undefined);
|
199
190
|
}
|
200
191
|
|
201
192
|
render() {
|
@@ -203,12 +194,14 @@ class HiDateRangeSelector extends React.Component {
|
|
203
194
|
{
|
204
195
|
disabled,
|
205
196
|
enableTime,
|
206
|
-
error,
|
207
197
|
errorText,
|
198
|
+
fromError,
|
199
|
+
toError,
|
208
200
|
helperIcon,
|
209
201
|
helperText,
|
210
202
|
idRange,
|
211
203
|
idSelect,
|
204
|
+
minimumDate,
|
212
205
|
label,
|
213
206
|
from,
|
214
207
|
onChange,
|
@@ -219,20 +212,26 @@ class HiDateRangeSelector extends React.Component {
|
|
219
212
|
selectProps,
|
220
213
|
staticPosition
|
221
214
|
} = _this$props,
|
222
|
-
props = _objectWithoutProperties(_this$props, ["disabled", "enableTime", "
|
215
|
+
props = _objectWithoutProperties(_this$props, ["disabled", "enableTime", "errorText", "fromError", "toError", "helperIcon", "helperText", "idRange", "idSelect", "minimumDate", "label", "from", "onChange", "required", "to", "translations", "classes", "selectProps", "staticPosition"]);
|
223
216
|
|
224
217
|
const {
|
225
|
-
defaultFrom,
|
226
|
-
defaultTo,
|
227
218
|
selectedPreset
|
228
219
|
} = this.state;
|
229
|
-
|
220
|
+
const hiSelectableListProps = {
|
221
|
+
hideCheckbox: true
|
222
|
+
};
|
223
|
+
return React.createElement(HiFormControl, {
|
224
|
+
disabled: disabled,
|
225
|
+
helperIcon: helperIcon,
|
226
|
+
helperText: helperText,
|
227
|
+
errorText: errorText,
|
228
|
+
error: !!(fromError || toError),
|
229
|
+
label: ' '
|
230
|
+
}, React.createElement(Grid, {
|
230
231
|
container: true,
|
231
232
|
spacing: 8,
|
232
233
|
className: classes.root,
|
233
|
-
ref: container =>
|
234
|
-
this.container = container;
|
235
|
-
}
|
234
|
+
ref: container => this.container = container
|
236
235
|
}, React.createElement(Grid, {
|
237
236
|
item: true,
|
238
237
|
xs: 12,
|
@@ -242,12 +241,10 @@ class HiDateRangeSelector extends React.Component {
|
|
242
241
|
}
|
243
242
|
}, React.createElement(HiSelectField, _extends({
|
244
243
|
disabled: disabled,
|
245
|
-
error: error,
|
246
|
-
errorText: errorText,
|
247
|
-
helperIcon: helperIcon,
|
248
|
-
helperText: helperText,
|
249
244
|
id: idSelect,
|
250
245
|
label: label,
|
246
|
+
hideCheckbox: true,
|
247
|
+
hiSelectableListProps: hiSelectableListProps,
|
251
248
|
name: 'selectedPreset',
|
252
249
|
options: this.options,
|
253
250
|
onChange: this.handleSelectChange('selectedPreset'),
|
@@ -267,19 +264,26 @@ class HiDateRangeSelector extends React.Component {
|
|
267
264
|
'grid-sm-8': classes.smRangePicker
|
268
265
|
}
|
269
266
|
}, React.createElement(HiDateRangePicker, _extends({
|
267
|
+
key: this.state.key,
|
270
268
|
classes: {
|
271
269
|
root: classes.dateRangePicker
|
272
270
|
},
|
273
271
|
id: idRange,
|
274
|
-
from: from
|
275
|
-
to: to
|
272
|
+
from: from,
|
273
|
+
to: to,
|
276
274
|
enableTime: enableTime,
|
277
275
|
onChange: onChange,
|
276
|
+
toError: toError,
|
277
|
+
fromError: fromError,
|
278
|
+
minimumDate: minimumDate,
|
279
|
+
errorText: null,
|
278
280
|
onReset: this.handleReset,
|
279
281
|
disabled: disabled || selectedPreset !== 'custom',
|
280
282
|
translations: translations,
|
281
|
-
staticPosition: staticPosition
|
282
|
-
|
283
|
+
staticPosition: staticPosition,
|
284
|
+
onBlur: this.onBlur,
|
285
|
+
hasSelector: true
|
286
|
+
}, props)))));
|
283
287
|
}
|
284
288
|
|
285
289
|
}
|
@@ -300,7 +304,8 @@ HiDateRangeSelector.defaultProps = {
|
|
300
304
|
quarter: 'Quarter',
|
301
305
|
week: 'Week',
|
302
306
|
short_week: 'W',
|
303
|
-
|
307
|
+
yearAndMonth: 'YYYY[-]MM',
|
308
|
+
yearAndQuarter: 'YYYY[-Q]Q',
|
304
309
|
year: 'Year',
|
305
310
|
days: 'days',
|
306
311
|
custom_period: 'Custom Period',
|
@@ -313,7 +318,13 @@ HiDateRangeSelector.defaultProps = {
|
|
313
318
|
previous_month: 'Previous Month',
|
314
319
|
current_quarter: 'Current Quarter',
|
315
320
|
previous_quarter: 'Previous Quarter',
|
316
|
-
current_year: 'Current Year'
|
321
|
+
current_year: 'Current Year',
|
322
|
+
invalid_format: 'The date format is not valid',
|
323
|
+
to_superior_from: 'Date from cannot be greater than date to',
|
324
|
+
date_superior_max_date: 'Date from cannot be greater than %s',
|
325
|
+
date_inferior_min_date: 'Date from cannot be before than %s',
|
326
|
+
missing_date_from: 'Missing date from',
|
327
|
+
missing_date_to: 'Missing date to'
|
317
328
|
}
|
318
329
|
};
|
319
330
|
HiDateRangeSelector.propTypes = process.env.NODE_ENV !== "production" ? {
|
@@ -350,7 +361,7 @@ HiDateRangeSelector.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
350
361
|
/**
|
351
362
|
* Texte de l'erreur
|
352
363
|
*/
|
353
|
-
errorText: PropTypes.string,
|
364
|
+
errorText: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
354
365
|
|
355
366
|
/**
|
356
367
|
* Format de date utilisé
|
@@ -392,6 +403,11 @@ HiDateRangeSelector.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
392
403
|
*/
|
393
404
|
locale: PropTypes.string,
|
394
405
|
|
406
|
+
/**
|
407
|
+
* Date minimale sélectionnable
|
408
|
+
*/
|
409
|
+
minimumDate: PropTypes.instanceOf(Date).isRequired,
|
410
|
+
|
395
411
|
/**
|
396
412
|
* Callback à la sélection d'une date
|
397
413
|
*/
|
@@ -55,8 +55,8 @@ class YearPickerOverlay extends React.Component {
|
|
55
55
|
}
|
56
56
|
|
57
57
|
YearPickerOverlay.defaultProps = {
|
58
|
-
disableFutureDays:
|
59
|
-
disablePastDays: false,
|
58
|
+
// disableFutureDays: true,
|
59
|
+
// disablePastDays: false,
|
60
60
|
minimumDate: new Date(2013, 4, 1),
|
61
61
|
// by default 1 May 2013
|
62
62
|
translations: {
|
@@ -92,7 +92,7 @@ YearPickerOverlay.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
92
92
|
/**
|
93
93
|
* Date minimale sélectionnable
|
94
94
|
*/
|
95
|
-
minimumDate: PropTypes.instanceOf(Date),
|
95
|
+
minimumDate: PropTypes.instanceOf(Date).isRequired,
|
96
96
|
|
97
97
|
/**
|
98
98
|
* Fonction de callback
|
@@ -25,6 +25,7 @@ export const styles = theme => ({
|
|
25
25
|
position: 'absolute',
|
26
26
|
right: 5,
|
27
27
|
cursor: 'pointer',
|
28
|
+
zIndex: 1,
|
28
29
|
top: '-5px',
|
29
30
|
'&$iconButtonError': {
|
30
31
|
color: theme.palette.negative.main
|
@@ -194,7 +195,7 @@ class HiFormControl extends React.PureComponent {
|
|
194
195
|
required: required,
|
195
196
|
disabled: disabled,
|
196
197
|
focused: !disabled && (focused || hovered)
|
197
|
-
}, InputLabelProps), error && React.createElement(HiIconButton, {
|
198
|
+
}, InputLabelProps), error && errorText && React.createElement(HiIconButton, {
|
198
199
|
className: classNames(classes.iconButton, classes.iconButtonError),
|
199
200
|
onClick: this.handleHelperClick,
|
200
201
|
onKeyDown: this.handleKeyDown
|
@@ -227,8 +228,8 @@ HiFormControl.defaultProps = {
|
|
227
228
|
required: true,
|
228
229
|
disabled: false,
|
229
230
|
error: false,
|
230
|
-
errorText:
|
231
|
-
helperText:
|
231
|
+
errorText: undefined,
|
232
|
+
helperText: undefined,
|
232
233
|
helperIcon: false,
|
233
234
|
multiline: false,
|
234
235
|
nbChars: 0,
|
@@ -263,7 +264,7 @@ HiFormControl.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
263
264
|
/**
|
264
265
|
* Texte de l'erreur
|
265
266
|
*/
|
266
|
-
errorText: PropTypes.string,
|
267
|
+
errorText: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
267
268
|
|
268
269
|
/**
|
269
270
|
* Propriétés appliquées au composant FormHelperText
|
package/es/HiPin/HiPin.js
CHANGED
@@ -434,7 +434,7 @@ class HiSelect extends React.PureComponent {
|
|
434
434
|
|
435
435
|
const popperClass = classNames(classes.popper, {
|
436
436
|
[classes.popperWidth]: !this.props.containerWidth,
|
437
|
-
[classes.popperRightAlign]: this.props.containerWidth
|
437
|
+
[classes.popperRightAlign]: this.props.containerWidth && this.props.align === 'right'
|
438
438
|
});
|
439
439
|
const content = React.createElement(ClickAwayListener, {
|
440
440
|
onClickAway: this.handleClickAway
|
@@ -515,6 +515,7 @@ class HiSelect extends React.PureComponent {
|
|
515
515
|
}
|
516
516
|
|
517
517
|
HiSelect.defaultProps = {
|
518
|
+
align: 'left',
|
518
519
|
disabled: false,
|
519
520
|
displayAsChip: false,
|
520
521
|
error: false,
|
@@ -537,6 +538,8 @@ HiSelect.defaultProps = {
|
|
537
538
|
type: 'text'
|
538
539
|
};
|
539
540
|
HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
541
|
+
align: PropTypes.oneOf(['left', 'right']),
|
542
|
+
|
540
543
|
/**
|
541
544
|
* Useful to extend the style applied to components.
|
542
545
|
*/
|
@@ -205,6 +205,7 @@ class HiSelectableListItem extends React.PureComponent {
|
|
205
205
|
fallbackImage,
|
206
206
|
hideCheckbox,
|
207
207
|
onSelect,
|
208
|
+
onKeyDown,
|
208
209
|
indeterminate,
|
209
210
|
indeterminateIcon,
|
210
211
|
icon,
|
@@ -257,12 +258,14 @@ class HiSelectableListItem extends React.PureComponent {
|
|
257
258
|
}, disabled || {
|
258
259
|
onClick: onSelect,
|
259
260
|
onMouseEnter: this.setHover(true),
|
260
|
-
onMouseLeave: this.setHover(false)
|
261
|
+
onMouseLeave: this.setHover(false),
|
262
|
+
onKeyDown: onKeyDown
|
261
263
|
}, {
|
262
264
|
style: {
|
263
265
|
paddingLeft: `${paddingLeft + level * 32}px`
|
264
266
|
}
|
265
267
|
}), !hideCheckbox && !pinned && React.createElement(HiCheckbox, {
|
268
|
+
tabIndex: onKeyDown ? '-1' : 0,
|
266
269
|
checked: selected,
|
267
270
|
checkedIcon: checkedIcon,
|
268
271
|
classes: {
|
@@ -410,6 +413,11 @@ HiSelectableListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
410
413
|
*/
|
411
414
|
onSelect: PropTypes.func,
|
412
415
|
|
416
|
+
/**
|
417
|
+
* Fonction de callback à la sélection de l'élément
|
418
|
+
*/
|
419
|
+
onKeyDown: PropTypes.func,
|
420
|
+
|
413
421
|
/**
|
414
422
|
* Padding par défaut des éléments
|
415
423
|
*/
|
package/es/HiSwitch/HiSwitch.js
CHANGED
@@ -8,6 +8,7 @@ import CellIcon from '@hipay/hipay-material-ui/HiCell/CellIcon';
|
|
8
8
|
import CellImage from '@hipay/hipay-material-ui/HiCell/CellImage';
|
9
9
|
import CellNumeric from '@hipay/hipay-material-ui/HiCell/CellNumeric';
|
10
10
|
import CellSentinel from '@hipay/hipay-material-ui/HiCell/CellSentinel';
|
11
|
+
import CellSentinelScore from '@hipay/hipay-material-ui/HiCell/CellSentinelScore';
|
11
12
|
import CellText from '@hipay/hipay-material-ui/HiCell/CellText';
|
12
13
|
import CellRate from '@hipay/hipay-material-ui/HiCell/CellRate';
|
13
14
|
import CellPinToAction from '@hipay/hipay-material-ui/HiCell/CellPinToAction';
|
@@ -109,13 +110,18 @@ class HiCellBuilder extends React.PureComponent {
|
|
109
110
|
|
110
111
|
case cst.TYPE_SENTINEL:
|
111
112
|
return React.createElement(CellSentinel, {
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
color: datacell.color,
|
114
|
+
label: datacell.label,
|
115
|
+
letter: datacell.label2,
|
116
|
+
active: datacell.active,
|
117
|
+
reviewer: datacell.reviewer,
|
118
|
+
outlined: datacell.outlined
|
119
|
+
});
|
120
|
+
|
121
|
+
case cst.TYPE_SENTINEL_SCORE:
|
122
|
+
return React.createElement(CellSentinelScore, {
|
123
|
+
value: datacell.value,
|
124
|
+
result: datacell.result
|
119
125
|
});
|
120
126
|
|
121
127
|
case cst.TYPE_PIN_TO_ACTION:
|
package/es/HiTable/constants.js
CHANGED
@@ -26,6 +26,7 @@ export const TYPE_IMAGE = 'image';
|
|
26
26
|
export const TYPE_NUMERIC = 'numeric';
|
27
27
|
export const TYPE_RATE = 'rate';
|
28
28
|
export const TYPE_SENTINEL = 'sentinel';
|
29
|
+
export const TYPE_SENTINEL_SCORE = 'sentinel_score';
|
29
30
|
export const TYPE_STATUS = 'status';
|
30
31
|
export const TYPE_COUNTRY = 'country';
|
31
32
|
export const TYPE_TEXT = 'text';
|
@@ -123,6 +124,11 @@ export const DEFAULT_WIDTHS = {
|
|
123
124
|
[VIEWS.SMALL]: 80
|
124
125
|
},
|
125
126
|
[TYPE_SENTINEL]: {
|
127
|
+
[VIEWS.LARGE]: 64,
|
128
|
+
[VIEWS.MEDIUM]: 64,
|
129
|
+
[VIEWS.SMALL]: 64
|
130
|
+
},
|
131
|
+
[TYPE_SENTINEL_SCORE]: {
|
126
132
|
[VIEWS.LARGE]: 80,
|
127
133
|
[VIEWS.MEDIUM]: 80,
|
128
134
|
[VIEWS.SMALL]: 80
|
@@ -160,6 +166,7 @@ export const DEFAULT_VIEWS = {
|
|
160
166
|
[TYPE_NUMERIC]: VIEWS.LARGE,
|
161
167
|
[TYPE_RATE]: VIEWS.LARGE,
|
162
168
|
[TYPE_SENTINEL]: VIEWS.LARGE,
|
169
|
+
[TYPE_SENTINEL_SCORE]: VIEWS.LARGE,
|
163
170
|
[TYPE_STATUS]: VIEWS.LARGE,
|
164
171
|
[TYPE_TEXT]: VIEWS.LARGE,
|
165
172
|
[TYPE_THIRD_PARTY_SECURITY]: VIEWS.LARGE
|
@@ -179,4 +186,4 @@ export const DEFAULT_PADDING = {
|
|
179
186
|
* @type {*[]}
|
180
187
|
*/
|
181
188
|
|
182
|
-
export const ALIGN_RIGHT_TYPES = [TYPE_NUMERIC, TYPE_RATE, TYPE_SENTINEL];
|
189
|
+
export const ALIGN_RIGHT_TYPES = [TYPE_NUMERIC, TYPE_RATE, TYPE_SENTINEL, TYPE_SENTINEL_SCORE];
|
@@ -120,7 +120,7 @@ export default function createPalette(palette) {
|
|
120
120
|
contrastText: '#FFFFFF'
|
121
121
|
},
|
122
122
|
secondary = {
|
123
|
-
light: '#
|
123
|
+
light: '#ffd94f',
|
124
124
|
main: '#ffcf21',
|
125
125
|
dark: '#E9BE30',
|
126
126
|
contrastText: '#FFFFFF'
|
@@ -161,7 +161,7 @@ export default function createPalette(palette) {
|
|
161
161
|
main: '#EDED14'
|
162
162
|
},
|
163
163
|
type = 'light',
|
164
|
-
contrastThreshold = 2.
|
164
|
+
contrastThreshold = 2.2,
|
165
165
|
// max light contrast
|
166
166
|
tonalOffset = 0.2,
|
167
167
|
context = 'local'
|
@@ -176,7 +176,7 @@ export default function createPalette(palette) {
|
|
176
176
|
|
177
177
|
if (process.env.NODE_ENV !== 'production') {
|
178
178
|
const contrast = getContrastRatio(background, contrastText);
|
179
|
-
process.env.NODE_ENV !== "production" ? warning(contrast >=
|
179
|
+
process.env.NODE_ENV !== "production" ? warning(contrast >= 2.2, [`Material-UI: the contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n')) : void 0;
|
180
180
|
}
|
181
181
|
|
182
182
|
return contrastText;
|
package/index.es.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@hipay/hipay-material-ui",
|
3
3
|
"private": false,
|
4
4
|
"author": "HiPay PSYCHE Team",
|
5
|
-
"version": "2.0.0-beta.
|
5
|
+
"version": "2.0.0-beta.54",
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
7
7
|
"keywords": [
|
8
8
|
"react",
|
@@ -48,6 +48,7 @@
|
|
48
48
|
"jss-vendor-prefixer": "^8.0.1",
|
49
49
|
"keycode": "^2.1.9",
|
50
50
|
"mdi-material-ui": "^5.4.0",
|
51
|
+
"moment": "^2.22.2",
|
51
52
|
"normalize-scroll-left": "^0.1.2",
|
52
53
|
"popper.js": "^1.14.1",
|
53
54
|
"prop-types": "^15.6.0",
|
@@ -71,4 +72,4 @@
|
|
71
72
|
},
|
72
73
|
"main": "./index.js",
|
73
74
|
"module": "./index.es.js"
|
74
|
-
}
|
75
|
+
}
|
package/styles/createPalette.js
CHANGED
@@ -141,7 +141,7 @@ function createPalette(palette) {
|
|
141
141
|
} : _palette$primary,
|
142
142
|
_palette$secondary = palette.secondary,
|
143
143
|
secondary = _palette$secondary === void 0 ? {
|
144
|
-
light: '#
|
144
|
+
light: '#ffd94f',
|
145
145
|
main: '#ffcf21',
|
146
146
|
dark: '#E9BE30',
|
147
147
|
contrastText: '#FFFFFF'
|
@@ -190,7 +190,7 @@ function createPalette(palette) {
|
|
190
190
|
_palette$type = palette.type,
|
191
191
|
type = _palette$type === void 0 ? 'light' : _palette$type,
|
192
192
|
_palette$contrastThre = palette.contrastThreshold,
|
193
|
-
contrastThreshold = _palette$contrastThre === void 0 ? 2.
|
193
|
+
contrastThreshold = _palette$contrastThre === void 0 ? 2.2 : _palette$contrastThre,
|
194
194
|
_palette$tonalOffset = palette.tonalOffset,
|
195
195
|
tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,
|
196
196
|
_palette$context = palette.context,
|
@@ -205,7 +205,7 @@ function createPalette(palette) {
|
|
205
205
|
|
206
206
|
if (process.env.NODE_ENV !== 'production') {
|
207
207
|
var contrast = (0, _colorManipulator.getContrastRatio)(background, contrastText);
|
208
|
-
process.env.NODE_ENV !== "production" ? (0, _warning.default)(contrast >=
|
208
|
+
process.env.NODE_ENV !== "production" ? (0, _warning.default)(contrast >= 2.2, ["Material-UI: the contrast ratio of ".concat(contrast, ":1 for ").concat(contrastText, " on ").concat(background), 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n')) : void 0;
|
209
209
|
}
|
210
210
|
|
211
211
|
return contrastText;
|