UNPKG

@atlaskit/dynamic-table

Version:

A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.

43 lines • 1.44 kB
import _extends from "@babel/runtime/helpers/extends"; import React from 'react'; import { inlineStylesIfRanking } from '../../internal/inline-styles-if-ranking'; import { RankableTableBodyCell } from '../../styled/rankable/table-cell'; // eslint-disable-next-line @repo/internal/react/no-class-components export class RankableTableCell extends React.Component { render() { const { cell, head, isFixedSize, isRanking, refWidth, innerRef, testId } = this.props; // `key` is pulled out so it isn't spread into JSX (React 19 warns about that). The parent // row already applies it to this cell. const { content, testId: cellTestId, key: _cellKey, ...restCellProps } = cell; const { shouldTruncate, width } = head || {}; const inlineStyles = inlineStylesIfRanking(isRanking, refWidth); return /*#__PURE__*/React.createElement(RankableTableBodyCell, _extends({}, restCellProps, { isFixedSize: isFixedSize, shouldTruncate: shouldTruncate, width: width, isRanking: isRanking // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 , style: inlineStyles, onKeyDown: e => e.stopPropagation(), innerRef: innerRef, "data-testid": cellTestId || testId && `${testId}--rankable--table--body--cell` }), content); } }