@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
47 lines (46 loc) • 1.82 kB
TypeScript
import React from 'react';
import type { CollapsibleAdapter, CollapsibleFoundationProps, CollapsibleFoundationState } from '@douyinfe/semi-foundation/lib/cjs/collapsible/foundation';
import CollapsibleFoundation from '@douyinfe/semi-foundation/lib/cjs/collapsible/foundation';
import BaseComponent from "../_base/baseComponent";
import '@douyinfe/semi-foundation/lib/cjs/collapsible/collapsible.css';
export interface CollapsibleProps extends CollapsibleFoundationProps {
motion?: boolean;
children?: React.ReactNode;
isOpen?: boolean;
duration?: number;
keepDOM?: boolean;
lazyRender?: boolean;
className?: string;
style?: React.CSSProperties;
collapseHeight?: number;
reCalcKey?: number | string;
id?: string;
onMotionEnd?: () => void;
}
interface CollapsibleState extends CollapsibleFoundationState {
domInRenderTree: boolean;
domHeight: number;
visible: boolean;
isTransitioning: boolean;
}
declare class Collapsible extends BaseComponent<CollapsibleProps, CollapsibleState> {
static __SemiComponentName__: string;
static defaultProps: any;
foundation: CollapsibleFoundation;
private domRef;
private resizeObserver;
private hasBeenRendered;
constructor(props: CollapsibleProps);
get adapter(): CollapsibleAdapter<CollapsibleProps, CollapsibleState>;
static getEntryInfo: (entry: ResizeObserverEntry) => {
isShown: boolean;
height: number;
};
componentDidMount(): void;
componentDidUpdate(prevProps: Readonly<CollapsibleProps>, prevState: Readonly<CollapsibleState>, snapshot?: any): void;
componentWillUnmount(): void;
handleResize: (entryList: ResizeObserverEntry[]) => void;
isChildrenInRenderTree: () => boolean;
render(): React.JSX.Element;
}
export default Collapsible;