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

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" },
@@ -314,7 +314,6 @@ var FIELDS3 = {
314
314
  };
315
315
  var TICKET_SUMMARY_AVAILABLE_COLUMNS = [
316
316
  "locationName",
317
- "orderNumber",
318
317
  "businessDate",
319
318
  "ticketOpenedAt",
320
319
  "ticketClosedAt",
@@ -345,7 +344,7 @@ var FIELDS4 = {
345
344
  orderNumber: {
346
345
  type: "number",
347
346
  columnKey: "ticketNumber",
348
- footerCalculation: { type: "none" }
347
+ footerCalculation: { type: "count" }
349
348
  },
350
349
  dateOpen: { type: "string", columnKey: "date" },
351
350
  timeOpen: { type: "string", columnKey: "ticketOpen" },
@@ -632,7 +631,6 @@ var FIELDS8 = {
632
631
  var EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS = [
633
632
  "locationName",
634
633
  "businessDate",
635
- "employeeName",
636
634
  "isActive",
637
635
  "lookup",
638
636
  "payrollCode",
@@ -1457,6 +1455,9 @@ var calculateFieldTotal = (rows, field, config) => {
1457
1455
  if (calc?.type === "none") {
1458
1456
  return null;
1459
1457
  }
1458
+ if (calc?.type === "count") {
1459
+ return rows.length;
1460
+ }
1460
1461
  if (!calc || calc.type === "sum") {
1461
1462
  return config.columnKey || calc?.type === "sum" ? sumField(rows, field) : 0;
1462
1463
  }
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" },
@@ -253,7 +253,6 @@ var FIELDS3 = {
253
253
  };
254
254
  var TICKET_SUMMARY_AVAILABLE_COLUMNS = [
255
255
  "locationName",
256
- "orderNumber",
257
256
  "businessDate",
258
257
  "ticketOpenedAt",
259
258
  "ticketClosedAt",
@@ -284,7 +283,7 @@ var FIELDS4 = {
284
283
  orderNumber: {
285
284
  type: "number",
286
285
  columnKey: "ticketNumber",
287
- footerCalculation: { type: "none" }
286
+ footerCalculation: { type: "count" }
288
287
  },
289
288
  dateOpen: { type: "string", columnKey: "date" },
290
289
  timeOpen: { type: "string", columnKey: "ticketOpen" },
@@ -571,7 +570,6 @@ var FIELDS8 = {
571
570
  var EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS = [
572
571
  "locationName",
573
572
  "businessDate",
574
- "employeeName",
575
573
  "isActive",
576
574
  "lookup",
577
575
  "payrollCode",
@@ -1396,6 +1394,9 @@ var calculateFieldTotal = (rows, field, config) => {
1396
1394
  if (calc?.type === "none") {
1397
1395
  return null;
1398
1396
  }
1397
+ if (calc?.type === "count") {
1398
+ return rows.length;
1399
+ }
1399
1400
  if (!calc || calc.type === "sum") {
1400
1401
  return config.columnKey || calc?.type === "sum" ? sumField(rows, field) : 0;
1401
1402
  }
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.2",
4
4
  "description": "Centralized report column presentation configuration for SkyTab Analytics",
5
5
  "engines": {
6
6
  "node": ">=22.6.0",