@quillsql/react 2.16.51 → 2.16.52
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 +45 -19
- package/dist/index.js +45 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -61926,7 +61926,8 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
61926
61926
|
effectiveReportBuilderTableNames,
|
|
61927
61927
|
scopedSchemaColumns,
|
|
61928
61928
|
displayColumns,
|
|
61929
|
-
sourceReport
|
|
61929
|
+
sourceReport,
|
|
61930
|
+
includeSelectedSchemaFallback
|
|
61930
61931
|
} = args;
|
|
61931
61932
|
const selectedTableNames = new Set(effectiveReportBuilderTableNames);
|
|
61932
61933
|
const persistedReportColumns = Array.isArray(sourceReport?.columns) && sourceReport.columns.length > 0 ? sourceReport.columns : null;
|
|
@@ -61947,6 +61948,21 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
61947
61948
|
...tableName ? { table: tableName } : {}
|
|
61948
61949
|
};
|
|
61949
61950
|
}).filter((column) => Boolean(column));
|
|
61951
|
+
const normalizedSchemaColumns = includeSelectedSchemaFallback ? scopedSchemaColumns.filter(
|
|
61952
|
+
(column) => selectedTableNames.has(String(column.table ?? "").trim())
|
|
61953
|
+
).map((column) => {
|
|
61954
|
+
const field = String(column.field ?? "").trim();
|
|
61955
|
+
if (!field) return null;
|
|
61956
|
+
const label = String(column.label ?? "").trim() || field;
|
|
61957
|
+
const format9 = String(column.format ?? "").trim() || "string";
|
|
61958
|
+
const tableName = String(column.table ?? "").trim();
|
|
61959
|
+
return {
|
|
61960
|
+
label,
|
|
61961
|
+
field,
|
|
61962
|
+
format: format9,
|
|
61963
|
+
...tableName ? { table: tableName } : {}
|
|
61964
|
+
};
|
|
61965
|
+
}).filter((column) => Boolean(column)) : [];
|
|
61950
61966
|
const normalizedDisplayColumns = (displayColumns ?? []).map((column) => {
|
|
61951
61967
|
const field = String(column?.field ?? "").trim();
|
|
61952
61968
|
if (!field) return null;
|
|
@@ -61971,7 +61987,10 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
61971
61987
|
sourceColumnsByKey.set(key, [column]);
|
|
61972
61988
|
}
|
|
61973
61989
|
};
|
|
61974
|
-
for (const sourceColumn of
|
|
61990
|
+
for (const sourceColumn of [
|
|
61991
|
+
...normalizedSourceColumns,
|
|
61992
|
+
...normalizedSchemaColumns
|
|
61993
|
+
]) {
|
|
61975
61994
|
const tableName = String(sourceColumn.table ?? "").trim();
|
|
61976
61995
|
addSourceColumnKey(sourceColumn.field, sourceColumn);
|
|
61977
61996
|
addSourceColumnKey(sourceColumn.label, sourceColumn);
|
|
@@ -63322,6 +63341,9 @@ function useReport(reportIdArg, options = {}) {
|
|
|
63322
63341
|
const [preserveSchemaWideOptions, setPreserveSchemaWideOptions] = (0, import_react61.useState)(false);
|
|
63323
63342
|
const [initialSchemaScopedTableNames, setInitialSchemaScopedTableNames] = (0, import_react61.useState)(null);
|
|
63324
63343
|
const [tableColumnsEditedSignature, setTableColumnsEditedSignature] = (0, import_react61.useState)(null);
|
|
63344
|
+
(0, import_react61.useEffect)(() => {
|
|
63345
|
+
setTableColumnsEditedSignature(null);
|
|
63346
|
+
}, [effectiveReportId]);
|
|
63325
63347
|
const [chartAxisEdits, setChartAxisEdits] = (0, import_react61.useState)({});
|
|
63326
63348
|
const [chartVisibilityOverrides, setChartVisibilityOverrides] = (0, import_react61.useState)({});
|
|
63327
63349
|
const [client] = (0, import_react61.useContext)(ClientContext);
|
|
@@ -66638,13 +66660,15 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66638
66660
|
effectiveReportBuilderTableNames,
|
|
66639
66661
|
scopedSchemaColumns,
|
|
66640
66662
|
displayColumns,
|
|
66641
|
-
sourceReport
|
|
66663
|
+
sourceReport,
|
|
66664
|
+
includeSelectedSchemaFallback: tableColumnsEditedSignature !== null
|
|
66642
66665
|
}),
|
|
66643
66666
|
[
|
|
66644
66667
|
effectiveReportBuilderTableNames,
|
|
66645
66668
|
scopedSchemaColumns,
|
|
66646
66669
|
displayColumns,
|
|
66647
|
-
sourceReport
|
|
66670
|
+
sourceReport,
|
|
66671
|
+
tableColumnsEditedSignature
|
|
66648
66672
|
]
|
|
66649
66673
|
);
|
|
66650
66674
|
const table = (0, import_react61.useMemo)(() => {
|
|
@@ -66654,7 +66678,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66654
66678
|
effectiveReportBuilderTableNames,
|
|
66655
66679
|
scopedSchemaColumns,
|
|
66656
66680
|
displayColumns,
|
|
66657
|
-
sourceReport
|
|
66681
|
+
sourceReport,
|
|
66682
|
+
includeSelectedSchemaFallback: tableColumnsEditedSignature !== null
|
|
66658
66683
|
});
|
|
66659
66684
|
const pivotRowFieldForTable = String(
|
|
66660
66685
|
sourceReport?.pivot?.rowField ?? ""
|
|
@@ -66755,6 +66780,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66755
66780
|
resolvedYAxisFieldsForDisplay,
|
|
66756
66781
|
scopedSchemaColumns,
|
|
66757
66782
|
sourceReport,
|
|
66783
|
+
tableColumnsEditedSignature,
|
|
66758
66784
|
pagination,
|
|
66759
66785
|
paginationActive,
|
|
66760
66786
|
paginationPageCount,
|
|
@@ -67249,6 +67275,17 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67249
67275
|
};
|
|
67250
67276
|
applyReportChange = (nextState) => {
|
|
67251
67277
|
const effectiveNextState = nextState;
|
|
67278
|
+
const normalizedRequestedDisplayColumns = effectiveNextState.columns === void 0 ? void 0 : normalizeColumnsInput(
|
|
67279
|
+
effectiveNextState.columns,
|
|
67280
|
+
columnIdentifierLookup
|
|
67281
|
+
);
|
|
67282
|
+
const visibleDisplayColumnKeys = new Set(
|
|
67283
|
+
activeTableColumnIds.map((id) => columnIdentifierLookup.get(id)).filter((column) => Boolean(column)).map((column) => toReportBuilderColumnKey(column)).filter(Boolean)
|
|
67284
|
+
);
|
|
67285
|
+
const addedRequestedDisplayColumns = (normalizedRequestedDisplayColumns ?? []).filter((column) => {
|
|
67286
|
+
const key = toReportBuilderColumnKey(column);
|
|
67287
|
+
return Boolean(key) && !visibleDisplayColumnKeys.has(key);
|
|
67288
|
+
});
|
|
67252
67289
|
if (effectiveNextState.showLegend !== void 0) {
|
|
67253
67290
|
setChartVisibilityOverrides((previous) => ({
|
|
67254
67291
|
...previous,
|
|
@@ -67344,7 +67381,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67344
67381
|
dispatchFormRuntime({
|
|
67345
67382
|
type: "APPLY_SET_REPORT",
|
|
67346
67383
|
touchesPivotState: dispatchTouchesPivot,
|
|
67347
|
-
shouldRefreshExpandedTableData: shouldRefreshExpandedTableData || isDatasourceUpdate,
|
|
67384
|
+
shouldRefreshExpandedTableData: shouldRefreshExpandedTableData || isDatasourceUpdate || addedRequestedDisplayColumns.length > 0,
|
|
67348
67385
|
queuePromoteColumnToRow,
|
|
67349
67386
|
updater: (prev) => {
|
|
67350
67387
|
const next = {
|
|
@@ -67410,19 +67447,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67410
67447
|
}
|
|
67411
67448
|
}
|
|
67412
67449
|
if (effectiveNextState.columns !== void 0) {
|
|
67413
|
-
const normalizedDisplayColumns =
|
|
67414
|
-
|
|
67415
|
-
columnIdentifierLookup
|
|
67416
|
-
);
|
|
67417
|
-
const previousDisplayColumnKeys = new Set(
|
|
67418
|
-
next.columns.map((column) => toReportBuilderColumnKey(column)).filter(Boolean)
|
|
67419
|
-
);
|
|
67420
|
-
const addedDisplayColumns = normalizedDisplayColumns.filter(
|
|
67421
|
-
(column) => {
|
|
67422
|
-
const key = toReportBuilderColumnKey(column);
|
|
67423
|
-
return Boolean(key) && !previousDisplayColumnKeys.has(key);
|
|
67424
|
-
}
|
|
67425
|
-
);
|
|
67450
|
+
const normalizedDisplayColumns = normalizedRequestedDisplayColumns ?? [];
|
|
67451
|
+
const addedDisplayColumns = addedRequestedDisplayColumns;
|
|
67426
67452
|
next.columns = normalizedDisplayColumns;
|
|
67427
67453
|
if (addedDisplayColumns.length > 0) {
|
|
67428
67454
|
const queryTableNames = new Set(
|
package/dist/index.js
CHANGED
|
@@ -62138,7 +62138,8 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
62138
62138
|
effectiveReportBuilderTableNames,
|
|
62139
62139
|
scopedSchemaColumns,
|
|
62140
62140
|
displayColumns,
|
|
62141
|
-
sourceReport
|
|
62141
|
+
sourceReport,
|
|
62142
|
+
includeSelectedSchemaFallback
|
|
62142
62143
|
} = args;
|
|
62143
62144
|
const selectedTableNames = new Set(effectiveReportBuilderTableNames);
|
|
62144
62145
|
const persistedReportColumns = Array.isArray(sourceReport?.columns) && sourceReport.columns.length > 0 ? sourceReport.columns : null;
|
|
@@ -62159,6 +62160,21 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
62159
62160
|
...tableName ? { table: tableName } : {}
|
|
62160
62161
|
};
|
|
62161
62162
|
}).filter((column) => Boolean(column));
|
|
62163
|
+
const normalizedSchemaColumns = includeSelectedSchemaFallback ? scopedSchemaColumns.filter(
|
|
62164
|
+
(column) => selectedTableNames.has(String(column.table ?? "").trim())
|
|
62165
|
+
).map((column) => {
|
|
62166
|
+
const field = String(column.field ?? "").trim();
|
|
62167
|
+
if (!field) return null;
|
|
62168
|
+
const label = String(column.label ?? "").trim() || field;
|
|
62169
|
+
const format9 = String(column.format ?? "").trim() || "string";
|
|
62170
|
+
const tableName = String(column.table ?? "").trim();
|
|
62171
|
+
return {
|
|
62172
|
+
label,
|
|
62173
|
+
field,
|
|
62174
|
+
format: format9,
|
|
62175
|
+
...tableName ? { table: tableName } : {}
|
|
62176
|
+
};
|
|
62177
|
+
}).filter((column) => Boolean(column)) : [];
|
|
62162
62178
|
const normalizedDisplayColumns = (displayColumns ?? []).map((column) => {
|
|
62163
62179
|
const field = String(column?.field ?? "").trim();
|
|
62164
62180
|
if (!field) return null;
|
|
@@ -62183,7 +62199,10 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
62183
62199
|
sourceColumnsByKey.set(key, [column]);
|
|
62184
62200
|
}
|
|
62185
62201
|
};
|
|
62186
|
-
for (const sourceColumn of
|
|
62202
|
+
for (const sourceColumn of [
|
|
62203
|
+
...normalizedSourceColumns,
|
|
62204
|
+
...normalizedSchemaColumns
|
|
62205
|
+
]) {
|
|
62187
62206
|
const tableName = String(sourceColumn.table ?? "").trim();
|
|
62188
62207
|
addSourceColumnKey(sourceColumn.field, sourceColumn);
|
|
62189
62208
|
addSourceColumnKey(sourceColumn.label, sourceColumn);
|
|
@@ -63534,6 +63553,9 @@ function useReport(reportIdArg, options = {}) {
|
|
|
63534
63553
|
const [preserveSchemaWideOptions, setPreserveSchemaWideOptions] = useState41(false);
|
|
63535
63554
|
const [initialSchemaScopedTableNames, setInitialSchemaScopedTableNames] = useState41(null);
|
|
63536
63555
|
const [tableColumnsEditedSignature, setTableColumnsEditedSignature] = useState41(null);
|
|
63556
|
+
useEffect31(() => {
|
|
63557
|
+
setTableColumnsEditedSignature(null);
|
|
63558
|
+
}, [effectiveReportId]);
|
|
63537
63559
|
const [chartAxisEdits, setChartAxisEdits] = useState41({});
|
|
63538
63560
|
const [chartVisibilityOverrides, setChartVisibilityOverrides] = useState41({});
|
|
63539
63561
|
const [client] = useContext36(ClientContext);
|
|
@@ -66850,13 +66872,15 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66850
66872
|
effectiveReportBuilderTableNames,
|
|
66851
66873
|
scopedSchemaColumns,
|
|
66852
66874
|
displayColumns,
|
|
66853
|
-
sourceReport
|
|
66875
|
+
sourceReport,
|
|
66876
|
+
includeSelectedSchemaFallback: tableColumnsEditedSignature !== null
|
|
66854
66877
|
}),
|
|
66855
66878
|
[
|
|
66856
66879
|
effectiveReportBuilderTableNames,
|
|
66857
66880
|
scopedSchemaColumns,
|
|
66858
66881
|
displayColumns,
|
|
66859
|
-
sourceReport
|
|
66882
|
+
sourceReport,
|
|
66883
|
+
tableColumnsEditedSignature
|
|
66860
66884
|
]
|
|
66861
66885
|
);
|
|
66862
66886
|
const table = useMemo32(() => {
|
|
@@ -66866,7 +66890,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66866
66890
|
effectiveReportBuilderTableNames,
|
|
66867
66891
|
scopedSchemaColumns,
|
|
66868
66892
|
displayColumns,
|
|
66869
|
-
sourceReport
|
|
66893
|
+
sourceReport,
|
|
66894
|
+
includeSelectedSchemaFallback: tableColumnsEditedSignature !== null
|
|
66870
66895
|
});
|
|
66871
66896
|
const pivotRowFieldForTable = String(
|
|
66872
66897
|
sourceReport?.pivot?.rowField ?? ""
|
|
@@ -66967,6 +66992,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66967
66992
|
resolvedYAxisFieldsForDisplay,
|
|
66968
66993
|
scopedSchemaColumns,
|
|
66969
66994
|
sourceReport,
|
|
66995
|
+
tableColumnsEditedSignature,
|
|
66970
66996
|
pagination,
|
|
66971
66997
|
paginationActive,
|
|
66972
66998
|
paginationPageCount,
|
|
@@ -67461,6 +67487,17 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67461
67487
|
};
|
|
67462
67488
|
applyReportChange = (nextState) => {
|
|
67463
67489
|
const effectiveNextState = nextState;
|
|
67490
|
+
const normalizedRequestedDisplayColumns = effectiveNextState.columns === void 0 ? void 0 : normalizeColumnsInput(
|
|
67491
|
+
effectiveNextState.columns,
|
|
67492
|
+
columnIdentifierLookup
|
|
67493
|
+
);
|
|
67494
|
+
const visibleDisplayColumnKeys = new Set(
|
|
67495
|
+
activeTableColumnIds.map((id) => columnIdentifierLookup.get(id)).filter((column) => Boolean(column)).map((column) => toReportBuilderColumnKey(column)).filter(Boolean)
|
|
67496
|
+
);
|
|
67497
|
+
const addedRequestedDisplayColumns = (normalizedRequestedDisplayColumns ?? []).filter((column) => {
|
|
67498
|
+
const key = toReportBuilderColumnKey(column);
|
|
67499
|
+
return Boolean(key) && !visibleDisplayColumnKeys.has(key);
|
|
67500
|
+
});
|
|
67464
67501
|
if (effectiveNextState.showLegend !== void 0) {
|
|
67465
67502
|
setChartVisibilityOverrides((previous) => ({
|
|
67466
67503
|
...previous,
|
|
@@ -67556,7 +67593,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67556
67593
|
dispatchFormRuntime({
|
|
67557
67594
|
type: "APPLY_SET_REPORT",
|
|
67558
67595
|
touchesPivotState: dispatchTouchesPivot,
|
|
67559
|
-
shouldRefreshExpandedTableData: shouldRefreshExpandedTableData || isDatasourceUpdate,
|
|
67596
|
+
shouldRefreshExpandedTableData: shouldRefreshExpandedTableData || isDatasourceUpdate || addedRequestedDisplayColumns.length > 0,
|
|
67560
67597
|
queuePromoteColumnToRow,
|
|
67561
67598
|
updater: (prev) => {
|
|
67562
67599
|
const next = {
|
|
@@ -67622,19 +67659,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67622
67659
|
}
|
|
67623
67660
|
}
|
|
67624
67661
|
if (effectiveNextState.columns !== void 0) {
|
|
67625
|
-
const normalizedDisplayColumns =
|
|
67626
|
-
|
|
67627
|
-
columnIdentifierLookup
|
|
67628
|
-
);
|
|
67629
|
-
const previousDisplayColumnKeys = new Set(
|
|
67630
|
-
next.columns.map((column) => toReportBuilderColumnKey(column)).filter(Boolean)
|
|
67631
|
-
);
|
|
67632
|
-
const addedDisplayColumns = normalizedDisplayColumns.filter(
|
|
67633
|
-
(column) => {
|
|
67634
|
-
const key = toReportBuilderColumnKey(column);
|
|
67635
|
-
return Boolean(key) && !previousDisplayColumnKeys.has(key);
|
|
67636
|
-
}
|
|
67637
|
-
);
|
|
67662
|
+
const normalizedDisplayColumns = normalizedRequestedDisplayColumns ?? [];
|
|
67663
|
+
const addedDisplayColumns = addedRequestedDisplayColumns;
|
|
67638
67664
|
next.columns = normalizedDisplayColumns;
|
|
67639
67665
|
if (addedDisplayColumns.length > 0) {
|
|
67640
67666
|
const queryTableNames = new Set(
|