@contrail/data-grouping 1.0.45 → 1.0.46
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.
@@ -10,7 +10,7 @@ class DataGroupGenerator {
|
|
10
10
|
const map = new Map();
|
11
11
|
const sortingArray = [];
|
12
12
|
let hasEmptyValues = false;
|
13
|
-
data.forEach(obj => {
|
13
|
+
data.forEach((obj) => {
|
14
14
|
if (!obj) {
|
15
15
|
return;
|
16
16
|
}
|
@@ -49,7 +49,7 @@ class DataGroupGenerator {
|
|
49
49
|
key = value.id || value.name || value;
|
50
50
|
}
|
51
51
|
if (Array.isArray(value) && !groupMultiSelectInSeparateFrame) {
|
52
|
-
value.forEach(arrayValue => {
|
52
|
+
value.forEach((arrayValue) => {
|
53
53
|
map[arrayValue] = arrayValue;
|
54
54
|
if (!sortingArray.includes(arrayValue)) {
|
55
55
|
sortingArray.push(arrayValue);
|
@@ -103,7 +103,7 @@ class DataGroupGenerator {
|
|
103
103
|
return distinctValues;
|
104
104
|
}
|
105
105
|
static buildChildDataGroups(data, parentGroup, groupingProperties, leafNodeDataCount, currentDepth, groupMultiSelectInSeparateFrame = false, displayItemsWithEmptyGroupingValues = false) {
|
106
|
-
var _a, _b, _c, _d, _e, _f
|
106
|
+
var _a, _b, _c, _d, _e, _f;
|
107
107
|
const groupingProperty = groupingProperties[currentDepth];
|
108
108
|
const propertyTypeOptions = {
|
109
109
|
isDate: ((_a = groupingProperty === null || groupingProperty === void 0 ? void 0 : groupingProperty.propertyDefinition) === null || _a === void 0 ? void 0 : _a.propertyType) === 'date',
|
@@ -115,11 +115,10 @@ class DataGroupGenerator {
|
|
115
115
|
const rootAltIndex = util_1.StringUtil.convertToCamelCase(groupingProperty.typeRootSlug);
|
116
116
|
const slugAltIndex = groupingProperty.propertyDefinition.slug;
|
117
117
|
const sort = groupingProperty.sort || types_1.TypePropertySortOrder.ASCENDING;
|
118
|
-
|
119
|
-
const options = ((_g = (_f = groupingProperty.propertyDefinition) === null || _f === void 0 ? void 0 : _f.options) === null || _g === void 0 ? void 0 : _g.map(x => x.value)) || null;
|
118
|
+
const options = ((_f = (_e = groupingProperty.propertyDefinition) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.map((x) => x.value)) || null;
|
120
119
|
let distinctValues = this.getDistinctValues(data, rootIndex, slugIndex, rootAltIndex, slugAltIndex, groupMultiSelectInSeparateFrame, { sortOrder: sort, options }, propertyTypeOptions, displayItemsWithEmptyGroupingValues);
|
121
120
|
for (let val of distinctValues) {
|
122
|
-
const groupData = data.filter(obj => {
|
121
|
+
const groupData = data.filter((obj) => {
|
123
122
|
const objVal = util_1.ObjectUtil.getBySlugs(obj, rootIndex, slugIndex) || util_1.ObjectUtil.getBySlugs(obj, rootAltIndex, slugAltIndex);
|
124
123
|
if (val === '(empty)') {
|
125
124
|
return !objVal;
|
package/package.json
CHANGED