Sha256: e227c1637956136fd71e48a8a833fce89f7855e95501c7c93be8eba648719b80
Contents?: true
Size: 1.61 KB
Versions: 142
Compression:
Stored size: 1.61 KB
Contents
/* @flow */ import React, { type Node } from 'react' import classnames from 'classnames' import { buildAriaProps, buildDataProps } from '../utilities/props' import { globalProps } from '../utilities/globalProps.js' import PbTable from './' type TableProps = { aria?: object, children: array<Node> | Node, className: string, collapse?: "sm" | "md" | "lg", container: boolean, dark?: boolean, data?: object, dataTable: boolean, disableHover: boolean, id?: string, responsive: "collapse" | "scroll" | "none", singleLine: boolean, size: "sm" | "md" | "lg", } const Table = (props: TableProps) => { const { aria = {}, children, className, collapse = 'sm', container = true, dark, data = {}, dataTable = false, disableHover = false, id, responsive = 'collapse', singleLine = false, size = 'sm', } = props const ariaProps = buildAriaProps(aria) const dataProps = buildDataProps(data) const tableCollapseCss = responsive !== 'none' ? `table-collapse-${collapse}` : '' const instance = new PbTable() instance.connect() return ( <table {...ariaProps} {...dataProps} className={classnames( 'pb_table', `table-${size}`, `table-responsive-${responsive}`, { 'table-card': container, 'table-dark': dark, 'data_table': dataTable, 'single-line': singleLine, 'no-hover': disableHover, }, globalProps(props), tableCollapseCss, className )} id={id} > {children} </table> ) } export default Table
Version data entries
142 entries across 142 versions & 1 rubygems