@contrail/data-grouping 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
@@ -36,10 +36,10 @@ class DataGroupGenerator {
|
|
36
36
|
const group = {
|
37
37
|
data: [],
|
38
38
|
subGroups: [],
|
39
|
-
|
39
|
+
propertyValues: {},
|
40
40
|
name: ''
|
41
41
|
};
|
42
|
-
group.
|
42
|
+
group.propertyValues[groupingProperty.property.slug] = val;
|
43
43
|
const label = new types_1.PropertyValueFormatter().formatValueForProperty(val, groupingProperty.property);
|
44
44
|
group.name = label;
|
45
45
|
if (currentDepth === groupingProperties.length - 1) {
|
@@ -56,7 +56,7 @@ class DataGroupGenerator {
|
|
56
56
|
rootGroup: {
|
57
57
|
subGroups: [],
|
58
58
|
name: "root",
|
59
|
-
|
59
|
+
propertyValues: {},
|
60
60
|
data: [],
|
61
61
|
},
|
62
62
|
groupingProperties,
|
@@ -77,7 +77,7 @@ class DataGroupGenerator {
|
|
77
77
|
data: groupData,
|
78
78
|
subGroups: [],
|
79
79
|
name: parentGroup.name,
|
80
|
-
|
80
|
+
propertyValues: parentGroup.propertyValues,
|
81
81
|
};
|
82
82
|
groups.push(group);
|
83
83
|
}
|
package/lib/interfaces.d.ts
CHANGED
@@ -2,7 +2,10 @@ import { TypeProperty } from "@contrail/types";
|
|
2
2
|
export interface DataGroup {
|
3
3
|
subGroups: Array<DataGroup>;
|
4
4
|
name: string;
|
5
|
-
|
5
|
+
propertyValues: {
|
6
|
+
[key: string]: any;
|
7
|
+
};
|
8
|
+
aggregateValues?: {
|
6
9
|
[key: string]: any;
|
7
10
|
};
|
8
11
|
data: Array<any>;
|
@@ -11,6 +14,12 @@ export interface DataGroupStructure {
|
|
11
14
|
rootGroup: DataGroup;
|
12
15
|
depth: number;
|
13
16
|
groupingProperties: Array<DataGroupingProperty>;
|
17
|
+
aggregationProperties?: Array<DataGroupingProperty>;
|
18
|
+
sourceDataDefinition?: {
|
19
|
+
sourceDataReference: string;
|
20
|
+
filterDefinition?: any;
|
21
|
+
sortDefinition?: any;
|
22
|
+
};
|
14
23
|
}
|
15
24
|
export interface DataGroupingProperty {
|
16
25
|
property: TypeProperty;
|
package/package.json
CHANGED