@bytebrand/fe-ui-core 4.0.261 → 4.0.262

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.0.261",
3
+ "version": "4.0.262",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -30,6 +30,8 @@ export interface IRangeControlledProps {
30
30
  onChangeControls?: (name: string, value: any) => void;
31
31
  changeControlsAfterOnChange?: boolean;
32
32
  t?: (key: string) => string;
33
+ isNumberWithDot?: boolean;
34
+ unit?: string;
33
35
  }
34
36
 
35
37
  const RangeControlled = ({
@@ -42,7 +44,9 @@ const RangeControlled = ({
42
44
  options,
43
45
  changeControlsAfterOnChange,
44
46
  handleLabelFormat = '.2s',
45
- showTitle
47
+ showTitle,
48
+ isNumberWithDot,
49
+ unit
46
50
  }: IRangeControlledProps) => {
47
51
  // static readonly defaultProps = {
48
52
  // showTitle: true,
@@ -59,7 +63,7 @@ const RangeControlled = ({
59
63
  const getOptions = (options: any): Object[] =>
60
64
  options.map((option: string) => ({
61
65
  value: `${option}`,
62
- label: `${option}`
66
+ label: `${isNumberWithDot ? numberWithDot(option) : option}`
63
67
  }));
64
68
 
65
69
  const transformValues = (values: any): number[] => {
@@ -114,7 +118,7 @@ const RangeControlled = ({
114
118
  const fromProps = {
115
119
  size: 'custom',
116
120
  value: from ? from : null,
117
- label: `${t('filters.from')} €`,
121
+ label: `${t('filters.from')} ${unit ? unit : '€'}`,
118
122
  onChange: (value: any) => onDropDownChange('from', value),
119
123
  items: getOptions(sliceLessThan(getDropdownRange(name), to))
120
124
  };
@@ -122,7 +126,7 @@ const RangeControlled = ({
122
126
  const toProps = {
123
127
  size: 'custom',
124
128
  value: to ? to : null,
125
- label: `${t('filters.to')} €`,
129
+ label: `${t('filters.from')} ${unit ? unit : '€'}`,
126
130
  onChange: (value: any) => onDropDownChange('to', value),
127
131
  items: getOptions(sliceMoreThan(getDropdownRange(name), from))
128
132
  };
@@ -97,7 +97,8 @@ class Cost extends React.Component<ICostProps, ICostState> {
97
97
  name: 'PRICE',
98
98
  options: PRICE.options,
99
99
  values: PRICE.values,
100
- controls: PRICE.controls
100
+ controls: PRICE.controls,
101
+ isNumberWithDot: true
101
102
  };
102
103
 
103
104
  return <RangeControlled {...priceProps} />;
@@ -46,7 +46,7 @@ const FirstRegistration = ({ controls, onChange, onChangeControls, values, optio
46
46
  values: transformValues(values),
47
47
  onChange: (value: string, name: string) => {
48
48
  onChange(name, value);
49
- onChangeControls(name, RANGE_FILTERS_DEFAULT_CONTROLS);
49
+ // onChangeControls(name, RANGE_FILTERS_DEFAULT_CONTROLS);
50
50
  }
51
51
  };
52
52