1 | import React from 'react';
|
2 | import PropTypes from 'prop-types';
|
3 | import { SelectCallback, TransitionType } from './helpers';
|
4 | export interface TabContainerProps extends React.PropsWithChildren<unknown> {
|
5 | id?: string;
|
6 | transition?: TransitionType;
|
7 | mountOnEnter?: boolean;
|
8 | unmountOnExit?: boolean;
|
9 | generateChildId?: (eventKey: unknown, type: 'tab' | 'pane') => string;
|
10 | onSelect?: SelectCallback;
|
11 | activeKey?: unknown;
|
12 | defaultActiveKey?: unknown;
|
13 | }
|
14 | declare const TabContainer: {
|
15 | (props: TabContainerProps): JSX.Element;
|
16 | propTypes: {
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | id: PropTypes.Validator<string>;
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | transition: PropTypes.Requireable<string | boolean | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>;
|
33 | /**
|
34 | * Wait until the first "enter" transition to mount tabs (add them to the DOM)
|
35 | */
|
36 | mountOnEnter: PropTypes.Requireable<boolean>;
|
37 | /**
|
38 | * Unmount tabs (remove it from the DOM) when they are no longer visible
|
39 | */
|
40 | unmountOnExit: PropTypes.Requireable<boolean>;
|
41 | /**
|
42 | * A function that takes an `eventKey` and `type` and returns a unique id for
|
43 | * child tab `<NavItem>`s and `<TabPane>`s. The function _must_ be a pure
|
44 | * function, meaning it should always return the _same_ id for the same set
|
45 | * of inputs. The default value requires that an `id` to be set for the
|
46 | * `<TabContainer>`.
|
47 | *
|
48 | * The `type` argument will either be `"tab"` or `"pane"`.
|
49 | *
|
50 | * @defaultValue (eventKey, type) => `${props.id}-${type}-${eventKey}`
|
51 | */
|
52 | generateChildId: PropTypes.Requireable<(...args: any[]) => any>;
|
53 | |
54 |
|
55 |
|
56 |
|
57 |
|
58 | onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
59 | |
60 |
|
61 |
|
62 |
|
63 |
|
64 | activeKey: PropTypes.Requireable<any>;
|
65 | };
|
66 | };
|
67 | export default TabContainer;
|