@bytebrand/fe-ui-core 4.1.164 → 4.1.166

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.1.164",
3
+ "version": "4.1.166",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -101,7 +101,7 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
101
101
  handleHomeEndKeys
102
102
  value={value}
103
103
  name={name}
104
- error={error}
104
+ error={error.toString()}
105
105
  readOnly={readOnly}
106
106
  listwithimage={listWithImage}
107
107
  onChange={(e, newValue, reason: string, details?: { option: any }) => {
@@ -205,7 +205,7 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
205
205
  {...params}
206
206
  type={type}
207
207
  className={selectClassName}
208
- error={error}
208
+ error={error.toString()}
209
209
  disabled={disabled}
210
210
  required={required}
211
211
  size={size}
@@ -70,7 +70,7 @@ const MaterialField: React.FC<IVehicleModalProps> = ({
70
70
  value={value}
71
71
  name={name}
72
72
  sx={sx}
73
- error={error}
73
+ error={error.toString()}
74
74
  type={type === 'password' ? passType : type}
75
75
  disabled={disabled}
76
76
  required={required}
@@ -141,7 +141,7 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
141
141
  <ThemeProvider theme={Theme}>
142
142
  <FormControl
143
143
  className={className}
144
- error={error}
144
+ error={error.toString()}
145
145
  disabled={disabled}
146
146
  required={required}
147
147
  size={size}
@@ -44,7 +44,7 @@ class FormTextField extends React.Component<IFormTextFieldProps, {}> {
44
44
 
45
45
  return (
46
46
  <div className={classnames(styles.field, className)}>
47
- <TextField error={hasError && error} {...props} type={type || field.type} />
47
+ <TextField error={(hasError && error).toString()} {...props} type={type || field.type} />
48
48
  {hasError && error ? (<span className={errorClassName}>{error}</span>) : false}
49
49
  </div>
50
50
  );
@@ -295,11 +295,9 @@ const getDecoratedProps = (
295
295
  chargingDuration230V: {
296
296
  title: t('vehicleProps:title.chargingDuration230V'),
297
297
  get value() {
298
- const {
299
- batteryChargingDuration230VSelect,
300
- batteryChargingDuration230VHour,
301
- batteryCharchingDuration230VMinutesHours
302
- } = car.battery;
298
+ const batteryChargingDuration230VSelect = car.battery && car.battery.batteryChargingDuration230VSelect;
299
+ const batteryChargingDuration230VHour = car.battery && car.battery.batteryChargingDuration230VHour;
300
+ const batteryCharchingDuration230VMinutesHours = car.battery && car.battery.batteryCharchingDuration230VMinutesHours;
303
301
 
304
302
  return batteryChargingDuration230VSelect
305
303
  ? `${batteryChargingDuration230VHour ? `${batteryChargingDuration230VHour} ${isCheckedBatteryTime(batteryCharchingDuration230VMinutesHours, t)}` : ''} ${batteryChargingDuration230VSelect}`
@@ -309,11 +307,9 @@ const getDecoratedProps = (
309
307
  chargingDurationMaxSpeed: {
310
308
  title: t('vehicleProps:title.chargingDurationMaxSpeed'),
311
309
  get value() {
312
- const {
313
- batteryChargingDurationMaxSelect,
314
- batteryChargingDurationMaxHour,
315
- batteryCharchingDurationMaxSelectMinutesHours
316
- } = car.battery;
310
+ const batteryChargingDurationMaxSelect = car.battery && car.battery.batteryChargingDurationMaxSelect
311
+ const batteryChargingDurationMaxHour = car.battery && car.battery.batteryChargingDurationMaxHour
312
+ const batteryCharchingDurationMaxSelectMinutesHours = car.battery && car.battery.batteryCharchingDurationMaxSelectMinutesHours
317
313
 
318
314
  return batteryChargingDurationMaxSelect
319
315
  ? `${batteryChargingDurationMaxHour ? `${batteryChargingDurationMaxHour} ${isCheckedBatteryTime(batteryCharchingDurationMaxSelectMinutesHours, t)}` : ''} ${batteryChargingDurationMaxSelect}`
@@ -323,7 +319,7 @@ const getDecoratedProps = (
323
319
  batteryChargerType: {
324
320
  title: t('vehicleProps:title.batteryChargerType'),
325
321
  get value() {
326
- const { batteryChargerType } = car.battery;
322
+ const batteryChargerType = car.battery && car.battery.batteryChargerType
327
323
 
328
324
  return isPropDefined(batteryChargerType)
329
325
  ? batteryChargerType.map((item: any) => t(`cbd:${item}`)).join('\n')
@@ -775,7 +771,7 @@ const getDecoratedProps = (
775
771
  batteryRangeElectric: {
776
772
  title: t('vehicleProps:title.batteryRangeElectric'),
777
773
  get value() {
778
- const { batteryRangeElectric } = car.battery;
774
+ const batteryRangeElectric = car.battery && car.battery.batteryRangeElectric;
779
775
  return Number.isFinite(batteryRangeElectric)
780
776
  ? t('vehicleProps:value.batteryRangeElectric', { consumption: batteryRangeElectric.toLocaleString(language) })
781
777
  : t('vehicleProps:value.na');