@bytebrand/fe-ui-core 4.1.219 → 4.1.220

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.219",
3
+ "version": "4.1.220",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -10,7 +10,7 @@ type SwitcherProps = {
10
10
  value: any;
11
11
  options: any[];
12
12
 
13
- onChange?: (event: React.SyntheticEvent, value: number, name: any) => void;
13
+ onChange?: (e: React.SyntheticEvent, value: number, key: string) => void;
14
14
 
15
15
  borderLeftRadius?: boolean;
16
16
  borderRightRadius?: boolean;
@@ -23,9 +23,8 @@ const Switcher = ({
23
23
  value
24
24
  }: SwitcherProps) => {
25
25
 
26
- const onChangeSwitch = (event: React.SyntheticEvent, value: number) => {
26
+ const onChangeSwitch = (event: React.SyntheticEvent) => {
27
27
  onChange(event, +event.target.value, name);
28
- console.log('qqqq value ====', +event.target.value);
29
28
  };
30
29
 
31
30
  return (
@@ -36,9 +35,9 @@ const Switcher = ({
36
35
  exclusive
37
36
  onChange={onChangeSwitch}
38
37
  >
39
- {options.map((option, index) => {
38
+ {options && options.map((option, index) => {
40
39
  return (
41
- <ToggleButton key={option} value={index}>{option}</ToggleButton>
40
+ <ToggleButton key={option} value={index + 1}>{option}</ToggleButton>
42
41
  );
43
42
  })}
44
43
  </ToggleButtonGroup>