terra-table
Version:
The Terra Table component provides user a way to display data in an accessible table format.
76 lines (75 loc) • 2.94 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.SortIndicators = exports.ColumnHighlightColor = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _actionShape = _interopRequireDefault(require("./actionShape"));
var SortIndicators = exports.SortIndicators = {
ASCENDING: 'ascending',
DESCENDING: 'descending'
};
var ColumnHighlightColor = exports.ColumnHighlightColor = {
ORANGE: 'orange',
GREEN: 'green'
};
var columnShape = _propTypes.default.shape({
/**
* Required string representing a unique identifier for the column.
*/
id: _propTypes.default.string.isRequired,
/**
* String of text to render within the column header cell.
*/
displayName: _propTypes.default.string,
/**
* Number that specifies the column span value.
*/
columnSpan: _propTypes.default.number,
/**
* Object containing label and onClick properties for column action button, which will be displayed in an additional row below the column header row.
*/
action: _propTypes.default.shape({
actionShape: _actionShape.default
}),
/**
* Boolean value indicating whether or not the column has an error in the data.
*/
hasError: _propTypes.default.bool,
/**
* Boolean value indicating whether or not the column header is resizable. This value is ignored when for a table with auto layout enabled.
*/
isResizable: _propTypes.default.bool,
/**
* Boolean value indicating whether or not the column header is selectable.
*/
isSelectable: _propTypes.default.bool,
/**
* Number that specifies the minimum column width in pixels.
*/
minimumWidth: _propTypes.default.number,
/**
* Number that specifies the maximum column width in pixels.
*/
maximumWidth: _propTypes.default.number,
/**
* The width can be either a numeric or string value.
* When a number is provided, it is the number (in px) specifying the width of the column. If not provided, the Table's default column width will be used.
* when a string is provided, it specifies the default column width and can be any valid CSS width value
*/
width: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
/* A string indicating which sorting indicator should be rendered. If not provided, no sorting indicator will be rendered.
* One of `ascending`, `descending`.
*/
sortIndicator: _propTypes.default.oneOf(Object.values(SortIndicators)),
/**
* The color to be used for highlighting a column.
*/
columnHighlightColor: _propTypes.default.oneOf(Object.values(ColumnHighlightColor)),
/**
* The information to be conveyed to screen readers about the highlighted column.
*/
columnHighlightDescription: _propTypes.default.string
});
var _default = exports.default = columnShape;