gm-datagrid 0.1.22 → 0.1.23
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 +31 -9
- package/dist/features/useAggregation.d.ts +21 -13
- package/dist/gm-datagrid.js +1663 -1593
- package/dist/gm-datagrid.umd.cjs +17 -17
- package/dist/types/index.d.ts +11 -7
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -29,20 +29,24 @@ export type ExportFormat = 'xlsx' | 'csv' | 'txt' | 'json';
|
|
|
29
29
|
/**
|
|
30
30
|
* Built-in aggregation functions — mirrors MUI DataGrid Premium's built-in set.
|
|
31
31
|
* - `sum` — total of all numeric values
|
|
32
|
-
* - `avg`
|
|
33
|
-
* - `min`
|
|
34
|
-
* - `max`
|
|
35
|
-
* - `size`
|
|
32
|
+
* - `avg` — arithmetic mean of non-null values
|
|
33
|
+
* - `min` — smallest value (numeric or lexicographic for strings/dates)
|
|
34
|
+
* - `max` — largest value (numeric or lexicographic for strings/dates)
|
|
35
|
+
* - `size` — legacy alias for `count`
|
|
36
|
+
* - `count` — count of non-null cells
|
|
37
|
+
* - `count-distinct`— count of unique non-null values
|
|
38
|
+
* - `count-true` — count of truthy values (boolean columns)
|
|
39
|
+
* - `count-false` — count of falsy (but non-null) values (boolean columns)
|
|
36
40
|
*/
|
|
37
|
-
export type AggregationFunction = 'sum' | 'avg' | 'min' | 'max' | 'size';
|
|
41
|
+
export type AggregationFunction = 'sum' | 'avg' | 'min' | 'max' | 'size' | 'count' | 'count-distinct' | 'count-true' | 'count-false';
|
|
38
42
|
/**
|
|
39
43
|
* Aggregation model — keys are column `field` names, values are function names.
|
|
40
44
|
* Compatible with MUI DataGrid Premium `aggregationModel` prop.
|
|
41
45
|
* @example { gross: 'sum', year: 'max' }
|
|
42
46
|
*/
|
|
43
47
|
export type AggregationModel = Record<string, AggregationFunction>;
|
|
44
|
-
/** Computed aggregation results — keys are column `field` names, values are the aggregated
|
|
45
|
-
export type AggregationResults = Record<string, number | null>;
|
|
48
|
+
/** Computed aggregation results — keys are column `field` names, values are the aggregated result (number or string). */
|
|
49
|
+
export type AggregationResults = Record<string, number | string | null>;
|
|
46
50
|
export interface StatusMapEntry {
|
|
47
51
|
label: string;
|
|
48
52
|
color: MuiChipColor;
|
package/package.json
CHANGED