@harbortouch/skytab-analytics-report-utils 0.21.0 → 0.22.0

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,4 +1,4 @@
1
- import { R as ReportType, A as AnalyticsField } from '../report-BOL9p86o.cjs';
1
+ import { R as ReportType, A as AnalyticsField } from '../report-DklnjPk7.cjs';
2
2
  import { E as ExportTable, a as ExportFilter } from '../types-BzLsgnfc.cjs';
3
3
 
4
4
  interface ReportDocumentSection {
@@ -1,4 +1,4 @@
1
- import { R as ReportType, A as AnalyticsField } from '../report-BOL9p86o.js';
1
+ import { R as ReportType, A as AnalyticsField } from '../report-DklnjPk7.js';
2
2
  import { E as ExportTable, a as ExportFilter } from '../types-BzLsgnfc.js';
3
3
 
4
4
  interface ReportDocumentSection {
@@ -1,13 +1,12 @@
1
1
  import {
2
2
  calculateReportTotals,
3
- en_US_default,
4
3
  formatFieldValue,
5
4
  getColumnExportHeaderLabel,
6
5
  getColumnMetadata,
7
6
  getReportConfig,
8
7
  getReportFormattingLocaleOptions,
9
8
  resolveTranslate
10
- } from "../chunk-7NXZJEGU.js";
9
+ } from "../chunk-2UW4QVTT.js";
11
10
 
12
11
  // src/exporters/exportBuilder.ts
13
12
  import { format, isValid, parseISO } from "date-fns";
@@ -112,8 +111,7 @@ var ExportBuilder = class {
112
111
  if (!config || value === void 0 || value === null) {
113
112
  return "";
114
113
  }
115
- const formatted = formatFieldValue(value, config.type, localeOption, fullRecord, config);
116
- return typeof formatted === "string" && formatted in en_US_default ? this.translate(formatted) : formatted;
114
+ return formatFieldValue(value, config.type, localeOption, fullRecord, config);
117
115
  }
118
116
  formatRow(raw, columns, columnTypes, localeConfig, fullRecord) {
119
117
  const formatted = {};
@@ -123,22 +121,21 @@ var ExportBuilder = class {
123
121
  return formatted;
124
122
  }
125
123
  resolveLabelField(config, columns) {
126
- if ("groupByName" in config.fields) {
124
+ if (columns.includes("groupByName")) {
127
125
  return "groupByName";
128
126
  }
129
127
  const firstStringCol = columns.find((col) => {
130
128
  const field = config.fields[col];
131
129
  return field?.type === "string" && !field.footerCalculation;
132
130
  });
133
- return firstStringCol ?? columns[0] ?? "groupByName";
131
+ return firstStringCol ?? columns[0];
134
132
  }
135
133
  buildTotalsRow(data, config, columns) {
136
134
  if (data.length === 0) {
137
135
  return null;
138
136
  }
139
137
  const labelField = this.resolveLabelField(config, columns);
140
- const label = config.totalsLabel ? this.translate(config.totalsLabel) : this.translate("table.total");
141
- return calculateReportTotals(data, config.fields, { labelField, label });
138
+ return calculateReportTotals(data, config.fields, { labelField, label: this.translate("table.total") });
142
139
  }
143
140
  getExtraFooterRows(data, config, sectionData, columns) {
144
141
  if (config.extraFooterRowsKey) {