Fix types

This commit is contained in:
Wei Zhu 2017-07-31 01:50:46 +08:00
parent 12bf17b166
commit 401519ec6f
5 changed files with 14 additions and 6 deletions

View File

@ -17,6 +17,7 @@ export interface AbstractCheckboxProps {
onMouseLeave?: React.MouseEventHandler<any>;
value?: any;
name?: string;
children?: React.ReactChild;
}
export interface CheckboxProps extends AbstractCheckboxProps {

View File

@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { changeConfirmLocale } from '../modal/locale';
import { ModalLocale, changeConfirmLocale } from '../modal/locale';
export interface LocaleProviderProps {
locale: {
@ -9,7 +9,7 @@ export interface LocaleProviderProps {
TimePicker?: Object,
Calendar?: Object,
Table?: Object,
Modal?: Object,
Modal?: ModalLocale,
Popconfirm?: Object,
Transfer?: Object,
Select?: Object,

View File

@ -1,14 +1,20 @@
const defaultLocale = {
export interface ModalLocale {
okText: string;
cancelText: string;
justOkText: string;
}
const defaultLocale: ModalLocale = {
okText: '确定',
cancelText: '取消',
justOkText: '知道了',
};
let runtimeLocale = {
let runtimeLocale: ModalLocale = {
...defaultLocale,
};
export function changeConfirmLocale(newLocale?: Object) {
export function changeConfirmLocale(newLocale?: ModalLocale) {
if (newLocale) {
runtimeLocale = {
...runtimeLocale,

View File

@ -54,6 +54,7 @@ export interface ArgsProps {
placement?: notificationPlacement;
style?: string;
className?: string;
type: string;
}
export interface ConfigProps {

View File

@ -15,7 +15,7 @@ export default class RadioButton extends React.Component<RadioButtonProps, any>
};
render() {
let radioProps: RadioButtonProps = { ...this.props };
const radioProps: RadioButtonProps = { ...this.props };
if (this.context.radioGroup) {
radioProps.onChange = this.context.radioGroup.onChange;
radioProps.checked = this.props.value === this.context.radioGroup.value;