Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*/
class TableRow extends UIComponent, any> {
static displayName = 'TableRow'
static className = 'ui-table__row'
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
content: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([
PropTypes.arrayOf(customPropTypes.nodeContent),
customPropTypes.nodeContent,
]),
]),
items: customPropTypes.collectionShorthand,
header: PropTypes.bool,
compact: PropTypes.bool,
}
static defaultProps = {
as: 'div',
accessibility: tableRowBehavior as Accessibility,
}
renderCells(variables: ComponentVariablesObject) {
const { items, header } = this.props
static slotClassNames: TableCellSlotClassNames = {
content: `${TableCell.className}__content`,
}
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
content: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([
PropTypes.arrayOf(customPropTypes.nodeContent),
customPropTypes.nodeContent,
]),
]),
truncateContent: PropTypes.bool,
}
static defaultProps = {
as: 'div',
accessibility: tableCellBehavior as Accessibility,
}
renderComponent({
accessibility,
ElementType,
styles,
classes,
unhandledProps,
static Cell = TableCell
static Row = TableRow
static slotClassNames: TableSlotClassNames = {
header: `${Table.className}__header`,
}
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
content: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([
PropTypes.arrayOf(customPropTypes.nodeContent),
customPropTypes.nodeContent,
]),
]),
header: customPropTypes.itemShorthand,
rows: customPropTypes.collectionShorthand,
compact: PropTypes.bool,
}
static defaultProps = {
as: 'div',
accessibility: tableBehavior as Accessibility,
}
renderRows(accessibility: ReactAccessibilityBehavior, variables: ComponentVariablesObject) {
const { rows, compact } = this.props
return _.map(rows, (row: TableRowProps, index: number) => {
static Cell = TableCell
static Row = TableRow
static slotClassNames: TableSlotClassNames = {
header: `${Table.className}__header`,
}
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
content: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([
PropTypes.arrayOf(customPropTypes.nodeContent),
customPropTypes.nodeContent,
]),
]),
header: customPropTypes.itemShorthand,
rows: customPropTypes.collectionShorthand,
compact: PropTypes.bool,
}
static defaultProps = {
as: 'div',
accessibility: tableBehavior as Accessibility,
}
renderRows(accessibility: ReactAccessibilityBehavior, variables: ComponentVariablesObject) {
const { rows, compact } = this.props
static className = 'ui-table__cell'
static slotClassNames: TableCellSlotClassNames = {
content: `${TableCell.className}__content`,
}
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
content: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([
PropTypes.arrayOf(customPropTypes.nodeContent),
customPropTypes.nodeContent,
]),
]),
truncateContent: PropTypes.bool,
}
static defaultProps = {
as: 'div',
accessibility: tableCellBehavior as Accessibility,
}
renderComponent({
accessibility,
ElementType,
styles,
classes,
class TableRow extends UIComponent, any> {
static displayName = 'TableRow'
static className = 'ui-table__row'
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
content: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([
PropTypes.arrayOf(customPropTypes.nodeContent),
customPropTypes.nodeContent,
]),
]),
items: customPropTypes.collectionShorthand,
header: PropTypes.bool,
compact: PropTypes.bool,
}
static defaultProps = {
as: 'div',
accessibility: tableRowBehavior as Accessibility,
}
renderCells(variables: ComponentVariablesObject) {
const { items, header } = this.props
return _.map(items, (item: TableCellProps, index: number) => {