@quillsql/react 2.16.92 → 2.16.94
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 +86 -39
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +86 -39
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -103,7 +103,7 @@ function formatIdentifierLabel(str) {
|
|
|
103
103
|
if (hasUnderscore || hasCamelCaseBoundary) {
|
|
104
104
|
return snakeAndCamelCaseToTitleCase(str);
|
|
105
105
|
}
|
|
106
|
-
return str;
|
|
106
|
+
return str.split(/\s+/).map((word) => word === "id" ? "ID" : capitalize(word)).join(" ");
|
|
107
107
|
}
|
|
108
108
|
function removeDoubleQuotes(str) {
|
|
109
109
|
if (!str) {
|
|
@@ -137,13 +137,14 @@ function getValidDate(dateString) {
|
|
|
137
137
|
const dates = FORMATS.map((fmt) => (0, import_date_fns.parse)(dateString, fmt, /* @__PURE__ */ new Date()));
|
|
138
138
|
return dates.find((date) => (0, import_date_fns.isValid)(date));
|
|
139
139
|
}
|
|
140
|
-
var import_date_fns, import_date_fns_tz, DATE_FORMAT_TYPES, NUMBER_FORMAT_TYPES, valueFormatter, quillFormat, quillAutoFormat, formatString, formatterDollar, formatDollarAmount, formatterCentsDollar, formatDollarCents, wholeNumberFormatter, formatWholeNumber, formatOneDecimalPlace, formatterTwoDecimalPlaces, formatTwoDecimalPlaces, formatterPercent, formatPercent, _getUTCDateHelper, format_YYYY, format_MMM_yyyy, format_hh_ap_pm, format_MMM_d, format_MMM_dd_yyyy, format_MMM_d_MMM_d, format_MMM_dd_hh_mm_ap_pm, format_wo_yyyy, localeFormatter, FORMATS, compareValues;
|
|
140
|
+
var import_date_fns, import_date_fns_tz, DATE_OUTSIDE_RANGE, DATE_FORMAT_TYPES, NUMBER_FORMAT_TYPES, valueFormatter, quillFormat, quillAutoFormat, formatString, formatterDollar, formatDollarAmount, formatterCentsDollar, formatDollarCents, wholeNumberFormatter, formatWholeNumber, formatOneDecimalPlace, formatterTwoDecimalPlaces, formatTwoDecimalPlaces, formatterPercent, formatPercent, _getUTCDateHelper, format_YYYY, format_MMM_yyyy, format_hh_ap_pm, format_MMM_d, format_MMM_dd_yyyy, format_MMM_d_MMM_d, format_MMM_dd_hh_mm_ap_pm, format_wo_yyyy, localeFormatter, FORMATS, compareValues;
|
|
141
141
|
var init_valueFormatter = __esm({
|
|
142
142
|
"src/utils/valueFormatter.ts"() {
|
|
143
143
|
"use strict";
|
|
144
144
|
import_date_fns = require("date-fns");
|
|
145
145
|
import_date_fns_tz = require("date-fns-tz");
|
|
146
146
|
init_textProcessing();
|
|
147
|
+
DATE_OUTSIDE_RANGE = "Date outside range";
|
|
147
148
|
DATE_FORMAT_TYPES = [
|
|
148
149
|
"yyyy",
|
|
149
150
|
"MMM_yyyy",
|
|
@@ -392,7 +393,7 @@ var init_valueFormatter = __esm({
|
|
|
392
393
|
weekEnd = utcEnd;
|
|
393
394
|
}
|
|
394
395
|
if ((0, import_date_fns.isAfter)(weekStart, utcEnd) || (0, import_date_fns.isBefore)(weekEnd, utcStart)) {
|
|
395
|
-
return
|
|
396
|
+
return DATE_OUTSIDE_RANGE;
|
|
396
397
|
}
|
|
397
398
|
}
|
|
398
399
|
}
|
|
@@ -17287,7 +17288,7 @@ async function generatePivotWithSQL({
|
|
|
17287
17288
|
);
|
|
17288
17289
|
const responseRows = queryResponseRows;
|
|
17289
17290
|
const responseFields = queryResponseFields;
|
|
17290
|
-
|
|
17291
|
+
let rows = resultRowField ? responseRows.map(
|
|
17291
17292
|
(row) => !row[resultRowField] ? { ...row, [resultRowField]: "-" } : row
|
|
17292
17293
|
) : responseRows;
|
|
17293
17294
|
if (pivot.columnField && client.databaseType?.toLowerCase() === "bigquery") {
|
|
@@ -17326,24 +17327,21 @@ async function generatePivotWithSQL({
|
|
|
17326
17327
|
return 0;
|
|
17327
17328
|
});
|
|
17328
17329
|
if (resultRowField && !isStringType(pivot.rowFieldType || "")) {
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
const rowDate = new Date(value);
|
|
17334
|
-
if (rowDate < dateFilter.startDate) {
|
|
17335
|
-
value = dateFilter.startDate.toISOString();
|
|
17336
|
-
} else if (rowDate > dateFilter.endDate) {
|
|
17337
|
-
value = dateFilter.endDate.toISOString();
|
|
17338
|
-
}
|
|
17339
|
-
}
|
|
17330
|
+
const dateRange = dateFilter?.startDate && dateFilter?.endDate ? { start: dateFilter.startDate, end: dateFilter.endDate } : void 0;
|
|
17331
|
+
rows = rows.filter((row) => {
|
|
17332
|
+
const rawValue = typeof row[resultRowField] === "object" ? row[resultRowField].value : row[resultRowField];
|
|
17333
|
+
row.__quillRawDate = rawValue;
|
|
17340
17334
|
const dateString = getDateString(
|
|
17341
|
-
|
|
17342
|
-
|
|
17335
|
+
rawValue,
|
|
17336
|
+
dateRange,
|
|
17343
17337
|
dateBucket,
|
|
17344
17338
|
databaseType
|
|
17345
17339
|
);
|
|
17340
|
+
if (dateBucket === "week" && dateRange && dateString === DATE_OUTSIDE_RANGE) {
|
|
17341
|
+
return false;
|
|
17342
|
+
}
|
|
17346
17343
|
row[resultRowField] = dateString;
|
|
17344
|
+
return true;
|
|
17347
17345
|
});
|
|
17348
17346
|
if (resultRowField && pivot.rowFieldType && !isStringType(pivot.rowFieldType) && dateFilter?.startDate && dateFilter?.endDate) {
|
|
17349
17347
|
const dateSet = new Set(rows.map((row) => row[resultRowField]));
|
|
@@ -17508,7 +17506,7 @@ function processPivotData({
|
|
|
17508
17506
|
const pivotRowField = processColumnName(
|
|
17509
17507
|
String(resultRowField ?? pivot.rowField ?? "")
|
|
17510
17508
|
);
|
|
17511
|
-
|
|
17509
|
+
let rows = pivotRowField ? responseRows.map(
|
|
17512
17510
|
(row) => !row[pivotRowField] ? { ...row, [pivotRowField]: "-" } : row
|
|
17513
17511
|
) : responseRows;
|
|
17514
17512
|
if (pivot.columnField && client.databaseType?.toLowerCase() === "bigquery") {
|
|
@@ -17547,24 +17545,21 @@ function processPivotData({
|
|
|
17547
17545
|
return 0;
|
|
17548
17546
|
});
|
|
17549
17547
|
if (pivotRowField && !isStringType(pivot.rowFieldType || "")) {
|
|
17550
|
-
|
|
17551
|
-
|
|
17552
|
-
|
|
17553
|
-
|
|
17554
|
-
const rowDate = new Date(value);
|
|
17555
|
-
if (rowDate < dateFilter.startDate) {
|
|
17556
|
-
value = dateFilter.startDate.toISOString();
|
|
17557
|
-
} else if (rowDate > dateFilter.endDate) {
|
|
17558
|
-
value = dateFilter.endDate.toISOString();
|
|
17559
|
-
}
|
|
17560
|
-
}
|
|
17548
|
+
const dateRange = dateFilter?.startDate && dateFilter?.endDate ? { start: dateFilter.startDate, end: dateFilter.endDate } : void 0;
|
|
17549
|
+
rows = rows.filter((row) => {
|
|
17550
|
+
const rawValue = typeof row[pivotRowField] === "object" ? row[pivotRowField].value : row[pivotRowField];
|
|
17551
|
+
row.__quillRawDate = rawValue;
|
|
17561
17552
|
const dateString = getDateString(
|
|
17562
|
-
|
|
17563
|
-
|
|
17553
|
+
rawValue,
|
|
17554
|
+
dateRange,
|
|
17564
17555
|
dateBucket,
|
|
17565
17556
|
databaseType
|
|
17566
17557
|
);
|
|
17558
|
+
if (dateBucket === "week" && dateRange && dateString === DATE_OUTSIDE_RANGE) {
|
|
17559
|
+
return false;
|
|
17560
|
+
}
|
|
17567
17561
|
row[pivotRowField] = dateString;
|
|
17562
|
+
return true;
|
|
17568
17563
|
});
|
|
17569
17564
|
if (pivotRowField && pivot.rowFieldType && !isStringType(pivot.rowFieldType) && dateFilter?.startDate && dateFilter?.endDate) {
|
|
17570
17565
|
const dateSet = new Set(rows.map((row) => row[pivotRowField]));
|
|
@@ -17628,6 +17623,7 @@ var init_pivotConstructor = __esm({
|
|
|
17628
17623
|
init_dataProcessing();
|
|
17629
17624
|
init_dates();
|
|
17630
17625
|
init_textProcessing();
|
|
17626
|
+
init_valueFormatter();
|
|
17631
17627
|
}
|
|
17632
17628
|
});
|
|
17633
17629
|
|
|
@@ -22802,6 +22798,7 @@ init_columnProcessing();
|
|
|
22802
22798
|
init_dataFetcher();
|
|
22803
22799
|
init_dataProcessing();
|
|
22804
22800
|
init_dates();
|
|
22801
|
+
init_columnType();
|
|
22805
22802
|
init_paginationProcessing();
|
|
22806
22803
|
init_pivotProcessing();
|
|
22807
22804
|
init_tableProcessing();
|
|
@@ -23727,6 +23724,15 @@ function hasPreformattedDateBucketLabels(report) {
|
|
|
23727
23724
|
if (report.chartType?.toLowerCase() === "table") return false;
|
|
23728
23725
|
return report.xAxisField?.trim() === pivot.rowField?.trim();
|
|
23729
23726
|
}
|
|
23727
|
+
function resolvePivotBucketXAxisFormat(report) {
|
|
23728
|
+
const pivot = report.pivot;
|
|
23729
|
+
if (!pivot?.dateBucket) return null;
|
|
23730
|
+
if (report.chartType?.toLowerCase() === "table") return null;
|
|
23731
|
+
const rowField = pivot.rowField?.trim();
|
|
23732
|
+
if (!rowField || report.xAxisField?.trim() !== rowField) return null;
|
|
23733
|
+
if (!isDateType(String(pivot.rowFieldType ?? ""))) return null;
|
|
23734
|
+
return getDateFormatFromBucket(pivot.dateBucket);
|
|
23735
|
+
}
|
|
23730
23736
|
function applySavedPivotColumnLabels(report, pivotColumns) {
|
|
23731
23737
|
return pivotColumns?.map((column) => {
|
|
23732
23738
|
const savedColumn = report.columns?.find(
|
|
@@ -23802,6 +23808,10 @@ function convertInternalReportToReport(report, dashboardFilters, eventTracking,
|
|
|
23802
23808
|
...extractAllReportValuesFromQuillInternalReport(formattedReport),
|
|
23803
23809
|
...pivotFormatted
|
|
23804
23810
|
};
|
|
23811
|
+
const bucketXAxisFormat = resolvePivotBucketXAxisFormat(pivotReport);
|
|
23812
|
+
if (bucketXAxisFormat) {
|
|
23813
|
+
pivotReport.xAxisFormat = bucketXAxisFormat;
|
|
23814
|
+
}
|
|
23805
23815
|
pivotReport.formattedBaseRows = formattedBaseRows;
|
|
23806
23816
|
return applyChartSort(pivotReport);
|
|
23807
23817
|
}
|
|
@@ -34074,9 +34084,8 @@ function RadarChart({
|
|
|
34074
34084
|
fields: [{ field: xAxisField, format: xAxisFormat }]
|
|
34075
34085
|
}),
|
|
34076
34086
|
valueFormatter: (value, name2) => {
|
|
34077
|
-
const
|
|
34078
|
-
|
|
34079
|
-
)?.dataKey;
|
|
34087
|
+
const payloadItem = payloadItems.find((p) => p.dataKey === name2) ?? payloadItems.find((p) => p.name === name2);
|
|
34088
|
+
const field = payloadItem?.dataKey;
|
|
34080
34089
|
if (!field) return value;
|
|
34081
34090
|
return valueFormatter({
|
|
34082
34091
|
value,
|
|
@@ -37573,7 +37582,8 @@ var useDashboards = () => {
|
|
|
37573
37582
|
reports: Object.values(dashboard.config.sections ?? {}).flat(),
|
|
37574
37583
|
tenantKeys: dashboard.config.tenantKeys,
|
|
37575
37584
|
createdAt: dashboard.config.createdAt,
|
|
37576
|
-
sectionOrder: dashboard.config.sectionOrder
|
|
37585
|
+
sectionOrder: dashboard.config.sectionOrder,
|
|
37586
|
+
hidden: dashboard.config.hidden
|
|
37577
37587
|
};
|
|
37578
37588
|
}).sort(
|
|
37579
37589
|
(a, b) => (a.createdAt?.getTime() ?? 0) - (b.createdAt?.getTime() ?? 0)
|
|
@@ -46216,6 +46226,7 @@ var QuillProvider = ({
|
|
|
46216
46226
|
isAdmin,
|
|
46217
46227
|
getAuthorizationToken,
|
|
46218
46228
|
eventTracking,
|
|
46229
|
+
onChangelogs,
|
|
46219
46230
|
children
|
|
46220
46231
|
}
|
|
46221
46232
|
) });
|
|
@@ -63339,9 +63350,21 @@ function normalizePivotChartForDisplay(chart, resolveTableLabel) {
|
|
|
63339
63350
|
const firstPivotRow = (withResolvedXAxis.rows ?? []).find(
|
|
63340
63351
|
(row) => Object.keys(row).length > 0
|
|
63341
63352
|
);
|
|
63342
|
-
const
|
|
63343
|
-
|
|
63344
|
-
)
|
|
63353
|
+
const pivotRowFieldName = String(
|
|
63354
|
+
withResolvedXAxis.pivot?.rowField ?? ""
|
|
63355
|
+
).trim();
|
|
63356
|
+
const pivotRowFields = firstPivotRow ? (() => {
|
|
63357
|
+
const keys = Object.keys(firstPivotRow).filter(
|
|
63358
|
+
(field) => !INTERNAL_PIVOT_ROW_FIELDS.has(field)
|
|
63359
|
+
);
|
|
63360
|
+
if (pivotRowFieldName && keys.includes(pivotRowFieldName)) {
|
|
63361
|
+
return [
|
|
63362
|
+
pivotRowFieldName,
|
|
63363
|
+
...keys.filter((field) => field !== pivotRowFieldName)
|
|
63364
|
+
];
|
|
63365
|
+
}
|
|
63366
|
+
return keys;
|
|
63367
|
+
})() : [];
|
|
63345
63368
|
const pivotValueFields = pivotRowFields.filter(
|
|
63346
63369
|
(field) => field !== withResolvedXAxis.pivot?.rowField
|
|
63347
63370
|
);
|
|
@@ -63354,6 +63377,10 @@ function normalizePivotChartForDisplay(chart, resolveTableLabel) {
|
|
|
63354
63377
|
);
|
|
63355
63378
|
const resolveYAxisFormat = (field, aggregation) => {
|
|
63356
63379
|
if (aggregation?.aggregationType === "count") {
|
|
63380
|
+
const savedFormat = yAxisFormatByField.get(field) ?? yAxisFormatByField.get("count") ?? withResolvedXAxis.yAxisFields?.find(
|
|
63381
|
+
(axis) => String(axis.field ?? "").trim() === field
|
|
63382
|
+
)?.format ?? withResolvedXAxis.yAxisFields?.[0]?.format;
|
|
63383
|
+
if (savedFormat) return savedFormat;
|
|
63357
63384
|
return "whole_number";
|
|
63358
63385
|
}
|
|
63359
63386
|
if (aggregation?.aggregationType === "percentage") {
|
|
@@ -69338,6 +69365,15 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69338
69365
|
}
|
|
69339
69366
|
for (const yAxis2 of chartAxesBaseChart.yAxisFields ?? []) {
|
|
69340
69367
|
registerOption(yAxis2.field, yAxis2.label, yAxis2.format);
|
|
69368
|
+
if (yAxis2.format) {
|
|
69369
|
+
const existing = optionsByField.get(yAxis2.field);
|
|
69370
|
+
if (existing) {
|
|
69371
|
+
optionsByField.set(yAxis2.field, {
|
|
69372
|
+
...existing,
|
|
69373
|
+
format: toAxisFormat(yAxis2.format, existing.format)
|
|
69374
|
+
});
|
|
69375
|
+
}
|
|
69376
|
+
}
|
|
69341
69377
|
}
|
|
69342
69378
|
if (chartAxesBaseChart.pivot?.columnField) {
|
|
69343
69379
|
for (const aggregationAxis of buildPivotAggregationAxisFields(
|
|
@@ -69351,11 +69387,22 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69351
69387
|
);
|
|
69352
69388
|
}
|
|
69353
69389
|
}
|
|
69390
|
+
const xField = String(chartAxesBaseChart.xAxisField ?? "").trim();
|
|
69391
|
+
const savedXFormat = String(chartAxesBaseChart.xAxisFormat ?? "").trim();
|
|
69354
69392
|
registerOption(
|
|
69355
|
-
|
|
69393
|
+
xField,
|
|
69356
69394
|
chartAxesBaseChart.xAxisLabel || chartAxesBaseChart.xAxisField,
|
|
69357
69395
|
chartAxesBaseChart.xAxisFormat
|
|
69358
69396
|
);
|
|
69397
|
+
if (xField && savedXFormat) {
|
|
69398
|
+
const existing = optionsByField.get(xField);
|
|
69399
|
+
if (existing) {
|
|
69400
|
+
optionsByField.set(xField, {
|
|
69401
|
+
...existing,
|
|
69402
|
+
format: toAxisFormat(savedXFormat, existing.format)
|
|
69403
|
+
});
|
|
69404
|
+
}
|
|
69405
|
+
}
|
|
69359
69406
|
return Array.from(optionsByField.values());
|
|
69360
69407
|
}, [chartAxesBaseChart, resolveTableDisplayLabel]);
|
|
69361
69408
|
const chartAxisOptionByField = (0, import_react63.useMemo)(() => {
|
package/dist/index.d.cts
CHANGED
|
@@ -1201,6 +1201,7 @@ declare function Dashboard({ name, onClickReport, containerStyle, EmptyDashboard
|
|
|
1201
1201
|
type DashboardConfig = {
|
|
1202
1202
|
dashboardId: string;
|
|
1203
1203
|
name: string;
|
|
1204
|
+
hidden?: boolean;
|
|
1204
1205
|
filters: InternalDashboardStringFilter[];
|
|
1205
1206
|
allTenantFilters?: InternalDashboardTenantFilter[];
|
|
1206
1207
|
tenantFilters?: InternalDashboardTenantFilter[];
|
|
@@ -3747,6 +3748,7 @@ declare const useDashboards: () => {
|
|
|
3747
3748
|
section: string;
|
|
3748
3749
|
reportOrder: string[];
|
|
3749
3750
|
}[] | undefined;
|
|
3751
|
+
hidden: boolean | undefined;
|
|
3750
3752
|
}[] | null;
|
|
3751
3753
|
isLoading: boolean;
|
|
3752
3754
|
createDashboard: ({ name, tenantFilters, filters, dateFilter, dashboardOwners, clientId, }: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1201,6 +1201,7 @@ declare function Dashboard({ name, onClickReport, containerStyle, EmptyDashboard
|
|
|
1201
1201
|
type DashboardConfig = {
|
|
1202
1202
|
dashboardId: string;
|
|
1203
1203
|
name: string;
|
|
1204
|
+
hidden?: boolean;
|
|
1204
1205
|
filters: InternalDashboardStringFilter[];
|
|
1205
1206
|
allTenantFilters?: InternalDashboardTenantFilter[];
|
|
1206
1207
|
tenantFilters?: InternalDashboardTenantFilter[];
|
|
@@ -3747,6 +3748,7 @@ declare const useDashboards: () => {
|
|
|
3747
3748
|
section: string;
|
|
3748
3749
|
reportOrder: string[];
|
|
3749
3750
|
}[] | undefined;
|
|
3751
|
+
hidden: boolean | undefined;
|
|
3750
3752
|
}[] | null;
|
|
3751
3753
|
isLoading: boolean;
|
|
3752
3754
|
createDashboard: ({ name, tenantFilters, filters, dateFilter, dashboardOwners, clientId, }: {
|
package/dist/index.js
CHANGED
|
@@ -107,7 +107,7 @@ function formatIdentifierLabel(str) {
|
|
|
107
107
|
if (hasUnderscore || hasCamelCaseBoundary) {
|
|
108
108
|
return snakeAndCamelCaseToTitleCase(str);
|
|
109
109
|
}
|
|
110
|
-
return str;
|
|
110
|
+
return str.split(/\s+/).map((word) => word === "id" ? "ID" : capitalize(word)).join(" ");
|
|
111
111
|
}
|
|
112
112
|
function removeDoubleQuotes(str) {
|
|
113
113
|
if (!str) {
|
|
@@ -153,11 +153,12 @@ function getValidDate(dateString) {
|
|
|
153
153
|
const dates = FORMATS.map((fmt) => parse(dateString, fmt, /* @__PURE__ */ new Date()));
|
|
154
154
|
return dates.find((date) => isValid(date));
|
|
155
155
|
}
|
|
156
|
-
var DATE_FORMAT_TYPES, NUMBER_FORMAT_TYPES, valueFormatter, quillFormat, quillAutoFormat, formatString, formatterDollar, formatDollarAmount, formatterCentsDollar, formatDollarCents, wholeNumberFormatter, formatWholeNumber, formatOneDecimalPlace, formatterTwoDecimalPlaces, formatTwoDecimalPlaces, formatterPercent, formatPercent, _getUTCDateHelper, format_YYYY, format_MMM_yyyy, format_hh_ap_pm, format_MMM_d, format_MMM_dd_yyyy, format_MMM_d_MMM_d, format_MMM_dd_hh_mm_ap_pm, format_wo_yyyy, localeFormatter, FORMATS, compareValues;
|
|
156
|
+
var DATE_OUTSIDE_RANGE, DATE_FORMAT_TYPES, NUMBER_FORMAT_TYPES, valueFormatter, quillFormat, quillAutoFormat, formatString, formatterDollar, formatDollarAmount, formatterCentsDollar, formatDollarCents, wholeNumberFormatter, formatWholeNumber, formatOneDecimalPlace, formatterTwoDecimalPlaces, formatTwoDecimalPlaces, formatterPercent, formatPercent, _getUTCDateHelper, format_YYYY, format_MMM_yyyy, format_hh_ap_pm, format_MMM_d, format_MMM_dd_yyyy, format_MMM_d_MMM_d, format_MMM_dd_hh_mm_ap_pm, format_wo_yyyy, localeFormatter, FORMATS, compareValues;
|
|
157
157
|
var init_valueFormatter = __esm({
|
|
158
158
|
"src/utils/valueFormatter.ts"() {
|
|
159
159
|
"use strict";
|
|
160
160
|
init_textProcessing();
|
|
161
|
+
DATE_OUTSIDE_RANGE = "Date outside range";
|
|
161
162
|
DATE_FORMAT_TYPES = [
|
|
162
163
|
"yyyy",
|
|
163
164
|
"MMM_yyyy",
|
|
@@ -406,7 +407,7 @@ var init_valueFormatter = __esm({
|
|
|
406
407
|
weekEnd = utcEnd;
|
|
407
408
|
}
|
|
408
409
|
if (isAfter(weekStart, utcEnd) || isBefore(weekEnd, utcStart)) {
|
|
409
|
-
return
|
|
410
|
+
return DATE_OUTSIDE_RANGE;
|
|
410
411
|
}
|
|
411
412
|
}
|
|
412
413
|
}
|
|
@@ -17334,7 +17335,7 @@ async function generatePivotWithSQL({
|
|
|
17334
17335
|
);
|
|
17335
17336
|
const responseRows = queryResponseRows;
|
|
17336
17337
|
const responseFields = queryResponseFields;
|
|
17337
|
-
|
|
17338
|
+
let rows = resultRowField ? responseRows.map(
|
|
17338
17339
|
(row) => !row[resultRowField] ? { ...row, [resultRowField]: "-" } : row
|
|
17339
17340
|
) : responseRows;
|
|
17340
17341
|
if (pivot.columnField && client.databaseType?.toLowerCase() === "bigquery") {
|
|
@@ -17373,24 +17374,21 @@ async function generatePivotWithSQL({
|
|
|
17373
17374
|
return 0;
|
|
17374
17375
|
});
|
|
17375
17376
|
if (resultRowField && !isStringType(pivot.rowFieldType || "")) {
|
|
17376
|
-
|
|
17377
|
-
|
|
17378
|
-
|
|
17379
|
-
|
|
17380
|
-
const rowDate = new Date(value);
|
|
17381
|
-
if (rowDate < dateFilter.startDate) {
|
|
17382
|
-
value = dateFilter.startDate.toISOString();
|
|
17383
|
-
} else if (rowDate > dateFilter.endDate) {
|
|
17384
|
-
value = dateFilter.endDate.toISOString();
|
|
17385
|
-
}
|
|
17386
|
-
}
|
|
17377
|
+
const dateRange = dateFilter?.startDate && dateFilter?.endDate ? { start: dateFilter.startDate, end: dateFilter.endDate } : void 0;
|
|
17378
|
+
rows = rows.filter((row) => {
|
|
17379
|
+
const rawValue = typeof row[resultRowField] === "object" ? row[resultRowField].value : row[resultRowField];
|
|
17380
|
+
row.__quillRawDate = rawValue;
|
|
17387
17381
|
const dateString = getDateString(
|
|
17388
|
-
|
|
17389
|
-
|
|
17382
|
+
rawValue,
|
|
17383
|
+
dateRange,
|
|
17390
17384
|
dateBucket,
|
|
17391
17385
|
databaseType
|
|
17392
17386
|
);
|
|
17387
|
+
if (dateBucket === "week" && dateRange && dateString === DATE_OUTSIDE_RANGE) {
|
|
17388
|
+
return false;
|
|
17389
|
+
}
|
|
17393
17390
|
row[resultRowField] = dateString;
|
|
17391
|
+
return true;
|
|
17394
17392
|
});
|
|
17395
17393
|
if (resultRowField && pivot.rowFieldType && !isStringType(pivot.rowFieldType) && dateFilter?.startDate && dateFilter?.endDate) {
|
|
17396
17394
|
const dateSet = new Set(rows.map((row) => row[resultRowField]));
|
|
@@ -17555,7 +17553,7 @@ function processPivotData({
|
|
|
17555
17553
|
const pivotRowField = processColumnName(
|
|
17556
17554
|
String(resultRowField ?? pivot.rowField ?? "")
|
|
17557
17555
|
);
|
|
17558
|
-
|
|
17556
|
+
let rows = pivotRowField ? responseRows.map(
|
|
17559
17557
|
(row) => !row[pivotRowField] ? { ...row, [pivotRowField]: "-" } : row
|
|
17560
17558
|
) : responseRows;
|
|
17561
17559
|
if (pivot.columnField && client.databaseType?.toLowerCase() === "bigquery") {
|
|
@@ -17594,24 +17592,21 @@ function processPivotData({
|
|
|
17594
17592
|
return 0;
|
|
17595
17593
|
});
|
|
17596
17594
|
if (pivotRowField && !isStringType(pivot.rowFieldType || "")) {
|
|
17597
|
-
|
|
17598
|
-
|
|
17599
|
-
|
|
17600
|
-
|
|
17601
|
-
const rowDate = new Date(value);
|
|
17602
|
-
if (rowDate < dateFilter.startDate) {
|
|
17603
|
-
value = dateFilter.startDate.toISOString();
|
|
17604
|
-
} else if (rowDate > dateFilter.endDate) {
|
|
17605
|
-
value = dateFilter.endDate.toISOString();
|
|
17606
|
-
}
|
|
17607
|
-
}
|
|
17595
|
+
const dateRange = dateFilter?.startDate && dateFilter?.endDate ? { start: dateFilter.startDate, end: dateFilter.endDate } : void 0;
|
|
17596
|
+
rows = rows.filter((row) => {
|
|
17597
|
+
const rawValue = typeof row[pivotRowField] === "object" ? row[pivotRowField].value : row[pivotRowField];
|
|
17598
|
+
row.__quillRawDate = rawValue;
|
|
17608
17599
|
const dateString = getDateString(
|
|
17609
|
-
|
|
17610
|
-
|
|
17600
|
+
rawValue,
|
|
17601
|
+
dateRange,
|
|
17611
17602
|
dateBucket,
|
|
17612
17603
|
databaseType
|
|
17613
17604
|
);
|
|
17605
|
+
if (dateBucket === "week" && dateRange && dateString === DATE_OUTSIDE_RANGE) {
|
|
17606
|
+
return false;
|
|
17607
|
+
}
|
|
17614
17608
|
row[pivotRowField] = dateString;
|
|
17609
|
+
return true;
|
|
17615
17610
|
});
|
|
17616
17611
|
if (pivotRowField && pivot.rowFieldType && !isStringType(pivot.rowFieldType) && dateFilter?.startDate && dateFilter?.endDate) {
|
|
17617
17612
|
const dateSet = new Set(rows.map((row) => row[pivotRowField]));
|
|
@@ -17675,6 +17670,7 @@ var init_pivotConstructor = __esm({
|
|
|
17675
17670
|
init_dataProcessing();
|
|
17676
17671
|
init_dates();
|
|
17677
17672
|
init_textProcessing();
|
|
17673
|
+
init_valueFormatter();
|
|
17678
17674
|
}
|
|
17679
17675
|
});
|
|
17680
17676
|
|
|
@@ -22784,6 +22780,7 @@ init_columnProcessing();
|
|
|
22784
22780
|
init_dataFetcher();
|
|
22785
22781
|
init_dataProcessing();
|
|
22786
22782
|
init_dates();
|
|
22783
|
+
init_columnType();
|
|
22787
22784
|
init_paginationProcessing();
|
|
22788
22785
|
init_pivotProcessing();
|
|
22789
22786
|
init_tableProcessing();
|
|
@@ -23709,6 +23706,15 @@ function hasPreformattedDateBucketLabels(report) {
|
|
|
23709
23706
|
if (report.chartType?.toLowerCase() === "table") return false;
|
|
23710
23707
|
return report.xAxisField?.trim() === pivot.rowField?.trim();
|
|
23711
23708
|
}
|
|
23709
|
+
function resolvePivotBucketXAxisFormat(report) {
|
|
23710
|
+
const pivot = report.pivot;
|
|
23711
|
+
if (!pivot?.dateBucket) return null;
|
|
23712
|
+
if (report.chartType?.toLowerCase() === "table") return null;
|
|
23713
|
+
const rowField = pivot.rowField?.trim();
|
|
23714
|
+
if (!rowField || report.xAxisField?.trim() !== rowField) return null;
|
|
23715
|
+
if (!isDateType(String(pivot.rowFieldType ?? ""))) return null;
|
|
23716
|
+
return getDateFormatFromBucket(pivot.dateBucket);
|
|
23717
|
+
}
|
|
23712
23718
|
function applySavedPivotColumnLabels(report, pivotColumns) {
|
|
23713
23719
|
return pivotColumns?.map((column) => {
|
|
23714
23720
|
const savedColumn = report.columns?.find(
|
|
@@ -23784,6 +23790,10 @@ function convertInternalReportToReport(report, dashboardFilters, eventTracking,
|
|
|
23784
23790
|
...extractAllReportValuesFromQuillInternalReport(formattedReport),
|
|
23785
23791
|
...pivotFormatted
|
|
23786
23792
|
};
|
|
23793
|
+
const bucketXAxisFormat = resolvePivotBucketXAxisFormat(pivotReport);
|
|
23794
|
+
if (bucketXAxisFormat) {
|
|
23795
|
+
pivotReport.xAxisFormat = bucketXAxisFormat;
|
|
23796
|
+
}
|
|
23787
23797
|
pivotReport.formattedBaseRows = formattedBaseRows;
|
|
23788
23798
|
return applyChartSort(pivotReport);
|
|
23789
23799
|
}
|
|
@@ -34109,9 +34119,8 @@ function RadarChart({
|
|
|
34109
34119
|
fields: [{ field: xAxisField, format: xAxisFormat }]
|
|
34110
34120
|
}),
|
|
34111
34121
|
valueFormatter: (value, name2) => {
|
|
34112
|
-
const
|
|
34113
|
-
|
|
34114
|
-
)?.dataKey;
|
|
34122
|
+
const payloadItem = payloadItems.find((p) => p.dataKey === name2) ?? payloadItems.find((p) => p.name === name2);
|
|
34123
|
+
const field = payloadItem?.dataKey;
|
|
34115
34124
|
if (!field) return value;
|
|
34116
34125
|
return valueFormatter({
|
|
34117
34126
|
value,
|
|
@@ -37660,7 +37669,8 @@ var useDashboards = () => {
|
|
|
37660
37669
|
reports: Object.values(dashboard.config.sections ?? {}).flat(),
|
|
37661
37670
|
tenantKeys: dashboard.config.tenantKeys,
|
|
37662
37671
|
createdAt: dashboard.config.createdAt,
|
|
37663
|
-
sectionOrder: dashboard.config.sectionOrder
|
|
37672
|
+
sectionOrder: dashboard.config.sectionOrder,
|
|
37673
|
+
hidden: dashboard.config.hidden
|
|
37664
37674
|
};
|
|
37665
37675
|
}).sort(
|
|
37666
37676
|
(a, b) => (a.createdAt?.getTime() ?? 0) - (b.createdAt?.getTime() ?? 0)
|
|
@@ -46310,6 +46320,7 @@ var QuillProvider = ({
|
|
|
46310
46320
|
isAdmin,
|
|
46311
46321
|
getAuthorizationToken,
|
|
46312
46322
|
eventTracking,
|
|
46323
|
+
onChangelogs,
|
|
46313
46324
|
children
|
|
46314
46325
|
}
|
|
46315
46326
|
) });
|
|
@@ -63547,9 +63558,21 @@ function normalizePivotChartForDisplay(chart, resolveTableLabel) {
|
|
|
63547
63558
|
const firstPivotRow = (withResolvedXAxis.rows ?? []).find(
|
|
63548
63559
|
(row) => Object.keys(row).length > 0
|
|
63549
63560
|
);
|
|
63550
|
-
const
|
|
63551
|
-
|
|
63552
|
-
)
|
|
63561
|
+
const pivotRowFieldName = String(
|
|
63562
|
+
withResolvedXAxis.pivot?.rowField ?? ""
|
|
63563
|
+
).trim();
|
|
63564
|
+
const pivotRowFields = firstPivotRow ? (() => {
|
|
63565
|
+
const keys = Object.keys(firstPivotRow).filter(
|
|
63566
|
+
(field) => !INTERNAL_PIVOT_ROW_FIELDS.has(field)
|
|
63567
|
+
);
|
|
63568
|
+
if (pivotRowFieldName && keys.includes(pivotRowFieldName)) {
|
|
63569
|
+
return [
|
|
63570
|
+
pivotRowFieldName,
|
|
63571
|
+
...keys.filter((field) => field !== pivotRowFieldName)
|
|
63572
|
+
];
|
|
63573
|
+
}
|
|
63574
|
+
return keys;
|
|
63575
|
+
})() : [];
|
|
63553
63576
|
const pivotValueFields = pivotRowFields.filter(
|
|
63554
63577
|
(field) => field !== withResolvedXAxis.pivot?.rowField
|
|
63555
63578
|
);
|
|
@@ -63562,6 +63585,10 @@ function normalizePivotChartForDisplay(chart, resolveTableLabel) {
|
|
|
63562
63585
|
);
|
|
63563
63586
|
const resolveYAxisFormat = (field, aggregation) => {
|
|
63564
63587
|
if (aggregation?.aggregationType === "count") {
|
|
63588
|
+
const savedFormat = yAxisFormatByField.get(field) ?? yAxisFormatByField.get("count") ?? withResolvedXAxis.yAxisFields?.find(
|
|
63589
|
+
(axis) => String(axis.field ?? "").trim() === field
|
|
63590
|
+
)?.format ?? withResolvedXAxis.yAxisFields?.[0]?.format;
|
|
63591
|
+
if (savedFormat) return savedFormat;
|
|
63565
63592
|
return "whole_number";
|
|
63566
63593
|
}
|
|
63567
63594
|
if (aggregation?.aggregationType === "percentage") {
|
|
@@ -69546,6 +69573,15 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69546
69573
|
}
|
|
69547
69574
|
for (const yAxis2 of chartAxesBaseChart.yAxisFields ?? []) {
|
|
69548
69575
|
registerOption(yAxis2.field, yAxis2.label, yAxis2.format);
|
|
69576
|
+
if (yAxis2.format) {
|
|
69577
|
+
const existing = optionsByField.get(yAxis2.field);
|
|
69578
|
+
if (existing) {
|
|
69579
|
+
optionsByField.set(yAxis2.field, {
|
|
69580
|
+
...existing,
|
|
69581
|
+
format: toAxisFormat(yAxis2.format, existing.format)
|
|
69582
|
+
});
|
|
69583
|
+
}
|
|
69584
|
+
}
|
|
69549
69585
|
}
|
|
69550
69586
|
if (chartAxesBaseChart.pivot?.columnField) {
|
|
69551
69587
|
for (const aggregationAxis of buildPivotAggregationAxisFields(
|
|
@@ -69559,11 +69595,22 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69559
69595
|
);
|
|
69560
69596
|
}
|
|
69561
69597
|
}
|
|
69598
|
+
const xField = String(chartAxesBaseChart.xAxisField ?? "").trim();
|
|
69599
|
+
const savedXFormat = String(chartAxesBaseChart.xAxisFormat ?? "").trim();
|
|
69562
69600
|
registerOption(
|
|
69563
|
-
|
|
69601
|
+
xField,
|
|
69564
69602
|
chartAxesBaseChart.xAxisLabel || chartAxesBaseChart.xAxisField,
|
|
69565
69603
|
chartAxesBaseChart.xAxisFormat
|
|
69566
69604
|
);
|
|
69605
|
+
if (xField && savedXFormat) {
|
|
69606
|
+
const existing = optionsByField.get(xField);
|
|
69607
|
+
if (existing) {
|
|
69608
|
+
optionsByField.set(xField, {
|
|
69609
|
+
...existing,
|
|
69610
|
+
format: toAxisFormat(savedXFormat, existing.format)
|
|
69611
|
+
});
|
|
69612
|
+
}
|
|
69613
|
+
}
|
|
69567
69614
|
return Array.from(optionsByField.values());
|
|
69568
69615
|
}, [chartAxesBaseChart, resolveTableDisplayLabel]);
|
|
69569
69616
|
const chartAxisOptionByField = useMemo33(() => {
|