rsuite
Version:
A suite of react components
53 lines (52 loc) • 1.54 kB
JavaScript
'use client';
import _extends from "@babel/runtime/helpers/esm/extends";
import React from 'react';
import TableCell from "./TableCell.js";
import TableHeaderCell from "./TableHeaderCell.js";
import TableColumn from "./TableColumn.js";
import TableColumnGroup from "./TableColumnGroup.js";
import { useCustom } from "../internals/hooks/index.js";
import { Table as RsTable } from 'rsuite-table';
const CustomTable = /*#__PURE__*/React.forwardRef(function Table(props, ref) {
const {
propsWithDefaults,
rtl,
getLocale
} = useCustom('Table', props);
const {
locale: overrideLocale,
loadAnimation = true,
...rest
} = propsWithDefaults;
const locale = getLocale('common', overrideLocale);
return /*#__PURE__*/React.createElement(RsTable, _extends({}, rest, {
rtl: rtl,
ref: ref,
locale: locale,
loadAnimation: loadAnimation
}));
});
/**
* The `Table` component is used to display data in a table.
*
* @see https://rsuitejs.com/components/table/
*/
const Table = Object.assign(CustomTable, {
/**
* The `Table.Cell` component is used to display data in a table cell.
*/
Cell: TableCell,
/**
* The `Table.Column` component is used to define a column in a table.
*/
Column: TableColumn,
/**
* The `Table.HeaderCell` component is used to define a header cell in a table.
*/
HeaderCell: TableHeaderCell,
/**
* The `Table.ColumnGroup` component is used to define a column group in a table.
*/
ColumnGroup: TableColumnGroup
});
export default Table;