@contrail/data-grouping 1.0.44 → 1.0.45

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.
@@ -40,7 +40,7 @@ class DataGroupGenerator {
40
40
  return;
41
41
  }
42
42
  }
43
- if (propertyTypeOptions.isDate && value && value !== '(empty)') {
43
+ if (propertyTypeOptions.isDate && value) {
44
44
  const date = new Date(value);
45
45
  value = date.toISOString().split('T')[0];
46
46
  key = value;
@@ -103,19 +103,20 @@ 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;
106
+ var _a, _b, _c, _d, _e, _f, _g;
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',
110
- isNumber: !!((_b = groupingProperty === null || groupingProperty === void 0 ? void 0 : groupingProperty.propertyDefinition) === null || _b === void 0 ? void 0 : _b.numberFormat) ||
111
- ((_c = groupingProperty === null || groupingProperty === void 0 ? void 0 : groupingProperty.propertyDefinition) === null || _c === void 0 ? void 0 : _c.propertyType) === 'sequence',
110
+ isNumber: !!((_c = (_b = groupingProperty === null || groupingProperty === void 0 ? void 0 : groupingProperty.propertyDefinition) === null || _b === void 0 ? void 0 : _b.numberFormat) === null || _c === void 0 ? void 0 : _c.format) ||
111
+ ((_d = groupingProperty === null || groupingProperty === void 0 ? void 0 : groupingProperty.propertyDefinition) === null || _d === void 0 ? void 0 : _d.propertyType) === 'sequence',
112
112
  };
113
113
  const rootIndex = groupingProperty.typeRootSlug;
114
114
  const slugIndex = groupingProperty.propertyDefinition.slug;
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(x => x.value)) || null;
118
+ console.log('OPTS PROP', (_e = groupingProperty.propertyDefinition) === null || _e === void 0 ? void 0 : _e.options);
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;
119
120
  let distinctValues = this.getDistinctValues(data, rootIndex, slugIndex, rootAltIndex, slugAltIndex, groupMultiSelectInSeparateFrame, { sortOrder: sort, options }, propertyTypeOptions, displayItemsWithEmptyGroupingValues);
120
121
  for (let val of distinctValues) {
121
122
  const groupData = data.filter(obj => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/data-grouping",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "Utilities and interfaces for grouping data into hierarchial data structures based on properties.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -39,6 +39,6 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@contrail/documents": "^1.0.38",
42
- "@contrail/types": "^3.0.83"
42
+ "@contrail/types": "^3.0.95"
43
43
  }
44
44
  }