@harbortouch/skytab-analytics-report-utils 0.12.0 → 0.12.1

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/index.cjs CHANGED
@@ -258,7 +258,7 @@ var FIELDS3 = {
258
258
  footerCalculation: { type: "sum" }
259
259
  },
260
260
  locationName: { type: "string", size: 240, columnKey: "locationName" },
261
- orderNumber: { type: "number", columnKey: "ticketNumber", footerCalculation: { type: "none" } },
261
+ orderNumber: { type: "number", columnKey: "ticketNumber", footerCalculation: { type: "count" } },
262
262
  businessDate: { type: "date", columnKey: "date" },
263
263
  ticketOpenedAt: { type: "time", columnKey: "ticketOpen" },
264
264
  ticketClosedAt: { type: "time", columnKey: "ticketClosed" },
@@ -345,7 +345,7 @@ var FIELDS4 = {
345
345
  orderNumber: {
346
346
  type: "number",
347
347
  columnKey: "ticketNumber",
348
- footerCalculation: { type: "none" }
348
+ footerCalculation: { type: "count" }
349
349
  },
350
350
  dateOpen: { type: "string", columnKey: "date" },
351
351
  timeOpen: { type: "string", columnKey: "ticketOpen" },
@@ -1457,6 +1457,9 @@ var calculateFieldTotal = (rows, field, config) => {
1457
1457
  if (calc?.type === "none") {
1458
1458
  return null;
1459
1459
  }
1460
+ if (calc?.type === "count") {
1461
+ return rows.length;
1462
+ }
1460
1463
  if (!calc || calc.type === "sum") {
1461
1464
  return config.columnKey || calc?.type === "sum" ? sumField(rows, field) : 0;
1462
1465
  }
package/dist/index.d.cts CHANGED
@@ -1181,7 +1181,7 @@ declare function getColumnExportHeaderLabel(colTitle: string, groupTitle: string
1181
1181
 
1182
1182
  type FieldType = 'string' | 'money' | 'percent' | 'number' | 'fixedNumber' | 'date' | 'time' | 'boolean' | 'conditional';
1183
1183
  type ColumnAlignment = 'left' | 'right';
1184
- type FooterCalculationType = 'sum' | 'percentChange' | 'variancePercent' | 'average' | 'quotientOfDifferences' | 'none';
1184
+ type FooterCalculationType = 'sum' | 'percentChange' | 'variancePercent' | 'average' | 'quotientOfDifferences' | 'count' | 'none';
1185
1185
  interface FooterCalculation<TField = string> {
1186
1186
  type: FooterCalculationType;
1187
1187
  numeratorField?: TField;
package/dist/index.d.ts CHANGED
@@ -1181,7 +1181,7 @@ declare function getColumnExportHeaderLabel(colTitle: string, groupTitle: string
1181
1181
 
1182
1182
  type FieldType = 'string' | 'money' | 'percent' | 'number' | 'fixedNumber' | 'date' | 'time' | 'boolean' | 'conditional';
1183
1183
  type ColumnAlignment = 'left' | 'right';
1184
- type FooterCalculationType = 'sum' | 'percentChange' | 'variancePercent' | 'average' | 'quotientOfDifferences' | 'none';
1184
+ type FooterCalculationType = 'sum' | 'percentChange' | 'variancePercent' | 'average' | 'quotientOfDifferences' | 'count' | 'none';
1185
1185
  interface FooterCalculation<TField = string> {
1186
1186
  type: FooterCalculationType;
1187
1187
  numeratorField?: TField;
package/dist/index.js CHANGED
@@ -197,7 +197,7 @@ var FIELDS3 = {
197
197
  footerCalculation: { type: "sum" }
198
198
  },
199
199
  locationName: { type: "string", size: 240, columnKey: "locationName" },
200
- orderNumber: { type: "number", columnKey: "ticketNumber", footerCalculation: { type: "none" } },
200
+ orderNumber: { type: "number", columnKey: "ticketNumber", footerCalculation: { type: "count" } },
201
201
  businessDate: { type: "date", columnKey: "date" },
202
202
  ticketOpenedAt: { type: "time", columnKey: "ticketOpen" },
203
203
  ticketClosedAt: { type: "time", columnKey: "ticketClosed" },
@@ -284,7 +284,7 @@ var FIELDS4 = {
284
284
  orderNumber: {
285
285
  type: "number",
286
286
  columnKey: "ticketNumber",
287
- footerCalculation: { type: "none" }
287
+ footerCalculation: { type: "count" }
288
288
  },
289
289
  dateOpen: { type: "string", columnKey: "date" },
290
290
  timeOpen: { type: "string", columnKey: "ticketOpen" },
@@ -1396,6 +1396,9 @@ var calculateFieldTotal = (rows, field, config) => {
1396
1396
  if (calc?.type === "none") {
1397
1397
  return null;
1398
1398
  }
1399
+ if (calc?.type === "count") {
1400
+ return rows.length;
1401
+ }
1399
1402
  if (!calc || calc.type === "sum") {
1400
1403
  return config.columnKey || calc?.type === "sum" ? sumField(rows, field) : 0;
1401
1404
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbortouch/skytab-analytics-report-utils",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Centralized report column presentation configuration for SkyTab Analytics",
5
5
  "engines": {
6
6
  "node": ">=22.6.0",