import React, { ReactNode } from 'react'; export interface GridProps { /** * 自定义类名 * @en Custom classname */ className?: string; /** * 自定义样式 * @en Custom stylesheet */ style?: React.CSSProperties; /** * 传入的数据 * @en grid data * */ data: GridData[]; /** * 一行的列数 * @en number of columns * @default 3 */ columns?: number; /** * 是否有边框 * @en Whether there is a border * @default false */ border?: boolean; /** * 格子间的间距 * @en spacing between grids * @default 0 */ gutter?: number | { x: number; y: number; }; /** * 格子的形状,可选值为 circle * @en The shape of the grid, the optional value are circle and square * @default "square" */ shape?: string; /** * 溢出时是否支持滑动 * @en Whether to support swipe when overflowing * @default false */ isSliding?: boolean; /** * 格子内容排列的方向,可选值为 horizontal * @en The direction in which the grid content is arranged, the optional value are horizontal and vertical * @default "vertical" */ direction?: string; } export interface GridData { /** * 传入图标的资源地址 * @en The resource address of the input icon * */ img: string | ReactNode; /** * 传入的标题文字内容 * @en Title text content * */ title: ReactNode; /** * 传入的描述文字内容 * @en Description text * */ content?: ReactNode; /** * 自定义样式 * @en Custom classname * */ className?: string; /** * 点击后的回调函数 * @en Callback when clicking * */ onClick?: (item: GridData) => void; /** * 每个格子自定义样式 * @en Custom style for each grid * */ itemStyle?: React.CSSProperties; /** * 自定义单个 grid 的创建函数 * @en Customize the creation function of a single grid * */ renderGrid?: (item: GridData, colIndex: number, rowIndex: number) => ReactNode; [x: string]: any; } export interface GridRef { /** * 最外层元素 DOM * @en The outermost element DOM */ dom: HTMLDivElement | null; } /** * 宫格可以在水平方向上把页面分隔成等宽度的区块,用于展示内容或进行页面导航。 * @en The grid can divide the page into equal-width blocks in the horizontal direction for displaying content or for page navigation. * @type 布局 * @type_en Layout * @name 宫格 * @name_en Grid */ declare const Grid: React.ForwardRefExoticComponent>; export default Grid;