From 14e2a56b757f11b84ab947c58fb86d6ebb2c8f4a Mon Sep 17 00:00:00 2001 From: ChaXinyu Date: Mon, 25 Sep 2017 09:14:49 -0500 Subject: [PATCH] export components interface (#7654) * export components interface * export specific props * fix formItem missed import --- components/anchor/index.tsx | 3 +++ components/badge/index.tsx | 2 ++ components/breadcrumb/index.tsx | 3 +++ components/button/button-group.tsx | 3 +-- components/button/index.tsx | 3 +++ components/calendar/index.tsx | 2 ++ components/card/index.tsx | 3 +++ components/checkbox/index.tsx | 3 +++ components/col/index.tsx | 5 ++++- components/collapse/index.tsx | 2 ++ components/dropdown/index.tsx | 3 +++ components/form/FormItem.tsx | 1 + components/form/index.tsx | 3 +++ components/grid/index.tsx | 3 +++ components/input/index.tsx | 5 +++++ components/layout/index.tsx | 3 +++ components/list/index.tsx | 2 ++ components/modal/index.tsx | 3 ++- components/progress/index.tsx | 2 ++ components/radio/index.tsx | 4 ++++ components/row/index.tsx | 4 +++- components/table/index.tsx | 8 ++++++++ components/tag/index.tsx | 2 ++ components/timeline/index.tsx | 3 +++ components/tooltip/index.tsx | 4 +++- components/transfer/index.tsx | 4 ++++ components/tree-select/index.tsx | 2 +- components/upload/index.tsx | 3 +++ 28 files changed, 81 insertions(+), 7 deletions(-) diff --git a/components/anchor/index.tsx b/components/anchor/index.tsx index 8a3c466bc4..7a0e2f8649 100644 --- a/components/anchor/index.tsx +++ b/components/anchor/index.tsx @@ -1,5 +1,8 @@ import Anchor from './Anchor'; import AnchorLink from './AnchorLink'; +export { AnchorProps } from './Anchor'; +export { AnchorLinkProps } from './AnchorLink'; + Anchor.Link = AnchorLink; export default Anchor; diff --git a/components/badge/index.tsx b/components/badge/index.tsx index 1b7850ad43..bdc43a58ce 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -5,6 +5,8 @@ import ScrollNumber from './ScrollNumber'; import classNames from 'classnames'; import warning from '../_util/warning'; +export { ScrollNumberProps } from './ScrollNumber'; + export interface BadgeProps { /** Number to show in badge */ count?: number | string; diff --git a/components/breadcrumb/index.tsx b/components/breadcrumb/index.tsx index b77d03b267..5483e2e7b2 100644 --- a/components/breadcrumb/index.tsx +++ b/components/breadcrumb/index.tsx @@ -1,5 +1,8 @@ import Breadcrumb from './Breadcrumb'; import BreadcrumbItem from './BreadcrumbItem'; +export { BreadcrumbProps } from './Breadcrumb'; +export { BreadcrumbItemProps } from './BreadcrumbItem'; + Breadcrumb.Item = BreadcrumbItem; export default Breadcrumb; diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx index e5bf2c2bd6..f2dfb95f29 100644 --- a/components/button/button-group.tsx +++ b/components/button/button-group.tsx @@ -1,7 +1,6 @@ import React from 'react'; import classNames from 'classnames'; - -export type ButtonSize = 'small' | 'large'; +import { ButtonSize } from './button'; export interface ButtonGroupProps { size?: ButtonSize; diff --git a/components/button/index.tsx b/components/button/index.tsx index 46f49a643f..f5e9fed97f 100644 --- a/components/button/index.tsx +++ b/components/button/index.tsx @@ -1,5 +1,8 @@ import Button from './button'; import ButtonGroup from './button-group'; +export { ButtonProps, ButtonShape, ButtonSize, ButtonType } from './button'; +export { ButtonGroupProps } from './button-group'; + Button.Group = ButtonGroup; export default Button; diff --git a/components/calendar/index.tsx b/components/calendar/index.tsx index 9dda5ee953..698b4407aa 100644 --- a/components/calendar/index.tsx +++ b/components/calendar/index.tsx @@ -7,6 +7,8 @@ import Header from './Header'; import { getComponentLocale, getLocaleCode } from '../_util/getLocale'; declare const require: Function; +export { HeaderProps } from './Header'; + function noop() { return null; } function zerofixed(v) { diff --git a/components/card/index.tsx b/components/card/index.tsx index e6b82d38f2..630e1cb81e 100644 --- a/components/card/index.tsx +++ b/components/card/index.tsx @@ -7,6 +7,9 @@ import Meta from './Meta'; import Tabs from '../tabs'; import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame'; +export { CardGridProps } from './Grid'; +export { CardMetaProps } from './Meta'; + export type CardType = 'inner'; export interface CardTabListType { diff --git a/components/checkbox/index.tsx b/components/checkbox/index.tsx index 72c1c6d9a7..b5cb27c417 100644 --- a/components/checkbox/index.tsx +++ b/components/checkbox/index.tsx @@ -1,5 +1,8 @@ import Checkbox from './Checkbox'; import Group from './Group'; +export { CheckboxProps } from './Checkbox'; +export { CheckboxGroupProps, CheckboxOptionType } from './Group'; + Checkbox.Group = Group; export default Checkbox; diff --git a/components/col/index.tsx b/components/col/index.tsx index 4bf59d7c27..9b8a6fb70b 100644 --- a/components/col/index.tsx +++ b/components/col/index.tsx @@ -1,2 +1,5 @@ -import { Col } from '../grid'; +import { Col, ColProps, ColSize } from '../grid'; + +export { ColProps, ColSize }; + export default Col; diff --git a/components/collapse/index.tsx b/components/collapse/index.tsx index 2b5b0a3b04..32c2ffb00f 100644 --- a/components/collapse/index.tsx +++ b/components/collapse/index.tsx @@ -1,3 +1,5 @@ import Collapse from './Collapse'; +export { CollapsePanelProps, CollapseProps } from './Collapse'; + export default Collapse; diff --git a/components/dropdown/index.tsx b/components/dropdown/index.tsx index 052468b73e..d5088525d4 100644 --- a/components/dropdown/index.tsx +++ b/components/dropdown/index.tsx @@ -1,5 +1,8 @@ import Dropdown from './dropdown'; import DropdownButton from './dropdown-button'; +export { DropDownProps } from './dropdown'; +export { DropdownButtonProps } from './dropdown-button'; + Dropdown.Button = DropdownButton; export default Dropdown; diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 457d149d98..4cd06b1d86 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -4,6 +4,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import Animate from 'rc-animate'; import PureRenderMixin from 'rc-util/lib/PureRenderMixin'; +import Animate from 'rc-animate'; import Row from '../grid/row'; import Col, { ColProps } from '../grid/col'; import { WrappedFormUtils } from './Form'; diff --git a/components/form/index.tsx b/components/form/index.tsx index d0b8553235..26b4068453 100644 --- a/components/form/index.tsx +++ b/components/form/index.tsx @@ -1,3 +1,6 @@ import Form from './Form'; +export { FormProps, FormComponentProps, FormCreateOption, ValidateCallback, ValidationRule } from './Form'; +export { FormItemProps } from './FormItem'; + export default Form; diff --git a/components/grid/index.tsx b/components/grid/index.tsx index ebb32efd19..f252700afe 100644 --- a/components/grid/index.tsx +++ b/components/grid/index.tsx @@ -1,6 +1,9 @@ import Row from './row'; import Col from './col'; +export { RowProps } from './row'; +export { ColProps, ColSize } from './col'; + export { Row, Col, diff --git a/components/input/index.tsx b/components/input/index.tsx index ba2807878d..83600501c8 100644 --- a/components/input/index.tsx +++ b/components/input/index.tsx @@ -3,6 +3,11 @@ import Group from './Group'; import Search from './Search'; import TextArea from './TextArea'; +export { InputProps } from './Input'; +export { GroupProps } from './Group'; +export { SearchProps } from './Search'; +export { TextAreaProps } from './TextArea'; + Input.Group = Group; Input.Search = Search; Input.TextArea = TextArea; diff --git a/components/layout/index.tsx b/components/layout/index.tsx index ce13eeab57..3ffc2c5c58 100644 --- a/components/layout/index.tsx +++ b/components/layout/index.tsx @@ -1,5 +1,8 @@ import Layout from './layout'; import Sider from './Sider'; +export { BasicProps as LayoutProps } from './layout'; +export { SiderProps } from './Sider'; + Layout.Sider = Sider; export default Layout; diff --git a/components/list/index.tsx b/components/list/index.tsx index df094192f2..459a4a77b0 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -8,6 +8,8 @@ import { Row } from '../grid'; import Item from './Item'; +export { ListItemProps, ListItemMetaProps } from './Item'; + export interface ListGridType { gutter?: number; column?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24; diff --git a/components/modal/index.tsx b/components/modal/index.tsx index 1feaee3da1..418e661dba 100644 --- a/components/modal/index.tsx +++ b/components/modal/index.tsx @@ -1,7 +1,8 @@ import Modal, { ModalFuncProps } from './Modal'; import confirm from './confirm'; -export { ModalFuncProps }; +export { ActionButtonProps } from './ActionButton'; +export { ModalProps, ModalFuncProps } from './Modal'; Modal.info = function (props: ModalFuncProps) { const config = { diff --git a/components/progress/index.tsx b/components/progress/index.tsx index 1e77982d82..9dda9181e7 100644 --- a/components/progress/index.tsx +++ b/components/progress/index.tsx @@ -1,3 +1,5 @@ import Progress from './progress'; +export { ProgressProps } from './progress'; + export default Progress; diff --git a/components/radio/index.tsx b/components/radio/index.tsx index 355a3a2913..753a90c2f5 100644 --- a/components/radio/index.tsx +++ b/components/radio/index.tsx @@ -2,6 +2,10 @@ import Radio from './radio'; import Group from './group'; import Button from './radioButton'; +export { RadioProps } from './radio'; +export { RadioGroupProps } from './group'; +export { RadioButtonProps } from './radioButton'; + Radio.Button = Button; Radio.Group = Group; export { Button, Group }; diff --git a/components/row/index.tsx b/components/row/index.tsx index 3bba089796..fd66497f40 100644 --- a/components/row/index.tsx +++ b/components/row/index.tsx @@ -1,2 +1,4 @@ -import { Row } from '../grid'; +import { Row, RowProps } from '../grid'; + +export { RowProps }; export default Row; diff --git a/components/table/index.tsx b/components/table/index.tsx index de4c7d5e8f..cdd8610e4e 100644 --- a/components/table/index.tsx +++ b/components/table/index.tsx @@ -1,3 +1,11 @@ import Table from './Table'; +export { ColumnProps } from './Column'; +export { ColumnGroupProps } from './ColumnGroup'; +export { FilterMenuProps } from './filterDropdown'; +export { FilterDropdownMenuWrapperProps } from './FilterDropdownMenuWrapper'; +export { SelectionBoxProps } from './SelectionBox'; +export { SelectionCheckboxAllProps } from './SelectionCheckboxAll'; +export { TableProps, TableRowSelection, TableColumnConfig } from './Table'; + export default Table; diff --git a/components/tag/index.tsx b/components/tag/index.tsx index 42ce55a943..7de676a0e2 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -6,6 +6,8 @@ import omit from 'omit.js'; import Icon from '../icon'; import CheckableTag from './CheckableTag'; +export { CheckableTagProps } from './CheckableTag'; + export interface TagProps { prefixCls?: string; className?: string; diff --git a/components/timeline/index.tsx b/components/timeline/index.tsx index 33eb2dd868..4d0df1b8b0 100644 --- a/components/timeline/index.tsx +++ b/components/timeline/index.tsx @@ -1,3 +1,6 @@ import Timeline from './Timeline'; +export { TimelineProps } from './Timeline'; +export { TimeLineItemProps } from './TimelineItem'; + export default Timeline; diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index 40d4721cb9..95dbaa41e4 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -2,7 +2,9 @@ import React from 'react'; import { cloneElement } from 'react'; import RcTooltip from 'rc-tooltip'; import classNames from 'classnames'; -import getPlacements, { AdjustOverflow } from './placements'; +import getPlacements, { AdjustOverflow, PlacementsConfig } from './placements'; + +export { AdjustOverflow, PlacementsConfig }; export type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx index 9408c5e837..beb1006db5 100644 --- a/components/transfer/index.tsx +++ b/components/transfer/index.tsx @@ -6,6 +6,10 @@ import Operation from './operation'; import Search from './search'; import injectLocale from '../locale-provider/injectLocale'; +export { TransferListProps } from './list'; +export { TransferOperationProps } from './operation'; +export { SearchProps } from './search'; + function noop() { } diff --git a/components/tree-select/index.tsx b/components/tree-select/index.tsx index 6e0810d437..858256c697 100644 --- a/components/tree-select/index.tsx +++ b/components/tree-select/index.tsx @@ -5,7 +5,7 @@ import { TreeSelectProps } from './interface'; import injectLocale from '../locale-provider/injectLocale'; import warning from '../_util/warning'; -export { TreeSelectProps }; +export { TreeData, TreeSelectProps } from './interface'; abstract class TreeSelect extends React.Component { static TreeNode = TreeNode; diff --git a/components/upload/index.tsx b/components/upload/index.tsx index a907fe3aaa..0bae9596d2 100644 --- a/components/upload/index.tsx +++ b/components/upload/index.tsx @@ -1,5 +1,8 @@ import Upload from './Upload'; import Dragger from './Dragger'; +export { UploadProps, UploadListProps, UploadChangeParam } from './interface'; +export { DraggerProps } from './Dragger'; + Upload.Dragger = Dragger; export default Upload;