f0eed0ca3f
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
Deploy / Deploy Staging (push) Failing after 192h26m58s
CI/CD Pipeline / Frontend Lint (push) Failing after 192h27m37s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 192h27m46s
30 lines
849 B
TypeScript
30 lines
849 B
TypeScript
/**
|
|
* V21 Table 表格
|
|
* 封装 Ant Design Table,应用 V21 设计系统样式
|
|
*/
|
|
import React from "react";
|
|
import { Table as AntTable } from "antd";
|
|
import type { TableProps as AntTableProps } from "antd";
|
|
import classNames from "classnames";
|
|
import "./ui.css";
|
|
|
|
export interface TableProps<
|
|
RecordType = unknown,
|
|
> extends AntTableProps<RecordType> {
|
|
/** 使用 V21 样式 */
|
|
v21?: boolean;
|
|
}
|
|
|
|
function Table<RecordType extends object = Record<string, unknown>>({
|
|
className,
|
|
v21 = true,
|
|
...rest
|
|
}: TableProps<RecordType>) {
|
|
const v21Class = classNames(v21 && "xx-table", className);
|
|
return <AntTable<RecordType> className={v21Class} {...rest} />;
|
|
}
|
|
|
|
export default Table as <RecordType extends object = Record<string, unknown>>(
|
|
props: TableProps<RecordType> & React.RefAttributes<HTMLDivElement>,
|
|
) => React.ReactElement;
|