From ac5abd39edb542befef9876c5e708bb3cf23a9fd Mon Sep 17 00:00:00 2001 From: Alexey Morozov Date: Fri, 17 Jun 2016 17:37:13 +0300 Subject: [PATCH] Added Custom Tab Layout types to react-bootstrap.d.ts --- react-bootstrap/react-bootstrap-tests.tsx | 27 +++++++++++++++++ react-bootstrap/react-bootstrap.d.ts | 35 +++++++++++++++++++++-- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index 36d5c1ab23..3c181e2a9e 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -502,6 +502,33 @@ export class ReactBootstrapTest extends Component { +
+ + + + + + + + + Tab 1 content + + + Tab 2 content + + + + + +
+
Previous diff --git a/react-bootstrap/react-bootstrap.d.ts b/react-bootstrap/react-bootstrap.d.ts index 366eeef7b5..6b962ae8fa 100644 --- a/react-bootstrap/react-bootstrap.d.ts +++ b/react-bootstrap/react-bootstrap.d.ts @@ -435,8 +435,39 @@ declare module "react-bootstrap" { animation?: boolean; eventKey?: any; // TODO: Add more specific type } - type Tab = React.ClassicComponent; - var Tab: React.ClassicComponentClass; + interface TabClass extends React.ClassicComponentClass { + Container: TabContainer; + Pane: TabPane; + Content: TabClass; + } + type Tab = TabClass; + var Tab: TabClass; + + // + // ---------------------------------------- + interface TabContainerProps extends React.HTMLAttributes { + activeKey?: any; + defaultActiveKey?: any; + generateChildId?: (eventKey: any, type: any) => string; + } + type TabContainer = React.ClassicComponentClass; + + // + // ---------------------------------------- + interface TabPaneProps extends React.HTMLAttributes { + animation?: boolean | React.ComponentClass; + 'aria-labelledby'?: string; + bsClass?: string; + eventKey?: any; + onEnter?: Function; + onEntered?: Function; + onEntering?: Function; + onExit?: Function; + onExited?: Function; + onExiting?: Function; + unmountOnExit?: boolean; + } + type TabPane = React.ClassicComponentClass; // // ----------------------------------------