@cellaware/utils 8.11.18 → 8.11.20
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/dist/chatwms/datagrid.js +5 -4
- package/package.json +1 -1
package/dist/chatwms/datagrid.js
CHANGED
|
@@ -674,8 +674,9 @@ function pivotData(data, rowGroupCols, pivotCols, valueCols) {
|
|
|
674
674
|
const grouped = new Map();
|
|
675
675
|
for (const row of data) {
|
|
676
676
|
const groupKey = JSON.stringify(groupBy(row));
|
|
677
|
-
if (!grouped.has(groupKey))
|
|
677
|
+
if (!grouped.has(groupKey)) {
|
|
678
678
|
grouped.set(groupKey, []);
|
|
679
|
+
}
|
|
679
680
|
grouped.get(groupKey).push(row);
|
|
680
681
|
}
|
|
681
682
|
const rows = [];
|
|
@@ -692,7 +693,7 @@ function pivotData(data, rowGroupCols, pivotCols, valueCols) {
|
|
|
692
693
|
}
|
|
693
694
|
for (const [pivotKey, rows] of pivotBuckets.entries()) {
|
|
694
695
|
for (const { field, aggFunc } of valueCols) {
|
|
695
|
-
const values = rows.map(r => r[field]
|
|
696
|
+
const values = rows.map(r => r[field] ?? 0);
|
|
696
697
|
const key = `${pivotKey} ${field}`;
|
|
697
698
|
let columnNames = mappedColumnNames.get(field);
|
|
698
699
|
if (!!columnNames) {
|
|
@@ -1306,7 +1307,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1306
1307
|
let htmlTransposeColumnStyles = [];
|
|
1307
1308
|
let teamsRowStyles = [];
|
|
1308
1309
|
let teamsColumnStyles = [];
|
|
1309
|
-
// Important: anchoring to
|
|
1310
|
+
// Important: anchoring to ColumnState will ensure we add columns in the correct sequence.
|
|
1310
1311
|
visibleColumnState.forEach(column => {
|
|
1311
1312
|
const columnFormat = columnFormats.find(columnFormat => columnFormat.name === column.colId);
|
|
1312
1313
|
if (!!columnFormat) {
|
|
@@ -1397,7 +1398,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1397
1398
|
let htmlTransposeColumnStyles = [];
|
|
1398
1399
|
let teamsRowStyles = [];
|
|
1399
1400
|
let teamsColumnStyles = [];
|
|
1400
|
-
// Important: anchoring to
|
|
1401
|
+
// Important: anchoring to ColumnState will ensure we add columns in the correct sequence.
|
|
1401
1402
|
visibleColumnState.forEach(column => {
|
|
1402
1403
|
const columnFormat = columnFormats.find(columnFormat => columnFormat.name === column.colId);
|
|
1403
1404
|
if (!!columnFormat) {
|