@toolbox-web/grid 2.9.0 → 2.10.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.
Files changed (45) hide show
  1. package/all.js +2 -2
  2. package/all.js.map +1 -1
  3. package/index.js +1 -1
  4. package/index.js.map +1 -1
  5. package/lib/core/plugin/index.d.ts +1 -0
  6. package/lib/core/plugin/types.d.ts +61 -0
  7. package/lib/core/types.d.ts +54 -2
  8. package/lib/plugins/clipboard/index.js.map +1 -1
  9. package/lib/plugins/column-virtualization/index.js.map +1 -1
  10. package/lib/plugins/context-menu/index.js.map +1 -1
  11. package/lib/plugins/editing/index.js.map +1 -1
  12. package/lib/plugins/export/index.js +1 -1
  13. package/lib/plugins/export/index.js.map +1 -1
  14. package/lib/plugins/export/types.d.ts +35 -5
  15. package/lib/plugins/filtering/index.js.map +1 -1
  16. package/lib/plugins/grouping-columns/index.js +1 -1
  17. package/lib/plugins/grouping-columns/index.js.map +1 -1
  18. package/lib/plugins/grouping-rows/index.js.map +1 -1
  19. package/lib/plugins/master-detail/index.js.map +1 -1
  20. package/lib/plugins/multi-sort/index.js.map +1 -1
  21. package/lib/plugins/pinned-columns/index.js.map +1 -1
  22. package/lib/plugins/pinned-rows/index.js.map +1 -1
  23. package/lib/plugins/pivot/index.js.map +1 -1
  24. package/lib/plugins/print/index.js.map +1 -1
  25. package/lib/plugins/reorder-columns/index.js.map +1 -1
  26. package/lib/plugins/reorder-rows/index.js.map +1 -1
  27. package/lib/plugins/responsive/index.js.map +1 -1
  28. package/lib/plugins/row-drag-drop/index.js.map +1 -1
  29. package/lib/plugins/selection/index.js.map +1 -1
  30. package/lib/plugins/server-side/index.js.map +1 -1
  31. package/lib/plugins/sticky-rows/index.js.map +1 -1
  32. package/lib/plugins/tooltip/index.js.map +1 -1
  33. package/lib/plugins/tree/index.js.map +1 -1
  34. package/lib/plugins/undo-redo/index.js.map +1 -1
  35. package/lib/plugins/visibility/index.js.map +1 -1
  36. package/package.json +1 -1
  37. package/public.d.ts +1 -1
  38. package/umd/grid.all.umd.js +1 -1
  39. package/umd/grid.all.umd.js.map +1 -1
  40. package/umd/grid.umd.js +1 -1
  41. package/umd/grid.umd.js.map +1 -1
  42. package/umd/plugins/export.umd.js +1 -1
  43. package/umd/plugins/export.umd.js.map +1 -1
  44. package/umd/plugins/grouping-columns.umd.js +1 -1
  45. package/umd/plugins/grouping-columns.umd.js.map +1 -1
@@ -1,8 +1,4 @@
1
- /**
2
- * Export Plugin Types
3
- *
4
- * Type definitions for the data export feature.
5
- */
1
+ import { HeaderRowCell, HeaderRowContribution } from '../../core/plugin/types';
6
2
  /**
7
3
  * Supported export file formats.
8
4
  *
@@ -76,6 +72,20 @@ export interface ExportParams {
76
72
  processCell?: (value: any, field: string, row: any) => any;
77
73
  /** Custom header processor */
78
74
  processHeader?: (header: string, field: string) => string;
75
+ /**
76
+ * Custom processor for cells in **plugin-contributed header rows** (e.g. the
77
+ * column-group header row above the leaf headers). Runs once per cell.
78
+ *
79
+ * Return `null` to blank a cell (its `span` is preserved so neighbours stay
80
+ * aligned). If **every** cell in a row is blank after processing, the
81
+ * entire row is dropped from the output. Return the same `cell` unchanged
82
+ * to keep it as-is.
83
+ *
84
+ * @param cell - The contributed cell (`label`, `span`, optional `source`).
85
+ * @param rowIndex - 0-based index of the contributed row (top-down).
86
+ * @since 2.10.0
87
+ */
88
+ processHeaderRow?: (cell: HeaderRowCell, rowIndex: number) => HeaderRowCell | null;
79
89
  /**
80
90
  * Controls how cell values are produced. See {@link ExportMode}.
81
91
  *
@@ -86,6 +96,17 @@ export interface ExportParams {
86
96
  mode?: ExportMode;
87
97
  /** Excel style configuration (only applies to Excel export) */
88
98
  excelStyles?: ExcelStyleConfig;
99
+ /**
100
+ * Plugin-contributed extra header rows that sit **above** the leaf header
101
+ * row. Normally populated automatically from the `'collectHeaderRows'`
102
+ * broadcast in `ExportPlugin.export*()`; you only set it manually when
103
+ * calling the pure formatters ({@link ExportPlugin.formatCsv} /
104
+ * {@link ExportPlugin.formatExcel}) with pre-built row data.
105
+ *
106
+ * Ignored when `includeHeaders` is `false`.
107
+ * @since 2.10.0
108
+ */
109
+ headerRows?: HeaderRowContribution[];
89
110
  }
90
111
  /**
91
112
  * Configuration for styled Excel export.
@@ -97,6 +118,15 @@ export interface ExportParams {
97
118
  export interface ExcelStyleConfig {
98
119
  /** Style applied to all header cells */
99
120
  headerStyle?: ExcelCellStyle;
121
+ /**
122
+ * Style applied to cells in **plugin-contributed header rows** (e.g. the
123
+ * column-group header row). Falls back to `headerStyle` when omitted.
124
+ *
125
+ * Use this to visually distinguish group/super headers from leaf headers
126
+ * (e.g. heavier weight, larger font, accent fill).
127
+ * @since 2.10.0
128
+ */
129
+ groupHeaderStyle?: ExcelCellStyle;
100
130
  /** Default style for all data cells */
101
131
  defaultStyle?: ExcelCellStyle;
102
132
  /** Per-column style overrides (keyed by field name) */