UNPKG

terra-clinical-data-grid

Version:

An organizational component that renders a collection of data in a grid-like format.

47 lines (46 loc) 2.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.columnDataShape = exports.SortIndicators = void 0; var _propTypes = _interopRequireDefault(require("prop-types")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SortIndicators = exports.SortIndicators = { ASCENDING: 'ascending', DESCENDING: 'descending' }; var columnDataShape = exports.columnDataShape = _propTypes.default.shape({ /** * An identifier for the column. This identifier should be unique across the set of columns provided to the DataGrid. */ id: _propTypes.default.string.isRequired, /** * A number (in px) specifying the width of the column. If not provided, the DataGrid's default column width will be used. */ width: _propTypes.default.number, /** * A boolean indicating whether or not the column header is selectable. If true, the DataGrid's `onColumnSelect` prop will * be called upon column header selection. */ isSelectable: _propTypes.default.bool, /** * A boolean indicating whether or not the column header is resizable. If true, a resize indicator will be rendered over * the column header's contents, and the DataGrid's `onRequestColumnResize` function will be called upon interaction with * the resize indicator. The new width will be provided with the function call so that the column's width property can be updated as needed. */ isResizable: _propTypes.default.bool, /** * A string of text to render within the column header. This text will follow standard truncation rules as necessary. * If a `component` value is specified, `text` will be ignored. */ text: _propTypes.default.string, /** * A string indicating which sorting indicator should be rendered. If not provided, no sorting indicator will be rendered. * If a `component` value is specified, `sortIndicator` will be ignored. One of `ascending`, `descending`. */ sortIndicator: _propTypes.default.oneOf(Object.values(SortIndicators)), /** * A custom component to render within the column header. If provided, the `text` and `sortIndicator` values will be ignored. */ component: _propTypes.default.node });