@opencorestack/opengridx 1.1.0 → 1.2.1
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/CHANGELOG.md +29 -0
- package/dist/index.d.ts +60 -0
- package/dist/opengridx.es.js +2126 -2003
- package/dist/opengridx.es.js.map +1 -1
- package/dist/opengridx.umd.js +11 -11
- package/dist/opengridx.umd.js.map +1 -1
- package/docs/API_REFERENCE.md +50 -0
- package/docs/features/pdf-export.md +110 -0
- package/lib/components/Cell/Cell.tsx +5 -3
- package/lib/components/Cell/CellErrorBoundary.tsx +2 -2
- package/lib/index.ts +3 -1
- package/lib/types/index.ts +69 -0
- package/lib/utils/export/exportToPdf.test.ts +121 -0
- package/lib/utils/export/exportToPdf.ts +277 -0
- package/lib/utils/export/index.ts +3 -0
- package/lib/utils/export/pdf-types.d.ts +19 -0
- package/package.json +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [1.2.1] — 2026-09-07
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- `CellErrorBoundary` now accepts a `renderFn: () => React.ReactNode` prop and calls it
|
|
12
|
+
inside its own `render()`, so React correctly catches thrown errors from `renderCell`.
|
|
13
|
+
Previously the call happened in the parent's render phase — before the boundary — causing
|
|
14
|
+
the entire app to crash instead of showing a per-cell error indicator.
|
|
15
|
+
- `exportToPdf` double-cast through `unknown` to satisfy the installed `jspdf` TypeScript
|
|
16
|
+
types (the library's class does not expose `autoTable`/`lastAutoTable` in its official
|
|
17
|
+
type definitions).
|
|
18
|
+
- Added `jspdf` and `jspdf-autotable` to `devDependencies` so local development and demo
|
|
19
|
+
builds work without a manual `npm install`.
|
|
20
|
+
- Deploy workflow now copies `index.html` → `404.html` so GitHub Pages serves the SPA for
|
|
21
|
+
direct URL access to any demo route.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## [1.2.0] — 2026-09-03
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- `exportToPdf(rows, columns, options?)` — generate a styled PDF report from grid data.
|
|
29
|
+
Optional peer deps required: `npm install jspdf jspdf-autotable`.
|
|
30
|
+
Features: optional branded header (logo, title, filter summary, row count), multi-page
|
|
31
|
+
data table with repeating column headers, alternating row shading, aggregation footer row.
|
|
32
|
+
See `docs/features/pdf-export.md`.
|
|
33
|
+
- New exported type: `PdfExportOptions`
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
8
37
|
## [1.1.0] — 2026-09-02
|
|
9
38
|
|
|
10
39
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -368,6 +368,8 @@ export declare function exportToExcelAdvanced<R extends GridRowModel>(rows: R[],
|
|
|
368
368
|
*/
|
|
369
369
|
export declare function exportToJson<R extends GridRowModel>(rows: R[], columns: GridColDef<R>[], options?: JsonExportOptions): void;
|
|
370
370
|
|
|
371
|
+
export declare function exportToPdf<R extends GridRowModel>(rows: R[], columns: GridColDef<R>[], options?: PdfExportOptions): Promise<void>;
|
|
372
|
+
|
|
371
373
|
export declare const FilterPanel: default_2.FC<FilterPanelProps>;
|
|
372
374
|
|
|
373
375
|
declare interface FilterPanelProps {
|
|
@@ -1172,6 +1174,64 @@ export declare interface JsonExportOptions {
|
|
|
1172
1174
|
aggregationModel?: GridAggregationModel | null;
|
|
1173
1175
|
}
|
|
1174
1176
|
|
|
1177
|
+
/**
|
|
1178
|
+
* Configuration options for exporting the DataGrid to PDF format.
|
|
1179
|
+
* Requires jspdf and jspdf-autotable peer dependencies.
|
|
1180
|
+
*/
|
|
1181
|
+
export declare interface PdfExportOptions {
|
|
1182
|
+
/**
|
|
1183
|
+
* Output filename without extension. Default: 'export'
|
|
1184
|
+
*/
|
|
1185
|
+
fileName?: string;
|
|
1186
|
+
/**
|
|
1187
|
+
* Title text displayed in the document header.
|
|
1188
|
+
* When omitted, no header block is rendered.
|
|
1189
|
+
*/
|
|
1190
|
+
title?: string;
|
|
1191
|
+
/**
|
|
1192
|
+
* URL or data URI of a logo image rendered left of the title.
|
|
1193
|
+
* Only used when `title` is also set. Default: none
|
|
1194
|
+
*/
|
|
1195
|
+
logoUrl?: string;
|
|
1196
|
+
/**
|
|
1197
|
+
* Page orientation. Default: 'landscape'
|
|
1198
|
+
*/
|
|
1199
|
+
orientation?: 'portrait' | 'landscape';
|
|
1200
|
+
/**
|
|
1201
|
+
* If provided, only rows whose id is in this array are exported.
|
|
1202
|
+
*/
|
|
1203
|
+
selectedRows?: (string | number)[];
|
|
1204
|
+
/**
|
|
1205
|
+
* Aggregation result from apiRef.current.getAggregationResult().
|
|
1206
|
+
* When provided alongside aggregationModel, appends a footer row.
|
|
1207
|
+
*/
|
|
1208
|
+
aggregationResult?: Record<string, unknown> | null;
|
|
1209
|
+
/**
|
|
1210
|
+
* Aggregation model from apiRef.current.getAggregationModel().
|
|
1211
|
+
*/
|
|
1212
|
+
aggregationModel?: GridAggregationModel | null;
|
|
1213
|
+
/**
|
|
1214
|
+
* Active filter model. When provided, a filter summary is shown in the header.
|
|
1215
|
+
*/
|
|
1216
|
+
filterModel?: GridFilterModel | null;
|
|
1217
|
+
/**
|
|
1218
|
+
* Whether to apply alternating row shading. Default: true
|
|
1219
|
+
*/
|
|
1220
|
+
alternateRowColor?: boolean;
|
|
1221
|
+
/**
|
|
1222
|
+
* Column header background color (hex). Default: '#4f46e5'
|
|
1223
|
+
*/
|
|
1224
|
+
headerBackgroundColor?: string;
|
|
1225
|
+
/**
|
|
1226
|
+
* Column header text color (hex). Default: '#ffffff'
|
|
1227
|
+
*/
|
|
1228
|
+
headerTextColor?: string;
|
|
1229
|
+
/**
|
|
1230
|
+
* Base font size in points for table body. Default: 9
|
|
1231
|
+
*/
|
|
1232
|
+
fontSize?: number;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1175
1235
|
/**
|
|
1176
1236
|
* Open print dialog with formatted table
|
|
1177
1237
|
*/
|