@bytebrand/fe-ui-core 4.0.248 → 4.0.250
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/package.json
CHANGED
|
@@ -13,7 +13,7 @@ export const Theme = createTheme({
|
|
|
13
13
|
popupIndicator: {
|
|
14
14
|
padding: 4,
|
|
15
15
|
},
|
|
16
|
-
root: {
|
|
16
|
+
root: ({ ownerState }) => ({
|
|
17
17
|
['&.Mui-focused + [data-popper-placement*="bottom"] .MuiOutlinedInput-root']: {
|
|
18
18
|
borderTopRightRadius: 0,
|
|
19
19
|
borderTopLeftRadius: 0
|
|
@@ -37,7 +37,10 @@ export const Theme = createTheme({
|
|
|
37
37
|
borderBottomRightRadius: 0,
|
|
38
38
|
borderLeft: '2px solid #1976d2',
|
|
39
39
|
borderRight: '2px solid #1976d2',
|
|
40
|
-
borderTop: '2px solid #1976d2'
|
|
40
|
+
borderTop: '2px solid #1976d2',
|
|
41
|
+
...(ownerState.error && { // tslint:disable-line
|
|
42
|
+
borderColor: '#d32f2f'
|
|
43
|
+
})
|
|
41
44
|
},
|
|
42
45
|
['&.Mui-focused + [data-popper-placement*="bottom"] > .MuiPaper-root']: {
|
|
43
46
|
borderTopLeftRadius: 0,
|
|
@@ -45,6 +48,9 @@ export const Theme = createTheme({
|
|
|
45
48
|
borderLeft: '2px solid #1976d2',
|
|
46
49
|
borderRight: '2px solid #1976d2',
|
|
47
50
|
borderBottom: '2px solid #1976d2',
|
|
51
|
+
...(ownerState.error && { // tslint:disable-line
|
|
52
|
+
borderColor: '#d32f2f'
|
|
53
|
+
}),
|
|
48
54
|
marginTop: '-3px'
|
|
49
55
|
},
|
|
50
56
|
['& + .MuiAutocomplete-popper .MuiAutocomplete-listbox']: {
|
|
@@ -66,7 +72,7 @@ export const Theme = createTheme({
|
|
|
66
72
|
['& + .MuiAutocomplete-popper > .MuiPaper-root::-webkit-scrollbar-thumb:hover']: {
|
|
67
73
|
backgroundColor: 'grey'
|
|
68
74
|
}
|
|
69
|
-
}
|
|
75
|
+
})
|
|
70
76
|
}
|
|
71
77
|
},
|
|
72
78
|
MuiChip: {
|
|
@@ -90,6 +90,7 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
|
|
|
90
90
|
multiple={multiple}
|
|
91
91
|
handleHomeEndKeys
|
|
92
92
|
value={value}
|
|
93
|
+
error={error}
|
|
93
94
|
onChange={(e, newValue, reason: string, details?: { option: any }) => {
|
|
94
95
|
if (typeof newValue === 'string') {
|
|
95
96
|
onChange(newValue);
|
|
@@ -408,14 +408,14 @@ export function getChipFilterValue (chip: any, t: (key: string, options?: object
|
|
|
408
408
|
|
|
409
409
|
case 'MANUFACTURER_EXCLUDE':
|
|
410
410
|
case 'MODEL_EXCLUDE':
|
|
411
|
-
title = t(`filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
411
|
+
title = t(`SearchPage:filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
412
412
|
filterValue = `${title} ${chipFilterValue}`;
|
|
413
413
|
break;
|
|
414
414
|
|
|
415
415
|
case 'FIRST_REGISTRATION':
|
|
416
|
-
title = t(`filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
417
|
-
from = chipFilterValue.from ? `${t('filters.from')} ${chipFilterValue.from} ` : '';
|
|
418
|
-
to = chipFilterValue.to ? `${t('filters.to')} ${chipFilterValue.to}` : '';
|
|
416
|
+
title = t(`SearchPage:filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
417
|
+
from = chipFilterValue.from ? `${t('SearchPage:filters.from')} ${chipFilterValue.from} ` : '';
|
|
418
|
+
to = chipFilterValue.to ? `${t('SearchPage:filters.to')} ${chipFilterValue.to}` : '';
|
|
419
419
|
filterValue = `${title} ${from} ${to}`;
|
|
420
420
|
break;
|
|
421
421
|
|
|
@@ -425,21 +425,21 @@ export function getChipFilterValue (chip: any, t: (key: string, options?: object
|
|
|
425
425
|
case 'EMISSION_CO2':
|
|
426
426
|
case 'POWER':
|
|
427
427
|
case 'IMAGES_COUNT':
|
|
428
|
-
title = t(`filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
429
|
-
from = chipFilterValue.from ? `${t('filters.from')} ${getFormattedPrice(+chipFilterValue.from)} ` : '';
|
|
430
|
-
to = chipFilterValue.to ? `${t('filters.to')} ${getFormattedPrice(+chipFilterValue.to)}` : '';
|
|
428
|
+
title = t(`SearchPage:filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
429
|
+
from = chipFilterValue.from ? `${t('SearchPage:filters.from')} ${getFormattedPrice(+chipFilterValue.from)} ` : '';
|
|
430
|
+
to = chipFilterValue.to ? `${t('SearchPage:filters.to')} ${getFormattedPrice(+chipFilterValue.to)}` : '';
|
|
431
431
|
const type = chipFilterValue.type ? ` ${chipFilterValue.type}` : '';
|
|
432
432
|
filterValue = `${title} ${from} ${to}${type}`;
|
|
433
433
|
break;
|
|
434
434
|
|
|
435
435
|
case 'DOORS':
|
|
436
436
|
case 'OWNERS':
|
|
437
|
-
filterValue = t(`filters.${chipFilterValue}`);
|
|
437
|
+
filterValue = t(`SearchPage:filters.${chipFilterValue}`);
|
|
438
438
|
break;
|
|
439
439
|
|
|
440
440
|
case 'SEATS':
|
|
441
441
|
case 'CUBIC_CAPACITY':
|
|
442
|
-
title = t(`filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
442
|
+
title = t(`SearchPage:filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
443
443
|
const fromTo = `${chipFilterValue.from} - ${chipFilterValue.to}`;
|
|
444
444
|
filterValue = `${title} ${fromTo}`;
|
|
445
445
|
break;
|
|
@@ -450,15 +450,15 @@ export function getChipFilterValue (chip: any, t: (key: string, options?: object
|
|
|
450
450
|
const newFromValue: any = (fromValue === 'NaN') ? '1' : fromValue;
|
|
451
451
|
const newToValue: any = (toValue === 'NaN') ? '18' : toValue;
|
|
452
452
|
const fromToWithInfo = `${newFromValue} - ${newToValue}`;
|
|
453
|
-
filterValue = t(`filtersChips.${chipFilterKey.toLocaleLowerCase()}`, { value: fromToWithInfo });
|
|
453
|
+
filterValue = t(`SearchPage:filtersChips.${chipFilterKey.toLocaleLowerCase()}`, { value: fromToWithInfo });
|
|
454
454
|
break;
|
|
455
455
|
|
|
456
456
|
case 'ONLINE_SINCE':
|
|
457
|
-
filterValue = t(`filters.${chipFilterValue}`);
|
|
457
|
+
filterValue = t(`SearchPage:filters.${chipFilterValue}`);
|
|
458
458
|
break;
|
|
459
459
|
|
|
460
460
|
case 'GENERAL_INSPECTION':
|
|
461
|
-
filterValue = t(`filtersChips.generalInspection`, { month: t(`filters.${chipFilterValue}`) });
|
|
461
|
+
filterValue = t(`SearchPage:filtersChips.generalInspection`, { month: t(`SearchPage:filters.${chipFilterValue}`) });
|
|
462
462
|
break;
|
|
463
463
|
|
|
464
464
|
case 'RATE':
|
|
@@ -471,11 +471,11 @@ export function getChipFilterValue (chip: any, t: (key: string, options?: object
|
|
|
471
471
|
.map((field: string) => {
|
|
472
472
|
const rowValue = rowValues[field];
|
|
473
473
|
const value = Number.isFinite(+rowValue) ? getFormattedPrice(+rowValue) : rowValue;
|
|
474
|
-
return +rowValue ? t(`filtersChips.${field}Chip`, { value }) : null;
|
|
474
|
+
return +rowValue ? t(`SearchPage:filtersChips.${field}Chip`, { value }) : null;
|
|
475
475
|
})
|
|
476
476
|
.filter((item: any) => !!item)
|
|
477
477
|
);
|
|
478
|
-
const rateValue = `${t('filtersChips.rateChip')} ${values[0].length ? values[0].join(' ') : t('filtersChips.any')}`;
|
|
478
|
+
const rateValue = `${t('SearchPage:filtersChips.rateChip')} ${values[0].length ? values[0].join(' ') : t('SearchPage:filtersChips.any')}`;
|
|
479
479
|
filterValue = `${rateValue}, ${values[1].join(', ')}`;
|
|
480
480
|
break;
|
|
481
481
|
|