|
1 | 1 | import * as React from 'react' |
2 | 2 | import { ForwardRefComponent, HtmlLabelProps, SemanticShorthandItem } from '../../generic' |
3 | 3 |
|
4 | | -export interface CheckboxProps extends StrictCheckboxProps { |
5 | | - [key: string]: any |
6 | | -} |
7 | | - |
8 | | -export interface StrictCheckboxProps { |
| 4 | +export interface CheckboxProps { |
9 | 5 | /** An element type to render as (string or function). */ |
10 | 6 | as?: any |
11 | 7 |
|
@@ -45,31 +41,51 @@ export interface StrictCheckboxProps { |
45 | 41 | * @param {SyntheticEvent} event - React's original SyntheticEvent. |
46 | 42 | * @param {object} data - All props and proposed checked/indeterminate state. |
47 | 43 | */ |
48 | | - onChange?: (event: React.FormEvent<HTMLInputElement>, data: CheckboxProps) => void |
| 44 | + onChange?: ( |
| 45 | + event: React.FormEvent<HTMLInputElement>, |
| 46 | + props: CheckboxProps, |
| 47 | + checked: boolean, |
| 48 | + indeterminate: boolean, |
| 49 | + ) => void |
49 | 50 |
|
50 | 51 | /** |
51 | 52 | * Called when the checkbox or label is clicked. |
52 | 53 | * |
53 | 54 | * @param {SyntheticEvent} event - React's original SyntheticEvent. |
54 | 55 | * @param {object} data - All props and current checked/indeterminate state. |
55 | 56 | */ |
56 | | - onClick?: (event: React.MouseEvent<HTMLInputElement>, data: CheckboxProps) => void |
| 57 | + onClick?: ( |
| 58 | + event: React.MouseEvent<HTMLInputElement>, |
| 59 | + props: CheckboxProps, |
| 60 | + checked: boolean, |
| 61 | + indeterminate: boolean, |
| 62 | + ) => void |
57 | 63 |
|
58 | 64 | /** |
59 | 65 | * Called when the user presses down on the mouse. |
60 | 66 | * |
61 | 67 | * @param {SyntheticEvent} event - React's original SyntheticEvent. |
62 | 68 | * @param {object} data - All props and current checked/indeterminate state. |
63 | 69 | */ |
64 | | - onMouseDown?: (event: React.MouseEvent<HTMLInputElement>, data: CheckboxProps) => void |
| 70 | + onMouseDown?: ( |
| 71 | + event: React.MouseEvent<HTMLInputElement>, |
| 72 | + props: CheckboxProps, |
| 73 | + checked: boolean, |
| 74 | + indeterminate: boolean, |
| 75 | + ) => void |
65 | 76 |
|
66 | 77 | /** |
67 | 78 | * Called when the user releases the mouse. |
68 | 79 | * |
69 | 80 | * @param {SyntheticEvent} event - React's original SyntheticEvent. |
70 | 81 | * @param {object} data - All props and current checked/indeterminate state. |
71 | 82 | */ |
72 | | - onMouseUp?: (event: React.MouseEvent<HTMLInputElement>, data: CheckboxProps) => void |
| 83 | + onMouseUp?: ( |
| 84 | + event: React.MouseEvent<HTMLInputElement>, |
| 85 | + props: CheckboxProps, |
| 86 | + checked: boolean, |
| 87 | + indeterminate: boolean, |
| 88 | + ) => void |
73 | 89 |
|
74 | 90 | /** Format as a radio element. This means it is an exclusive option. */ |
75 | 91 | radio?: boolean |
|
0 commit comments