mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
Fix types for Radio Group
This commit is contained in:
parent
007c7d0ef7
commit
cd5cbafdf0
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import shallowEqual from 'shallowequal';
|
import shallowEqual from 'shallowequal';
|
||||||
import Radio from './radio';
|
import Radio from './radio';
|
||||||
import { RadioGroupProps, RadioGroupState, RadioChangeEvent } from './interface';
|
import { RadioGroupProps, RadioGroupState, RadioChangeEvent, RadioGroupButtonStyle } from './interface';
|
||||||
|
|
||||||
function getCheckedValue(children: React.ReactNode) {
|
function getCheckedValue(children: React.ReactNode) {
|
||||||
let value = null;
|
let value = null;
|
||||||
@ -21,7 +21,7 @@ export default class RadioGroup extends React.Component<RadioGroupProps, RadioGr
|
|||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
disabled: false,
|
disabled: false,
|
||||||
prefixCls: 'ant-radio',
|
prefixCls: 'ant-radio',
|
||||||
buttonStyle: 'outline',
|
buttonStyle: 'outline' as RadioGroupButtonStyle,
|
||||||
};
|
};
|
||||||
|
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
|
@ -2,6 +2,8 @@ import * as React from 'react';
|
|||||||
import { AbstractCheckboxGroupProps } from '../checkbox/Group';
|
import { AbstractCheckboxGroupProps } from '../checkbox/Group';
|
||||||
import { AbstractCheckboxProps } from '../checkbox/Checkbox';
|
import { AbstractCheckboxProps } from '../checkbox/Checkbox';
|
||||||
|
|
||||||
|
export type RadioGroupButtonStyle = 'outline' | 'solid';
|
||||||
|
|
||||||
export interface RadioGroupProps extends AbstractCheckboxGroupProps {
|
export interface RadioGroupProps extends AbstractCheckboxGroupProps {
|
||||||
defaultValue?: any;
|
defaultValue?: any;
|
||||||
value?: any;
|
value?: any;
|
||||||
@ -12,7 +14,7 @@ export interface RadioGroupProps extends AbstractCheckboxGroupProps {
|
|||||||
name?: string;
|
name?: string;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
id?: string;
|
id?: string;
|
||||||
buttonStyle?: 'outline' | 'solid';
|
buttonStyle?: RadioGroupButtonStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RadioGroupState {
|
export interface RadioGroupState {
|
||||||
|
Loading…
Reference in New Issue
Block a user