@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.
- package/dist/{chunk-7NXZJEGU.js → chunk-2UW4QVTT.js} +670 -584
- package/dist/exporters/exportBuilder.cjs +2865 -2779
- package/dist/exporters/exportBuilder.d.cts +1 -1
- package/dist/exporters/exportBuilder.d.ts +1 -1
- package/dist/exporters/exportBuilder.js +5 -8
- package/dist/index.cjs +178 -105
- package/dist/index.d.cts +22 -15
- package/dist/index.d.ts +22 -15
- package/dist/index.js +19 -34
- package/dist/{report-BOL9p86o.d.cts → report-DklnjPk7.d.cts} +13 -5
- package/dist/{report-BOL9p86o.d.ts → report-DklnjPk7.d.ts} +13 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ReportType, A as AnalyticsField } from '../report-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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"
|
|
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]
|
|
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
|
-
|
|
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) {
|