Unverified Commit 31ddbf7a by Michael Roytman Committed by GitHub

update docs and add proptype validation for hideHeader (#65)

update docs and add prop type validation for hideHeader
parent 6ad42ee2
{ {
"name": "@edx/paragon", "name": "@edx/paragon",
"version": "1.1.2", "version": "1.1.3",
"description": "Accessible, responsive UI component library based on Bootstrap.", "description": "Accessible, responsive UI component library based on Bootstrap.",
"main": "src/index.js", "main": "src/index.js",
"author": "arizzitano", "author": "arizzitano",
......
...@@ -11,6 +11,7 @@ Provides a very basic table component with col-scoped headings displayed in the ...@@ -11,6 +11,7 @@ Provides a very basic table component with col-scoped headings displayed in the
2. `key` (string; required) maps that label to its corresponding datum for each row in `data`, to ensure table data are displayed in their appropriate columns. 2. `key` (string; required) maps that label to its corresponding datum for each row in `data`, to ensure table data are displayed in their appropriate columns.
3. `columnSortable` (boolean; optional) specifies at the column-level whether the column is sortable. If `columnSortable` is `true`, a sort button will be rendered in the column table heading. It is only required if `tableSortable` is set to `true`. 3. `columnSortable` (boolean; optional) specifies at the column-level whether the column is sortable. If `columnSortable` is `true`, a sort button will be rendered in the column table heading. It is only required if `tableSortable` is set to `true`.
4. `onSort` (function; conditionally required) specifies what function is called when a sortable column is clicked. It is only required if the column's `columnSortable` is set to `true`. 4. `onSort` (function; conditionally required) specifies what function is called when a sortable column is clicked. It is only required if the column's `columnSortable` is set to `true`.
5. `hideHeader` (boolean; optional) specifies at the column-level whether the column label is visible. A column that is sortable cannot have its label be hidden.
The order of objects in `columns` specifies the order of the columns in the table. The order of objects in `columns` specifies the order of the columns in the table.
......
...@@ -152,6 +152,7 @@ Table.propTypes = { ...@@ -152,6 +152,7 @@ Table.propTypes = {
]).isRequired, ]).isRequired,
columnSortable: isRequiredIf(PropTypes.bool, props => props.tableSortable), columnSortable: isRequiredIf(PropTypes.bool, props => props.tableSortable),
onSort: isRequiredIf(PropTypes.func, props => props.columnSortable), onSort: isRequiredIf(PropTypes.func, props => props.columnSortable),
hideHeader: PropTypes.bool,
})).isRequired, })).isRequired,
headingClassName: PropTypes.arrayOf(PropTypes.string), headingClassName: PropTypes.arrayOf(PropTypes.string),
tableSortable: PropTypes.bool, tableSortable: PropTypes.bool,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment