@cellaware/utils 8.11.2 → 8.11.4
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 +41 -4
- package/dist/chatwms/teams.d.ts +26 -0
- package/dist/chatwms/teams.js +18 -0
- package/package.json +1 -1
package/dist/chatwms/datagrid.js
CHANGED
|
@@ -1143,6 +1143,36 @@ function createTeamsTableCellText(value, columnStyle) {
|
|
|
1143
1143
|
isSubtle
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
|
+
function createTeamsTransposeTableCellText(value, columnStyle) {
|
|
1147
|
+
// Same as ^^^, just a couple minor tweaks.
|
|
1148
|
+
let color = undefined;
|
|
1149
|
+
let weight = undefined;
|
|
1150
|
+
let isSubtle = undefined;
|
|
1151
|
+
let italic = undefined;
|
|
1152
|
+
for (const styles of columnStyle?.styles ?? []) {
|
|
1153
|
+
if (!!styles.color) {
|
|
1154
|
+
color = styles.color;
|
|
1155
|
+
}
|
|
1156
|
+
if (!!styles.weight) {
|
|
1157
|
+
weight = styles.weight;
|
|
1158
|
+
}
|
|
1159
|
+
if (!!styles.isSubtle) {
|
|
1160
|
+
isSubtle = styles.isSubtle;
|
|
1161
|
+
}
|
|
1162
|
+
if (!!styles.italic) {
|
|
1163
|
+
italic = styles.italic;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
const truncValue = truncateValue(value, 16);
|
|
1167
|
+
return {
|
|
1168
|
+
type: "TextBlock",
|
|
1169
|
+
text: italic ? `*${truncValue}*` : truncValue,
|
|
1170
|
+
size: "Medium",
|
|
1171
|
+
color,
|
|
1172
|
+
weight,
|
|
1173
|
+
isSubtle
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1146
1176
|
export function createTeamsTableRow(columnNames, values, rowStyles, columnStyles) {
|
|
1147
1177
|
let rowStyle = undefined;
|
|
1148
1178
|
for (const style of rowStyles ?? []) {
|
|
@@ -1171,14 +1201,21 @@ export function createTeamsTableRow(columnNames, values, rowStyles, columnStyles
|
|
|
1171
1201
|
export function createTeamsTransposeTableRow(row, columnStyle) {
|
|
1172
1202
|
const keyCell = {
|
|
1173
1203
|
type: "TableCell",
|
|
1174
|
-
items: [
|
|
1204
|
+
items: [createTeamsTransposeTableCellText(row.key, {
|
|
1175
1205
|
columnName: 'key',
|
|
1176
1206
|
styles: [{ weight: 'Bolder' }]
|
|
1177
1207
|
})]
|
|
1178
1208
|
};
|
|
1209
|
+
let style = undefined;
|
|
1210
|
+
for (const styles of columnStyle?.styles ?? []) {
|
|
1211
|
+
if (!!styles.style) {
|
|
1212
|
+
style = styles.style;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1179
1215
|
const valueCell = {
|
|
1180
1216
|
type: "TableCell",
|
|
1181
|
-
|
|
1217
|
+
style,
|
|
1218
|
+
items: [createTeamsTransposeTableCellText(row.value, columnStyle)]
|
|
1182
1219
|
};
|
|
1183
1220
|
return {
|
|
1184
1221
|
type: "TableRow",
|
|
@@ -1287,7 +1324,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1287
1324
|
}));
|
|
1288
1325
|
for (let i = 0; i < transposedRows.length; i++) {
|
|
1289
1326
|
htmlTransposeBuf += buildHtmlTransposeRow(transposedRows[i], htmlTransposeColumnStyles[i]);
|
|
1290
|
-
|
|
1327
|
+
teamsTranspose.push(createTeamsTransposeTableRow(transposedRows[i], mapTeamsTransposeStyles(htmlTransposeColumnStyles[i])));
|
|
1291
1328
|
}
|
|
1292
1329
|
}
|
|
1293
1330
|
rowIdx++;
|
|
@@ -1346,7 +1383,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
|
|
|
1346
1383
|
}));
|
|
1347
1384
|
for (let i = 0; i < transposedRows.length; i++) {
|
|
1348
1385
|
htmlTransposeBuf += buildHtmlTransposeRow(transposedRows[i], htmlTransposeColumnStyles[i]);
|
|
1349
|
-
|
|
1386
|
+
teamsTranspose.push(createTeamsTransposeTableRow(transposedRows[i], mapTeamsTransposeStyles(htmlTransposeColumnStyles[i])));
|
|
1350
1387
|
}
|
|
1351
1388
|
}
|
|
1352
1389
|
rowIdx++;
|
package/dist/chatwms/teams.d.ts
CHANGED
|
@@ -118,6 +118,32 @@ export declare function createTeamsReportValueCard(lineTitle: string, columnName
|
|
|
118
118
|
}[];
|
|
119
119
|
})[];
|
|
120
120
|
};
|
|
121
|
+
export declare function createTeamsReportRowCard(lineTitle: string, table: any[], summary: string, reportTitle: string): {
|
|
122
|
+
type: string;
|
|
123
|
+
version: string;
|
|
124
|
+
msteams: {
|
|
125
|
+
width: string;
|
|
126
|
+
};
|
|
127
|
+
body: ({
|
|
128
|
+
type: string;
|
|
129
|
+
facts: {
|
|
130
|
+
title: string;
|
|
131
|
+
value: string;
|
|
132
|
+
}[];
|
|
133
|
+
} | {
|
|
134
|
+
type: string;
|
|
135
|
+
text: string;
|
|
136
|
+
size: string;
|
|
137
|
+
isSubtle: boolean;
|
|
138
|
+
wrap: boolean;
|
|
139
|
+
} | {
|
|
140
|
+
type: string;
|
|
141
|
+
roundedCorners: boolean;
|
|
142
|
+
firstRowAsHeaders: boolean;
|
|
143
|
+
columns: any;
|
|
144
|
+
rows: any[];
|
|
145
|
+
})[];
|
|
146
|
+
};
|
|
121
147
|
export declare function createTeamsReportChartCard(lineTitle: string, png: string, summary: string, reportTitle: string): {
|
|
122
148
|
type: string;
|
|
123
149
|
version: string;
|
package/dist/chatwms/teams.js
CHANGED
|
@@ -136,6 +136,24 @@ export function createTeamsReportValueCard(lineTitle, columnName, value, styles,
|
|
|
136
136
|
]
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
+
export function createTeamsReportRowCard(lineTitle, table, summary, reportTitle) {
|
|
140
|
+
return {
|
|
141
|
+
type: "AdaptiveCard",
|
|
142
|
+
version: "1.5",
|
|
143
|
+
msteams: { width: "Full" },
|
|
144
|
+
body: [
|
|
145
|
+
createTeamsTitleItem(reportTitle, lineTitle),
|
|
146
|
+
{
|
|
147
|
+
type: "Table",
|
|
148
|
+
roundedCorners: true,
|
|
149
|
+
firstRowAsHeaders: true,
|
|
150
|
+
columns: table.length === 0 ? [] : table[0].cells.map(() => ({ width: 3 })),
|
|
151
|
+
rows: table
|
|
152
|
+
},
|
|
153
|
+
createTeamsSummaryItem(summary)
|
|
154
|
+
]
|
|
155
|
+
};
|
|
156
|
+
}
|
|
139
157
|
export function createTeamsReportChartCard(lineTitle, png, summary, reportTitle) {
|
|
140
158
|
return {
|
|
141
159
|
type: "AdaptiveCard",
|