Improve Grid and Layout type definition

This commit is contained in:
Wei Zhu 2018-03-06 15:51:06 +08:00
parent 26934b37c8
commit 518c424ca4
4 changed files with 4 additions and 12 deletions

View File

@ -13,8 +13,7 @@ export interface ColSize {
pull?: number;
}
export interface ColProps {
className?: string;
export interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
span?: number;
order?: number;
offset?: number;
@ -27,7 +26,6 @@ export interface ColProps {
xl?: number | ColSize;
xxl?: number | ColSize;
prefixCls?: string;
style?: React.CSSProperties;
}
export default class Col extends React.Component<ColProps, {}> {

View File

@ -31,13 +31,11 @@ export type BreakpointMap = {
xxl?: string
};
export interface RowProps {
className?: string;
export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
gutter?: number | BreakpointMap;
type?: 'flex';
align?: 'top' | 'middle' | 'bottom';
justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between';
style?: React.CSSProperties;
prefixCls?: string;
}

View File

@ -31,10 +31,8 @@ const dimensionMap = {
export type CollapseType = 'clickTrigger' | 'responsive';
export interface SiderProps {
style?: React.CSSProperties;
export interface SiderProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;
className?: string;
collapsible?: boolean;
collapsed?: boolean;
defaultCollapsed?: boolean;

View File

@ -3,10 +3,8 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import { SiderProps } from './Sider';
export interface BasicProps {
style?: React.CSSProperties;
export interface BasicProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;
className?: string;
hasSider?: boolean;
}