1 | import type * as React from 'react';
|
2 | import type { AbstractCheckboxProps } from '../checkbox/Checkbox';
|
3 | import type { AbstractCheckboxGroupProps } from '../checkbox/Group';
|
4 | import type { DisabledType } from '../config-provider/DisabledContext';
|
5 | import type { SizeType } from '../config-provider/SizeContext';
|
6 | export type RadioGroupButtonStyle = 'outline' | 'solid';
|
7 | export type RadioGroupOptionType = 'default' | 'button';
|
8 | export interface RadioGroupProps extends AbstractCheckboxGroupProps {
|
9 | defaultValue?: any;
|
10 | value?: any;
|
11 | onChange?: (e: RadioChangeEvent) => void;
|
12 | size?: SizeType;
|
13 | disabled?: DisabledType;
|
14 | onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
15 | onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
16 | name?: string;
|
17 | children?: React.ReactNode;
|
18 | id?: string;
|
19 | optionType?: RadioGroupOptionType;
|
20 | buttonStyle?: RadioGroupButtonStyle;
|
21 | onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
22 | onBlur?: React.FocusEventHandler<HTMLDivElement>;
|
23 | }
|
24 | export interface RadioGroupContextProps {
|
25 | onChange: (e: RadioChangeEvent) => void;
|
26 | value: any;
|
27 | disabled?: boolean;
|
28 | name?: string;
|
29 | }
|
30 | export interface RadioProps extends AbstractCheckboxProps<RadioChangeEvent> {
|
31 | }
|
32 | export interface RadioChangeEventTarget extends RadioProps {
|
33 | checked: boolean;
|
34 | }
|
35 | export interface RadioChangeEvent {
|
36 | target: RadioChangeEventTarget;
|
37 | stopPropagation: () => void;
|
38 | preventDefault: () => void;
|
39 | nativeEvent: MouseEvent;
|
40 | }
|
41 | export type RadioOptionTypeContextProps = RadioGroupOptionType;
|