@cellaware/utils 8.6.6 → 8.6.8
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.
|
@@ -148,7 +148,7 @@ interface TeamsColumnStyle {
|
|
|
148
148
|
}
|
|
149
149
|
export declare function mapTeamsStyles(columnNames: string[], htmlRowStyles: string[], htmlColumnStyles: HtmlColumnStyle[], teamsRowStyles: string[], teamsColumnStyles: TeamsColumnStyle[]): [string[], TeamsColumnStyle[]];
|
|
150
150
|
/**
|
|
151
|
-
* **Important:** `html` and `teamsRows` output will be limited to **
|
|
151
|
+
* **Important:** `html` and `teamsRows` output will be limited to **200 rows** and **8 columns**.
|
|
152
152
|
*
|
|
153
153
|
* All outputs respect and will be filtered by optional `condition` argument.
|
|
154
154
|
*/
|
package/dist/chatwms/datagrid.js
CHANGED
|
@@ -998,6 +998,7 @@ function createTeamsTableCellText(value, columnStyle) {
|
|
|
998
998
|
isSubtle = styles.isSubtle;
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
+
console.log('HERE: ' + columnStyle);
|
|
1001
1002
|
return {
|
|
1002
1003
|
type: "TextBlock",
|
|
1003
1004
|
text: italic ? `*${value}*` : value,
|
|
@@ -1010,17 +1011,19 @@ function createTeamsTableCellText(value, columnStyle) {
|
|
|
1010
1011
|
isSubtle
|
|
1011
1012
|
};
|
|
1012
1013
|
}
|
|
1013
|
-
function createTeamsTableRow(columnNames, values,
|
|
1014
|
+
function createTeamsTableRow(columnNames, values, rowStyles, columnStyles) {
|
|
1014
1015
|
let rowStyle = undefined;
|
|
1015
1016
|
for (const style of rowStyles) {
|
|
1016
1017
|
rowStyle = style;
|
|
1018
|
+
console.log(style);
|
|
1017
1019
|
}
|
|
1018
1020
|
return {
|
|
1019
1021
|
type: "TableRow",
|
|
1020
|
-
|
|
1022
|
+
style: rowStyle,
|
|
1021
1023
|
cells: values.map((value, idx) => {
|
|
1022
1024
|
const columnName = columnNames[idx];
|
|
1023
1025
|
const columnStyle = columnStyles.find(columnStyle => columnStyle.columnName === columnName);
|
|
1026
|
+
console.log(columnStyle);
|
|
1024
1027
|
let style = undefined;
|
|
1025
1028
|
for (const styles of columnStyle?.styles ?? []) {
|
|
1026
1029
|
if (!!styles.style) {
|
|
@@ -1036,12 +1039,12 @@ function createTeamsTableRow(columnNames, values, oddRow, rowStyles, columnStyle
|
|
|
1036
1039
|
};
|
|
1037
1040
|
}
|
|
1038
1041
|
/**
|
|
1039
|
-
* **Important:** `html` and `teamsRows` output will be limited to **
|
|
1042
|
+
* **Important:** `html` and `teamsRows` output will be limited to **200 rows** and **8 columns**.
|
|
1040
1043
|
*
|
|
1041
1044
|
* All outputs respect and will be filtered by optional `condition` argument.
|
|
1042
1045
|
*/
|
|
1043
1046
|
export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
1044
|
-
const HTML_ROWS =
|
|
1047
|
+
const HTML_ROWS = 200;
|
|
1045
1048
|
const HTML_COLS = 8;
|
|
1046
1049
|
const columnState = datagridState.columnState ?? [];
|
|
1047
1050
|
const filterModel = datagridState.filterModel ?? {};
|
|
@@ -1108,7 +1111,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1108
1111
|
let teamsColumnStyles = [];
|
|
1109
1112
|
columnFormats.forEach(columnFormat => {
|
|
1110
1113
|
if (columnFormat.name in row) {
|
|
1111
|
-
const formattedValue = evaluateValueFormat(columnFormat, row[columnFormat.
|
|
1114
|
+
const formattedValue = evaluateValueFormat(columnFormat, row[columnFormat.displayName], locale);
|
|
1112
1115
|
chartRow[columnFormat.displayName] = formatNumberEnabled(columnFormat.valueFormat) ? stripNumericValueFormat(formattedValue) : formattedValue;
|
|
1113
1116
|
htmlRowValues.push(formattedValue);
|
|
1114
1117
|
[htmlRowStyles, htmlColumnStyles] = processHtmlStyles(formattedValue, columnFormat, htmlRowStyles, htmlColumnStyles);
|
|
@@ -1124,10 +1127,11 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1124
1127
|
for (const mappedColumnName of mappedColumnNamesArr) {
|
|
1125
1128
|
if (mappedColumnName in row) {
|
|
1126
1129
|
const adjDisplayName = mappedColumnName.replace(columnFormat.name, columnFormat.displayName);
|
|
1127
|
-
const formattedValue =
|
|
1130
|
+
const formattedValue = row[adjDisplayName];
|
|
1128
1131
|
chartRow[adjDisplayName] = formatNumberEnabled(columnFormat.valueFormat) ? stripNumericValueFormat(formattedValue) : formattedValue;
|
|
1129
1132
|
htmlRowValues.push(formattedValue);
|
|
1130
1133
|
[htmlRowStyles, htmlColumnStyles] = processHtmlStyles(formattedValue, columnFormat, htmlRowStyles, htmlColumnStyles);
|
|
1134
|
+
[teamsRowStyles, teamsColumnStyles] = mapTeamsStyles(htmlColumnNames, htmlRowStyles, htmlColumnStyles, teamsRowStyles, teamsColumnStyles);
|
|
1131
1135
|
if (rowIdx === 0) {
|
|
1132
1136
|
htmlColumnNames.push(columnFormat.displayName);
|
|
1133
1137
|
}
|
|
@@ -1139,7 +1143,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1139
1143
|
chartRows.push(chartRow);
|
|
1140
1144
|
if (rowIdx < HTML_ROWS) {
|
|
1141
1145
|
htmlBuf += buildHtmlRow(htmlRowValues, htmlRowStyles, htmlColumnStyles, HTML_COLS);
|
|
1142
|
-
teamsRows.push(createTeamsTableRow(htmlColumnNames, htmlRowValues,
|
|
1146
|
+
teamsRows.push(createTeamsTableRow(htmlColumnNames, htmlRowValues, teamsRowStyles, teamsColumnStyles));
|
|
1143
1147
|
}
|
|
1144
1148
|
rowIdx++;
|
|
1145
1149
|
});
|
|
@@ -1174,10 +1178,11 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1174
1178
|
let teamsRowStyles = [];
|
|
1175
1179
|
let teamsColumnStyles = [];
|
|
1176
1180
|
visibleColumnFormats.forEach(columnFormat => {
|
|
1177
|
-
const formattedValue =
|
|
1181
|
+
const formattedValue = row[columnFormat.displayName];
|
|
1178
1182
|
chartRow[columnFormat.displayName] = formatNumberEnabled(columnFormat.valueFormat) ? stripNumericValueFormat(formattedValue) : formattedValue;
|
|
1179
1183
|
htmlRowValues.push(formattedValue);
|
|
1180
1184
|
[htmlRowStyles, htmlColumnStyles] = processHtmlStyles(formattedValue, columnFormat, htmlRowStyles, htmlColumnStyles);
|
|
1185
|
+
[teamsRowStyles, teamsColumnStyles] = mapTeamsStyles(htmlColumnNames, htmlRowStyles, htmlColumnStyles, teamsRowStyles, teamsColumnStyles);
|
|
1181
1186
|
if (rowIdx === 0) {
|
|
1182
1187
|
htmlColumnNames.push(columnFormat.displayName);
|
|
1183
1188
|
}
|
|
@@ -1185,7 +1190,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1185
1190
|
chartRows.push(chartRow);
|
|
1186
1191
|
if (rowIdx < HTML_ROWS) {
|
|
1187
1192
|
htmlBuf += buildHtmlRow(htmlRowValues, htmlRowStyles, htmlColumnStyles, HTML_COLS);
|
|
1188
|
-
teamsRows.push(createTeamsTableRow(htmlColumnNames, htmlRowValues,
|
|
1193
|
+
teamsRows.push(createTeamsTableRow(htmlColumnNames, htmlRowValues, teamsRowStyles, teamsColumnStyles));
|
|
1189
1194
|
}
|
|
1190
1195
|
rowIdx++;
|
|
1191
1196
|
});
|