@quillsql/react 2.16.97 → 2.16.98
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 +15 -55
- package/dist/index.js +15 -55
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -63950,18 +63950,6 @@ function encodeColumnOptionValue(table, field) {
|
|
|
63950
63950
|
if (!table || !table.trim()) return field;
|
|
63951
63951
|
return `${table}_${field}`;
|
|
63952
63952
|
}
|
|
63953
|
-
function isNumericishColumnType(type) {
|
|
63954
|
-
const t = String(type ?? "").toLowerCase();
|
|
63955
|
-
return t === "number" || t === "integer" || t === "float" || t === "decimal" || t === "bigint" || t === "double" || t === "whole_number";
|
|
63956
|
-
}
|
|
63957
|
-
function findSchemaColumnForChartAxisField(chartField, schemaOptions) {
|
|
63958
|
-
const f = String(chartField ?? "").trim();
|
|
63959
|
-
if (!f) return void 0;
|
|
63960
|
-
for (const opt of schemaOptions) {
|
|
63961
|
-
if (opt.value === f || opt.field === f) return opt;
|
|
63962
|
-
}
|
|
63963
|
-
return void 0;
|
|
63964
|
-
}
|
|
63965
63953
|
function getAllColumnOptions({
|
|
63966
63954
|
schemaColumnOptions,
|
|
63967
63955
|
tableColumns,
|
|
@@ -69619,42 +69607,6 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69619
69607
|
}
|
|
69620
69608
|
return chartAxisOptions;
|
|
69621
69609
|
}, [chartAxesBaseChart, chartAxisOptions, chartAxisOptionByField]);
|
|
69622
|
-
const yAxisOptions = (0, import_react63.useMemo)(() => {
|
|
69623
|
-
if (!chartAxesBaseChart) return [];
|
|
69624
|
-
const keepOption = (option) => {
|
|
69625
|
-
const col = findSchemaColumnForChartAxisField(
|
|
69626
|
-
option.value,
|
|
69627
|
-
schemaColumnOptions
|
|
69628
|
-
);
|
|
69629
|
-
if (!col) return true;
|
|
69630
|
-
return isNumericishColumnType(col.type);
|
|
69631
|
-
};
|
|
69632
|
-
let eligible = chartAxisOptions.filter(keepOption);
|
|
69633
|
-
const pivot = chartAxesBaseChart.pivot;
|
|
69634
|
-
const pivotRowField = String(pivot?.rowField ?? "").trim();
|
|
69635
|
-
if (pivot && !pivotRowField) {
|
|
69636
|
-
const allowed = new Set(yAxisResolved.measures.map((axis) => axis.field));
|
|
69637
|
-
if (allowed.size > 0) {
|
|
69638
|
-
eligible = eligible.filter((o) => allowed.has(o.value));
|
|
69639
|
-
}
|
|
69640
|
-
}
|
|
69641
|
-
const merged = new Map(
|
|
69642
|
-
eligible.map((o) => [o.value, o])
|
|
69643
|
-
);
|
|
69644
|
-
for (const yAxisField of yAxisResolved.measures) {
|
|
69645
|
-
const field = String(yAxisField?.field ?? "").trim();
|
|
69646
|
-
if (!field || merged.has(field)) continue;
|
|
69647
|
-
const opt = chartAxisOptionByField.get(field);
|
|
69648
|
-
if (opt) merged.set(field, opt);
|
|
69649
|
-
}
|
|
69650
|
-
return Array.from(merged.values());
|
|
69651
|
-
}, [
|
|
69652
|
-
chartAxesBaseChart,
|
|
69653
|
-
chartAxisOptionByField,
|
|
69654
|
-
chartAxisOptions,
|
|
69655
|
-
schemaColumnOptions,
|
|
69656
|
-
yAxisResolved.measures
|
|
69657
|
-
]);
|
|
69658
69610
|
const normalizedChartXAxisOptions = (0, import_react63.useMemo)(() => {
|
|
69659
69611
|
return xAxisOptions.map((option) => ({
|
|
69660
69612
|
value: String(option.value ?? "").trim(),
|
|
@@ -69662,13 +69614,6 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69662
69614
|
format: String(option.format ?? "").trim()
|
|
69663
69615
|
}));
|
|
69664
69616
|
}, [xAxisOptions]);
|
|
69665
|
-
const normalizedChartYAxisOptions = (0, import_react63.useMemo)(() => {
|
|
69666
|
-
return yAxisOptions.map((option) => ({
|
|
69667
|
-
value: String(option.value ?? "").trim(),
|
|
69668
|
-
label: String(option.label ?? option.value ?? "").trim(),
|
|
69669
|
-
format: String(option.format ?? "").trim()
|
|
69670
|
-
}));
|
|
69671
|
-
}, [yAxisOptions]);
|
|
69672
69617
|
const yAxisMeasures = (0, import_react63.useMemo)(() => {
|
|
69673
69618
|
if (yAxisResolved.measures.length > 0) {
|
|
69674
69619
|
return yAxisResolved.measures;
|
|
@@ -69683,6 +69628,21 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69683
69628
|
}
|
|
69684
69629
|
];
|
|
69685
69630
|
}, [chartAxisOptions, yAxisResolved.measures]);
|
|
69631
|
+
const yAxisOptions = (0, import_react63.useMemo)(
|
|
69632
|
+
() => yAxisMeasures.map((measure) => ({
|
|
69633
|
+
value: measure.field,
|
|
69634
|
+
label: measure.label,
|
|
69635
|
+
format: toAxisFormat(measure.format, "string")
|
|
69636
|
+
})),
|
|
69637
|
+
[yAxisMeasures]
|
|
69638
|
+
);
|
|
69639
|
+
const normalizedChartYAxisOptions = (0, import_react63.useMemo)(() => {
|
|
69640
|
+
return yAxisOptions.map((option) => ({
|
|
69641
|
+
value: String(option.value ?? "").trim(),
|
|
69642
|
+
label: String(option.label ?? option.value ?? "").trim(),
|
|
69643
|
+
format: String(option.format ?? "").trim()
|
|
69644
|
+
}));
|
|
69645
|
+
}, [yAxisOptions]);
|
|
69686
69646
|
const resolvedXAxisField = (0, import_react63.useMemo)(() => {
|
|
69687
69647
|
if (!chartAxesBaseChart) return "";
|
|
69688
69648
|
const chartType2 = String(chartAxesBaseChart.chartType ?? "").toLowerCase();
|
package/dist/index.js
CHANGED
|
@@ -64158,18 +64158,6 @@ function encodeColumnOptionValue(table, field) {
|
|
|
64158
64158
|
if (!table || !table.trim()) return field;
|
|
64159
64159
|
return `${table}_${field}`;
|
|
64160
64160
|
}
|
|
64161
|
-
function isNumericishColumnType(type) {
|
|
64162
|
-
const t = String(type ?? "").toLowerCase();
|
|
64163
|
-
return t === "number" || t === "integer" || t === "float" || t === "decimal" || t === "bigint" || t === "double" || t === "whole_number";
|
|
64164
|
-
}
|
|
64165
|
-
function findSchemaColumnForChartAxisField(chartField, schemaOptions) {
|
|
64166
|
-
const f = String(chartField ?? "").trim();
|
|
64167
|
-
if (!f) return void 0;
|
|
64168
|
-
for (const opt of schemaOptions) {
|
|
64169
|
-
if (opt.value === f || opt.field === f) return opt;
|
|
64170
|
-
}
|
|
64171
|
-
return void 0;
|
|
64172
|
-
}
|
|
64173
64161
|
function getAllColumnOptions({
|
|
64174
64162
|
schemaColumnOptions,
|
|
64175
64163
|
tableColumns,
|
|
@@ -69827,42 +69815,6 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69827
69815
|
}
|
|
69828
69816
|
return chartAxisOptions;
|
|
69829
69817
|
}, [chartAxesBaseChart, chartAxisOptions, chartAxisOptionByField]);
|
|
69830
|
-
const yAxisOptions = useMemo33(() => {
|
|
69831
|
-
if (!chartAxesBaseChart) return [];
|
|
69832
|
-
const keepOption = (option) => {
|
|
69833
|
-
const col = findSchemaColumnForChartAxisField(
|
|
69834
|
-
option.value,
|
|
69835
|
-
schemaColumnOptions
|
|
69836
|
-
);
|
|
69837
|
-
if (!col) return true;
|
|
69838
|
-
return isNumericishColumnType(col.type);
|
|
69839
|
-
};
|
|
69840
|
-
let eligible = chartAxisOptions.filter(keepOption);
|
|
69841
|
-
const pivot = chartAxesBaseChart.pivot;
|
|
69842
|
-
const pivotRowField = String(pivot?.rowField ?? "").trim();
|
|
69843
|
-
if (pivot && !pivotRowField) {
|
|
69844
|
-
const allowed = new Set(yAxisResolved.measures.map((axis) => axis.field));
|
|
69845
|
-
if (allowed.size > 0) {
|
|
69846
|
-
eligible = eligible.filter((o) => allowed.has(o.value));
|
|
69847
|
-
}
|
|
69848
|
-
}
|
|
69849
|
-
const merged = new Map(
|
|
69850
|
-
eligible.map((o) => [o.value, o])
|
|
69851
|
-
);
|
|
69852
|
-
for (const yAxisField of yAxisResolved.measures) {
|
|
69853
|
-
const field = String(yAxisField?.field ?? "").trim();
|
|
69854
|
-
if (!field || merged.has(field)) continue;
|
|
69855
|
-
const opt = chartAxisOptionByField.get(field);
|
|
69856
|
-
if (opt) merged.set(field, opt);
|
|
69857
|
-
}
|
|
69858
|
-
return Array.from(merged.values());
|
|
69859
|
-
}, [
|
|
69860
|
-
chartAxesBaseChart,
|
|
69861
|
-
chartAxisOptionByField,
|
|
69862
|
-
chartAxisOptions,
|
|
69863
|
-
schemaColumnOptions,
|
|
69864
|
-
yAxisResolved.measures
|
|
69865
|
-
]);
|
|
69866
69818
|
const normalizedChartXAxisOptions = useMemo33(() => {
|
|
69867
69819
|
return xAxisOptions.map((option) => ({
|
|
69868
69820
|
value: String(option.value ?? "").trim(),
|
|
@@ -69870,13 +69822,6 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69870
69822
|
format: String(option.format ?? "").trim()
|
|
69871
69823
|
}));
|
|
69872
69824
|
}, [xAxisOptions]);
|
|
69873
|
-
const normalizedChartYAxisOptions = useMemo33(() => {
|
|
69874
|
-
return yAxisOptions.map((option) => ({
|
|
69875
|
-
value: String(option.value ?? "").trim(),
|
|
69876
|
-
label: String(option.label ?? option.value ?? "").trim(),
|
|
69877
|
-
format: String(option.format ?? "").trim()
|
|
69878
|
-
}));
|
|
69879
|
-
}, [yAxisOptions]);
|
|
69880
69825
|
const yAxisMeasures = useMemo33(() => {
|
|
69881
69826
|
if (yAxisResolved.measures.length > 0) {
|
|
69882
69827
|
return yAxisResolved.measures;
|
|
@@ -69891,6 +69836,21 @@ function useReport(reportIdArg, options = {}) {
|
|
|
69891
69836
|
}
|
|
69892
69837
|
];
|
|
69893
69838
|
}, [chartAxisOptions, yAxisResolved.measures]);
|
|
69839
|
+
const yAxisOptions = useMemo33(
|
|
69840
|
+
() => yAxisMeasures.map((measure) => ({
|
|
69841
|
+
value: measure.field,
|
|
69842
|
+
label: measure.label,
|
|
69843
|
+
format: toAxisFormat(measure.format, "string")
|
|
69844
|
+
})),
|
|
69845
|
+
[yAxisMeasures]
|
|
69846
|
+
);
|
|
69847
|
+
const normalizedChartYAxisOptions = useMemo33(() => {
|
|
69848
|
+
return yAxisOptions.map((option) => ({
|
|
69849
|
+
value: String(option.value ?? "").trim(),
|
|
69850
|
+
label: String(option.label ?? option.value ?? "").trim(),
|
|
69851
|
+
format: String(option.format ?? "").trim()
|
|
69852
|
+
}));
|
|
69853
|
+
}, [yAxisOptions]);
|
|
69894
69854
|
const resolvedXAxisField = useMemo33(() => {
|
|
69895
69855
|
if (!chartAxesBaseChart) return "";
|
|
69896
69856
|
const chartType2 = String(chartAxesBaseChart.chartType ?? "").toLowerCase();
|