This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[terra-outline-table-view] Creating base component and pass through p…
…rops. (#3657) * initial base attempt and pass through test * Fixing wdio test to not fail do to aria issues, and making note about aria labels in body data * fixing linting issues * Update packages/terra-outline-table-view/src/Table.jsx Co-authored-by: Saad Adnan <38024451+sdadn@users.noreply.github.com> * Update packages/terra-outline-table-view/tests/jest/Table.test.jsx Co-authored-by: Saad Adnan <38024451+sdadn@users.noreply.github.com> * adding changelog change to terra-core-docs * fixing jest test Co-authored-by: Saad Adnan <38024451+sdadn@users.noreply.github.com> Co-authored-by: Ben Cai <benbcai@gmail.com>
- Loading branch information
1 parent
7e7fbca
commit b694cfb
Showing
21 changed files
with
599 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/terra-outline-table-view/src/proptypes/cellShape.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
const cellShape = PropTypes.shape({ | ||
/** | ||
* The react key to apply to the cell. | ||
*/ | ||
key: PropTypes.string.isRequired, | ||
/** | ||
* Child content to be displayed for the row cell. | ||
*/ | ||
children: PropTypes.node, | ||
/** | ||
* Function callback returning the html node for the cell. | ||
*/ | ||
refCallback: PropTypes.func, | ||
/** | ||
* Whether or not the cell's inner containing element responsible for handling table's default padding is removed. | ||
* This is useful to optimize the DOM for either a table without padding or to optimize a cell whose custom content is providing its own padding. | ||
*/ | ||
removeInner: PropTypes.bool, | ||
/** | ||
* Additional attributes to be passed to the cell. | ||
*/ | ||
// eslint-disable-next-line react/forbid-prop-types | ||
attrs: PropTypes.object, | ||
}); | ||
|
||
export default cellShape; |
29 changes: 29 additions & 0 deletions
29
packages/terra-outline-table-view/src/proptypes/discloseShape.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
const discloseShape = PropTypes.shape({ | ||
/** | ||
* The index of the cell that provides the accessible link entry point for disclosure style rows. | ||
*/ | ||
discloseCellIndex: PropTypes.number.isRequired, | ||
/** | ||
* The label associated to the row action. Should be set if `'rowStyle'` is set to `'disclose'` or `'toggle'`. | ||
*/ | ||
discloseLabel: PropTypes.string, | ||
/** | ||
* Whether or not the row is the currently selected disclosure. | ||
* This aria state relates to the primary link cell. | ||
*/ | ||
isDisclosed: PropTypes.bool, | ||
/** | ||
* The associated metaData to be return within row disclose callbacks. | ||
*/ | ||
// eslint-disable-next-line react/forbid-prop-types | ||
metaData: PropTypes.object, | ||
/** | ||
* Function callback for when the appropriate click or key action is performed. | ||
* Callback contains the javascript event and prop metadata, e.g. onRowAction(event, metaData) | ||
*/ | ||
onDisclose: PropTypes.func, | ||
}); | ||
|
||
export default discloseShape; |
57 changes: 57 additions & 0 deletions
57
packages/terra-outline-table-view/src/proptypes/headerCellShape.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
const headerCellShape = PropTypes.shape({ | ||
/** | ||
* The id of the header cell for the row cells to set within their "headers" prop. | ||
*/ | ||
id: PropTypes.string.isRequired, | ||
/** | ||
* The react key to apply to the cell. | ||
*/ | ||
key: PropTypes.string.isRequired, | ||
/** | ||
* Content to be displayed for the column header. | ||
*/ | ||
children: PropTypes.node, | ||
/** | ||
* Whether or not the sort indicator is descending. | ||
*/ | ||
isSortDesc: PropTypes.bool, | ||
/** | ||
* Whether or not the column is to be marked as a sorted column. | ||
*/ | ||
isSortActive: PropTypes.bool, | ||
/** | ||
* The associated metaData to be provided in the onCellAction and onSortAction callbacks. | ||
*/ | ||
// eslint-disable-next-line react/forbid-prop-types | ||
metaData: PropTypes.object, | ||
/** | ||
* Function callback for when the appropriate click or key action is performed. | ||
* Callback contains the javascript event and prop metadata, e.g. onCellAction(event, metaData) | ||
* The presence of this func will indicate that the cell can be interacted with for actions or selections. | ||
*/ | ||
onCellAction: PropTypes.func, | ||
/** | ||
* Function callback for when the appropriate click or key action is performed. | ||
* Callback contains the javascript event and prop metadata, e.g. onSortAction(event, metaData) | ||
* The presence of this func will indicate that the cell can be interacted with for sorting. | ||
*/ | ||
onSortAction: PropTypes.func, | ||
/** | ||
* Function callback returning the html node for the header cell. | ||
*/ | ||
refCallback: PropTypes.func, | ||
/** | ||
* Whether or not the cell's inner containing element responsible for handling table's default padding is removed. | ||
* This is useful to optimize the DOM for either a table without padding or to optimize a cell whose custom content is providing its own padding. | ||
*/ | ||
removeInner: PropTypes.bool, | ||
/** | ||
* Additional attributes to be passed to the cell. | ||
*/ | ||
// eslint-disable-next-line react/forbid-prop-types | ||
attrs: PropTypes.object, | ||
}); | ||
|
||
export default headerCellShape; |
20 changes: 20 additions & 0 deletions
20
packages/terra-outline-table-view/src/proptypes/headerShape.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import PropTypes from 'prop-types'; | ||
import headerCellShape from './headerCellShape'; | ||
import selectAllColumnShape from './selectAllColumnShape'; | ||
|
||
const headerShape = PropTypes.shape({ | ||
/** | ||
* The cells to be displayed within the header. | ||
*/ | ||
cells: PropTypes.arrayOf(headerCellShape), | ||
/** | ||
* Function callback returning the html node for the header. | ||
*/ | ||
refCallback: PropTypes.func, | ||
/** | ||
* The select all column header's properties. | ||
*/ | ||
selectAllColumn: selectAllColumnShape, | ||
}); | ||
|
||
export default headerShape; |
Oops, something went wrong.