@atawi/react-datatable
Advanced tools
+21
| MIT License | ||
| Copyright (c) 2025 Ahmed Alatawi | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
+70
-3
@@ -7,2 +7,10 @@ import type { JSX as JSX_2 } from 'react/jsx-runtime'; | ||
| export declare function BulkActionsButton({ onClick, disabled, useTailwind, }: BulkActionsButtonProps): JSX_2.Element; | ||
| declare interface BulkActionsButtonProps { | ||
| onClick: () => void; | ||
| disabled?: boolean; | ||
| useTailwind?: boolean; | ||
| } | ||
| export declare interface Column<T> { | ||
@@ -36,3 +44,3 @@ key: keyof T; | ||
| id: string | number; | ||
| }>({ data, columns, pagination, pageSize, selectable, expandable, expandedContent, onSelectionChange, onRowClick, onPageChange, onSearchTextChange, theme, sortable, defaultSortColumn, defaultSortDirection, loading, emptyMessage, className, rowClassName, headerClassName, cellClassName, stickyHeader, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, searchable, searchPlaceholder, exportable, exportFilename, disableInternalSearch, useTailwind, }: DataTableProps<T>): JSX_2.Element; | ||
| }>({ data, columns, pagination, pageSize, selectable, expandable, expandedContent, onSelectionChange, onRowClick, onPageChange, onSearchTextChange, theme, sortable, defaultSortColumn, defaultSortDirection, loading, emptyMessage, className, rowClassName, headerClassName, cellClassName, stickyHeader, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, searchable, searchPlaceholder, exportable, exportFilename, disableInternalSearch, useTailwind, rowActions, onRowNavigate, toolbarLeft, toolbarRight, }: DataTableProps<T>): JSX_2.Element; | ||
@@ -70,2 +78,7 @@ export declare interface DataTableProps<T> { | ||
| useTailwind?: boolean; | ||
| rowActions?: RowAction<T>[]; | ||
| onRowNavigate?: (item: T) => void; | ||
| onBulkAction?: () => void; | ||
| toolbarLeft?: ReactNode; | ||
| toolbarRight?: ReactNode; | ||
| } | ||
@@ -94,2 +107,15 @@ | ||
| export declare function DropdownFilter({ value, onChange, options, label, useTailwind, }: DropdownFilterProps): JSX_2.Element; | ||
| declare interface DropdownFilterProps { | ||
| value: string; | ||
| onChange: (value: string) => void; | ||
| options: { | ||
| label: string; | ||
| value: string; | ||
| }[]; | ||
| label?: string; | ||
| useTailwind?: boolean; | ||
| } | ||
| export declare function ExportMenu<T>({ data, columns, theme, filename, useTailwind, }: ExportMenuProps<T>): JSX_2.Element; | ||
@@ -129,2 +155,23 @@ | ||
| export declare interface RowAction<T> { | ||
| label: string; | ||
| onClick: (item: T) => void; | ||
| icon?: ReactNode; | ||
| } | ||
| declare interface RowAction_2<T> { | ||
| label: string; | ||
| onClick: (item: T) => void; | ||
| icon?: React.ReactNode; | ||
| } | ||
| export declare function RowActionMenu<T>({ item, actions, onNavigate, useTailwind, }: RowActionMenuProps<T>): JSX_2.Element; | ||
| declare interface RowActionMenuProps<T> { | ||
| item: T; | ||
| actions: RowAction_2<T>[]; | ||
| onNavigate?: (item: T) => void; | ||
| useTailwind?: boolean; | ||
| } | ||
| export declare function SearchBar({ value, onChange, placeholder, theme, useTailwind, }: SearchBarProps): JSX_2.Element; | ||
@@ -145,4 +192,12 @@ | ||
| export declare function TableHeader<T>({ columns, sortConfig, onSort, selectable, selectedAll, onSelectAll, theme, sticky, filters, onFilterChange, uniqueColumnValues, useTailwind, }: TableHeaderProps<T>): JSX_2.Element; | ||
| export declare function StatusIndicator({ status, color, useTailwind, }: StatusIndicatorProps): JSX_2.Element; | ||
| declare interface StatusIndicatorProps { | ||
| status: string; | ||
| color?: string; | ||
| useTailwind?: boolean; | ||
| } | ||
| export declare function TableHeader<T>({ columns, sortConfig, onSort, selectable, selectedAll, onSelectAll, theme, sticky, filters, onFilterChange, uniqueColumnValues, useTailwind, hasRowActions, }: TableHeaderProps<T>): JSX_2.Element; | ||
| declare interface TableHeaderProps<T> { | ||
@@ -164,5 +219,6 @@ columns: Column<T>[]; | ||
| useTailwind?: boolean; | ||
| hasRowActions?: boolean; | ||
| } | ||
| export declare function TableRow<T>({ item, columns, selected, expanded, selectable, expandable, onSelect, onExpand, onClick, onKeyPress, expandedContent, theme, useTailwind, }: TableRowProps<T>): JSX_2.Element; | ||
| export declare function TableRow<T>({ item, columns, selected, expanded, selectable, expandable, onSelect, onExpand, onClick, onKeyPress, expandedContent, theme, useTailwind, rowActions, onNavigate, }: TableRowProps<T>): JSX_2.Element; | ||
@@ -183,4 +239,15 @@ declare interface TableRowProps<T> { | ||
| useTailwind?: boolean; | ||
| rowActions?: RowAction<T>[]; | ||
| onNavigate?: (item: T) => void; | ||
| } | ||
| export declare function ToggleSwitch({ checked, onChange, label, useTailwind, }: ToggleSwitchProps): JSX_2.Element; | ||
| declare interface ToggleSwitchProps { | ||
| checked: boolean; | ||
| onChange: (checked: boolean) => void; | ||
| label?: string; | ||
| useTailwind?: boolean; | ||
| } | ||
| export declare function useDataTableLogic<T extends { | ||
@@ -187,0 +254,0 @@ id: string | number; |
+1
-1
| { | ||
| "name": "@atawi/react-datatable", | ||
| "private": false, | ||
| "version": "1.1.0", | ||
| "version": "1.1.1", | ||
| "type": "module", | ||
@@ -6,0 +6,0 @@ "main": "./dist/index.js", |
+9
-5
@@ -0,1 +1,5 @@ | ||
|  | ||
| [](https://codecov.io/github/ahmedalatawi/react-datatable) | ||
| [](https://github.com/AhmedAlatawi/react-datatable/blob/master/LICENSE) | ||
| # React Datatable | ||
@@ -9,2 +13,6 @@ | ||
| [Codesandbox using CSS](https://codesandbox.io/p/sandbox/kjj4ld) | ||
| [Codesandbox using Tailwind](https://codesandbox.io/p/devbox/festive-tess-928f89) | ||
| ## Features | ||
@@ -83,7 +91,3 @@ | ||
| <DataTable | ||
| data={data} | ||
| columns={columns} | ||
| useTailwind={true} | ||
| /> | ||
| <DataTable data={data} columns={columns} useTailwind={true} />; | ||
| ``` | ||
@@ -90,0 +94,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No License Found
LicenseLicense information could not be found.
Found 1 instance in 1 package
5932153
1.28%10
11.11%0
-100%23327
2.01%456
0.88%