UNPKG

1.61 kBTypeScriptView Raw
1import * as React from "react";
2import { Boundary } from "../../common/boundary";
3import { Props } from "../../common/props";
4import { MenuItemProps } from "../menu/menuItem";
5import { IPopoverProps } from "../popover/popover";
6export declare type CollapsibleListProps = ICollapsibleListProps;
7/** @deprecated use CollapsibleListProps */
8export interface ICollapsibleListProps extends Props {
9 /**
10 * Element to render as dropdown target with `CLICK` interaction to show collapsed menu.
11 */
12 dropdownTarget: JSX.Element;
13 /**
14 * Props to pass to the dropdown.
15 */
16 dropdownProps?: IPopoverProps;
17 /**
18 * Callback invoked to render each visible item. The item will be wrapped in an `li` with
19 * the optional `visibleItemClassName` prop.
20 */
21 visibleItemRenderer: (props: MenuItemProps, index: number) => JSX.Element;
22 /**
23 * Which direction the items should collapse from: start or end of the children.
24 *
25 * @default Boundary.START
26 */
27 collapseFrom?: Boundary;
28 /**
29 * CSS class names to add to `<li>` tags containing each visible item and the dropdown.
30 */
31 visibleItemClassName?: string;
32 /**
33 * Exact number of visible items.
34 *
35 * @default 3
36 */
37 visibleItemCount?: number;
38}
39/** @deprecated use `<OverflowList>` for automatic overflow based on available space. */
40export declare class CollapsibleList extends React.Component<CollapsibleListProps> {
41 static displayName: string;
42 static defaultProps: Partial<CollapsibleListProps>;
43 render(): JSX.Element;
44 private partitionChildren;
45}