@cellaware/utils 8.6.5 → 8.6.7
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
|
@@ -1036,12 +1036,12 @@ function createTeamsTableRow(columnNames, values, oddRow, rowStyles, columnStyle
|
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
1038
|
/**
|
|
1039
|
-
* **Important:** `html` and `teamsRows` output will be limited to **
|
|
1039
|
+
* **Important:** `html` and `teamsRows` output will be limited to **200 rows** and **8 columns**.
|
|
1040
1040
|
*
|
|
1041
1041
|
* All outputs respect and will be filtered by optional `condition` argument.
|
|
1042
1042
|
*/
|
|
1043
1043
|
export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
1044
|
-
const HTML_ROWS =
|
|
1044
|
+
const HTML_ROWS = 200;
|
|
1045
1045
|
const HTML_COLS = 8;
|
|
1046
1046
|
const columnState = datagridState.columnState ?? [];
|
|
1047
1047
|
const filterModel = datagridState.filterModel ?? {};
|
|
@@ -1108,7 +1108,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1108
1108
|
let teamsColumnStyles = [];
|
|
1109
1109
|
columnFormats.forEach(columnFormat => {
|
|
1110
1110
|
if (columnFormat.name in row) {
|
|
1111
|
-
const formattedValue = evaluateValueFormat(columnFormat, row[columnFormat.
|
|
1111
|
+
const formattedValue = evaluateValueFormat(columnFormat, row[columnFormat.displayName], locale);
|
|
1112
1112
|
chartRow[columnFormat.displayName] = formatNumberEnabled(columnFormat.valueFormat) ? stripNumericValueFormat(formattedValue) : formattedValue;
|
|
1113
1113
|
htmlRowValues.push(formattedValue);
|
|
1114
1114
|
[htmlRowStyles, htmlColumnStyles] = processHtmlStyles(formattedValue, columnFormat, htmlRowStyles, htmlColumnStyles);
|
|
@@ -1124,10 +1124,11 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1124
1124
|
for (const mappedColumnName of mappedColumnNamesArr) {
|
|
1125
1125
|
if (mappedColumnName in row) {
|
|
1126
1126
|
const adjDisplayName = mappedColumnName.replace(columnFormat.name, columnFormat.displayName);
|
|
1127
|
-
const formattedValue =
|
|
1127
|
+
const formattedValue = row[adjDisplayName];
|
|
1128
1128
|
chartRow[adjDisplayName] = formatNumberEnabled(columnFormat.valueFormat) ? stripNumericValueFormat(formattedValue) : formattedValue;
|
|
1129
1129
|
htmlRowValues.push(formattedValue);
|
|
1130
1130
|
[htmlRowStyles, htmlColumnStyles] = processHtmlStyles(formattedValue, columnFormat, htmlRowStyles, htmlColumnStyles);
|
|
1131
|
+
[teamsRowStyles, teamsColumnStyles] = mapTeamsStyles(htmlColumnNames, htmlRowStyles, htmlColumnStyles, teamsRowStyles, teamsColumnStyles);
|
|
1131
1132
|
if (rowIdx === 0) {
|
|
1132
1133
|
htmlColumnNames.push(columnFormat.displayName);
|
|
1133
1134
|
}
|
|
@@ -1174,10 +1175,11 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1174
1175
|
let teamsRowStyles = [];
|
|
1175
1176
|
let teamsColumnStyles = [];
|
|
1176
1177
|
visibleColumnFormats.forEach(columnFormat => {
|
|
1177
|
-
const formattedValue =
|
|
1178
|
+
const formattedValue = row[columnFormat.displayName];
|
|
1178
1179
|
chartRow[columnFormat.displayName] = formatNumberEnabled(columnFormat.valueFormat) ? stripNumericValueFormat(formattedValue) : formattedValue;
|
|
1179
1180
|
htmlRowValues.push(formattedValue);
|
|
1180
1181
|
[htmlRowStyles, htmlColumnStyles] = processHtmlStyles(formattedValue, columnFormat, htmlRowStyles, htmlColumnStyles);
|
|
1182
|
+
[teamsRowStyles, teamsColumnStyles] = mapTeamsStyles(htmlColumnNames, htmlRowStyles, htmlColumnStyles, teamsRowStyles, teamsColumnStyles);
|
|
1181
1183
|
if (rowIdx === 0) {
|
|
1182
1184
|
htmlColumnNames.push(columnFormat.displayName);
|
|
1183
1185
|
}
|
package/dist/chatwms/teams.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function createTeamsTableCard(title: string,
|
|
1
|
+
export declare function createTeamsTableCard(title: string, table: any[], summary: string): {
|
|
2
2
|
type: string;
|
|
3
3
|
version: string;
|
|
4
4
|
msteams: {
|
|
@@ -19,9 +19,7 @@ export declare function createTeamsTableCard(title: string, columnNames: string[
|
|
|
19
19
|
type: string;
|
|
20
20
|
roundedCorners: boolean;
|
|
21
21
|
firstRowAsHeaders: boolean;
|
|
22
|
-
columns:
|
|
23
|
-
width: number;
|
|
24
|
-
}[];
|
|
22
|
+
columns: any;
|
|
25
23
|
rows: any[];
|
|
26
24
|
})[];
|
|
27
25
|
};
|
package/dist/chatwms/teams.js
CHANGED
|
@@ -16,7 +16,7 @@ function createTeamsSummaryItem(summary) {
|
|
|
16
16
|
wrap: true
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export function createTeamsTableCard(title,
|
|
19
|
+
export function createTeamsTableCard(title, table, summary) {
|
|
20
20
|
return {
|
|
21
21
|
type: "AdaptiveCard",
|
|
22
22
|
version: "1.5",
|
|
@@ -27,7 +27,7 @@ export function createTeamsTableCard(title, columnNames, table, summary) {
|
|
|
27
27
|
type: "Table",
|
|
28
28
|
roundedCorners: true,
|
|
29
29
|
firstRowAsHeaders: true,
|
|
30
|
-
columns:
|
|
30
|
+
columns: table.length === 0 ? [] : table[0].cells.map(() => ({ width: 3 })),
|
|
31
31
|
rows: table
|
|
32
32
|
},
|
|
33
33
|
createTeamsSummaryItem(summary)
|