@cellaware/utils 8.11.14 → 8.11.15
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 +20 -14
- package/package.json +1 -1
package/dist/chatwms/datagrid.js
CHANGED
|
@@ -1250,6 +1250,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1250
1250
|
rows = sortModel.length > 0 ? sortRows(rows, sortModel) : rows;
|
|
1251
1251
|
let mappedDisplayColumnNames = new Map();
|
|
1252
1252
|
// Should not need to do hidden/visible column analysis -- pivoting creates new results with only the necessary columns.
|
|
1253
|
+
// Also should not need to analyze column sequence -- our newly created results *should* respect the correct sequence.
|
|
1253
1254
|
let rowIdx = 0;
|
|
1254
1255
|
rows.forEach(row => {
|
|
1255
1256
|
let chartRow = {};
|
|
@@ -1339,6 +1340,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1339
1340
|
rows = groupAndAggregate(rows, rowGroupCols, [], valueCols);
|
|
1340
1341
|
}
|
|
1341
1342
|
rows = sortModel.length > 0 ? sortRows(rows, sortModel) : rows;
|
|
1343
|
+
const visibleColumnState = columnState.filter(column => !column.hide);
|
|
1342
1344
|
const hiddenColumnNames = columnState.filter(column => !!column.hide && !column.rowGroup).map(column => column.colId) ?? [];
|
|
1343
1345
|
const visibleColumnFormats = columnFormats.filter(column => !hiddenColumnNames.includes(column.name)) ?? [];
|
|
1344
1346
|
let rowIdx = 0;
|
|
@@ -1353,20 +1355,24 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1353
1355
|
hiddenColumnNames.forEach(columnName => {
|
|
1354
1356
|
delete row[columnName];
|
|
1355
1357
|
});
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1358
|
+
// Important: anchoring to column state will ensure we add columns in the correct sequence.
|
|
1359
|
+
visibleColumnState.forEach(column => {
|
|
1360
|
+
const columnFormat = visibleColumnFormats.find(columnFormat => columnFormat.name === column.colId);
|
|
1361
|
+
if (!!columnFormat) {
|
|
1362
|
+
const value = row[columnFormat.name];
|
|
1363
|
+
const formattedValue = evaluateValueFormat(columnFormat, value, locale);
|
|
1364
|
+
row[columnFormat.displayName] = formattedValue;
|
|
1365
|
+
chartRow[columnFormat.displayName] = formatNumberEnabled(columnFormat.valueFormat) ? value : formattedValue;
|
|
1366
|
+
htmlRowValues.push(formattedValue);
|
|
1367
|
+
[htmlRowStyles, htmlColumnStyles] = processHtmlStyles(formattedValue, columnFormat.displayName, columnFormat, htmlRowStyles, htmlColumnStyles);
|
|
1368
|
+
htmlTransposeColumnStyles = processHtmlTransposeStyles(formattedValue, columnFormat.displayName, columnFormat, htmlTransposeColumnStyles);
|
|
1369
|
+
if (rowIdx === 0) {
|
|
1370
|
+
htmlColumnNames.push(columnFormat.displayName);
|
|
1371
|
+
}
|
|
1372
|
+
// Remove name in favor of display name.
|
|
1373
|
+
if (columnFormat.displayName !== columnFormat.name) {
|
|
1374
|
+
delete row[columnFormat.name];
|
|
1375
|
+
}
|
|
1370
1376
|
}
|
|
1371
1377
|
});
|
|
1372
1378
|
chartRows.push(chartRow);
|