x-ui-design 0.4.2 → 0.4.3

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.
@@ -1,13 +1,9 @@
1
- import { KeyboardEventHandler, MouseEvent, MouseEventHandler, ReactNode } from 'react';
1
+ import { MouseEvent, ReactNode } from 'react';
2
2
  import { DefaultProps, TargetProps } from '.';
3
3
  export type SwitchProps = DefaultProps & {
4
4
  disabled?: boolean;
5
5
  onChange?: (e: MouseEvent<HTMLInputElement> & TargetProps) => void;
6
- onClick?: MouseEventHandler<HTMLElement>;
7
- onMouseEnter?: MouseEventHandler<HTMLElement>;
8
- onMouseLeave?: MouseEventHandler<HTMLElement>;
9
- onKeyPress?: KeyboardEventHandler<HTMLElement>;
10
- onKeyDown?: KeyboardEventHandler<HTMLElement>;
6
+ onClick?: (value: boolean) => void;
11
7
  value?: boolean;
12
8
  tabIndex?: number;
13
9
  name?: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { CSSProperties, ReactNode, MouseEvent, MouseEventHandler, KeyboardEventHandler } from 'react';
2
+ import { CSSProperties, ReactNode, MouseEvent } from 'react';
3
3
  import * as __types_select from '@/types/select';
4
4
  export { CustomTagProps, DisplayValueType, OptionProps, OptionType, SelectProps, TagProps } from '@/types/select';
5
5
  import * as __types_radio from '@/types/radio';
@@ -93,11 +93,7 @@ type EmptyContentProps = DefaultProps & {
93
93
  type SwitchProps = DefaultProps & {
94
94
  disabled?: boolean;
95
95
  onChange?: (e: MouseEvent<HTMLInputElement> & TargetProps) => void;
96
- onClick?: MouseEventHandler<HTMLElement>;
97
- onMouseEnter?: MouseEventHandler<HTMLElement>;
98
- onMouseLeave?: MouseEventHandler<HTMLElement>;
99
- onKeyPress?: KeyboardEventHandler<HTMLElement>;
100
- onKeyDown?: KeyboardEventHandler<HTMLElement>;
96
+ onClick?: (value: boolean) => void;
101
97
  value?: boolean;
102
98
  tabIndex?: number;
103
99
  name?: string;
package/dist/index.esm.js CHANGED
@@ -1464,7 +1464,7 @@ const Switch = ({
1464
1464
  }
1465
1465
  setInternalChecked(!internalChecked);
1466
1466
  e.target.value = !internalChecked;
1467
- onClick?.(e);
1467
+ onClick?.(e.target.value);
1468
1468
  onChange?.(e);
1469
1469
  };
1470
1470
  useEffect(() => {