ia-table 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -134
- package/dist/index.js +5486 -5512
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,33 +13,27 @@ npm install --save ia-table
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
|
-
import
|
|
17
|
-
import 'ia-table/dist/style.css'; // Import styles
|
|
16
|
+
import IATable from "ia-table";
|
|
18
17
|
|
|
19
18
|
const App = () => {
|
|
20
19
|
const data = [
|
|
21
|
-
{ id: 1, name:
|
|
22
|
-
{ id: 2, name:
|
|
20
|
+
{ id: 1, name: "Product A", price: 100 },
|
|
21
|
+
{ id: 2, name: "Product B", price: 200 },
|
|
23
22
|
];
|
|
24
23
|
|
|
25
24
|
const columns = [
|
|
26
|
-
{ field:
|
|
27
|
-
{ field:
|
|
28
|
-
{ field:
|
|
25
|
+
{ field: "id", headerName: "ID" },
|
|
26
|
+
{ field: "name", headerName: "Name" },
|
|
27
|
+
{ field: "price", headerName: "Price" },
|
|
29
28
|
];
|
|
30
29
|
|
|
31
30
|
return (
|
|
32
|
-
<IATable
|
|
33
|
-
data={data}
|
|
34
|
-
columns={columns}
|
|
35
|
-
height="400px"
|
|
36
|
-
uniqueIdField="id"
|
|
37
|
-
/>
|
|
31
|
+
<IATable data={data} columns={columns} height="400px" uniqueIdField="id" />
|
|
38
32
|
);
|
|
39
33
|
};
|
|
40
34
|
```
|
|
41
35
|
|
|
42
|
-
For detailed documentation on publishing this package, see [PUBLISHING.md](./PUBLISHING.md).
|
|
36
|
+
<!-- For detailed documentation on publishing this package, see [PUBLISHING.md](./PUBLISHING.md). -->
|
|
43
37
|
|
|
44
38
|
## Features
|
|
45
39
|
|
|
@@ -236,7 +230,7 @@ For detailed documentation on publishing this package, see [PUBLISHING.md](./PUB
|
|
|
236
230
|
## Usage
|
|
237
231
|
|
|
238
232
|
```jsx
|
|
239
|
-
import
|
|
233
|
+
import IATable from "ia-table";
|
|
240
234
|
|
|
241
235
|
// Sample data
|
|
242
236
|
const data = [
|
|
@@ -281,7 +275,7 @@ const columns = [
|
|
|
281
275
|
// Component implementation
|
|
282
276
|
const MyTable = () => {
|
|
283
277
|
return (
|
|
284
|
-
<
|
|
278
|
+
<IATable
|
|
285
279
|
data={data}
|
|
286
280
|
columns={columns}
|
|
287
281
|
height="500px"
|
|
@@ -296,23 +290,20 @@ const MyTable = () => {
|
|
|
296
290
|
|
|
297
291
|
## Props
|
|
298
292
|
|
|
299
|
-
| Prop
|
|
300
|
-
|
|
|
301
|
-
| `data`
|
|
302
|
-
| `columns`
|
|
303
|
-
| `height`
|
|
304
|
-
| `uniqueIdField`
|
|
305
|
-
| `childKeyField`
|
|
306
|
-
| `showHeader`
|
|
307
|
-
| `showFooter`
|
|
308
|
-
| `showToolbar`
|
|
309
|
-
| `
|
|
310
|
-
| `
|
|
311
|
-
| `
|
|
312
|
-
| `
|
|
313
|
-
| `pageSize` | Number | `10` | Items per page when pagination is enabled |
|
|
314
|
-
| `onRowClick` | Function | - | Row click handler |
|
|
315
|
-
| `onCellClick` | Function | - | Cell click handler |
|
|
293
|
+
| Prop | Type | Default | Description |
|
|
294
|
+
| ----------------- | ------- | --------------- | -------------------------------------------------- |
|
|
295
|
+
| `data` | Array | `[]` | Array of data objects to display |
|
|
296
|
+
| `columns` | Array | `[]` | Column definitions |
|
|
297
|
+
| `height` | String | `'auto'` | Table height |
|
|
298
|
+
| `uniqueIdField` | String | `'store_code'` | Field to use as unique row identifier |
|
|
299
|
+
| `childKeyField` | String | `'status_obj1'` | Field containing child items for hierarchical data |
|
|
300
|
+
| `showHeader` | Boolean | `true` | Whether to show the table header |
|
|
301
|
+
| `showFooter` | Boolean | `false` | Whether to show the table footer |
|
|
302
|
+
| `showToolbar` | Boolean | `true` | Whether to show the toolbar |
|
|
303
|
+
| `selectable` | Boolean | `false` | Enable row selection |
|
|
304
|
+
| `expandable` | Boolean | `false` | Enable row expansion |
|
|
305
|
+
| `pagination` | Boolean | `false` | Enable pagination |
|
|
306
|
+
| `defaultPageSize` | Number | `10` | Items per page when pagination is enabled |
|
|
316
307
|
|
|
317
308
|
## Column Definition
|
|
318
309
|
|
|
@@ -321,111 +312,12 @@ interface ColumnDefinition {
|
|
|
321
312
|
field: string; // The field name in the data object
|
|
322
313
|
headerName: string; // The display name for the column header
|
|
323
314
|
width?: number; // The width of the column in pixels (default: 100)
|
|
324
|
-
|
|
315
|
+
isSortable?: boolean; // Whether the column is sortable (default: true)
|
|
325
316
|
filterable?: boolean; // Whether the column is filterable (default: true)
|
|
326
317
|
resizable?: boolean; // Whether the column can be resized (default: true)
|
|
327
318
|
cellRenderer?: Function; // Custom cell renderer function
|
|
328
|
-
headerRenderer?: Function; // Custom header renderer function
|
|
329
319
|
align?: "left" | "center" | "right"; // Text alignment (default: 'left')
|
|
330
320
|
pinned?: boolean | "left"; // Whether the column is pinned (true = right, 'left' = left)
|
|
331
|
-
|
|
332
|
-
children?: ColumnDefinition[]; // Child columns for grouping headers
|
|
321
|
+
is_hidden?: boolean; // Whether the column is initially hidden
|
|
333
322
|
}
|
|
334
323
|
```
|
|
335
|
-
|
|
336
|
-
## Project Setup
|
|
337
|
-
|
|
338
|
-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
|
339
|
-
|
|
340
|
-
### Available Scripts
|
|
341
|
-
|
|
342
|
-
In the project directory, you can run:
|
|
343
|
-
|
|
344
|
-
#### `npm start`
|
|
345
|
-
|
|
346
|
-
Runs the app in the development mode.\
|
|
347
|
-
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
|
|
348
|
-
|
|
349
|
-
#### `npm test`
|
|
350
|
-
|
|
351
|
-
Launches the test runner in the interactive watch mode.
|
|
352
|
-
|
|
353
|
-
#### `npm run build`
|
|
354
|
-
|
|
355
|
-
Builds the app for production to the `build` folder.
|
|
356
|
-
|
|
357
|
-
# Advanced Data Caching System for React Tables
|
|
358
|
-
|
|
359
|
-
A high-performance caching system for handling extremely large datasets (50M+ rows) in React applications with support for both pagination and infinite scrolling patterns.
|
|
360
|
-
|
|
361
|
-
## Core Components
|
|
362
|
-
|
|
363
|
-
- **InfiniteCache**: Block-based cache management with multiple purge strategies
|
|
364
|
-
- **InfiniteRowModel**: Virtual row model to efficiently handle rows and viewport
|
|
365
|
-
- **InfiniteDataSource**: Data provider with client-side and server-side implementations
|
|
366
|
-
- **InfiniteBlock**: Data block for efficient memory management and cache operations
|
|
367
|
-
- **StreamingDataAdapter**: Enables streaming large datasets in chunks
|
|
368
|
-
- **LargeDataStorage**: Optimized storage for extremely large datasets
|
|
369
|
-
- **LargeDataSourceAdapter**: Adapter for connecting large storage to data sources
|
|
370
|
-
- **Web Workers**: Background processing for heavy operations
|
|
371
|
-
- `worker.js`: Standard worker for data processing
|
|
372
|
-
- `enhanced-worker.js`: WebAssembly-enhanced worker for extreme performance
|
|
373
|
-
|
|
374
|
-
## Key Features
|
|
375
|
-
|
|
376
|
-
- **Virtual Rendering**: Only renders visible rows with intelligent row recycling
|
|
377
|
-
- **Block-Based Caching**: Stores data in blocks for efficient memory use
|
|
378
|
-
- **Multiple Purge Strategies**:
|
|
379
|
-
- LRU (Least Recently Used)
|
|
380
|
-
- Furthest From Viewport
|
|
381
|
-
- Memory Optimized
|
|
382
|
-
- **Persistence Options**: Save cache state between sessions
|
|
383
|
-
- **Automatic Memory Management**: Monitors and optimizes memory usage
|
|
384
|
-
- **Extreme Dataset Optimizations**:
|
|
385
|
-
- Web Worker offloading
|
|
386
|
-
- IndexedDB integration
|
|
387
|
-
- Binary data format
|
|
388
|
-
- Streaming data loading
|
|
389
|
-
- WebAssembly acceleration
|
|
390
|
-
|
|
391
|
-
## Performance Characteristics
|
|
392
|
-
|
|
393
|
-
- **Dataset Size**: Efficiently handles 50M+ rows
|
|
394
|
-
- **Memory Usage**: Optimized for low memory footprint
|
|
395
|
-
- **Rendering Performance**: Maintains 60fps scrolling
|
|
396
|
-
- **Initial Load Time**: Fast initial loading with progressive enhancements
|
|
397
|
-
- **Server-Side Operations**: Optimized for REST/GraphQL pagination
|
|
398
|
-
|
|
399
|
-
## Usage
|
|
400
|
-
|
|
401
|
-
The system can be used via the `useInfiniteCache` hook:
|
|
402
|
-
|
|
403
|
-
```jsx
|
|
404
|
-
const { visibleData, getRows, setVisibleRange, refreshCache, analytics } =
|
|
405
|
-
useInfiniteCache(data, {
|
|
406
|
-
threshold: 1000,
|
|
407
|
-
blockSize: 100,
|
|
408
|
-
maxBlocksInCache: 10,
|
|
409
|
-
enableEnhancedWorker: true,
|
|
410
|
-
});
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
Perfect for:
|
|
414
|
-
|
|
415
|
-
- Data grids/tables
|
|
416
|
-
- Virtual lists
|
|
417
|
-
- Infinite scrolling feeds
|
|
418
|
-
- Paginated data displays
|
|
419
|
-
|
|
420
|
-
## Advanced Configuration
|
|
421
|
-
|
|
422
|
-
- **Block Size**: Configure memory/performance tradeoff
|
|
423
|
-
- **Cache Size**: Adjust total blocks kept in memory
|
|
424
|
-
- **Worker Options**: Enable/disable WebAssembly optimization
|
|
425
|
-
- **Storage Options**: Configure persistence and compression
|
|
426
|
-
- **Streaming Options**: Fine-tune loading behavior
|
|
427
|
-
- **IndexedDB Integration**: Offload memory pressure for extreme datasets
|
|
428
|
-
|
|
429
|
-
## Industry Compatibility
|
|
430
|
-
|
|
431
|
-
Implements the same caching architecture as AG Grid Enterprise (v27), ensuring familiar patterns and optimal performance for massive datasets.
|