@smallwebco/tinypivot-react 1.0.0 → 1.0.9
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 +96 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @smallwebco/tinypivot-react
|
|
2
|
+
|
|
3
|
+
A powerful Excel-like data grid and pivot table component for React.
|
|
4
|
+
|
|
5
|
+
**[Live Demo](https://tiny-pivot.com)** · **[Buy License](https://tiny-pivot.com/#pricing)**
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @smallwebco/tinypivot-react
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { DataGrid } from '@smallwebco/tinypivot-react'
|
|
17
|
+
import '@smallwebco/tinypivot-react/style.css'
|
|
18
|
+
|
|
19
|
+
const data = [
|
|
20
|
+
{ id: 1, region: 'North', product: 'Widget A', sales: 12500, units: 150 },
|
|
21
|
+
{ id: 2, region: 'North', product: 'Widget B', sales: 8300, units: 95 },
|
|
22
|
+
{ id: 3, region: 'South', product: 'Widget A', sales: 15200, units: 180 },
|
|
23
|
+
{ id: 4, region: 'South', product: 'Widget B', sales: 9800, units: 110 },
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
export default function App() {
|
|
27
|
+
return (
|
|
28
|
+
<DataGrid
|
|
29
|
+
data={data}
|
|
30
|
+
enableExport={true}
|
|
31
|
+
enableSearch={true}
|
|
32
|
+
enablePagination={true}
|
|
33
|
+
pageSize={100}
|
|
34
|
+
theme="light"
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
| Feature | Free | Pro |
|
|
43
|
+
|---------|:----:|:---:|
|
|
44
|
+
| Excel-like data grid | ✅ | ✅ |
|
|
45
|
+
| Column filtering & sorting | ✅ | ✅ |
|
|
46
|
+
| Global search | ✅ | ✅ |
|
|
47
|
+
| CSV export | ✅ | ✅ |
|
|
48
|
+
| Pagination | ✅ | ✅ |
|
|
49
|
+
| Column resizing | ✅ | ✅ |
|
|
50
|
+
| Clipboard (Ctrl+C) | ✅ | ✅ |
|
|
51
|
+
| Dark mode | ✅ | ✅ |
|
|
52
|
+
| Pivot table | ❌ | ✅ |
|
|
53
|
+
| Aggregations (Sum, Avg, etc.) | ❌ | ✅ |
|
|
54
|
+
| Row/column totals | ❌ | ✅ |
|
|
55
|
+
| No watermark | ❌ | ✅ |
|
|
56
|
+
|
|
57
|
+
## Props
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Default | Description |
|
|
60
|
+
|------|------|---------|-------------|
|
|
61
|
+
| `data` | `Record<string, unknown>[]` | **required** | Array of data objects |
|
|
62
|
+
| `loading` | `boolean` | `false` | Show loading spinner |
|
|
63
|
+
| `fontSize` | `'xs' \| 'sm' \| 'base'` | `'xs'` | Font size preset |
|
|
64
|
+
| `showPivot` | `boolean` | `true` | Show pivot toggle (Pro) |
|
|
65
|
+
| `enableExport` | `boolean` | `true` | Show CSV export button |
|
|
66
|
+
| `enableSearch` | `boolean` | `true` | Show global search |
|
|
67
|
+
| `enablePagination` | `boolean` | `false` | Enable pagination |
|
|
68
|
+
| `pageSize` | `number` | `50` | Rows per page |
|
|
69
|
+
| `enableColumnResize` | `boolean` | `true` | Drag to resize columns |
|
|
70
|
+
| `enableClipboard` | `boolean` | `true` | Ctrl+C to copy cells |
|
|
71
|
+
| `theme` | `'light' \| 'dark' \| 'auto'` | `'light'` | Color theme |
|
|
72
|
+
|
|
73
|
+
## Callbacks
|
|
74
|
+
|
|
75
|
+
| Prop | Type | Description |
|
|
76
|
+
|------|------|-------------|
|
|
77
|
+
| `onCellClick` | `(payload) => void` | Cell clicked |
|
|
78
|
+
| `onSelectionChange` | `(payload) => void` | Selection changed |
|
|
79
|
+
| `onExport` | `(payload) => void` | CSV exported |
|
|
80
|
+
| `onCopy` | `(payload) => void` | Cells copied |
|
|
81
|
+
|
|
82
|
+
## Documentation
|
|
83
|
+
|
|
84
|
+
See the [full documentation](https://github.com/Small-Web-Co/tinypivot) for complete API reference, styling, and Pro license activation.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
- **Free Tier**: MIT License for basic grid features
|
|
89
|
+
- **Pro Features**: Commercial license required
|
|
90
|
+
|
|
91
|
+
**[Purchase at tiny-pivot.com/#pricing](https://tiny-pivot.com/#pricing)**
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
Built with ❤️ by [Small Web, LLC](https://thesmallweb.co)
|
|
96
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smallwebco/tinypivot-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "TinyPivot React - Excel-like data grid and pivot table components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@tanstack/react-table": "^8.20.0",
|
|
29
|
-
"@smallwebco/tinypivot-core": "1.0.
|
|
29
|
+
"@smallwebco/tinypivot-core": "1.0.9"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "^18.2.0",
|