@toolbox-web/grid 1.3.0 → 1.4.0
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/all.d.ts +1 -0
- package/all.d.ts.map +1 -1
- package/all.js +997 -710
- package/all.js.map +1 -1
- package/index.js +642 -599
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/header.d.ts +7 -0
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/types.d.ts +151 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +19 -16
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +42 -39
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +25 -22
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +53 -48
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +23 -20
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +186 -150
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +21 -18
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +67 -64
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +52 -49
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +18 -15
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +25 -22
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +26 -23
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +50 -47
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/PrintPlugin.d.ts +98 -0
- package/lib/plugins/print/PrintPlugin.d.ts.map +1 -0
- package/lib/plugins/print/index.d.ts +10 -0
- package/lib/plugins/print/index.d.ts.map +1 -0
- package/lib/plugins/print/index.js +626 -0
- package/lib/plugins/print/index.js.map +1 -0
- package/lib/plugins/print/print-isolated.d.ts +26 -0
- package/lib/plugins/print/print-isolated.d.ts.map +1 -0
- package/lib/plugins/print/types.d.ts +147 -0
- package/lib/plugins/print/types.d.ts.map +1 -0
- package/lib/plugins/reorder/index.js +25 -22
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +20 -17
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +39 -36
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +115 -101
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +35 -32
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +26 -23
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +23 -20
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +22 -19
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/public.d.ts +1 -1
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +98 -24
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +11 -11
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/print.umd.js +76 -0
- package/umd/plugins/print.umd.js.map +1 -0
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { BaseGridPlugin } from '../../core/plugin/base-plugin';
|
|
2
|
+
import { PrintConfig, PrintParams } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Print Plugin for tbw-grid
|
|
5
|
+
*
|
|
6
|
+
* Enables printing the full grid content by temporarily disabling virtualization
|
|
7
|
+
* and applying print-optimized styles. Handles large datasets gracefully with
|
|
8
|
+
* configurable row limits.
|
|
9
|
+
*
|
|
10
|
+
* ## Installation
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { PrintPlugin } from '@toolbox-web/grid/plugins/print';
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* ## Configuration Options
|
|
17
|
+
*
|
|
18
|
+
* | Option | Type | Default | Description |
|
|
19
|
+
* |--------|------|---------|-------------|
|
|
20
|
+
* | `button` | `boolean` | `false` | Show print button in toolbar |
|
|
21
|
+
* | `orientation` | `'portrait' \| 'landscape'` | `'landscape'` | Page orientation |
|
|
22
|
+
* | `warnThreshold` | `number` | `500` | Show confirmation dialog when rows exceed this (0 = no warning) |
|
|
23
|
+
* | `maxRows` | `number` | `0` | Hard limit on printed rows (0 = unlimited) |
|
|
24
|
+
* | `includeTitle` | `boolean` | `true` | Include grid title in print |
|
|
25
|
+
* | `includeTimestamp` | `boolean` | `true` | Include timestamp in footer |
|
|
26
|
+
* | `title` | `string` | `''` | Custom print title |
|
|
27
|
+
*
|
|
28
|
+
* ## Programmatic API
|
|
29
|
+
*
|
|
30
|
+
* | Method | Signature | Description |
|
|
31
|
+
* |--------|-----------|-------------|
|
|
32
|
+
* | `print` | `(params?) => Promise<void>` | Trigger print dialog |
|
|
33
|
+
* | `isPrinting` | `() => boolean` | Check if print is in progress |
|
|
34
|
+
*
|
|
35
|
+
* ## Events
|
|
36
|
+
*
|
|
37
|
+
* | Event | Detail | Description |
|
|
38
|
+
* |-------|--------|-------------|
|
|
39
|
+
* | `print-start` | `PrintStartDetail` | Fired when print begins |
|
|
40
|
+
* | `print-complete` | `PrintCompleteDetail` | Fired when print completes |
|
|
41
|
+
*
|
|
42
|
+
* @example Basic Print
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { PrintPlugin } from '@toolbox-web/grid/plugins/print';
|
|
45
|
+
*
|
|
46
|
+
* const grid = document.querySelector('tbw-grid');
|
|
47
|
+
* grid.gridConfig = {
|
|
48
|
+
* plugins: [new PrintPlugin()],
|
|
49
|
+
* };
|
|
50
|
+
*
|
|
51
|
+
* // Trigger print
|
|
52
|
+
* const printPlugin = grid.getPlugin(PrintPlugin);
|
|
53
|
+
* await printPlugin.print();
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @example With Toolbar Button
|
|
57
|
+
* ```ts
|
|
58
|
+
* grid.gridConfig = {
|
|
59
|
+
* plugins: [new PrintPlugin({ button: true, orientation: 'landscape' })],
|
|
60
|
+
* };
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @see {@link PrintConfig} for all configuration options
|
|
64
|
+
*/
|
|
65
|
+
export declare class PrintPlugin extends BaseGridPlugin<PrintConfig> {
|
|
66
|
+
#private;
|
|
67
|
+
/** @internal */
|
|
68
|
+
readonly name = "print";
|
|
69
|
+
/** @internal */
|
|
70
|
+
readonly version = "1.0.0";
|
|
71
|
+
/** CSS styles for print mode */
|
|
72
|
+
readonly styles: string;
|
|
73
|
+
/**
|
|
74
|
+
* Check if print is currently in progress
|
|
75
|
+
*/
|
|
76
|
+
isPrinting(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Trigger the browser print dialog
|
|
79
|
+
*
|
|
80
|
+
* This method:
|
|
81
|
+
* 1. Validates row count against maxRows limit
|
|
82
|
+
* 2. Disables virtualization to render all rows
|
|
83
|
+
* 3. Applies print-specific CSS classes
|
|
84
|
+
* 4. Opens the browser print dialog (or isolated window if `isolate: true`)
|
|
85
|
+
* 5. Restores normal state after printing
|
|
86
|
+
*
|
|
87
|
+
* @param params - Optional parameters to override config for this print
|
|
88
|
+
* @param params.isolate - If true, prints in an isolated window containing only the grid
|
|
89
|
+
* @returns Promise that resolves when print dialog closes
|
|
90
|
+
*/
|
|
91
|
+
print(params?: PrintParams): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Register toolbar button if configured
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
afterRender(): void;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=PrintPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrintPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/print/PrintPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,OAAO,KAAK,EAAuB,WAAW,EAAE,WAAW,EAAoB,MAAM,SAAS,CAAC;AAwB/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,qBAAa,WAAY,SAAQ,cAAc,CAAC,WAAW,CAAC;;IAC1D,gBAAgB;IAChB,QAAQ,CAAC,IAAI,WAAW;IAExB,gBAAgB;IAChB,SAAkB,OAAO,WAAW;IAEpC,gCAAgC;IAChC,SAAkB,MAAM,SAAU;IA8BlC;;OAEG;IACH,UAAU,IAAI,OAAO;IAIrB;;;;;;;;;;;;;OAaG;IACG,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAiShD;;;OAGG;IACM,WAAW,IAAI,IAAI;CA2C7B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Print Plugin Entry Point
|
|
3
|
+
* Re-exports plugin class and types for tree-shakeable imports.
|
|
4
|
+
*
|
|
5
|
+
* @module Plugins/Print
|
|
6
|
+
*/
|
|
7
|
+
export { printGridIsolated, type PrintIsolatedOptions } from './print-isolated';
|
|
8
|
+
export { PrintPlugin } from './PrintPlugin';
|
|
9
|
+
export type { PrintCompleteDetail, PrintConfig, PrintOrientation, PrintParams, PrintStartDetail } from './types';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/print/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|