Table.js 1.1 KB

1234567891011121314151617181920212223242526272829
  1. "use client";
  2. import * as React from 'react';
  3. import { EXPAND_COLUMN, Summary } from 'rc-table';
  4. import Column from './Column';
  5. import ColumnGroup from './ColumnGroup';
  6. import { SELECTION_ALL, SELECTION_COLUMN, SELECTION_INVERT, SELECTION_NONE } from './hooks/useSelection';
  7. import InternalTable from './InternalTable';
  8. const Table = (props, ref) => {
  9. const renderTimesRef = React.useRef(0);
  10. renderTimesRef.current += 1;
  11. return /*#__PURE__*/React.createElement(InternalTable, Object.assign({}, props, {
  12. ref: ref,
  13. _renderTimes: renderTimesRef.current
  14. }));
  15. };
  16. const ForwardTable = /*#__PURE__*/React.forwardRef(Table);
  17. ForwardTable.SELECTION_COLUMN = SELECTION_COLUMN;
  18. ForwardTable.EXPAND_COLUMN = EXPAND_COLUMN;
  19. ForwardTable.SELECTION_ALL = SELECTION_ALL;
  20. ForwardTable.SELECTION_INVERT = SELECTION_INVERT;
  21. ForwardTable.SELECTION_NONE = SELECTION_NONE;
  22. ForwardTable.Column = Column;
  23. ForwardTable.ColumnGroup = ColumnGroup;
  24. ForwardTable.Summary = Summary;
  25. if (process.env.NODE_ENV !== 'production') {
  26. ForwardTable.displayName = 'Table';
  27. }
  28. export default ForwardTable;