diff --git a/components/index.tsx b/components/index.tsx index 5723cca7f7..2058845ef4 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -28,6 +28,9 @@ export { Carousel }; import Cascader from './cascader'; export { Cascader }; +import Popconfirm from './popconfirm'; +export { Popconfirm }; + import Transfer from './transfer'; export { Transfer }; diff --git a/components/popconfirm/index.tsx b/components/popconfirm/index.tsx index da820bba35..fccf4dc54b 100644 --- a/components/popconfirm/index.tsx +++ b/components/popconfirm/index.tsx @@ -8,7 +8,33 @@ const placements = getPlacements(); const prefixCls = 'ant-popover'; const noop = () => {}; -export default class Popconfirm extends React.Component { +export interface PopconfirmProps { + + /** + * Position of popup-container, options:`top`, `left`, `right`, `bottom` + */ + placement?: 'top' | 'left' | 'right' | 'bottom'; + /** Description of Popconfirm */ + title: React.ReactNode; + /** Callback when confirm */ + onConfirm?: () => void; + /** Callback when cancel */ + onCancel?: () => void; + /** Callback when display/hide */ + onVisibleChange?: (visible: boolean) => void; + /** Confirm button text */ + okText?: React.ReactNode; + /** Cancel button text */ + cancelText?: React.ReactNode; + style?: React.CSSProperties; + transitionName?: string; + trigger?: 'hover' | 'focus' | 'click'; + /** Style of overlay */ + overlayStyle?: React.CSSProperties; + prefixCls?: string; +} + +export default class Popconfirm extends React.Component { static defaultProps = { transitionName: 'zoom-big', placement: 'top', diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index e33e21ddce..164073bf0d 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -20,8 +20,18 @@ export interface TooltipProps { */ placement?: PopoverPlacement; /** 提示文字 */ - title?: string | React.ReactNode; + title: React.ReactNode; style?: React.CSSProperties; + builtinPlacements?: Object; + /** Style of overlay */ + overlayStyle?: React.CSSProperties; + prefixCls?: string; + /** Callback when display/hide */ + onVisibleChange?: (visible: boolean) => void; + transitionName?: string; + visible?: boolean; + trigger?: 'hover' | 'focus' | 'click'; + overlay?: React.ReactNode; } export default class Tooltip extends React.Component {