@harbortouch/skytab-analytics-report-utils 0.31.0 → 0.32.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-IIPYKKDA.js → chunk-WGCCNROK.js} +11 -0
- package/dist/exporters/exportBuilder.cjs +11 -8
- package/dist/exporters/exportBuilder.d.cts +1 -1
- package/dist/exporters/exportBuilder.d.ts +1 -1
- package/dist/exporters/exportBuilder.js +3 -9
- package/dist/index.cjs +12 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/dist/{report-BqJq4PM3.d.cts → report-07XHPnMh.d.cts} +4 -1
- package/dist/{report-BqJq4PM3.d.ts → report-07XHPnMh.d.ts} +4 -1
- package/package.json +1 -1
|
@@ -1038,6 +1038,16 @@ var REPORT_DEFAULT_NAME_MAP = {
|
|
|
1038
1038
|
"daily-sales-live": "Daily Sales Live"
|
|
1039
1039
|
};
|
|
1040
1040
|
var getReportConfig = (reportType) => REPORT_CONFIG_MAP[reportType];
|
|
1041
|
+
var getFixedColumns = (config, parameters) => {
|
|
1042
|
+
const visibleColumns = new Set(config.defaultVisibleColumns ?? []);
|
|
1043
|
+
const fixedCols = config.availableColumns.filter((col) => !visibleColumns.has(col));
|
|
1044
|
+
return fixedCols.filter((col) => {
|
|
1045
|
+
if (col === "groupByName2") {
|
|
1046
|
+
return !!parameters?.secondGroupBy;
|
|
1047
|
+
}
|
|
1048
|
+
return true;
|
|
1049
|
+
});
|
|
1050
|
+
};
|
|
1041
1051
|
var getReportExportFileName = ({
|
|
1042
1052
|
reportType,
|
|
1043
1053
|
startDate,
|
|
@@ -3523,6 +3533,7 @@ export {
|
|
|
3523
3533
|
dailySalesTrendsOrderTypeConfig,
|
|
3524
3534
|
Report,
|
|
3525
3535
|
getReportConfig,
|
|
3536
|
+
getFixedColumns,
|
|
3526
3537
|
getReportExportFileName,
|
|
3527
3538
|
COLUMN_REGISTRY,
|
|
3528
3539
|
getColumnMetadata,
|
|
@@ -2663,6 +2663,16 @@ var REPORT_CONFIG_MAP = {
|
|
|
2663
2663
|
"daily-sales-live": DAILY_SALES_SECTION_CONFIGS
|
|
2664
2664
|
};
|
|
2665
2665
|
var getReportConfig = (reportType) => REPORT_CONFIG_MAP[reportType];
|
|
2666
|
+
var getFixedColumns = (config, parameters) => {
|
|
2667
|
+
const visibleColumns = new Set(config.defaultVisibleColumns ?? []);
|
|
2668
|
+
const fixedCols = config.availableColumns.filter((col) => !visibleColumns.has(col));
|
|
2669
|
+
return fixedCols.filter((col) => {
|
|
2670
|
+
if (col === "groupByName2") {
|
|
2671
|
+
return !!parameters?.secondGroupBy;
|
|
2672
|
+
}
|
|
2673
|
+
return true;
|
|
2674
|
+
});
|
|
2675
|
+
};
|
|
2666
2676
|
|
|
2667
2677
|
// src/columns/index.ts
|
|
2668
2678
|
var COLUMN_REGISTRY = {
|
|
@@ -3491,14 +3501,7 @@ var ExportBuilder = class {
|
|
|
3491
3501
|
return resolveTranslate(messageKey, this.locale);
|
|
3492
3502
|
}
|
|
3493
3503
|
getFixedColFromConfig(config, parameters) {
|
|
3494
|
-
|
|
3495
|
-
const fixedCols = config.availableColumns.filter((col) => !visibleColumns.has(col));
|
|
3496
|
-
return fixedCols.filter((col) => {
|
|
3497
|
-
if (col === "groupByName2") {
|
|
3498
|
-
return !!parameters.secondGroupBy;
|
|
3499
|
-
}
|
|
3500
|
-
return true;
|
|
3501
|
-
});
|
|
3504
|
+
return getFixedColumns(config, parameters);
|
|
3502
3505
|
}
|
|
3503
3506
|
sortAndAddFixedCols(config, parameters, collected) {
|
|
3504
3507
|
const fixedCols = this.getFixedColFromConfig(config, parameters);
|
|
@@ -3,10 +3,11 @@ import {
|
|
|
3
3
|
formatFieldValue,
|
|
4
4
|
getColumnExportHeaderLabel,
|
|
5
5
|
getColumnMetadata,
|
|
6
|
+
getFixedColumns,
|
|
6
7
|
getReportConfig,
|
|
7
8
|
getReportFormattingLocaleOptions,
|
|
8
9
|
resolveTranslate
|
|
9
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-WGCCNROK.js";
|
|
10
11
|
|
|
11
12
|
// src/exporters/exportBuilder.ts
|
|
12
13
|
import { format, isValid, parseISO } from "date-fns";
|
|
@@ -30,14 +31,7 @@ var ExportBuilder = class {
|
|
|
30
31
|
return resolveTranslate(messageKey, this.locale);
|
|
31
32
|
}
|
|
32
33
|
getFixedColFromConfig(config, parameters) {
|
|
33
|
-
|
|
34
|
-
const fixedCols = config.availableColumns.filter((col) => !visibleColumns.has(col));
|
|
35
|
-
return fixedCols.filter((col) => {
|
|
36
|
-
if (col === "groupByName2") {
|
|
37
|
-
return !!parameters.secondGroupBy;
|
|
38
|
-
}
|
|
39
|
-
return true;
|
|
40
|
-
});
|
|
34
|
+
return getFixedColumns(config, parameters);
|
|
41
35
|
}
|
|
42
36
|
sortAndAddFixedCols(config, parameters, collected) {
|
|
43
37
|
const fixedCols = this.getFixedColFromConfig(config, parameters);
|
package/dist/index.cjs
CHANGED
|
@@ -53,6 +53,7 @@ __export(index_exports, {
|
|
|
53
53
|
getColumnExportHeaderLabel: () => getColumnExportHeaderLabel,
|
|
54
54
|
getColumnMetadata: () => getColumnMetadata,
|
|
55
55
|
getDateToFormat: () => getDateToFormat,
|
|
56
|
+
getFixedColumns: () => getFixedColumns,
|
|
56
57
|
getFooterValue: () => getFooterValue,
|
|
57
58
|
getNumberToFormat: () => getNumberToFormat,
|
|
58
59
|
getReportConfig: () => getReportConfig,
|
|
@@ -1111,6 +1112,16 @@ var REPORT_DEFAULT_NAME_MAP = {
|
|
|
1111
1112
|
"daily-sales-live": "Daily Sales Live"
|
|
1112
1113
|
};
|
|
1113
1114
|
var getReportConfig = (reportType) => REPORT_CONFIG_MAP[reportType];
|
|
1115
|
+
var getFixedColumns = (config, parameters) => {
|
|
1116
|
+
const visibleColumns = new Set(config.defaultVisibleColumns ?? []);
|
|
1117
|
+
const fixedCols = config.availableColumns.filter((col) => !visibleColumns.has(col));
|
|
1118
|
+
return fixedCols.filter((col) => {
|
|
1119
|
+
if (col === "groupByName2") {
|
|
1120
|
+
return !!parameters?.secondGroupBy;
|
|
1121
|
+
}
|
|
1122
|
+
return true;
|
|
1123
|
+
});
|
|
1124
|
+
};
|
|
1114
1125
|
var getReportExportFileName = ({
|
|
1115
1126
|
reportType,
|
|
1116
1127
|
startDate,
|
|
@@ -3797,6 +3808,7 @@ var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DE
|
|
|
3797
3808
|
getColumnExportHeaderLabel,
|
|
3798
3809
|
getColumnMetadata,
|
|
3799
3810
|
getDateToFormat,
|
|
3811
|
+
getFixedColumns,
|
|
3800
3812
|
getFooterValue,
|
|
3801
3813
|
getNumberToFormat,
|
|
3802
3814
|
getReportConfig,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MessageKey, F as FieldType, C as ColumnAlignment, a as ColumnPresentationConfig, b as ColumnGroupConfig, R as ReportType, c as ReportConfig, d as ReportColumnKey } from './report-
|
|
2
|
-
export { e as COLUMN_REGISTRY, f as ColumnMessageKey, g as ColumnMetadata, h as FooterCalculation, i as FooterCalculationType, j as Report, k as getColumnExportHeaderLabel, l as getColumnMetadata, m as
|
|
1
|
+
import { M as MessageKey, F as FieldType, C as ColumnAlignment, a as ColumnPresentationConfig, b as ColumnGroupConfig, R as ReportType, c as ReportConfig, d as ReportColumnKey } from './report-07XHPnMh.cjs';
|
|
2
|
+
export { e as COLUMN_REGISTRY, f as ColumnMessageKey, g as ColumnMetadata, h as FooterCalculation, i as FooterCalculationType, j as Report, k as getColumnExportHeaderLabel, l as getColumnMetadata, m as getFixedColumns, n as getReportConfig, o as getReportExportFileName } from './report-07XHPnMh.cjs';
|
|
3
3
|
import { LocaleCode } from '@harbortouch/locale-registry';
|
|
4
4
|
export { R as RenderedReport, a as ReportDocument, b as ReportFormat, c as ReportSection, d as ResolvedColumn, S as SummaryRow } from './ir-CUi0Z9hv.cjs';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MessageKey, F as FieldType, C as ColumnAlignment, a as ColumnPresentationConfig, b as ColumnGroupConfig, R as ReportType, c as ReportConfig, d as ReportColumnKey } from './report-
|
|
2
|
-
export { e as COLUMN_REGISTRY, f as ColumnMessageKey, g as ColumnMetadata, h as FooterCalculation, i as FooterCalculationType, j as Report, k as getColumnExportHeaderLabel, l as getColumnMetadata, m as
|
|
1
|
+
import { M as MessageKey, F as FieldType, C as ColumnAlignment, a as ColumnPresentationConfig, b as ColumnGroupConfig, R as ReportType, c as ReportConfig, d as ReportColumnKey } from './report-07XHPnMh.js';
|
|
2
|
+
export { e as COLUMN_REGISTRY, f as ColumnMessageKey, g as ColumnMetadata, h as FooterCalculation, i as FooterCalculationType, j as Report, k as getColumnExportHeaderLabel, l as getColumnMetadata, m as getFixedColumns, n as getReportConfig, o as getReportExportFileName } from './report-07XHPnMh.js';
|
|
3
3
|
import { LocaleCode } from '@harbortouch/locale-registry';
|
|
4
4
|
export { R as RenderedReport, a as ReportDocument, b as ReportFormat, c as ReportSection, d as ResolvedColumn, S as SummaryRow } from './ir-CUi0Z9hv.js';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
getColumnExportHeaderLabel,
|
|
25
25
|
getColumnMetadata,
|
|
26
26
|
getDateToFormat,
|
|
27
|
+
getFixedColumns,
|
|
27
28
|
getFooterValue,
|
|
28
29
|
getNumberToFormat,
|
|
29
30
|
getReportConfig,
|
|
@@ -38,7 +39,7 @@ import {
|
|
|
38
39
|
ticketLiveConfig,
|
|
39
40
|
ticketSummaryConfig,
|
|
40
41
|
tipCashoutReconciliationConfig
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-WGCCNROK.js";
|
|
42
43
|
|
|
43
44
|
// src/utils/alignment.ts
|
|
44
45
|
function getColumnAlignment(type) {
|
|
@@ -261,6 +262,7 @@ export {
|
|
|
261
262
|
getColumnExportHeaderLabel,
|
|
262
263
|
getColumnMetadata,
|
|
263
264
|
getDateToFormat,
|
|
265
|
+
getFixedColumns,
|
|
264
266
|
getFooterValue,
|
|
265
267
|
getNumberToFormat,
|
|
266
268
|
getReportConfig,
|
|
@@ -1305,6 +1305,9 @@ declare const Report: {
|
|
|
1305
1305
|
};
|
|
1306
1306
|
type ReportType = (typeof Report)[keyof typeof Report];
|
|
1307
1307
|
declare const getReportConfig: (reportType: ReportType) => ReportConfig<string> | ReportConfig<string>[] | null;
|
|
1308
|
+
declare const getFixedColumns: <TField extends string = string>(config: ReportConfig<TField>, parameters?: {
|
|
1309
|
+
secondGroupBy?: AnalyticsField;
|
|
1310
|
+
}) => TField[];
|
|
1308
1311
|
declare const getReportExportFileName: ({ reportType, startDate, endDate, format, }: {
|
|
1309
1312
|
reportType: ReportType;
|
|
1310
1313
|
startDate: Date;
|
|
@@ -1312,4 +1315,4 @@ declare const getReportExportFileName: ({ reportType, startDate, endDate, format
|
|
|
1312
1315
|
format: "csv" | "xlsx" | "pdf";
|
|
1313
1316
|
}) => string;
|
|
1314
1317
|
|
|
1315
|
-
export { type AnalyticsField as A, type ColumnAlignment as C, type FieldType as F, type MessageKey as M, type ReportType as R, type ColumnPresentationConfig as a, type ColumnGroupConfig as b, type ReportConfig as c, type ReportColumnKey as d, COLUMN_REGISTRY as e, type ColumnMessageKey as f, type ColumnMetadata as g, type FooterCalculation as h, type FooterCalculationType as i, Report as j, getColumnExportHeaderLabel as k, getColumnMetadata as l,
|
|
1318
|
+
export { type AnalyticsField as A, type ColumnAlignment as C, type FieldType as F, type MessageKey as M, type ReportType as R, type ColumnPresentationConfig as a, type ColumnGroupConfig as b, type ReportConfig as c, type ReportColumnKey as d, COLUMN_REGISTRY as e, type ColumnMessageKey as f, type ColumnMetadata as g, type FooterCalculation as h, type FooterCalculationType as i, Report as j, getColumnExportHeaderLabel as k, getColumnMetadata as l, getFixedColumns as m, getReportConfig as n, getReportExportFileName as o };
|
|
@@ -1305,6 +1305,9 @@ declare const Report: {
|
|
|
1305
1305
|
};
|
|
1306
1306
|
type ReportType = (typeof Report)[keyof typeof Report];
|
|
1307
1307
|
declare const getReportConfig: (reportType: ReportType) => ReportConfig<string> | ReportConfig<string>[] | null;
|
|
1308
|
+
declare const getFixedColumns: <TField extends string = string>(config: ReportConfig<TField>, parameters?: {
|
|
1309
|
+
secondGroupBy?: AnalyticsField;
|
|
1310
|
+
}) => TField[];
|
|
1308
1311
|
declare const getReportExportFileName: ({ reportType, startDate, endDate, format, }: {
|
|
1309
1312
|
reportType: ReportType;
|
|
1310
1313
|
startDate: Date;
|
|
@@ -1312,4 +1315,4 @@ declare const getReportExportFileName: ({ reportType, startDate, endDate, format
|
|
|
1312
1315
|
format: "csv" | "xlsx" | "pdf";
|
|
1313
1316
|
}) => string;
|
|
1314
1317
|
|
|
1315
|
-
export { type AnalyticsField as A, type ColumnAlignment as C, type FieldType as F, type MessageKey as M, type ReportType as R, type ColumnPresentationConfig as a, type ColumnGroupConfig as b, type ReportConfig as c, type ReportColumnKey as d, COLUMN_REGISTRY as e, type ColumnMessageKey as f, type ColumnMetadata as g, type FooterCalculation as h, type FooterCalculationType as i, Report as j, getColumnExportHeaderLabel as k, getColumnMetadata as l,
|
|
1318
|
+
export { type AnalyticsField as A, type ColumnAlignment as C, type FieldType as F, type MessageKey as M, type ReportType as R, type ColumnPresentationConfig as a, type ColumnGroupConfig as b, type ReportConfig as c, type ReportColumnKey as d, COLUMN_REGISTRY as e, type ColumnMessageKey as f, type ColumnMetadata as g, type FooterCalculation as h, type FooterCalculationType as i, Report as j, getColumnExportHeaderLabel as k, getColumnMetadata as l, getFixedColumns as m, getReportConfig as n, getReportExportFileName as o };
|