@quillsql/react 2.16.51 → 2.16.53
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 +52 -23
- package/dist/index.js +52 -23
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -61073,16 +61073,19 @@ function normalizePivotChartForDisplay(chart) {
|
|
|
61073
61073
|
if (!row || typeof row !== "object") {
|
|
61074
61074
|
return row;
|
|
61075
61075
|
}
|
|
61076
|
-
const
|
|
61077
|
-
|
|
61076
|
+
const record = row;
|
|
61077
|
+
const displayValue = record[pivotDisplayRowField];
|
|
61078
|
+
if (displayValue === void 0 || displayValue === null) {
|
|
61078
61079
|
return row;
|
|
61079
61080
|
}
|
|
61080
|
-
const asString = String(
|
|
61081
|
+
const asString = String(displayValue).trim();
|
|
61081
61082
|
if (!asString || pivotDateRowMonthLabelRe.test(asString)) {
|
|
61082
61083
|
return row;
|
|
61083
61084
|
}
|
|
61085
|
+
const rawDate = record.__quillRawDate;
|
|
61086
|
+
const formatInput = rawDate !== void 0 && rawDate !== null && rawDate !== "" && rawDate !== 0 ? rawDate : displayValue;
|
|
61084
61087
|
const formatted = quillFormat({
|
|
61085
|
-
value:
|
|
61088
|
+
value: formatInput,
|
|
61086
61089
|
format: pivotDisplayDateFormat
|
|
61087
61090
|
});
|
|
61088
61091
|
if (!formatted || !String(formatted).trim()) {
|
|
@@ -61926,7 +61929,8 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
61926
61929
|
effectiveReportBuilderTableNames,
|
|
61927
61930
|
scopedSchemaColumns,
|
|
61928
61931
|
displayColumns,
|
|
61929
|
-
sourceReport
|
|
61932
|
+
sourceReport,
|
|
61933
|
+
includeSelectedSchemaFallback
|
|
61930
61934
|
} = args;
|
|
61931
61935
|
const selectedTableNames = new Set(effectiveReportBuilderTableNames);
|
|
61932
61936
|
const persistedReportColumns = Array.isArray(sourceReport?.columns) && sourceReport.columns.length > 0 ? sourceReport.columns : null;
|
|
@@ -61947,6 +61951,21 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
61947
61951
|
...tableName ? { table: tableName } : {}
|
|
61948
61952
|
};
|
|
61949
61953
|
}).filter((column) => Boolean(column));
|
|
61954
|
+
const normalizedSchemaColumns = includeSelectedSchemaFallback ? scopedSchemaColumns.filter(
|
|
61955
|
+
(column) => selectedTableNames.has(String(column.table ?? "").trim())
|
|
61956
|
+
).map((column) => {
|
|
61957
|
+
const field = String(column.field ?? "").trim();
|
|
61958
|
+
if (!field) return null;
|
|
61959
|
+
const label = String(column.label ?? "").trim() || field;
|
|
61960
|
+
const format9 = String(column.format ?? "").trim() || "string";
|
|
61961
|
+
const tableName = String(column.table ?? "").trim();
|
|
61962
|
+
return {
|
|
61963
|
+
label,
|
|
61964
|
+
field,
|
|
61965
|
+
format: format9,
|
|
61966
|
+
...tableName ? { table: tableName } : {}
|
|
61967
|
+
};
|
|
61968
|
+
}).filter((column) => Boolean(column)) : [];
|
|
61950
61969
|
const normalizedDisplayColumns = (displayColumns ?? []).map((column) => {
|
|
61951
61970
|
const field = String(column?.field ?? "").trim();
|
|
61952
61971
|
if (!field) return null;
|
|
@@ -61971,7 +61990,10 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
61971
61990
|
sourceColumnsByKey.set(key, [column]);
|
|
61972
61991
|
}
|
|
61973
61992
|
};
|
|
61974
|
-
for (const sourceColumn of
|
|
61993
|
+
for (const sourceColumn of [
|
|
61994
|
+
...normalizedSourceColumns,
|
|
61995
|
+
...normalizedSchemaColumns
|
|
61996
|
+
]) {
|
|
61975
61997
|
const tableName = String(sourceColumn.table ?? "").trim();
|
|
61976
61998
|
addSourceColumnKey(sourceColumn.field, sourceColumn);
|
|
61977
61999
|
addSourceColumnKey(sourceColumn.label, sourceColumn);
|
|
@@ -63322,6 +63344,9 @@ function useReport(reportIdArg, options = {}) {
|
|
|
63322
63344
|
const [preserveSchemaWideOptions, setPreserveSchemaWideOptions] = (0, import_react61.useState)(false);
|
|
63323
63345
|
const [initialSchemaScopedTableNames, setInitialSchemaScopedTableNames] = (0, import_react61.useState)(null);
|
|
63324
63346
|
const [tableColumnsEditedSignature, setTableColumnsEditedSignature] = (0, import_react61.useState)(null);
|
|
63347
|
+
(0, import_react61.useEffect)(() => {
|
|
63348
|
+
setTableColumnsEditedSignature(null);
|
|
63349
|
+
}, [effectiveReportId]);
|
|
63325
63350
|
const [chartAxisEdits, setChartAxisEdits] = (0, import_react61.useState)({});
|
|
63326
63351
|
const [chartVisibilityOverrides, setChartVisibilityOverrides] = (0, import_react61.useState)({});
|
|
63327
63352
|
const [client] = (0, import_react61.useContext)(ClientContext);
|
|
@@ -66638,13 +66663,15 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66638
66663
|
effectiveReportBuilderTableNames,
|
|
66639
66664
|
scopedSchemaColumns,
|
|
66640
66665
|
displayColumns,
|
|
66641
|
-
sourceReport
|
|
66666
|
+
sourceReport,
|
|
66667
|
+
includeSelectedSchemaFallback: tableColumnsEditedSignature !== null
|
|
66642
66668
|
}),
|
|
66643
66669
|
[
|
|
66644
66670
|
effectiveReportBuilderTableNames,
|
|
66645
66671
|
scopedSchemaColumns,
|
|
66646
66672
|
displayColumns,
|
|
66647
|
-
sourceReport
|
|
66673
|
+
sourceReport,
|
|
66674
|
+
tableColumnsEditedSignature
|
|
66648
66675
|
]
|
|
66649
66676
|
);
|
|
66650
66677
|
const table = (0, import_react61.useMemo)(() => {
|
|
@@ -66654,7 +66681,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66654
66681
|
effectiveReportBuilderTableNames,
|
|
66655
66682
|
scopedSchemaColumns,
|
|
66656
66683
|
displayColumns,
|
|
66657
|
-
sourceReport
|
|
66684
|
+
sourceReport,
|
|
66685
|
+
includeSelectedSchemaFallback: tableColumnsEditedSignature !== null
|
|
66658
66686
|
});
|
|
66659
66687
|
const pivotRowFieldForTable = String(
|
|
66660
66688
|
sourceReport?.pivot?.rowField ?? ""
|
|
@@ -66755,6 +66783,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66755
66783
|
resolvedYAxisFieldsForDisplay,
|
|
66756
66784
|
scopedSchemaColumns,
|
|
66757
66785
|
sourceReport,
|
|
66786
|
+
tableColumnsEditedSignature,
|
|
66758
66787
|
pagination,
|
|
66759
66788
|
paginationActive,
|
|
66760
66789
|
paginationPageCount,
|
|
@@ -67249,6 +67278,17 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67249
67278
|
};
|
|
67250
67279
|
applyReportChange = (nextState) => {
|
|
67251
67280
|
const effectiveNextState = nextState;
|
|
67281
|
+
const normalizedRequestedDisplayColumns = effectiveNextState.columns === void 0 ? void 0 : normalizeColumnsInput(
|
|
67282
|
+
effectiveNextState.columns,
|
|
67283
|
+
columnIdentifierLookup
|
|
67284
|
+
);
|
|
67285
|
+
const visibleDisplayColumnKeys = new Set(
|
|
67286
|
+
activeTableColumnIds.map((id) => columnIdentifierLookup.get(id)).filter((column) => Boolean(column)).map((column) => toReportBuilderColumnKey(column)).filter(Boolean)
|
|
67287
|
+
);
|
|
67288
|
+
const addedRequestedDisplayColumns = (normalizedRequestedDisplayColumns ?? []).filter((column) => {
|
|
67289
|
+
const key = toReportBuilderColumnKey(column);
|
|
67290
|
+
return Boolean(key) && !visibleDisplayColumnKeys.has(key);
|
|
67291
|
+
});
|
|
67252
67292
|
if (effectiveNextState.showLegend !== void 0) {
|
|
67253
67293
|
setChartVisibilityOverrides((previous) => ({
|
|
67254
67294
|
...previous,
|
|
@@ -67344,7 +67384,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67344
67384
|
dispatchFormRuntime({
|
|
67345
67385
|
type: "APPLY_SET_REPORT",
|
|
67346
67386
|
touchesPivotState: dispatchTouchesPivot,
|
|
67347
|
-
shouldRefreshExpandedTableData: shouldRefreshExpandedTableData || isDatasourceUpdate,
|
|
67387
|
+
shouldRefreshExpandedTableData: shouldRefreshExpandedTableData || isDatasourceUpdate || addedRequestedDisplayColumns.length > 0,
|
|
67348
67388
|
queuePromoteColumnToRow,
|
|
67349
67389
|
updater: (prev) => {
|
|
67350
67390
|
const next = {
|
|
@@ -67410,19 +67450,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67410
67450
|
}
|
|
67411
67451
|
}
|
|
67412
67452
|
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
|
-
);
|
|
67453
|
+
const normalizedDisplayColumns = normalizedRequestedDisplayColumns ?? [];
|
|
67454
|
+
const addedDisplayColumns = addedRequestedDisplayColumns;
|
|
67426
67455
|
next.columns = normalizedDisplayColumns;
|
|
67427
67456
|
if (addedDisplayColumns.length > 0) {
|
|
67428
67457
|
const queryTableNames = new Set(
|
package/dist/index.js
CHANGED
|
@@ -61285,16 +61285,19 @@ function normalizePivotChartForDisplay(chart) {
|
|
|
61285
61285
|
if (!row || typeof row !== "object") {
|
|
61286
61286
|
return row;
|
|
61287
61287
|
}
|
|
61288
|
-
const
|
|
61289
|
-
|
|
61288
|
+
const record = row;
|
|
61289
|
+
const displayValue = record[pivotDisplayRowField];
|
|
61290
|
+
if (displayValue === void 0 || displayValue === null) {
|
|
61290
61291
|
return row;
|
|
61291
61292
|
}
|
|
61292
|
-
const asString = String(
|
|
61293
|
+
const asString = String(displayValue).trim();
|
|
61293
61294
|
if (!asString || pivotDateRowMonthLabelRe.test(asString)) {
|
|
61294
61295
|
return row;
|
|
61295
61296
|
}
|
|
61297
|
+
const rawDate = record.__quillRawDate;
|
|
61298
|
+
const formatInput = rawDate !== void 0 && rawDate !== null && rawDate !== "" && rawDate !== 0 ? rawDate : displayValue;
|
|
61296
61299
|
const formatted = quillFormat({
|
|
61297
|
-
value:
|
|
61300
|
+
value: formatInput,
|
|
61298
61301
|
format: pivotDisplayDateFormat
|
|
61299
61302
|
});
|
|
61300
61303
|
if (!formatted || !String(formatted).trim()) {
|
|
@@ -62138,7 +62141,8 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
62138
62141
|
effectiveReportBuilderTableNames,
|
|
62139
62142
|
scopedSchemaColumns,
|
|
62140
62143
|
displayColumns,
|
|
62141
|
-
sourceReport
|
|
62144
|
+
sourceReport,
|
|
62145
|
+
includeSelectedSchemaFallback
|
|
62142
62146
|
} = args;
|
|
62143
62147
|
const selectedTableNames = new Set(effectiveReportBuilderTableNames);
|
|
62144
62148
|
const persistedReportColumns = Array.isArray(sourceReport?.columns) && sourceReport.columns.length > 0 ? sourceReport.columns : null;
|
|
@@ -62159,6 +62163,21 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
62159
62163
|
...tableName ? { table: tableName } : {}
|
|
62160
62164
|
};
|
|
62161
62165
|
}).filter((column) => Boolean(column));
|
|
62166
|
+
const normalizedSchemaColumns = includeSelectedSchemaFallback ? scopedSchemaColumns.filter(
|
|
62167
|
+
(column) => selectedTableNames.has(String(column.table ?? "").trim())
|
|
62168
|
+
).map((column) => {
|
|
62169
|
+
const field = String(column.field ?? "").trim();
|
|
62170
|
+
if (!field) return null;
|
|
62171
|
+
const label = String(column.label ?? "").trim() || field;
|
|
62172
|
+
const format9 = String(column.format ?? "").trim() || "string";
|
|
62173
|
+
const tableName = String(column.table ?? "").trim();
|
|
62174
|
+
return {
|
|
62175
|
+
label,
|
|
62176
|
+
field,
|
|
62177
|
+
format: format9,
|
|
62178
|
+
...tableName ? { table: tableName } : {}
|
|
62179
|
+
};
|
|
62180
|
+
}).filter((column) => Boolean(column)) : [];
|
|
62162
62181
|
const normalizedDisplayColumns = (displayColumns ?? []).map((column) => {
|
|
62163
62182
|
const field = String(column?.field ?? "").trim();
|
|
62164
62183
|
if (!field) return null;
|
|
@@ -62183,7 +62202,10 @@ function mergeDisplayAndSourceForTableFormats(args) {
|
|
|
62183
62202
|
sourceColumnsByKey.set(key, [column]);
|
|
62184
62203
|
}
|
|
62185
62204
|
};
|
|
62186
|
-
for (const sourceColumn of
|
|
62205
|
+
for (const sourceColumn of [
|
|
62206
|
+
...normalizedSourceColumns,
|
|
62207
|
+
...normalizedSchemaColumns
|
|
62208
|
+
]) {
|
|
62187
62209
|
const tableName = String(sourceColumn.table ?? "").trim();
|
|
62188
62210
|
addSourceColumnKey(sourceColumn.field, sourceColumn);
|
|
62189
62211
|
addSourceColumnKey(sourceColumn.label, sourceColumn);
|
|
@@ -63534,6 +63556,9 @@ function useReport(reportIdArg, options = {}) {
|
|
|
63534
63556
|
const [preserveSchemaWideOptions, setPreserveSchemaWideOptions] = useState41(false);
|
|
63535
63557
|
const [initialSchemaScopedTableNames, setInitialSchemaScopedTableNames] = useState41(null);
|
|
63536
63558
|
const [tableColumnsEditedSignature, setTableColumnsEditedSignature] = useState41(null);
|
|
63559
|
+
useEffect31(() => {
|
|
63560
|
+
setTableColumnsEditedSignature(null);
|
|
63561
|
+
}, [effectiveReportId]);
|
|
63537
63562
|
const [chartAxisEdits, setChartAxisEdits] = useState41({});
|
|
63538
63563
|
const [chartVisibilityOverrides, setChartVisibilityOverrides] = useState41({});
|
|
63539
63564
|
const [client] = useContext36(ClientContext);
|
|
@@ -66850,13 +66875,15 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66850
66875
|
effectiveReportBuilderTableNames,
|
|
66851
66876
|
scopedSchemaColumns,
|
|
66852
66877
|
displayColumns,
|
|
66853
|
-
sourceReport
|
|
66878
|
+
sourceReport,
|
|
66879
|
+
includeSelectedSchemaFallback: tableColumnsEditedSignature !== null
|
|
66854
66880
|
}),
|
|
66855
66881
|
[
|
|
66856
66882
|
effectiveReportBuilderTableNames,
|
|
66857
66883
|
scopedSchemaColumns,
|
|
66858
66884
|
displayColumns,
|
|
66859
|
-
sourceReport
|
|
66885
|
+
sourceReport,
|
|
66886
|
+
tableColumnsEditedSignature
|
|
66860
66887
|
]
|
|
66861
66888
|
);
|
|
66862
66889
|
const table = useMemo32(() => {
|
|
@@ -66866,7 +66893,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66866
66893
|
effectiveReportBuilderTableNames,
|
|
66867
66894
|
scopedSchemaColumns,
|
|
66868
66895
|
displayColumns,
|
|
66869
|
-
sourceReport
|
|
66896
|
+
sourceReport,
|
|
66897
|
+
includeSelectedSchemaFallback: tableColumnsEditedSignature !== null
|
|
66870
66898
|
});
|
|
66871
66899
|
const pivotRowFieldForTable = String(
|
|
66872
66900
|
sourceReport?.pivot?.rowField ?? ""
|
|
@@ -66967,6 +66995,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
66967
66995
|
resolvedYAxisFieldsForDisplay,
|
|
66968
66996
|
scopedSchemaColumns,
|
|
66969
66997
|
sourceReport,
|
|
66998
|
+
tableColumnsEditedSignature,
|
|
66970
66999
|
pagination,
|
|
66971
67000
|
paginationActive,
|
|
66972
67001
|
paginationPageCount,
|
|
@@ -67461,6 +67490,17 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67461
67490
|
};
|
|
67462
67491
|
applyReportChange = (nextState) => {
|
|
67463
67492
|
const effectiveNextState = nextState;
|
|
67493
|
+
const normalizedRequestedDisplayColumns = effectiveNextState.columns === void 0 ? void 0 : normalizeColumnsInput(
|
|
67494
|
+
effectiveNextState.columns,
|
|
67495
|
+
columnIdentifierLookup
|
|
67496
|
+
);
|
|
67497
|
+
const visibleDisplayColumnKeys = new Set(
|
|
67498
|
+
activeTableColumnIds.map((id) => columnIdentifierLookup.get(id)).filter((column) => Boolean(column)).map((column) => toReportBuilderColumnKey(column)).filter(Boolean)
|
|
67499
|
+
);
|
|
67500
|
+
const addedRequestedDisplayColumns = (normalizedRequestedDisplayColumns ?? []).filter((column) => {
|
|
67501
|
+
const key = toReportBuilderColumnKey(column);
|
|
67502
|
+
return Boolean(key) && !visibleDisplayColumnKeys.has(key);
|
|
67503
|
+
});
|
|
67464
67504
|
if (effectiveNextState.showLegend !== void 0) {
|
|
67465
67505
|
setChartVisibilityOverrides((previous) => ({
|
|
67466
67506
|
...previous,
|
|
@@ -67556,7 +67596,7 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67556
67596
|
dispatchFormRuntime({
|
|
67557
67597
|
type: "APPLY_SET_REPORT",
|
|
67558
67598
|
touchesPivotState: dispatchTouchesPivot,
|
|
67559
|
-
shouldRefreshExpandedTableData: shouldRefreshExpandedTableData || isDatasourceUpdate,
|
|
67599
|
+
shouldRefreshExpandedTableData: shouldRefreshExpandedTableData || isDatasourceUpdate || addedRequestedDisplayColumns.length > 0,
|
|
67560
67600
|
queuePromoteColumnToRow,
|
|
67561
67601
|
updater: (prev) => {
|
|
67562
67602
|
const next = {
|
|
@@ -67622,19 +67662,8 @@ function useReport(reportIdArg, options = {}) {
|
|
|
67622
67662
|
}
|
|
67623
67663
|
}
|
|
67624
67664
|
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
|
-
);
|
|
67665
|
+
const normalizedDisplayColumns = normalizedRequestedDisplayColumns ?? [];
|
|
67666
|
+
const addedDisplayColumns = addedRequestedDisplayColumns;
|
|
67638
67667
|
next.columns = normalizedDisplayColumns;
|
|
67639
67668
|
if (addedDisplayColumns.length > 0) {
|
|
67640
67669
|
const queryTableNames = new Set(
|