@toolbox-web/grid 1.23.3 → 1.23.4
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.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +7 -0
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/plugin/base-plugin.d.ts +6 -0
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +1 -0
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +9 -2
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts +3 -3
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/types.d.ts +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/column-virtualization/types.d.ts +24 -2
- package/lib/plugins/column-virtualization/types.d.ts.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/types.d.ts +1 -1
- package/lib/plugins/export/ExportPlugin.d.ts +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/export/types.d.ts +9 -1
- package/lib/plugins/export/types.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/filtering/types.d.ts +158 -2
- package/lib/plugins/filtering/types.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/grouping-rows/types.d.ts +48 -3
- package/lib/plugins/grouping-rows/types.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/multi-sort/types.d.ts +40 -6
- package/lib/plugins/multi-sort/types.d.ts.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pinned-rows/types.d.ts +42 -4
- package/lib/plugins/pinned-rows/types.d.ts.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/pivot/types.d.ts +66 -1
- package/lib/plugins/pivot/types.d.ts.map +1 -1
- package/lib/plugins/print/PrintPlugin.d.ts +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/print/types.d.ts +9 -1
- package/lib/plugins/print/types.d.ts.map +1 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/reorder/types.d.ts +12 -1
- package/lib/plugins/reorder/types.d.ts.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +5 -5
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/server-side/types.d.ts +82 -0
- package/lib/plugins/server-side/types.d.ts.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/lib/plugins/visibility/types.d.ts +16 -2
- package/lib/plugins/visibility/types.d.ts.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.map +1 -1
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/print.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js.map +1 -1
|
@@ -1,12 +1,57 @@
|
|
|
1
1
|
import { ExpandCollapseAnimation } from '../../core/types';
|
|
2
2
|
export type { ExpandCollapseAnimation } from '../../core/types';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Built-in aggregation functions for pivot value fields.
|
|
5
|
+
*
|
|
6
|
+
* Each function is applied per-cell to aggregate the matching data rows into a single value:
|
|
7
|
+
*
|
|
8
|
+
* | Function | Result | Blank handling |
|
|
9
|
+
* |----------|--------|----------------|
|
|
10
|
+
* | `'sum'` | Numeric total of all values | Non-numeric values ignored |
|
|
11
|
+
* | `'avg'` | Arithmetic mean | Non-numeric values excluded from count |
|
|
12
|
+
* | `'count'` | Number of rows in the group | Counts all rows including blanks |
|
|
13
|
+
* | `'min'` | Smallest numeric value | Non-numeric values ignored |
|
|
14
|
+
* | `'max'` | Largest numeric value | Non-numeric values ignored |
|
|
15
|
+
* | `'first'` | Value from the first row in the group | May be `undefined` if group is empty |
|
|
16
|
+
* | `'last'` | Value from the last row in the group | May be `undefined` if group is empty |
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const valueFields: PivotValueField[] = [
|
|
21
|
+
* { field: 'revenue', aggFunc: 'sum', header: 'Total Revenue' },
|
|
22
|
+
* { field: 'revenue', aggFunc: 'avg', header: 'Avg Revenue' },
|
|
23
|
+
* { field: 'orders', aggFunc: 'count', header: '# Orders' },
|
|
24
|
+
* ];
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
4
27
|
export type AggFunc = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'first' | 'last';
|
|
28
|
+
/**
|
|
29
|
+
* Configuration for the pivot plugin.
|
|
30
|
+
*
|
|
31
|
+
* Pivot mode transforms flat row data into a cross-tabulation (pivot table)
|
|
32
|
+
* by grouping rows along one axis (`rowGroupFields`), spreading unique values
|
|
33
|
+
* of another field across columns (`columnGroupFields`), and computing
|
|
34
|
+
* aggregate values (`valueFields`) at each intersection.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* new PivotPlugin({
|
|
39
|
+
* rowGroupFields: ['department'],
|
|
40
|
+
* columnGroupFields: ['quarter'],
|
|
41
|
+
* valueFields: [{ field: 'revenue', aggFunc: 'sum' }],
|
|
42
|
+
* showTotals: true,
|
|
43
|
+
* showGrandTotal: true,
|
|
44
|
+
* })
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
5
47
|
export interface PivotConfig {
|
|
6
48
|
/** Whether pivot view is active on load (default: true when fields are configured) */
|
|
7
49
|
active?: boolean;
|
|
50
|
+
/** Fields to group rows by (vertical axis). Multiple fields create nested groups. */
|
|
8
51
|
rowGroupFields?: string[];
|
|
52
|
+
/** Fields whose unique values become column headers (horizontal axis). */
|
|
9
53
|
columnGroupFields?: string[];
|
|
54
|
+
/** Value fields to aggregate at each row/column intersection. */
|
|
10
55
|
valueFields?: PivotValueField[];
|
|
11
56
|
showTotals?: boolean;
|
|
12
57
|
showGrandTotal?: boolean;
|
|
@@ -25,9 +70,19 @@ export interface PivotConfig {
|
|
|
25
70
|
*/
|
|
26
71
|
animation?: ExpandCollapseAnimation;
|
|
27
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Defines a value field in the pivot table — which data field to aggregate
|
|
75
|
+
* and how to compute the aggregation.
|
|
76
|
+
*
|
|
77
|
+
* Multiple `PivotValueField` entries on the same `field` with different `aggFunc`
|
|
78
|
+
* values create separate columns (e.g. "Revenue (Sum)" and "Revenue (Avg)").
|
|
79
|
+
*/
|
|
28
80
|
export interface PivotValueField {
|
|
81
|
+
/** The row data field to aggregate (must exist on the source row objects). */
|
|
29
82
|
field: string;
|
|
83
|
+
/** Aggregation function to apply (see {@link AggFunc} for options). */
|
|
30
84
|
aggFunc: AggFunc;
|
|
85
|
+
/** Custom column header label. Defaults to `"field (aggFunc)"` if omitted. */
|
|
31
86
|
header?: string;
|
|
32
87
|
}
|
|
33
88
|
export interface PivotState {
|
|
@@ -35,10 +90,20 @@ export interface PivotState {
|
|
|
35
90
|
pivotResult: PivotResult | null;
|
|
36
91
|
expandedKeys: Set<string>;
|
|
37
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Computed result of the pivot transformation.
|
|
95
|
+
*
|
|
96
|
+
* Produced internally by the pivot engine after processing source rows
|
|
97
|
+
* through the configured `rowGroupFields`, `columnGroupFields`, and `valueFields`.
|
|
98
|
+
*/
|
|
38
99
|
export interface PivotResult {
|
|
100
|
+
/** Hierarchical pivot rows (group headers + leaf rows). */
|
|
39
101
|
rows: PivotRow[];
|
|
102
|
+
/** Unique column keys derived from `columnGroupFields` values. */
|
|
40
103
|
columnKeys: string[];
|
|
104
|
+
/** Per-column totals (keyed by column key). Present when `showTotals` is enabled. */
|
|
41
105
|
totals: Record<string, number>;
|
|
106
|
+
/** Grand total across all columns. Present when `showGrandTotal` is enabled. */
|
|
42
107
|
grandTotal: number;
|
|
43
108
|
}
|
|
44
109
|
export interface PivotRow {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pivot/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/pivot/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAA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