UNPKG

2.27 kBTypeScriptView Raw
1import { IBaseCardProps, IBaseCardStyles, IBaseCardStyleProps } from './BaseCard.types';
2import { IRenderFunction } from '../../Utilities';
3import { IStyle } from '../../Styling';
4/**
5 * {@docCategory HoverCard}
6 */
7export interface IExpandingCard {
8}
9/**
10 * ExpandingCard component props.
11 * {@docCategory HoverCard}
12 */
13export interface IExpandingCardProps extends IBaseCardProps<IExpandingCard, IExpandingCardStyles, IExpandingCardStyleProps> {
14 /**
15 * Height of compact card
16 * @defaultvalue 156
17 */
18 compactCardHeight?: number;
19 /**
20 * Height of expanded card
21 * @defaultvalue 384
22 */
23 expandedCardHeight?: number;
24 /**
25 * Use to open the card in expanded format and not wait for the delay
26 * @defaultvalue ExpandingCardMode.compact
27 */
28 mode?: ExpandingCardMode;
29 /**
30 * Render function to populate compact content area
31 */
32 onRenderCompactCard?: IRenderFunction<any>;
33 /**
34 * Render function to populate expanded content area
35 */
36 onRenderExpandedCard?: IRenderFunction<any>;
37}
38/**
39 * {@docCategory HoverCard}
40 */
41export declare enum ExpandingCardMode {
42 /**
43 * To have top compact card only
44 */
45 compact = 0,
46 /**
47 * To have both top compact and bottom expanded card
48 */
49 expanded = 1
50}
51/**
52 * {@docCategory HoverCard}
53 */
54export interface IExpandingCardStyleProps extends IBaseCardStyleProps {
55 /**
56 * Height of the compact section of the card.
57 */
58 compactCardHeight?: number;
59 /**
60 * Boolean flag that expanded card is in Expanded.mode === expanded && first frame was rendered.
61 */
62 expandedCardFirstFrameRendered?: boolean;
63 /**
64 * Height of the expanded section of the card.
65 */
66 expandedCardHeight?: number;
67 /**
68 * Whether the content of the expanded card overflows vertically.
69 */
70 needsScroll?: boolean;
71}
72/**
73 * {@docCategory HoverCard}
74 */
75export interface IExpandingCardStyles extends IBaseCardStyles {
76 /**
77 * Style for the main card element.
78 */
79 compactCard?: IStyle;
80 /**
81 * Base Style for the expanded card content.
82 */
83 expandedCard?: IStyle;
84 /**
85 * Style for the expanded card scroll content.
86 */
87 expandedCardScroll?: IStyle;
88}