@cellaware/utils 8.6.25 → 8.6.27

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.
@@ -1,3 +1,6 @@
1
+ export declare const DATAGRID_HTML_ROWS = 1000;
2
+ export declare const DATAGRID_HTML_COLS = 8;
3
+ export declare const DATAGRID_TEAMS_ROWS = 24;
1
4
  export interface DatagridStateBase {
2
5
  columnState?: ColumnState[];
3
6
  columnGroupState?: any[];
@@ -1,5 +1,8 @@
1
1
  import { isDateString, truncateValue } from "../util.js";
2
2
  import { CHATWMS_DEFAULT_LANGUAGE } from "./user.js";
3
+ export const DATAGRID_HTML_ROWS = 1000;
4
+ export const DATAGRID_HTML_COLS = 8;
5
+ export const DATAGRID_TEAMS_ROWS = 24;
3
6
  export function initDatagridState() {
4
7
  return {
5
8
  adjRows: []
@@ -1060,9 +1063,6 @@ export function createTeamsTableRow(columnNames, values, rowStyles, columnStyles
1060
1063
  * ~All outputs respect and will be filtered by optional `condition` argument.~
1061
1064
  */
1062
1065
  export function transformDatagrid(rows, datagridState, locale, condition) {
1063
- const HTML_ROWS = 1000;
1064
- const HTML_COLS = 8;
1065
- const TEAMS_ROWS = 24;
1066
1066
  const columnState = datagridState.columnState ?? [];
1067
1067
  const filterModel = datagridState.filterModel ?? {};
1068
1068
  const isPivotMode = !!datagridState.isPivotMode;
@@ -1140,9 +1140,9 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
1140
1140
  }
1141
1141
  });
1142
1142
  chartRows.push(chartRow);
1143
- if (rowIdx < HTML_ROWS) {
1144
- htmlBuf += buildHtmlRow(htmlRowValues, htmlRowStyles, htmlColumnStyles, HTML_COLS);
1145
- if (rowIdx < TEAMS_ROWS) {
1143
+ if (rowIdx < DATAGRID_HTML_ROWS) {
1144
+ htmlBuf += buildHtmlRow(htmlRowValues, htmlRowStyles, htmlColumnStyles, DATAGRID_HTML_COLS);
1145
+ if (rowIdx < DATAGRID_TEAMS_ROWS) {
1146
1146
  [teamsRowStyles, teamsColumnStyles] = mapTeamsStyles(htmlColumnNames, htmlRowStyles, htmlColumnStyles, teamsRowStyles, teamsColumnStyles);
1147
1147
  teamsRows.push(createTeamsTableRow(htmlColumnNames, htmlRowValues, teamsRowStyles, teamsColumnStyles));
1148
1148
  }
@@ -1187,9 +1187,9 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
1187
1187
  }
1188
1188
  });
1189
1189
  chartRows.push(chartRow);
1190
- if (rowIdx < HTML_ROWS) {
1191
- htmlBuf += buildHtmlRow(htmlRowValues, htmlRowStyles, htmlColumnStyles, HTML_COLS);
1192
- if (rowIdx < TEAMS_ROWS) {
1190
+ if (rowIdx < DATAGRID_HTML_ROWS) {
1191
+ htmlBuf += buildHtmlRow(htmlRowValues, htmlRowStyles, htmlColumnStyles, DATAGRID_HTML_COLS);
1192
+ if (rowIdx < DATAGRID_TEAMS_ROWS) {
1193
1193
  [teamsRowStyles, teamsColumnStyles] = mapTeamsStyles(htmlColumnNames, htmlRowStyles, htmlColumnStyles, teamsRowStyles, teamsColumnStyles);
1194
1194
  teamsRows.push(createTeamsTableRow(htmlColumnNames, htmlRowValues, teamsRowStyles, teamsColumnStyles));
1195
1195
  }
@@ -1204,7 +1204,7 @@ export function transformDatagrid(rows, datagridState, locale, condition) {
1204
1204
  ...datagridState,
1205
1205
  adjRows: rows,
1206
1206
  chartRows,
1207
- html: `${buildHtmlTableHeader(htmlColumnNames.slice(0, HTML_COLS))}${htmlBuf}${buildHtmlTableFooter()}`,
1207
+ html: `${buildHtmlTableHeader(htmlColumnNames.slice(0, DATAGRID_HTML_COLS))}${htmlBuf}${buildHtmlTableFooter()}`,
1208
1208
  teamsRows: [
1209
1209
  createTeamsTableColumns(htmlColumnNames),
1210
1210
  ...teamsRows
@@ -1,4 +1,4 @@
1
- import { createTeamsTableColumns, createTeamsTableRow, mapTeamsStyles } from "./datagrid.js";
1
+ import { createTeamsTableColumns, createTeamsTableRow, DATAGRID_HTML_COLS, DATAGRID_TEAMS_ROWS, mapTeamsStyles } from "./datagrid.js";
2
2
  function createTeamsTitleItem(title) {
3
3
  return {
4
4
  type: "TextBlock",
@@ -7,6 +7,14 @@ function createTeamsTitleItem(title) {
7
7
  weight: "Bolder"
8
8
  };
9
9
  }
10
+ function createTeamsTitleItemQualifier() {
11
+ return {
12
+ type: "TextBlock",
13
+ text: `Displaying first **${DATAGRID_TEAMS_ROWS} rows** and **${DATAGRID_HTML_COLS} columns**`,
14
+ size: "Small",
15
+ weight: "Lighter",
16
+ };
17
+ }
10
18
  function createTeamsSummaryItem(summary) {
11
19
  return {
12
20
  type: "TextBlock",
@@ -38,9 +46,10 @@ export function createTeamsTableCard(title, table, summary) {
38
46
  type: "Table",
39
47
  roundedCorners: true,
40
48
  firstRowAsHeaders: true,
41
- columns: table.length === 0 ? [] : table[0].cells.map(() => ({ width: "auto" })),
49
+ columns: table.length === 0 ? [] : table[0].cells.map(() => ({ width: 3 })),
42
50
  rows: table
43
51
  },
52
+ createTeamsTitleItemQualifier(),
44
53
  createTeamsSummaryItem(summary)
45
54
  ]
46
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "8.6.25",
3
+ "version": "8.6.27",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",