
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
qbs-react-grid
Advanced tools
npm install qbs-react-grid
import { QbsTable } from 'qbs-react-grid';
import 'qbs-react-grid/dist/css/qbs-react-grid.css';
<QbsTable data={[{ id: 1, name: 'John Doe' }]} columns={[{ title: 'Name', field: 'name' }]} />;
QbsTable
is a versatile and customizable table component designed to display tabular data efficiently. It provides features like sorting, column grouping, and various cell customizations.
QbsTableProps
Prop | Type | Description |
---|---|---|
columns | readonly QbsColumnProps[] | Defines each column in the table. |
data | readonly any[] | Data objects to be displayed in the table rows. |
actionProps | readonly ActionProps[] | Defines actions for each row. |
isTree | boolean | Specifies if the table should render as a tree. |
pagination | boolean | Enables pagination for the table. |
paginationProps | PaginationProps | Controls pagination properties. |
handleColumnSort | (sortColumn: string, sortType: string) => void | Handles column sorting. |
sortType | 'desc' | 'asc' | Defines the sorting type. |
sortColumn | string | Defines the column being sorted. |
selection | boolean | Enables row selection. |
onSelect | (keys: any[]) => void | Called when rows are selected. |
title | string | Specifies the table title. |
search | boolean | Enables search functionality. |
onSearch | (key?: string) => void | Called when a search is performed. |
asyncSearch | boolean | If true, the search will be asynchronous. |
searchValue | string | Represents the current value in the search input. |
handleSearchValue | (value?: string) => void | Handles search input changes. |
theme | string | Defines the theme applied to the table. |
onRowClick | (data: any) => void | Called when a row is clicked. |
cellBordered | boolean | If true, each cell will have a border. |
bordered | boolean | If true, the table will have a border. |
height | number | Defines the table height. |
minHeight | number | Defines the minimum table height. |
maxHeight | number | string | Defines the maximum table height. |
wordWrap | boolean | 'break-all' | 'break-word' | 'keep-all' | undefined | Defines the word wrap style for the content in a cell. |
dataRowKey | string | Defines the key field in the data. |
onExpandChange | (expanded: boolean, rowData: any) => void | Called when a row expands or collapses. |
defaultExpandAllRows | boolean | If true, all rows will be expanded by default. |
expandedRowKeys | readonly number[] | Contains the array of expanded row keys. |
setExpandedRowKeys | (value: readonly number[]) => void | Sets expanded row keys. |
handleMenuActions | (actions: ActionProps, rowData: any) => void | Handles menu actions. |
handleRowExpanded | (rowData: any) => React.ReactNode | Renders expanded row content. |
shouldUpdateScroll | boolean | If true, the table will update the scroll position on data or size change. |
rowExpand | boolean | Enables row expand functionality. |
primaryFilter | ReactElement | ReactNode | Defines the primary filter component. |
advanceFilter | ReactElement | ReactNode | Defines the advanced filter component. |
QbsColumnProps
Prop | Type | Description |
---|---|---|
title | string | Title of the column. |
field | string | Field in the data that this column represents. |
sortable | boolean | Specifies if the column is sortable. |
resizable | boolean | Specifies if the column is resizable. |
fixed | boolean | If true , the column will be fixed on horizontal scrolling. |
align | Align | Alignment of the column content. Supports 'center' , 'left' , 'right' . |
colWidth | number | Width of the column. |
renderCell | (rowData: any) => ReactElement | Renders custom cell content. |
customCell | boolean | If true , a custom cell will be rendered using renderCell . |
grouped | boolean | If true , the column will be grouped with the groupheader . |
groupheader | string | The header of the grouped column. |
children | readonly ColumnBase[] | Child columns of the grouped column. |
PaginationProps
Prop | Type | Description |
---|---|---|
total | number | Total number of items. |
rowsPerPage | number | Number of rows per page. |
dropOptions | number[] | Drop-down options for rows per page. |
currentPage | number | Current active page. |
maxPage | number | Maximum number of pages. |
onRowsPerPage | (row: number, page: number) => void | Function called when rows per page is changed. |
onPagination | (row: number, page: number) => void | Function called when pagination is changed. |
ActionProps
Prop | Type | Description |
---|---|---|
title | string | Title of the action. |
action | (row: any) => void | Function to be executed when the action is triggered. |
icon | React.ReactNode | Icon to be displayed for the action. |
toolTip | string | Tooltip text for the action. |
QbsTableToolbarProps
Prop | Type | Description |
---|---|---|
title | string | Title of the toolbar. |
search | boolean | Enables search functionality in the toolbar. |
onSearch | (key?: string) => void | Function called when a search is performed from the toolbar. |
asyncSearch | boolean | If true , search will be asynchronous. |
searchValue | string | Current value in the search input. |
handleSearchValue | (value?: string) => void | Function to handle search |
handleColumnSort: (sortColumn: any, sortType: any) => void
A function to handle the column sorting. It receives sortColumn
and sortType
as parameters.
<QbsTable handleColumnSort={(sortColumn, sortType) => console.log(sortColumn, sortType)} />
data: any[]
An array containing the data to be displayed in the table.
<QbsTable data={[{ id: 1, name: 'John Doe' }]} />
columns: Column[]
An array defining the columns of the table.
<QbsTable columns={[{ title: 'Name', field: 'name' }]} />
sortColumn: string
Defines the column that is currently sorted.
<QbsTable sortColumn="name" />
sortType: string
Defines the current sort type.
<QbsTable sortType="asc" />
selection: boolean
Enables or disables row selection using checkboxes.
<QbsTable selection={true} />
onSelect: (selectedKeys: number[]) => void
Callback fired when a row is selected.
<QbsTable onSelect={selectedKeys => console.log(selectedKeys)} />
title: string
Sets the title of the table.
<QbsTable title="My Custom Table" />
search: boolean
Enables or disables the search functionality.
<QbsTable search={true} />
asyncSearch: boolean
If true, activates asynchronous search.
<QbsTable asyncSearch={true} />
searchValue: string
Controls the value of the search input.
<QbsTable searchValue="John" />
onSearch: (value: string) => void
Callback fired when the search value changes.
<QbsTable onSearch={value => console.log(value)} />
handleSearchValue: (value: string) => void
A function to handle the search value, usually used for controlled components.
<QbsTable handleSearchValue={value => console.log(value)} />
paginationProps: object
Props to be passed to the Pagination
component.
<QbsTable paginationProps={{ total: 100, pageSize: 10 }} />
pagination: boolean
Enables or disables the pagination.
<QbsTable pagination={true} />
cellBordered: boolean
If true, displays borders around cells.
<QbsTable cellBordered={true} />
bordered: boolean
If true, displays a border around the table.
<QbsTable bordered={true} />
minHeight: number
Sets the minimum height of the table.
<QbsTable minHeight={300} />
height: number
Sets the height of the table.
<QbsTable height={550} />
onExpandChange: (rowData: any) => void
Callback fired when the expanded state of a row is changed.
<QbsTable onExpandChange={rowData => console.log(rowData)} />
wordWrap: boolean
If true, enables word wrapping in cells.
<QbsTable wordWrap={true} />
dataRowKey: string
Defines the key from the data that will be used for row keys.
<QbsTable dataRowKey="id" />
defaultExpandAllRows: boolean
If true, expands all rows by default.
<QbsTable defaultExpandAllRows={true} />
handleRowExpanded: (rowData: any) => ReactNode
A function to handle the rendering of expanded rows. It should return a valid ReactNode.
<QbsTable handleRowExpanded={rowData => <div>{rowData.name}</div>} />
shouldUpdateScroll: boolean
If true, updates the scroll position when needed.
<QbsTable shouldUpdateScroll={true} />
rowExpand: boolean
If true, enables the row expand functionality.
<QbsTable rowExpand={true} />
actionProps: any[]
An array of action props to be passed to the ActionCell
component.
<QbsTable actionProps={[{ title: 'Delete', onClick: rowData => console.log(rowData) }]} />
theme: string
Defines the theme of the table. It could be 'light' or 'dark'.
<QbsTable theme="dark" />
handleMenuActions: (action: any, rowData: any) => void
A function to handle the actions from the action menu.
<QbsTable handleMenuActions={(action, rowData) => console.log(action, rowData)} />
onRowClick: (rowData: any) => void
Callback fired when a row is clicked.
<QbsTable onRowClick={rowData => console.log(rowData)} />
expandedRowKeys: string[]
An array of the keys of the currently expanded rows.
<QbsTable expandedRowKeys={['1', '2']} />
setExpandedRowKeys: (keys: string[]) => void
A function to set the keys of the currently expanded rows.
<QbsTable setExpandedRowKeys={keys => console.log(keys)} />
primaryFilter: any
Prop to handle primary filtering.
<QbsTable primaryFilter={{ filterType: 'date', filterValue: '2023-01-01' }} />
advancefilter: any
Prop to handle advanced filtering.
<QbsTable advancefilter={{ filterType: 'name', filterValue: 'John' }} />
classes: object
Object containing className strings.
<QbsTable classes={{ headerClass: 'my-header-class', cellClass: 'my-cell-class' }} />
toolbar: boolean
If true, displays the toolbar.
<QbsTable toolbar={true} />
Here is an example of how you might use the QbsTable
component with various props:
<QbsTable
title="User Data"
data={[
{ id: 1, name: 'Quinoid' },
{ id: 2, name: 'Quinoid1' }
]}
columns={[{ title: 'Name', field: 'name' }]}
sortColumn="name"
sortType="asc"
selection={true}
onSelect={selectedKeys => console.log(selectedKeys)}
search={true}
onSearch={value => console.log(value)}
pagination={true}
paginationProps={{ total: 100, pageSize: 10 }}
cellBordered={true}
bordered={true}
minHeight={300}
height={550}
onExpandChange={rowData => console.log(rowData)}
wordWrap={true}
dataRowKey="id"
defaultExpandAllRows={true}
handleRowExpanded={rowData => <div>{rowData.name}</div>}
shouldUpdateScroll={true}
rowExpand={true}
actionProps={[{ title: 'Delete', onClick: rowData => console.log(rowData) }]}
theme="dark"
handleMenuActions={(action, rowData) => console.log(action, rowData)}
onRowClick={rowData => console.log(rowData)}
expandedRowKeys={['1', '2']}
setExpandedRowKeys={keys => console.log(keys)}
primaryFilter={{ filterType: 'date', filterValue: '2023-01-01' }}
advancefilter={{ filterType: 'name', filterValue: 'John' }}
classes={{ headerClass: 'my-header-class', cellClass: 'my-cell-class' }}
toolbar={true}
/>
QbsTable
component should be used in accordance with the requirements of your application. Ensure that you pass the correct props for your desired functionality.classes
PropThe classes
prop is an object where keys are the names of elements or parts of the QbsTable
component, and values are the class names you want to apply. Below is the list of keys you can use:
headerClass
: Class applied to the header cells of the table. It affects both grouped and ungrouped headers.
cellClass
: Class applied to the data cells of the table.
tableContainerClass
: Class applied to the container wrapping the whole table, including the toolbar.
headerlClass
: Class applied to the specific header cells, especially when using features like row expansion and selection.
selectionCell
: Class applied to the container of the checkbox in the header when selection is enabled.
tableCheckBoxClass
: Class applied to the checkboxes in the rows and the header when selection is enabled.
actionCellClass
: Class applied to the action cells in the table when actions are provided.
toolbarClass
: Class applied to table toolbar
<QbsTable
classes={{
headerClass: 'my-header-class',
cellClass: 'my-cell-class',
tableContainerClass: 'my-table-container-class',
headerlClass: 'my-headerl-class',
selectionCell: 'my-selection-cell-class',
tableCheckBoxClass: 'my-table-check-box-class',
actionCellClass: 'my-action-cell-class'
}}
//... other props
/>
.rows-count
for displaying row count with padding 0px 10px.npm install qbs-react-grid
FAQs
A React table component
The npm package qbs-react-grid receives a total of 46 weekly downloads. As such, qbs-react-grid popularity was classified as not popular.
We found that qbs-react-grid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.