@lumeer/pivot 0.0.8 → 0.0.10
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/esm2022/lib/lmr-pivot-table.component.mjs +2 -2
- package/esm2022/lib/util/pivot-table-converter.mjs +32 -30
- package/fesm2022/lumeer-pivot.mjs +32 -30
- package/fesm2022/lumeer-pivot.mjs.map +1 -1
- package/lib/lmr-pivot-table.component.d.ts +1 -1
- package/lumeer-pivot-0.0.10.tgz +0 -0
- package/package.json +1 -1
- package/lumeer-pivot-0.0.8.tgz +0 -0
|
@@ -1133,37 +1133,39 @@ class PivotTableConverter {
|
|
|
1133
1133
|
const columnsCount = cells[0]?.length || 0;
|
|
1134
1134
|
for (let i = 0; i < rowGroupsInfo.length; i++) {
|
|
1135
1135
|
const rowGroupInfo = rowGroupsInfo[i];
|
|
1136
|
-
if (rowGroupInfo) {
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
colSpan: 1,
|
|
1159
|
-
rowSpan: 1,
|
|
1160
|
-
cssClass: PivotTableConverter.groupDataClass,
|
|
1161
|
-
isValue: true,
|
|
1162
|
-
};
|
|
1163
|
-
}
|
|
1136
|
+
if (!rowGroupInfo) {
|
|
1137
|
+
continue;
|
|
1138
|
+
}
|
|
1139
|
+
for (let j = 0; j < columnGroupsInfo.length; j++) {
|
|
1140
|
+
if (!columnGroupsInfo[j]) {
|
|
1141
|
+
continue;
|
|
1142
|
+
}
|
|
1143
|
+
const columns = columnGroupsInfo[j].indexes;
|
|
1144
|
+
const { rowsIndexes, columnsIndexes } = this.getValuesIndexesFromCellsIndexes(rowGroupInfo.indexes, columns);
|
|
1145
|
+
let formattedValue;
|
|
1146
|
+
let dataResources;
|
|
1147
|
+
if (rowGroupInfo.expression) {
|
|
1148
|
+
const result = this.evaluateExpression(rowGroupInfo.expression, columnsIndexes);
|
|
1149
|
+
const valueIndex = columnsIndexes[0] % this.data.valueTitles.length;
|
|
1150
|
+
formattedValue = this.formatValueByConstraint(result.value, valueIndex);
|
|
1151
|
+
dataResources = result.dataResources;
|
|
1152
|
+
}
|
|
1153
|
+
else {
|
|
1154
|
+
// it's enough to fill group values only from row side
|
|
1155
|
+
const result = this.getGroupedValuesForRowsAndCols(rowsIndexes, columnsIndexes);
|
|
1156
|
+
formattedValue = this.aggregateAndFormatDataValues(result.values, rowsIndexes, columnsIndexes);
|
|
1157
|
+
dataResources = result.dataResources;
|
|
1164
1158
|
}
|
|
1165
|
-
|
|
1159
|
+
cells[i][j] = {
|
|
1160
|
+
value: String(formattedValue),
|
|
1161
|
+
dataResources,
|
|
1162
|
+
colSpan: 1,
|
|
1163
|
+
rowSpan: 1,
|
|
1164
|
+
cssClass: PivotTableConverter.groupDataClass,
|
|
1165
|
+
isValue: true,
|
|
1166
|
+
};
|
|
1166
1167
|
}
|
|
1168
|
+
this.fillRowWithColor(cells, i, rowGroupInfo, columnsCount);
|
|
1167
1169
|
}
|
|
1168
1170
|
for (let j = 0; j < columnGroupsInfo.length; j++) {
|
|
1169
1171
|
if (columnGroupsInfo[j]) {
|
|
@@ -2032,7 +2034,7 @@ class LmrPivotTableComponent {
|
|
|
2032
2034
|
pivotTransformer = new PivotDataConverter();
|
|
2033
2035
|
pivotTableConverter = new PivotTableConverter();
|
|
2034
2036
|
stickyColumnWidth = 150;
|
|
2035
|
-
stickyColumnHeight =
|
|
2037
|
+
stickyColumnHeight = 40;
|
|
2036
2038
|
dataSubject$ = new BehaviorSubject(null);
|
|
2037
2039
|
currentTables;
|
|
2038
2040
|
pivotData$;
|