@contrail/data-grouping 1.0.43 → 1.0.44
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(
|
13
|
+
data.forEach(obj => {
|
14
14
|
if (!obj) {
|
15
15
|
return;
|
16
16
|
}
|
@@ -40,7 +40,7 @@ class DataGroupGenerator {
|
|
40
40
|
return;
|
41
41
|
}
|
42
42
|
}
|
43
|
-
if (propertyTypeOptions.isDate && value) {
|
43
|
+
if (propertyTypeOptions.isDate && value && value !== '(empty)') {
|
44
44
|
const date = new Date(value);
|
45
45
|
value = date.toISOString().split('T')[0];
|
46
46
|
key = value;
|
@@ -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(
|
52
|
+
value.forEach(arrayValue => {
|
53
53
|
map[arrayValue] = arrayValue;
|
54
54
|
if (!sortingArray.includes(arrayValue)) {
|
55
55
|
sortingArray.push(arrayValue);
|
@@ -115,10 +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
|
-
const options = ((_e = (_d = groupingProperty.propertyDefinition) === null || _d === void 0 ? void 0 : _d.options) === null || _e === void 0 ? void 0 : _e.map(
|
118
|
+
const options = ((_e = (_d = groupingProperty.propertyDefinition) === null || _d === void 0 ? void 0 : _d.options) === null || _e === void 0 ? void 0 : _e.map(x => x.value)) || null;
|
119
119
|
let distinctValues = this.getDistinctValues(data, rootIndex, slugIndex, rootAltIndex, slugAltIndex, groupMultiSelectInSeparateFrame, { sortOrder: sort, options }, propertyTypeOptions, displayItemsWithEmptyGroupingValues);
|
120
120
|
for (let val of distinctValues) {
|
121
|
-
const groupData = data.filter(
|
121
|
+
const groupData = data.filter(obj => {
|
122
122
|
const objVal = util_1.ObjectUtil.getBySlugs(obj, rootIndex, slugIndex) || util_1.ObjectUtil.getBySlugs(obj, rootAltIndex, slugAltIndex);
|
123
123
|
if (val === '(empty)') {
|
124
124
|
return !objVal;
|
package/package.json
CHANGED