@quillsql/react 2.16.57 → 2.16.59
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 +33 -20
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +33 -20
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
35
35
|
|
|
36
36
|
// src/utils/textProcessing.ts
|
|
37
37
|
function capitalize(text) {
|
|
38
|
-
|
|
38
|
+
const capitalized = text.charAt(0).toUpperCase() + text.slice(1);
|
|
39
|
+
return text.charAt(1) === "/" ? capitalized.slice(0, 2) + capitalized.charAt(2).toUpperCase() + capitalized.slice(3) : capitalized;
|
|
39
40
|
}
|
|
40
41
|
function matchCasing(text, template) {
|
|
41
42
|
if (!text || !template) {
|
|
@@ -60837,7 +60838,12 @@ function isPivotTableDateBucketRowAxis(chart, xAxisField) {
|
|
|
60837
60838
|
if (!rowField || xf !== rowField) return false;
|
|
60838
60839
|
return isDateType(String(chart.pivot.rowFieldType ?? ""));
|
|
60839
60840
|
}
|
|
60840
|
-
var RESOLVABLE_X_AXIS_DATE_BUCKETS = /* @__PURE__ */ new Set([
|
|
60841
|
+
var RESOLVABLE_X_AXIS_DATE_BUCKETS = /* @__PURE__ */ new Set([
|
|
60842
|
+
"year",
|
|
60843
|
+
"month",
|
|
60844
|
+
"week",
|
|
60845
|
+
"day"
|
|
60846
|
+
]);
|
|
60841
60847
|
function resolvePivotDateBucketXAxisFormat(chart, xAxisField) {
|
|
60842
60848
|
if (String(chart?.chartType ?? "").toLowerCase() === "table") return null;
|
|
60843
60849
|
const dateBucket = String(chart?.pivot?.dateBucket ?? "").trim().toLowerCase();
|
|
@@ -62150,7 +62156,9 @@ function moveArrayItem(items, oldIndex, newIndex) {
|
|
|
62150
62156
|
var CHART_TYPES2 = [
|
|
62151
62157
|
"column",
|
|
62152
62158
|
"stacked",
|
|
62159
|
+
"stacked bar",
|
|
62153
62160
|
"line",
|
|
62161
|
+
"radar",
|
|
62154
62162
|
"table",
|
|
62155
62163
|
"metric",
|
|
62156
62164
|
"gauge",
|
|
@@ -63400,6 +63408,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
63400
63408
|
].map((entry) => String(entry ?? "").trim()).find((entry) => entry.length > 0) ?? "";
|
|
63401
63409
|
const initialFormState = (0, import_react61.useMemo)(
|
|
63402
63410
|
() => ({
|
|
63411
|
+
reportName: void 0,
|
|
63403
63412
|
columns: [],
|
|
63404
63413
|
queryColumns: [],
|
|
63405
63414
|
filterStack: [],
|
|
@@ -63430,6 +63439,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
63430
63439
|
pivotRefreshVersion
|
|
63431
63440
|
} = formRuntimeState;
|
|
63432
63441
|
const {
|
|
63442
|
+
reportName: formReportName,
|
|
63433
63443
|
columns: displayColumns,
|
|
63434
63444
|
queryColumns,
|
|
63435
63445
|
filterStack,
|
|
@@ -64474,6 +64484,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
64474
64484
|
updater: (previous) => {
|
|
64475
64485
|
return {
|
|
64476
64486
|
...previous,
|
|
64487
|
+
reportName: void 0,
|
|
64477
64488
|
schemaDatasourceIds: void 0,
|
|
64478
64489
|
filterStack: [],
|
|
64479
64490
|
queryFilters: { combinator: "and", rules: [] },
|
|
@@ -64566,6 +64577,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
64566
64577
|
const sourceReportNameForTitle = String(sourceReport?.name ?? "").trim();
|
|
64567
64578
|
const reportTitleFromTask = String(reportNameQuery.data?.name ?? "").trim();
|
|
64568
64579
|
const resolvedReportName = reportNameQueryReportId && sourceReportIdForTitle === reportNameQueryReportId && sourceReportNameForTitle ? sourceReportNameForTitle : reportTitleFromTask || sourceReportNameForTitle || "";
|
|
64580
|
+
const displayReportName = formReportName !== void 0 ? formReportName : resolvedReportName;
|
|
64569
64581
|
(0, import_react61.useEffect)(() => {
|
|
64570
64582
|
if (reportOverride) return;
|
|
64571
64583
|
const report = initialLoadQuery.data?.report ?? null;
|
|
@@ -64669,12 +64681,15 @@ function useReport(reportIdArg, options = {}) {
|
|
|
64669
64681
|
schemaTables: schemaForReportBuilderState
|
|
64670
64682
|
});
|
|
64671
64683
|
const sourceDisplayColumns = sourceDisplayColumnsFromSchema.length > 0 ? sourceDisplayColumnsFromSchema : sourceQueryColumns;
|
|
64672
|
-
const
|
|
64673
|
-
const
|
|
64684
|
+
const shouldKeepLocalRowGroup = groupRowsBySetViaSetReportRef.current || groupColumnsBySetViaSetReportRef.current && prev.groupRowsBy !== void 0;
|
|
64685
|
+
const shouldKeepLocalColumnGroup = groupColumnsBySetViaSetReportRef.current || groupRowsBySetViaSetReportRef.current && prev.groupColumnsBy !== void 0;
|
|
64686
|
+
const nextGroupRowsBy = shouldTakePivotGroupsFromSource ? shouldKeepLocalRowGroup ? prev.groupRowsBy : sourceRowGroupOption : prev.groupRowsBy !== void 0 ? prev.groupRowsBy : groupRowsBySetViaSetReportRef.current ? prev.groupRowsBy : sourceRowGroupOption;
|
|
64687
|
+
const nextGroupColumnsBy = shouldTakePivotGroupsFromSource ? shouldKeepLocalColumnGroup ? prev.groupColumnsBy : sourceColumnGroupOption : prev.groupColumnsBy !== void 0 ? prev.groupColumnsBy : prev.groupRowsBy !== void 0 ? prev.groupColumnsBy : sourceColumnGroupOption;
|
|
64674
64688
|
const sourceDateBucket = sourceReport.pivot?.dateBucket ?? sourceReport.reportBuilderState?.pivot?.dateBucket;
|
|
64675
64689
|
const nextDateBucket = dateBucketSetViaSetReportRef.current ? prev.dateBucket : sourceDateBucket;
|
|
64676
64690
|
const nextFromSource = {
|
|
64677
64691
|
...prev,
|
|
64692
|
+
reportName: prev.reportName !== void 0 ? prev.reportName : String(sourceReport.name ?? "").trim() || void 0,
|
|
64678
64693
|
queryColumns: prev.queryColumns.length ? prev.queryColumns : sourceQueryColumns,
|
|
64679
64694
|
columns: prev.columns.length ? prev.columns : sourceDisplayColumns,
|
|
64680
64695
|
filterStack: nextFilterStack.length > 0 ? nextFilterStack : prev.filterStack,
|
|
@@ -65261,11 +65276,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
65261
65276
|
const report = tableRefreshQuery.data?.report;
|
|
65262
65277
|
if (tableRefreshQuery.data?.error || !report) return;
|
|
65263
65278
|
setSourceReport(report);
|
|
65264
|
-
}, [
|
|
65265
|
-
effectiveReportId,
|
|
65266
|
-
tableRefreshQuery.data,
|
|
65267
|
-
tableRefreshQueryEnabled
|
|
65268
|
-
]);
|
|
65279
|
+
}, [effectiveReportId, tableRefreshQuery.data, tableRefreshQueryEnabled]);
|
|
65269
65280
|
const chartTypes = (0, import_react61.useMemo)(() => {
|
|
65270
65281
|
return getChartTypeOptions2({ pivot: pivotState });
|
|
65271
65282
|
}, [pivotState]);
|
|
@@ -66304,14 +66315,12 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66304
66315
|
chartAxisOptionByField.get(resolvedXAxisField)?.format ?? chartAxesBaseChart.xAxisFormat ?? resolvedYAxisFields[0]?.format,
|
|
66305
66316
|
"string"
|
|
66306
66317
|
);
|
|
66307
|
-
|
|
66308
|
-
|
|
66309
|
-
|
|
66310
|
-
|
|
66311
|
-
|
|
66312
|
-
|
|
66313
|
-
defaultFormat = bucketFormat;
|
|
66314
|
-
}
|
|
66318
|
+
const bucketFormat = resolvePivotDateBucketXAxisFormat(
|
|
66319
|
+
chartAxesBaseChart,
|
|
66320
|
+
resolvedXAxisField
|
|
66321
|
+
);
|
|
66322
|
+
if (bucketFormat && (defaultFormat === "string" || chartAxesBaseChart.pivot?.dateBucket === "week")) {
|
|
66323
|
+
defaultFormat = bucketFormat;
|
|
66315
66324
|
}
|
|
66316
66325
|
if (isPivotTableDateBucketRowAxis(chartAxesBaseChart, resolvedXAxisField) && chartAxisEdits.xAxisFormat === void 0) {
|
|
66317
66326
|
defaultFormat = "string";
|
|
@@ -67434,6 +67443,9 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67434
67443
|
columns: normalizeReportBuilderColumns(prev.columns ?? []),
|
|
67435
67444
|
queryColumns: normalizeReportBuilderColumns(prev.queryColumns ?? [])
|
|
67436
67445
|
};
|
|
67446
|
+
if (effectiveNextState.name !== void 0) {
|
|
67447
|
+
next.reportName = String(effectiveNextState.name);
|
|
67448
|
+
}
|
|
67437
67449
|
if (effectiveNextState.datasources !== void 0) {
|
|
67438
67450
|
const nextIds = effectiveNextState.datasources.map((tableName) => String(tableName ?? "").trim()).filter(Boolean);
|
|
67439
67451
|
next.schemaDatasourceIds = nextIds.length > 0 ? nextIds : void 0;
|
|
@@ -67923,7 +67935,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67923
67935
|
report: {
|
|
67924
67936
|
...EMPTY_INTERNAL_REPORT,
|
|
67925
67937
|
...sourceRest,
|
|
67926
|
-
name: String(sourceRest.name ?? "").trim() ? sourceRest.name : effectiveReportBuilderState.tables[0]?.name ? snakeAndCamelCaseToTitleCase(
|
|
67938
|
+
name: String(formReportName ?? "").trim() ? formReportName : String(sourceRest.name ?? "").trim() ? sourceRest.name : effectiveReportBuilderState.tables[0]?.name ? snakeAndCamelCaseToTitleCase(
|
|
67927
67939
|
String(effectiveReportBuilderState.tables[0].name)
|
|
67928
67940
|
) : "New report",
|
|
67929
67941
|
// Match chart rendering (`chartData`): form `chartType` wins over stale `sourceReport`.
|
|
@@ -67959,6 +67971,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67959
67971
|
effectiveReportBuilderState,
|
|
67960
67972
|
effectiveReportId,
|
|
67961
67973
|
eventTracking,
|
|
67974
|
+
formReportName,
|
|
67962
67975
|
getToken,
|
|
67963
67976
|
resolvedXAxisField,
|
|
67964
67977
|
resolvedXAxisFormat,
|
|
@@ -67977,8 +67990,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67977
67990
|
table,
|
|
67978
67991
|
tableLoading,
|
|
67979
67992
|
loading,
|
|
67980
|
-
/** Report title:
|
|
67981
|
-
name:
|
|
67993
|
+
/** Report title: form override, then `sourceReport.name`, else `report-name` task. */
|
|
67994
|
+
name: displayReportName,
|
|
67982
67995
|
/**
|
|
67983
67996
|
* Resolved report id: the `reportId` argument when provided, otherwise the id
|
|
67984
67997
|
* returned from `create-report` after the first datasource selection.
|
package/dist/index.d.cts
CHANGED
|
@@ -2982,7 +2982,7 @@ type FilterFieldOptions = {
|
|
|
2982
2982
|
type SetFiltersInput = QueryBuilderRuleGroup | ((prev: QueryBuilderRuleGroup) => QueryBuilderRuleGroup);
|
|
2983
2983
|
/** Maps table column format dropdown values to persisted report column `format` (used by `columnActions.update`). */
|
|
2984
2984
|
declare function tableColumnFormatFromUiSelection(raw: string): string;
|
|
2985
|
-
declare const CHART_TYPES: readonly ["column", "stacked", "line", "table", "metric", "gauge", "bar", "pie", "US map", "World map"];
|
|
2985
|
+
declare const CHART_TYPES: readonly ["column", "stacked", "stacked bar", "line", "radar", "table", "metric", "gauge", "bar", "pie", "US map", "World map"];
|
|
2986
2986
|
type ChartType = (typeof CHART_TYPES)[number];
|
|
2987
2987
|
type ChartTypeOption = {
|
|
2988
2988
|
label: string;
|
|
@@ -3004,6 +3004,8 @@ type SetReportChartAxesInput = {
|
|
|
3004
3004
|
};
|
|
3005
3005
|
};
|
|
3006
3006
|
interface SetReportBuilderInput {
|
|
3007
|
+
/** Report display name, persisted by `saveChanges`. */
|
|
3008
|
+
name?: string;
|
|
3007
3009
|
/** Complete selected column list in display order. */
|
|
3008
3010
|
columns?: ReportColumnValue[];
|
|
3009
3011
|
filters?: Filter[];
|
|
@@ -3186,7 +3188,7 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
|
3186
3188
|
table: UseFormTable;
|
|
3187
3189
|
tableLoading: boolean;
|
|
3188
3190
|
loading: boolean;
|
|
3189
|
-
/** Report title:
|
|
3191
|
+
/** Report title: form override, then `sourceReport.name`, else `report-name` task. */
|
|
3190
3192
|
name: string;
|
|
3191
3193
|
/**
|
|
3192
3194
|
* Resolved report id: the `reportId` argument when provided, otherwise the id
|
|
@@ -3214,7 +3216,7 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
|
3214
3216
|
label: string;
|
|
3215
3217
|
value: string;
|
|
3216
3218
|
}[];
|
|
3217
|
-
chartType: "table" | "column" | "metric" | "gauge" | "stacked" | "line" | "bar" | "pie" | "US map" | "World map";
|
|
3219
|
+
chartType: "table" | "column" | "metric" | "gauge" | "stacked" | "stacked bar" | "line" | "bar" | "pie" | "radar" | "US map" | "World map";
|
|
3218
3220
|
chartTypeOptions: ChartTypeOption[];
|
|
3219
3221
|
/** Selected tabular columns in display order. */
|
|
3220
3222
|
columns: ReportColumnValue[];
|
package/dist/index.d.ts
CHANGED
|
@@ -2982,7 +2982,7 @@ type FilterFieldOptions = {
|
|
|
2982
2982
|
type SetFiltersInput = QueryBuilderRuleGroup | ((prev: QueryBuilderRuleGroup) => QueryBuilderRuleGroup);
|
|
2983
2983
|
/** Maps table column format dropdown values to persisted report column `format` (used by `columnActions.update`). */
|
|
2984
2984
|
declare function tableColumnFormatFromUiSelection(raw: string): string;
|
|
2985
|
-
declare const CHART_TYPES: readonly ["column", "stacked", "line", "table", "metric", "gauge", "bar", "pie", "US map", "World map"];
|
|
2985
|
+
declare const CHART_TYPES: readonly ["column", "stacked", "stacked bar", "line", "radar", "table", "metric", "gauge", "bar", "pie", "US map", "World map"];
|
|
2986
2986
|
type ChartType = (typeof CHART_TYPES)[number];
|
|
2987
2987
|
type ChartTypeOption = {
|
|
2988
2988
|
label: string;
|
|
@@ -3004,6 +3004,8 @@ type SetReportChartAxesInput = {
|
|
|
3004
3004
|
};
|
|
3005
3005
|
};
|
|
3006
3006
|
interface SetReportBuilderInput {
|
|
3007
|
+
/** Report display name, persisted by `saveChanges`. */
|
|
3008
|
+
name?: string;
|
|
3007
3009
|
/** Complete selected column list in display order. */
|
|
3008
3010
|
columns?: ReportColumnValue[];
|
|
3009
3011
|
filters?: Filter[];
|
|
@@ -3186,7 +3188,7 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
|
3186
3188
|
table: UseFormTable;
|
|
3187
3189
|
tableLoading: boolean;
|
|
3188
3190
|
loading: boolean;
|
|
3189
|
-
/** Report title:
|
|
3191
|
+
/** Report title: form override, then `sourceReport.name`, else `report-name` task. */
|
|
3190
3192
|
name: string;
|
|
3191
3193
|
/**
|
|
3192
3194
|
* Resolved report id: the `reportId` argument when provided, otherwise the id
|
|
@@ -3214,7 +3216,7 @@ declare function useReport(reportIdArg?: string, options?: UseReportOptions): {
|
|
|
3214
3216
|
label: string;
|
|
3215
3217
|
value: string;
|
|
3216
3218
|
}[];
|
|
3217
|
-
chartType: "table" | "column" | "metric" | "gauge" | "stacked" | "line" | "bar" | "pie" | "US map" | "World map";
|
|
3219
|
+
chartType: "table" | "column" | "metric" | "gauge" | "stacked" | "stacked bar" | "line" | "bar" | "pie" | "radar" | "US map" | "World map";
|
|
3218
3220
|
chartTypeOptions: ChartTypeOption[];
|
|
3219
3221
|
/** Selected tabular columns in display order. */
|
|
3220
3222
|
columns: ReportColumnValue[];
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
39
|
|
|
40
40
|
// src/utils/textProcessing.ts
|
|
41
41
|
function capitalize(text) {
|
|
42
|
-
|
|
42
|
+
const capitalized = text.charAt(0).toUpperCase() + text.slice(1);
|
|
43
|
+
return text.charAt(1) === "/" ? capitalized.slice(0, 2) + capitalized.charAt(2).toUpperCase() + capitalized.slice(3) : capitalized;
|
|
43
44
|
}
|
|
44
45
|
function matchCasing(text, template) {
|
|
45
46
|
if (!text || !template) {
|
|
@@ -61049,7 +61050,12 @@ function isPivotTableDateBucketRowAxis(chart, xAxisField) {
|
|
|
61049
61050
|
if (!rowField || xf !== rowField) return false;
|
|
61050
61051
|
return isDateType(String(chart.pivot.rowFieldType ?? ""));
|
|
61051
61052
|
}
|
|
61052
|
-
var RESOLVABLE_X_AXIS_DATE_BUCKETS = /* @__PURE__ */ new Set([
|
|
61053
|
+
var RESOLVABLE_X_AXIS_DATE_BUCKETS = /* @__PURE__ */ new Set([
|
|
61054
|
+
"year",
|
|
61055
|
+
"month",
|
|
61056
|
+
"week",
|
|
61057
|
+
"day"
|
|
61058
|
+
]);
|
|
61053
61059
|
function resolvePivotDateBucketXAxisFormat(chart, xAxisField) {
|
|
61054
61060
|
if (String(chart?.chartType ?? "").toLowerCase() === "table") return null;
|
|
61055
61061
|
const dateBucket = String(chart?.pivot?.dateBucket ?? "").trim().toLowerCase();
|
|
@@ -62362,7 +62368,9 @@ function moveArrayItem(items, oldIndex, newIndex) {
|
|
|
62362
62368
|
var CHART_TYPES2 = [
|
|
62363
62369
|
"column",
|
|
62364
62370
|
"stacked",
|
|
62371
|
+
"stacked bar",
|
|
62365
62372
|
"line",
|
|
62373
|
+
"radar",
|
|
62366
62374
|
"table",
|
|
62367
62375
|
"metric",
|
|
62368
62376
|
"gauge",
|
|
@@ -63612,6 +63620,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
63612
63620
|
].map((entry) => String(entry ?? "").trim()).find((entry) => entry.length > 0) ?? "";
|
|
63613
63621
|
const initialFormState = useMemo32(
|
|
63614
63622
|
() => ({
|
|
63623
|
+
reportName: void 0,
|
|
63615
63624
|
columns: [],
|
|
63616
63625
|
queryColumns: [],
|
|
63617
63626
|
filterStack: [],
|
|
@@ -63642,6 +63651,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
63642
63651
|
pivotRefreshVersion
|
|
63643
63652
|
} = formRuntimeState;
|
|
63644
63653
|
const {
|
|
63654
|
+
reportName: formReportName,
|
|
63645
63655
|
columns: displayColumns,
|
|
63646
63656
|
queryColumns,
|
|
63647
63657
|
filterStack,
|
|
@@ -64686,6 +64696,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
64686
64696
|
updater: (previous) => {
|
|
64687
64697
|
return {
|
|
64688
64698
|
...previous,
|
|
64699
|
+
reportName: void 0,
|
|
64689
64700
|
schemaDatasourceIds: void 0,
|
|
64690
64701
|
filterStack: [],
|
|
64691
64702
|
queryFilters: { combinator: "and", rules: [] },
|
|
@@ -64778,6 +64789,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
64778
64789
|
const sourceReportNameForTitle = String(sourceReport?.name ?? "").trim();
|
|
64779
64790
|
const reportTitleFromTask = String(reportNameQuery.data?.name ?? "").trim();
|
|
64780
64791
|
const resolvedReportName = reportNameQueryReportId && sourceReportIdForTitle === reportNameQueryReportId && sourceReportNameForTitle ? sourceReportNameForTitle : reportTitleFromTask || sourceReportNameForTitle || "";
|
|
64792
|
+
const displayReportName = formReportName !== void 0 ? formReportName : resolvedReportName;
|
|
64781
64793
|
useEffect31(() => {
|
|
64782
64794
|
if (reportOverride) return;
|
|
64783
64795
|
const report = initialLoadQuery.data?.report ?? null;
|
|
@@ -64881,12 +64893,15 @@ function useReport(reportIdArg, options = {}) {
|
|
|
64881
64893
|
schemaTables: schemaForReportBuilderState
|
|
64882
64894
|
});
|
|
64883
64895
|
const sourceDisplayColumns = sourceDisplayColumnsFromSchema.length > 0 ? sourceDisplayColumnsFromSchema : sourceQueryColumns;
|
|
64884
|
-
const
|
|
64885
|
-
const
|
|
64896
|
+
const shouldKeepLocalRowGroup = groupRowsBySetViaSetReportRef.current || groupColumnsBySetViaSetReportRef.current && prev.groupRowsBy !== void 0;
|
|
64897
|
+
const shouldKeepLocalColumnGroup = groupColumnsBySetViaSetReportRef.current || groupRowsBySetViaSetReportRef.current && prev.groupColumnsBy !== void 0;
|
|
64898
|
+
const nextGroupRowsBy = shouldTakePivotGroupsFromSource ? shouldKeepLocalRowGroup ? prev.groupRowsBy : sourceRowGroupOption : prev.groupRowsBy !== void 0 ? prev.groupRowsBy : groupRowsBySetViaSetReportRef.current ? prev.groupRowsBy : sourceRowGroupOption;
|
|
64899
|
+
const nextGroupColumnsBy = shouldTakePivotGroupsFromSource ? shouldKeepLocalColumnGroup ? prev.groupColumnsBy : sourceColumnGroupOption : prev.groupColumnsBy !== void 0 ? prev.groupColumnsBy : prev.groupRowsBy !== void 0 ? prev.groupColumnsBy : sourceColumnGroupOption;
|
|
64886
64900
|
const sourceDateBucket = sourceReport.pivot?.dateBucket ?? sourceReport.reportBuilderState?.pivot?.dateBucket;
|
|
64887
64901
|
const nextDateBucket = dateBucketSetViaSetReportRef.current ? prev.dateBucket : sourceDateBucket;
|
|
64888
64902
|
const nextFromSource = {
|
|
64889
64903
|
...prev,
|
|
64904
|
+
reportName: prev.reportName !== void 0 ? prev.reportName : String(sourceReport.name ?? "").trim() || void 0,
|
|
64890
64905
|
queryColumns: prev.queryColumns.length ? prev.queryColumns : sourceQueryColumns,
|
|
64891
64906
|
columns: prev.columns.length ? prev.columns : sourceDisplayColumns,
|
|
64892
64907
|
filterStack: nextFilterStack.length > 0 ? nextFilterStack : prev.filterStack,
|
|
@@ -65473,11 +65488,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
65473
65488
|
const report = tableRefreshQuery.data?.report;
|
|
65474
65489
|
if (tableRefreshQuery.data?.error || !report) return;
|
|
65475
65490
|
setSourceReport(report);
|
|
65476
|
-
}, [
|
|
65477
|
-
effectiveReportId,
|
|
65478
|
-
tableRefreshQuery.data,
|
|
65479
|
-
tableRefreshQueryEnabled
|
|
65480
|
-
]);
|
|
65491
|
+
}, [effectiveReportId, tableRefreshQuery.data, tableRefreshQueryEnabled]);
|
|
65481
65492
|
const chartTypes = useMemo32(() => {
|
|
65482
65493
|
return getChartTypeOptions2({ pivot: pivotState });
|
|
65483
65494
|
}, [pivotState]);
|
|
@@ -66516,14 +66527,12 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66516
66527
|
chartAxisOptionByField.get(resolvedXAxisField)?.format ?? chartAxesBaseChart.xAxisFormat ?? resolvedYAxisFields[0]?.format,
|
|
66517
66528
|
"string"
|
|
66518
66529
|
);
|
|
66519
|
-
|
|
66520
|
-
|
|
66521
|
-
|
|
66522
|
-
|
|
66523
|
-
|
|
66524
|
-
|
|
66525
|
-
defaultFormat = bucketFormat;
|
|
66526
|
-
}
|
|
66530
|
+
const bucketFormat = resolvePivotDateBucketXAxisFormat(
|
|
66531
|
+
chartAxesBaseChart,
|
|
66532
|
+
resolvedXAxisField
|
|
66533
|
+
);
|
|
66534
|
+
if (bucketFormat && (defaultFormat === "string" || chartAxesBaseChart.pivot?.dateBucket === "week")) {
|
|
66535
|
+
defaultFormat = bucketFormat;
|
|
66527
66536
|
}
|
|
66528
66537
|
if (isPivotTableDateBucketRowAxis(chartAxesBaseChart, resolvedXAxisField) && chartAxisEdits.xAxisFormat === void 0) {
|
|
66529
66538
|
defaultFormat = "string";
|
|
@@ -67646,6 +67655,9 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67646
67655
|
columns: normalizeReportBuilderColumns(prev.columns ?? []),
|
|
67647
67656
|
queryColumns: normalizeReportBuilderColumns(prev.queryColumns ?? [])
|
|
67648
67657
|
};
|
|
67658
|
+
if (effectiveNextState.name !== void 0) {
|
|
67659
|
+
next.reportName = String(effectiveNextState.name);
|
|
67660
|
+
}
|
|
67649
67661
|
if (effectiveNextState.datasources !== void 0) {
|
|
67650
67662
|
const nextIds = effectiveNextState.datasources.map((tableName) => String(tableName ?? "").trim()).filter(Boolean);
|
|
67651
67663
|
next.schemaDatasourceIds = nextIds.length > 0 ? nextIds : void 0;
|
|
@@ -68135,7 +68147,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
68135
68147
|
report: {
|
|
68136
68148
|
...EMPTY_INTERNAL_REPORT,
|
|
68137
68149
|
...sourceRest,
|
|
68138
|
-
name: String(sourceRest.name ?? "").trim() ? sourceRest.name : effectiveReportBuilderState.tables[0]?.name ? snakeAndCamelCaseToTitleCase(
|
|
68150
|
+
name: String(formReportName ?? "").trim() ? formReportName : String(sourceRest.name ?? "").trim() ? sourceRest.name : effectiveReportBuilderState.tables[0]?.name ? snakeAndCamelCaseToTitleCase(
|
|
68139
68151
|
String(effectiveReportBuilderState.tables[0].name)
|
|
68140
68152
|
) : "New report",
|
|
68141
68153
|
// Match chart rendering (`chartData`): form `chartType` wins over stale `sourceReport`.
|
|
@@ -68171,6 +68183,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
68171
68183
|
effectiveReportBuilderState,
|
|
68172
68184
|
effectiveReportId,
|
|
68173
68185
|
eventTracking,
|
|
68186
|
+
formReportName,
|
|
68174
68187
|
getToken,
|
|
68175
68188
|
resolvedXAxisField,
|
|
68176
68189
|
resolvedXAxisFormat,
|
|
@@ -68189,8 +68202,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
68189
68202
|
table,
|
|
68190
68203
|
tableLoading,
|
|
68191
68204
|
loading,
|
|
68192
|
-
/** Report title:
|
|
68193
|
-
name:
|
|
68205
|
+
/** Report title: form override, then `sourceReport.name`, else `report-name` task. */
|
|
68206
|
+
name: displayReportName,
|
|
68194
68207
|
/**
|
|
68195
68208
|
* Resolved report id: the `reportId` argument when provided, otherwise the id
|
|
68196
68209
|
* returned from `create-report` after the first datasource selection.
|