@quillsql/react 2.16.88 → 2.16.89

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 CHANGED
@@ -23705,10 +23705,24 @@ function hasPreformattedDateBucketLabels(report) {
23705
23705
  if (report.chartType?.toLowerCase() === "table") return false;
23706
23706
  return report.xAxisField?.trim() === pivot.rowField?.trim();
23707
23707
  }
23708
+ function applySavedPivotColumnLabels(report, pivotColumns) {
23709
+ return pivotColumns?.map((column) => {
23710
+ const savedColumn = report.columns?.find(
23711
+ ({ field }) => field === column.field
23712
+ );
23713
+ const rowLabel = column.field === report.pivot?.rowField ? report.xAxisLabel : void 0;
23714
+ return {
23715
+ ...column,
23716
+ label: rowLabel || savedColumn?.label || column.label
23717
+ };
23718
+ });
23719
+ }
23708
23720
  function prepareStaticChartReport(report, { removePagination }) {
23709
- const config = report.pivot ? {
23721
+ const pivotData = report.pivot ? formattedPivotRowsAndColumns(report, [], { formatRows: false }) : void 0;
23722
+ const config = pivotData ? {
23710
23723
  ...report,
23711
- ...formattedPivotRowsAndColumns(report, [], { formatRows: false })
23724
+ ...pivotData,
23725
+ columns: applySavedPivotColumnLabels(report, pivotData.columns)
23712
23726
  } : { ...report };
23713
23727
  if (removePagination) {
23714
23728
  config.pagination = void 0;
package/dist/index.js CHANGED
@@ -23687,10 +23687,24 @@ function hasPreformattedDateBucketLabels(report) {
23687
23687
  if (report.chartType?.toLowerCase() === "table") return false;
23688
23688
  return report.xAxisField?.trim() === pivot.rowField?.trim();
23689
23689
  }
23690
+ function applySavedPivotColumnLabels(report, pivotColumns) {
23691
+ return pivotColumns?.map((column) => {
23692
+ const savedColumn = report.columns?.find(
23693
+ ({ field }) => field === column.field
23694
+ );
23695
+ const rowLabel = column.field === report.pivot?.rowField ? report.xAxisLabel : void 0;
23696
+ return {
23697
+ ...column,
23698
+ label: rowLabel || savedColumn?.label || column.label
23699
+ };
23700
+ });
23701
+ }
23690
23702
  function prepareStaticChartReport(report, { removePagination }) {
23691
- const config = report.pivot ? {
23703
+ const pivotData = report.pivot ? formattedPivotRowsAndColumns(report, [], { formatRows: false }) : void 0;
23704
+ const config = pivotData ? {
23692
23705
  ...report,
23693
- ...formattedPivotRowsAndColumns(report, [], { formatRows: false })
23706
+ ...pivotData,
23707
+ columns: applySavedPivotColumnLabels(report, pivotData.columns)
23694
23708
  } : { ...report };
23695
23709
  if (removePagination) {
23696
23710
  config.pagination = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/react",
3
- "version": "2.16.88",
3
+ "version": "2.16.89",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {