@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.
61 lines (60 loc) • 2.47 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import '@douyinfe/semi-foundation/lib/es/descriptions/descriptions.css';
import { DescriptionsAlign, DescriptionLayout } from './descriptions-context';
import Item from './item';
import DescriptionsFoundation, { DescriptionsAdapter } from '@douyinfe/semi-foundation/lib/es/descriptions/foundation';
import BaseComponent from '../_base/baseComponent';
export type { DescriptionsItemProps } from './item';
export type DescriptionsSize = 'small' | 'medium' | 'large';
export interface Data {
key?: React.ReactNode;
value?: (() => React.ReactNode) | React.ReactNode;
hidden?: boolean;
span?: number;
}
export interface DescriptionsProps {
align?: DescriptionsAlign;
row?: boolean;
size?: DescriptionsSize;
style?: React.CSSProperties;
className?: string;
children?: React.ReactNode;
data?: Data[];
layout?: DescriptionLayout;
column?: number;
}
declare class Descriptions extends BaseComponent<DescriptionsProps> {
static Item: typeof Item;
static contextType: React.Context<import("./descriptions-context").DescriptionsContextValue>;
static propTypes: {
align: PropTypes.Requireable<string>;
row: PropTypes.Requireable<boolean>;
size: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
className: PropTypes.Requireable<string>;
data: PropTypes.Requireable<PropTypes.InferProps<{
key: PropTypes.Requireable<PropTypes.ReactNodeLike>;
value: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
hidden: PropTypes.Requireable<boolean>;
className: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
}>[]>;
layout: PropTypes.Requireable<string>;
column: PropTypes.Requireable<number>;
};
static defaultProps: {
align: string;
row: boolean;
size: string;
data: Data[];
layout: string;
column: number;
};
foundation: DescriptionsFoundation;
constructor(props: DescriptionsProps);
get adapter(): DescriptionsAdapter<DescriptionsProps>;
renderChildrenList: () => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.JSX.Element[];
render(): React.JSX.Element;
}
export default Descriptions;