You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| onSelectionChange | function | Callback function that receives a Set of selected row IDs |
188
207
208
+
**Note**: Child rows (nested rows) do not display checkboxes. They automatically show placeholder spacers to maintain alignment with parent rows.
209
+
189
210
### 3.4 Sort Icons
190
211
191
212
You can customize the sort icons for ascending and descending states:
@@ -205,7 +226,86 @@ You can customize the sort icons for ascending and descending states:
205
226
| ascendingIcon | ReactNode | Custom icon component for ascending sort state |
206
227
| descendingIcon | ReactNode | Custom icon component for descending sort state |
207
228
208
-
### 3.5 Pagination
229
+
### 3.5 Search and Filter Features
230
+
231
+
The table provides comprehensive search and filtering capabilities:
232
+
233
+
#### Global Search
234
+
-**Searchable**: Enable/disable global search across all columns
235
+
-**Search Input**: Real-time search with debounced input
236
+
-**Search Icon**: Customizable search icon with proper positioning
237
+
-**Placeholder Text**: Customizable placeholder text for search input
238
+
239
+
#### Column Filtering
240
+
-**Filterable Columns**: Individual columns can be marked as filterable
241
+
-**Filter Dropdowns**: Dropdown-based filtering with multiple selection
242
+
-**Filter Options**: Custom filter options for each column
243
+
-**Filter State**: Maintains filter state across pagination
244
+
245
+
**Important Note**: Search and filter features are currently implemented at the parent level only. Child rows (nested rows) are not included in search results or filter operations. This ensures consistent behavior and performance.
246
+
247
+
#### Filter Configuration
248
+
```tsx
249
+
const columns = [
250
+
{
251
+
key: 'status',
252
+
title: 'Status',
253
+
filterable: true,
254
+
filterOptions: [
255
+
{ label: 'Active', value: 'active' },
256
+
{ label: 'Pending', value: 'pending' },
257
+
{ label: 'Completed', value: 'completed' }
258
+
]
259
+
}
260
+
];
261
+
```
262
+
263
+
### 3.6 Export Functionality
264
+
265
+
The table supports data export with customizable options:
| onExport | function | Custom export handler function |
272
+
273
+
```tsx
274
+
<MultiLevelTable
275
+
data={data}
276
+
columns={columns}
277
+
exportable={true}
278
+
exportFormats={['csv', 'excel']}
279
+
onExport={(data, format) => {
280
+
// Custom export logic
281
+
console.log('Exporting:', data, format);
282
+
}}
283
+
/>
284
+
```
285
+
286
+
### 3.7 Row Actions
287
+
288
+
The table supports row-level actions:
289
+
290
+
| Prop | Type | Description |
291
+
|------|------|-------------|
292
+
| onRowClick | function | Callback when parent row is clicked |
293
+
| onDelete | function | Callback for row deletion with confirmation |
294
+
295
+
```tsx
296
+
<MultiLevelTable
297
+
data={data}
298
+
columns={columns}
299
+
onRowClick={(row) => {
300
+
console.log('Row clicked:', row);
301
+
}}
302
+
onDelete={(rowId, rowName) => {
303
+
console.log('Delete row:', rowId, rowName);
304
+
}}
305
+
/>
306
+
```
307
+
308
+
### 3.8 Pagination
209
309
210
310
The table component provides comprehensive pagination functionality. You can either use the default pagination or create a custom one using the pagination props:
211
311
@@ -274,9 +374,9 @@ const CustomPagination = ({
274
374
/>
275
375
```
276
376
277
-
### 3.6 Theme Customization
377
+
### 3.9 Theme Customization
278
378
279
-
The table component supports theme customization through the `theme` prop. Here's the complete theme interface:
379
+
The table component supports comprehensive theme customization through the `theme` prop. Here's the complete theme interface:
280
380
281
381
```tsx
282
382
interfaceThemeProps {
@@ -394,18 +494,78 @@ const theme = {
394
494
```
395
495
396
496
The theme customization allows you to:
397
-
- Customize global colors for the table
398
-
- Style table components (header, cells, rows)
399
-
- Configure nested level appearances
400
-
- Customize filter and pagination components
401
-
- Style the expand icon
402
-
403
-
## 4. Development
497
+
-**Global Colors**: Customize background, primary, text, and border colors
498
+
-**Table Components**: Style headers, cells, and rows with custom colors and borders
499
+
-**Nested Levels**: Configure different background colors for each nesting level
500
+
-**Filter Components**: Customize filter dropdowns, inputs, and focus states
501
+
-**Pagination**: Style pagination buttons, selects, and info text
502
+
-**Icons**: Customize expand, sort, and action icon colors
503
+
-**Responsive Design**: All theme properties support responsive breakpoints
504
+
-**CSS Variables**: Theme properties can use CSS custom properties for dynamic theming
505
+
506
+
## 4. Component Features and Customization
507
+
508
+
### 4.1 MultiLevelTable Component
509
+
-**Hierarchical Data**: Supports unlimited nesting levels with automatic indentation
510
+
-**Responsive Design**: Percentage-based column widths with fixed table layout
511
+
-**Performance Optimized**: Virtual scrolling support for large datasets
512
+
-**Accessibility**: ARIA labels, keyboard navigation, and screen reader support
513
+
-**Customizable Icons**: Replace default expand, sort, and action icons
514
+
-**Event Handling**: Comprehensive callback system for all user interactions
515
+
516
+
### 4.2 TableRow Component
517
+
-**Level-based Styling**: Different background colors for each nesting level
518
+
-**Expand/Collapse**: Smooth animations for row expansion and collapse
519
+
-**Selection State**: Visual feedback for selected rows
520
+
-**Click Handlers**: Support for row click and action button clicks
521
+
-**Custom Rendering**: Flexible cell content rendering with custom components
522
+
523
+
### 4.3 TableCell Component
524
+
-**Flexible Content**: Support for text, numbers, custom components, and HTML
525
+
-**Alignment Options**: Left, center, and right text alignment
526
+
-**Custom Styling**: Inline styles and CSS classes for individual cells
527
+
-**Icon Integration**: Built-in support for expand, sort, and action icons
528
+
-**Responsive Behavior**: Automatic text truncation and ellipsis
529
+
530
+
### 4.4 TableHeader Component
531
+
-**Sortable Columns**: Click-to-sort functionality with custom sort icons
532
+
-**Filter Integration**: Dropdown filters with multi-select capability
533
+
-**Custom Styling**: Theme-based header styling with hover effects
534
+
-**Accessibility**: Proper ARIA labels and keyboard navigation
535
+
-**Responsive Design**: Adaptive header layout for mobile devices
536
+
537
+
### 4.5 Pagination Component
538
+
-**Page Navigation**: Previous/next buttons with page number display
539
+
-**Page Size Selection**: Dropdown to change items per page
0 commit comments