@harbortouch/skytab-analytics-report-utils 0.23.0 → 0.23.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.
@@ -588,11 +588,11 @@ var FIELDS8 = {
588
588
  filteringAvailable: false
589
589
  },
590
590
  startTime: {
591
- type: "string",
591
+ type: "time",
592
592
  columnKey: "clockInTime"
593
593
  },
594
594
  endTime: {
595
- type: "string",
595
+ type: "time",
596
596
  columnKey: "clockOutTime"
597
597
  },
598
598
  shiftHours: {
@@ -2222,11 +2222,11 @@ var FIELDS8 = {
2222
2222
  filteringAvailable: false
2223
2223
  },
2224
2224
  startTime: {
2225
- type: "string",
2225
+ type: "time",
2226
2226
  columnKey: "clockInTime"
2227
2227
  },
2228
2228
  endTime: {
2229
- type: "string",
2229
+ type: "time",
2230
2230
  columnKey: "clockOutTime"
2231
2231
  },
2232
2232
  shiftHours: {
@@ -3432,7 +3432,13 @@ var ExportBuilder = class {
3432
3432
  const metricCols = selectedGroupIds?.length ? config.availableColumns.filter((c) => selectedGroupIds.includes(c)) : config.defaultVisibleColumns;
3433
3433
  return [...this.buildColumnPrefix(config, parameters), ...metricCols];
3434
3434
  }
3435
- getColumnHeader(fieldName, config) {
3435
+ getColumnHeader(fieldName, config, parameters) {
3436
+ if (fieldName === "groupByName" && parameters.groupBy) {
3437
+ return this.translate(`analytics.field.${parameters.groupBy}`);
3438
+ }
3439
+ if (fieldName === "groupByName2" && parameters.secondGroupBy) {
3440
+ return this.translate(`analytics.field.${parameters.secondGroupBy}`);
3441
+ }
3436
3442
  const columnKey = config.fields[fieldName]?.columnKey;
3437
3443
  const titleKey = columnKey ? getColumnMetadata(columnKey)?.shortTitleKey : void 0;
3438
3444
  const colHeader = titleKey ? this.translate(titleKey) : fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (c) => c.toUpperCase()).trim();
@@ -3443,12 +3449,7 @@ var ExportBuilder = class {
3443
3449
  }
3444
3450
  resolveColumnsAndHeaders(parameters, config) {
3445
3451
  const columns = this.resolveColumns(config, parameters);
3446
- const headers = columns.map((col) => {
3447
- if (col === "groupByName2" && parameters.secondGroupBy) {
3448
- return this.translate(`analytics.field.${parameters.secondGroupBy}`);
3449
- }
3450
- return this.getColumnHeader(col, config);
3451
- });
3452
+ const headers = columns.map((col) => this.getColumnHeader(col, config, parameters));
3452
3453
  const columnTypes = columns.map((col) => config.fields[col]);
3453
3454
  return { columns, headers, columnTypes };
3454
3455
  }
@@ -6,7 +6,7 @@ import {
6
6
  getReportConfig,
7
7
  getReportFormattingLocaleOptions,
8
8
  resolveTranslate
9
- } from "../chunk-SP2ZXKSZ.js";
9
+ } from "../chunk-6CXSU5L4.js";
10
10
 
11
11
  // src/exporters/exportBuilder.ts
12
12
  import { format, isValid, parseISO } from "date-fns";
@@ -87,7 +87,13 @@ var ExportBuilder = class {
87
87
  const metricCols = selectedGroupIds?.length ? config.availableColumns.filter((c) => selectedGroupIds.includes(c)) : config.defaultVisibleColumns;
88
88
  return [...this.buildColumnPrefix(config, parameters), ...metricCols];
89
89
  }
90
- getColumnHeader(fieldName, config) {
90
+ getColumnHeader(fieldName, config, parameters) {
91
+ if (fieldName === "groupByName" && parameters.groupBy) {
92
+ return this.translate(`analytics.field.${parameters.groupBy}`);
93
+ }
94
+ if (fieldName === "groupByName2" && parameters.secondGroupBy) {
95
+ return this.translate(`analytics.field.${parameters.secondGroupBy}`);
96
+ }
91
97
  const columnKey = config.fields[fieldName]?.columnKey;
92
98
  const titleKey = columnKey ? getColumnMetadata(columnKey)?.shortTitleKey : void 0;
93
99
  const colHeader = titleKey ? this.translate(titleKey) : fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (c) => c.toUpperCase()).trim();
@@ -98,12 +104,7 @@ var ExportBuilder = class {
98
104
  }
99
105
  resolveColumnsAndHeaders(parameters, config) {
100
106
  const columns = this.resolveColumns(config, parameters);
101
- const headers = columns.map((col) => {
102
- if (col === "groupByName2" && parameters.secondGroupBy) {
103
- return this.translate(`analytics.field.${parameters.secondGroupBy}`);
104
- }
105
- return this.getColumnHeader(col, config);
106
- });
107
+ const headers = columns.map((col) => this.getColumnHeader(col, config, parameters));
107
108
  const columnTypes = columns.map((col) => config.fields[col]);
108
109
  return { columns, headers, columnTypes };
109
110
  }
package/dist/index.cjs CHANGED
@@ -660,11 +660,11 @@ var FIELDS8 = {
660
660
  filteringAvailable: false
661
661
  },
662
662
  startTime: {
663
- type: "string",
663
+ type: "time",
664
664
  columnKey: "clockInTime"
665
665
  },
666
666
  endTime: {
667
- type: "string",
667
+ type: "time",
668
668
  columnKey: "clockOutTime"
669
669
  },
670
670
  shiftHours: {
package/dist/index.js CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  salesSummaryConfig,
38
38
  ticketLiveConfig,
39
39
  ticketSummaryConfig
40
- } from "./chunk-SP2ZXKSZ.js";
40
+ } from "./chunk-6CXSU5L4.js";
41
41
 
42
42
  // src/utils/alignment.ts
43
43
  function getColumnAlignment(type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbortouch/skytab-analytics-report-utils",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "description": "Centralized report column presentation configuration for SkyTab Analytics",
5
5
  "engines": {
6
6
  "node": ">=22.6.0",