@cellaware/utils 8.6.29 → 8.6.31

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.
@@ -876,7 +876,8 @@ export function mapTeamsStyles(columnNames, htmlRowStyles, htmlColumnStyles, tea
876
876
  case ConditionalFormatStyle.NOT_IMPORTANT:
877
877
  return {
878
878
  isSubtle: true,
879
- italic: true
879
+ italic: true,
880
+ weight: 'Lighter'
880
881
  };
881
882
  default:
882
883
  return {};
@@ -25,7 +25,7 @@ export declare function createTeamsTableItem(rows: any[]): ({
25
25
  }[];
26
26
  }[];
27
27
  })[];
28
- export declare function createTeamsTableCard(title: string, table: any[], summary: string): {
28
+ export declare function createTeamsBriefCard(markdown: string, source: string): {
29
29
  type: string;
30
30
  version: string;
31
31
  msteams: {
@@ -35,6 +35,45 @@ export declare function createTeamsTableCard(title: string, table: any[], summar
35
35
  type: string;
36
36
  text: string;
37
37
  size: string;
38
+ weight: string;
39
+ } | {
40
+ type: string;
41
+ text: string;
42
+ size: string;
43
+ isSubtle: boolean;
44
+ wrap: boolean;
45
+ } | {
46
+ type: string;
47
+ facts: {
48
+ title: string;
49
+ value: string;
50
+ }[];
51
+ } | {
52
+ type: string;
53
+ roundedCorners: boolean;
54
+ items: {
55
+ type: string;
56
+ text: string;
57
+ wrap: boolean;
58
+ }[];
59
+ })[];
60
+ };
61
+ export declare function createTeamsTableCard(title: string, table: any[], summary: string, source: string): {
62
+ type: string;
63
+ version: string;
64
+ msteams: {
65
+ width: string;
66
+ };
67
+ body: ({
68
+ type: string;
69
+ text: string;
70
+ size: string;
71
+ } | {
72
+ type: string;
73
+ facts: {
74
+ title: string;
75
+ value: string;
76
+ }[];
38
77
  } | {
39
78
  type: string;
40
79
  roundedCorners: boolean;
@@ -43,7 +82,7 @@ export declare function createTeamsTableCard(title: string, table: any[], summar
43
82
  rows: any[];
44
83
  })[];
45
84
  };
46
- export declare function createTeamsValueCard(title: string, columnName: string, value: any, styles: string[], summary: string): {
85
+ export declare function createTeamsValueCard(title: string, columnName: string, value: any, styles: string[], summary: string, source: string): {
47
86
  type: string;
48
87
  version: string;
49
88
  msteams: {
@@ -60,6 +99,12 @@ export declare function createTeamsValueCard(title: string, columnName: string,
60
99
  size: string;
61
100
  isSubtle: boolean;
62
101
  wrap: boolean;
102
+ } | {
103
+ type: string;
104
+ facts: {
105
+ title: string;
106
+ value: string;
107
+ }[];
63
108
  } | {
64
109
  type: string;
65
110
  roundedCorners: boolean;
@@ -75,7 +120,7 @@ export declare function createTeamsValueCard(title: string, columnName: string,
75
120
  }[];
76
121
  })[];
77
122
  };
78
- export declare function createTeamsChartCard(title: string, png: string, summary: string): {
123
+ export declare function createTeamsChartCard(title: string, png: string, summary: string, source: string): {
79
124
  type: string;
80
125
  version: string;
81
126
  msteams: {
@@ -92,6 +137,12 @@ export declare function createTeamsChartCard(title: string, png: string, summary
92
137
  size: string;
93
138
  isSubtle: boolean;
94
139
  wrap: boolean;
140
+ } | {
141
+ type: string;
142
+ facts: {
143
+ title: string;
144
+ value: string;
145
+ }[];
95
146
  } | {
96
147
  type: string;
97
148
  url: string;
@@ -7,7 +7,7 @@ function createTeamsTitleItem(title) {
7
7
  weight: "Bolder"
8
8
  };
9
9
  }
10
- function createTeamsTitleItemQualifier() {
10
+ function createTeamsTableQualifierItem() {
11
11
  return {
12
12
  type: "TextBlock",
13
13
  text: `Displaying first **${DATAGRID_TEAMS_ROWS} rows** and **${DATAGRID_HTML_COLS} columns**`,
@@ -23,6 +23,17 @@ function createTeamsSummaryItem(summary) {
23
23
  wrap: true
24
24
  };
25
25
  }
26
+ function createTeamsSourceItem(text) {
27
+ return {
28
+ type: "FactSet",
29
+ facts: [
30
+ {
31
+ title: "Source:",
32
+ value: text
33
+ }
34
+ ]
35
+ };
36
+ }
26
37
  export function createTeamsTableItem(rows) {
27
38
  if (rows.length === 0) {
28
39
  return [];
@@ -34,14 +45,37 @@ export function createTeamsTableItem(rows) {
34
45
  ...teamsRows
35
46
  ];
36
47
  }
37
- export function createTeamsTableCard(title, table, summary) {
48
+ export function createTeamsBriefCard(markdown, source) {
49
+ return {
50
+ type: "AdaptiveCard",
51
+ version: "1.5",
52
+ msteams: { width: "Full" },
53
+ body: [
54
+ createTeamsTitleItem('Brief'),
55
+ {
56
+ type: "Container",
57
+ roundedCorners: true,
58
+ items: [
59
+ {
60
+ type: "TextBlock",
61
+ text: markdown,
62
+ wrap: true,
63
+ }
64
+ ]
65
+ },
66
+ createTeamsSummaryItem('ChatWMS can make mistakes. [Check important info.](https://chatwms.io/user-manual/chatwms/disclaimer)'),
67
+ createTeamsSourceItem(source)
68
+ ]
69
+ };
70
+ }
71
+ export function createTeamsTableCard(title, table, summary, source) {
38
72
  return {
39
73
  type: "AdaptiveCard",
40
74
  version: "1.5",
41
75
  msteams: { width: "Full" },
42
76
  body: [
43
77
  createTeamsTitleItem(title),
44
- createTeamsTitleItemQualifier(),
78
+ createTeamsTableQualifierItem(),
45
79
  {
46
80
  type: "Table",
47
81
  roundedCorners: true,
@@ -49,11 +83,12 @@ export function createTeamsTableCard(title, table, summary) {
49
83
  columns: table.length === 0 ? [] : table[0].cells.map(() => ({ width: 3 })),
50
84
  rows: table
51
85
  },
52
- createTeamsSummaryItem(summary)
86
+ createTeamsSummaryItem(summary),
87
+ createTeamsSourceItem(source)
53
88
  ]
54
89
  };
55
90
  }
56
- export function createTeamsValueCard(title, columnName, value, styles, summary) {
91
+ export function createTeamsValueCard(title, columnName, value, styles, summary, source) {
57
92
  // NOTE: we only care about mapping style string (represented as row styles) to column styles.
58
93
  let rowStyles = [];
59
94
  let columnStyles = [];
@@ -105,11 +140,12 @@ export function createTeamsValueCard(title, columnName, value, styles, summary)
105
140
  }
106
141
  ]
107
142
  },
108
- createTeamsSummaryItem(summary)
143
+ createTeamsSummaryItem(summary),
144
+ createTeamsSourceItem(source)
109
145
  ]
110
146
  };
111
147
  }
112
- export function createTeamsChartCard(title, png, summary) {
148
+ export function createTeamsChartCard(title, png, summary, source) {
113
149
  return {
114
150
  type: "AdaptiveCard",
115
151
  version: "1.5",
@@ -120,7 +156,8 @@ export function createTeamsChartCard(title, png, summary) {
120
156
  type: "Image",
121
157
  url: png
122
158
  },
123
- createTeamsSummaryItem(summary)
159
+ createTeamsSummaryItem(summary),
160
+ createTeamsSourceItem(source)
124
161
  ]
125
162
  };
126
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "8.6.29",
3
+ "version": "8.6.31",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",