mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
Fix more tslint problems
This commit is contained in:
parent
aee2b2c5ad
commit
2e41e35cc6
@ -48,12 +48,6 @@ export interface AffixProps {
|
||||
}
|
||||
|
||||
export default class Affix extends React.Component<AffixProps, any> {
|
||||
scrollEvent: any;
|
||||
resizeEvent: any;
|
||||
refs: {
|
||||
fixedNode: any;
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
offsetTop: React.PropTypes.number,
|
||||
offsetBottom: React.PropTypes.number,
|
||||
@ -63,6 +57,12 @@ export default class Affix extends React.Component<AffixProps, any> {
|
||||
onChange() {},
|
||||
};
|
||||
|
||||
scrollEvent: any;
|
||||
resizeEvent: any;
|
||||
refs: {
|
||||
fixedNode: any;
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
|
@ -17,7 +17,9 @@ export default class BreadcrumbItem extends React.Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const [{ prefixCls, separator, children }, restProps] = splitObject(this.props, ['prefixCls', 'separator', 'children']);
|
||||
const [{ prefixCls, separator, children }, restProps] = splitObject(
|
||||
this.props, ['prefixCls', 'separator', 'children']
|
||||
);
|
||||
let link;
|
||||
if ('href' in this.props) {
|
||||
link = <a className={`${prefixCls}-link`} {...restProps}>{children}</a>;
|
||||
|
@ -4,7 +4,7 @@ import splitObject from '../_util/splitObject';
|
||||
export default props => {
|
||||
const [{
|
||||
prefixCls = 'ant-card', className, extra, bodyStyle,
|
||||
title, loading, bordered = true
|
||||
title, loading, bordered = true,
|
||||
}, others] = splitObject(props,
|
||||
['prefixCls', 'className', 'children', 'extra', 'bodyStyle', 'title', 'loading', 'bordered']);
|
||||
let children = props.children;
|
||||
|
@ -33,7 +33,7 @@ export interface CarouselProps {
|
||||
/** 切换面板的回调 */
|
||||
beforeChange?: (from: number, to: number) => void;
|
||||
/** 切换面板的回调 */
|
||||
afterChange?: (current:number) => void;
|
||||
afterChange?: (current: number) => void;
|
||||
/** 行内样式 */
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
@ -23,9 +23,9 @@ export interface CascaderProps {
|
||||
/** 指定选中项 */
|
||||
value?: Array<CascaderOptionType>;
|
||||
/** 选择完成后的回调 */
|
||||
onChange?: (value:string, selectedOptions?:Array<CascaderOptionType>) => void;
|
||||
onChange?: (value: string, selectedOptions?: Array<CascaderOptionType>) => void;
|
||||
/** 选择后展示的渲染函数 */
|
||||
displayRender?: (label:Array<string>, selectedOptions?:Array<CascaderOptionType>) => React.ReactNode;
|
||||
displayRender?: (label: Array<string>, selectedOptions?: Array<CascaderOptionType>) => React.ReactNode;
|
||||
/** 自定义样式 */
|
||||
style?: React.CSSProperties;
|
||||
/** 自定义类名 */
|
||||
|
@ -1,7 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import Checkbox from './index';
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import assign from 'object-assign';
|
||||
|
||||
export interface CheckboxOptionType {
|
||||
label: string;
|
||||
|
@ -26,7 +26,9 @@ export default class Checkbox extends React.Component<CheckboxProps, any> {
|
||||
return PureRenderMixin.shouldComponentUpdate.apply(this, args);
|
||||
}
|
||||
render() {
|
||||
const [{ prefixCls, style, children, className }, restProps] = splitObject(this.props, ['prefixCls', 'style', 'children', 'className']);
|
||||
const [{ prefixCls, style, children, className }, restProps] = splitObject(
|
||||
this.props, ['prefixCls', 'style', 'children', 'className']
|
||||
);
|
||||
const classString = classNames({
|
||||
[className]: !!className,
|
||||
[`${prefixCls}-wrapper`]: true,
|
||||
|
@ -6,9 +6,9 @@ export interface CollapseProps {
|
||||
/** 初始化选中面板的key */
|
||||
defaultActiveKey?: Array<string>;
|
||||
/** accordion 为 true 的时候,一次只可以打开一个面板 */
|
||||
accordion?:boolean;
|
||||
accordion?: boolean;
|
||||
/** 切换面板的回调 */
|
||||
onChange?: (key:string) => void;
|
||||
onChange?: (key: string) => void;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ export default class FormItem extends React.Component {
|
||||
className: React.PropTypes.string,
|
||||
id: React.PropTypes.string,
|
||||
children: React.PropTypes.node,
|
||||
colon: React.PropTypes.bool
|
||||
colon: React.PropTypes.bool,
|
||||
};
|
||||
|
||||
static contextTypes = {
|
||||
|
@ -32,4 +32,3 @@ export { Timeline }
|
||||
|
||||
import Tooltip from './tooltip';
|
||||
export { Tooltip }
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import { Component, PropTypes } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import calculateNodeHeight from './calculateNodeHeight';
|
||||
import assign from 'object-assign';
|
||||
|
@ -33,7 +33,7 @@ export default class Line extends React.Component {
|
||||
render() {
|
||||
const [{
|
||||
prefixCls, status, format, percent, trailColor,
|
||||
type, strokeWidth, width, className, showInfo
|
||||
type, strokeWidth, width, className, showInfo,
|
||||
}, restProps] = splitObject(this.props,
|
||||
['prefixCls', 'status', 'format', 'percent', 'trailColor', 'type', 'strokeWidth', 'width',
|
||||
'className', 'showInfo']);
|
||||
|
@ -12,6 +12,11 @@ export default class Spin extends React.Component {
|
||||
spinning: true,
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
className: React.PropTypes.string,
|
||||
size: React.PropTypes.oneOf(['small', 'default', 'large']),
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const spinning = this.getSpinning(props);
|
||||
@ -20,11 +25,6 @@ export default class Spin extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
className: React.PropTypes.string,
|
||||
size: React.PropTypes.oneOf(['small', 'default', 'large']),
|
||||
};
|
||||
|
||||
isNestedPattern() {
|
||||
return !!(this.props && this.props.children);
|
||||
}
|
||||
@ -66,7 +66,7 @@ export default class Spin extends React.Component {
|
||||
|
||||
render() {
|
||||
const [{
|
||||
className, size, prefixCls, tip
|
||||
className, size, prefixCls, tip,
|
||||
}, restProps] = splitObject(this.props,
|
||||
['className', 'size', 'prefixCls', 'tip']);
|
||||
const { spinning } = this.state;
|
||||
|
@ -729,7 +729,7 @@ export default class Table extends React.Component {
|
||||
|
||||
render() {
|
||||
const [{
|
||||
style, className
|
||||
style, className,
|
||||
}, restProps] = splitObject(this.props, ['style', 'className']);
|
||||
const data = this.getCurrentPageData();
|
||||
let columns = this.renderRowSelection();
|
||||
|
@ -1,11 +1,7 @@
|
||||
import RcTabs from 'rc-tabs';
|
||||
// import React, { cloneElement } from 'react';
|
||||
import * as React from 'react';
|
||||
|
||||
const {cloneElement} = React;
|
||||
|
||||
const { cloneElement } = React;
|
||||
import classNames from 'classnames';
|
||||
|
||||
import Icon from '../icon';
|
||||
|
||||
type TabsType = 'line' | 'card' | 'editable-card'
|
||||
@ -36,12 +32,10 @@ export interface TabsProps {
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
|
||||
// Tabs
|
||||
export interface TabPaneProps {
|
||||
/** 选项卡头显示文字*/
|
||||
/** 选项卡头显示文字 */
|
||||
tab: React.ReactNode | string;
|
||||
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ export default class Tag extends React.Component<TagProps, any> {
|
||||
|
||||
render() {
|
||||
const [{
|
||||
prefixCls, closable, color, className, children
|
||||
prefixCls, closable, color, className, children,
|
||||
}, otherProps] = splitObject(
|
||||
this.props,
|
||||
['prefixCls', 'closable', 'color', 'className', 'children']
|
||||
|
@ -8,4 +8,3 @@ const locale = assign({}, {
|
||||
}, TimepickerLocale);
|
||||
|
||||
export default locale;
|
||||
|
||||
|
@ -8,6 +8,7 @@ export interface TimelineProps {
|
||||
pending?: boolean | React.ReactNode;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export default class Timeline extends React.Component<TimelineProps, any> {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-timeline',
|
||||
@ -15,7 +16,7 @@ export default class Timeline extends React.Component<TimelineProps, any> {
|
||||
|
||||
render() {
|
||||
const [{
|
||||
prefixCls, children, pending, className
|
||||
prefixCls, children, pending, className,
|
||||
}, restProps] = splitObject(this.props,
|
||||
['prefixCls', 'children', 'pending', 'className']);
|
||||
const pendingNode = typeof pending === 'boolean' ? null : pending;
|
||||
|
@ -20,7 +20,7 @@ export default class TimelineItem extends React.Component<TimeLineItemProps, any
|
||||
|
||||
render() {
|
||||
const [{
|
||||
prefixCls, color, last, children, pending, className, dot
|
||||
prefixCls, color, last, children, pending, className, dot,
|
||||
}, restProps] = splitObject(this.props,
|
||||
['prefixCls', 'color', 'last', 'children', 'pending', 'className', 'dot']);
|
||||
|
||||
|
@ -7,11 +7,17 @@ const placements = getPlacements({
|
||||
verticalArrowShift: 8,
|
||||
});
|
||||
|
||||
type PopoverPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom'
|
||||
type PopoverPlacement =
|
||||
'top' | 'left' | 'right' | 'bottom' | 'topLeft' |
|
||||
'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' |
|
||||
'leftBottom' | 'rightTop' | 'rightBottom'
|
||||
|
||||
// Tooltip
|
||||
export interface TooltipProps {
|
||||
/** 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom`*/
|
||||
/**
|
||||
气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft`
|
||||
`bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom`
|
||||
*/
|
||||
placement?: PopoverPlacement;
|
||||
/** 提示文字 */
|
||||
title?: string | React.ReactNode;
|
||||
|
@ -19,11 +19,11 @@ export interface TransferProps {
|
||||
/** 数据源 */
|
||||
dataSource: Array<TransferItem>;
|
||||
/** 每行数据渲染函数 */
|
||||
render?: (record:TransferItem) => any;
|
||||
render?: (record: TransferItem) => any;
|
||||
/** 显示在右侧框数据的key集合 */
|
||||
targetKeys: Array<string>;
|
||||
/** 变化时回调函数 */
|
||||
onChange?: (targetKeys:Array<TransferItem>, direction:string, moveKeys:any) => void;
|
||||
onChange?: (targetKeys: Array<TransferItem>, direction: string, moveKeys: any) => void;
|
||||
/** 两个穿梭框的自定义样式 */
|
||||
listStyle?: React.CSSProperties;
|
||||
/** 自定义类*/
|
||||
@ -39,7 +39,7 @@ export interface TransferProps {
|
||||
/** 当列表为空时显示的内容 */
|
||||
notFoundContent?: React.ReactNode | string;
|
||||
/** 底部渲染函数 */
|
||||
footer?: (props:any) => any;
|
||||
footer?: (props: any) => any;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
|
@ -29,9 +29,9 @@ export interface TreeNodeMouseEvent {
|
||||
|
||||
export interface TreeProps {
|
||||
showLine?: boolean;
|
||||
className?:string;
|
||||
className?: string;
|
||||
/** 是否支持多选 */
|
||||
multiple?:boolean;
|
||||
multiple?: boolean;
|
||||
/**是否自动展开父节点 */
|
||||
autoExpandParent?: boolean;
|
||||
/**checkable状态下节点选择完全受控(父子节点选中状态不再关联)*/
|
||||
@ -53,7 +53,7 @@ export interface TreeProps {
|
||||
/** 默认选中的树节点 */
|
||||
defaultSelectedKeys?: Array<string>;
|
||||
/** 展开/收起节点时触发 */
|
||||
onExpand?: (expandedKeys: Array<string>, {node: TreeNode, expanded: boolean}) => void | PromiseLike<any>;
|
||||
onExpand?: (expandedKeys: Array<string>, info: { node: TreeNode, expanded: boolean }) => void | PromiseLike<any>;
|
||||
/** 点击复选框触发 */
|
||||
onCheck?: (checkedKeys: Array<string>, e: TreeNodeEvent) => void;
|
||||
/** 点击树节点触发 */
|
||||
@ -67,15 +67,15 @@ export interface TreeProps {
|
||||
/** 设置节点可拖拽(IE>8)*/
|
||||
draggable?: boolean;
|
||||
/** 开始拖拽时调用 */
|
||||
onDragStart?: (options:TreeNodeMouseEvent) => void;
|
||||
onDragStart?: (options: TreeNodeMouseEvent) => void;
|
||||
/** dragenter 触发时调用 */
|
||||
onDragEnter?: (options:TreeNodeMouseEvent) => void;
|
||||
onDragEnter?: (options: TreeNodeMouseEvent) => void;
|
||||
/** dragover 触发时调用 */
|
||||
onDragOver?: (options:TreeNodeMouseEvent) => void;
|
||||
onDragOver?: (options: TreeNodeMouseEvent) => void;
|
||||
/** dragleave 触发时调用 */
|
||||
onDragLeave?: (options:TreeNodeMouseEvent) => void;
|
||||
onDragLeave?: (options: TreeNodeMouseEvent) => void;
|
||||
/** drop 触发时调用 */
|
||||
onDrop?: (options:TreeNodeMouseEvent) => void;
|
||||
onDrop?: (options: TreeNodeMouseEvent) => void;
|
||||
style?: React.CSSProperties;
|
||||
prefixCls?: string;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user