@quillsql/react 2.16.73 → 2.16.74

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
@@ -66276,14 +66276,16 @@ function useReport(reportIdArg, options = {}) {
66276
66276
  pivotRefreshQueryEnabled,
66277
66277
  effectiveReportId
66278
66278
  ]);
66279
+ const settledPivotForChart = sourceReport?.pivot ?? null;
66280
+ const settledSourceRowFieldForChart = String(
66281
+ sourceReport?.pivotResultSourceRowField ?? settledPivotForChart?.rowField ?? ""
66282
+ ).trim();
66283
+ const pendingPivotChangesDimensions = Boolean(
66284
+ sourceReport && pendingPivotRefresh && nextPivot && (settledSourceRowFieldForChart !== String(nextPivot.rowField ?? "").trim() || String(settledPivotForChart?.rowFieldTable ?? "").trim() !== String(nextPivot.rowFieldTable ?? "").trim() || String(settledPivotForChart?.columnField ?? "").trim() !== String(nextPivot.columnField ?? "").trim() || String(settledPivotForChart?.columnFieldTable ?? "").trim() !== String(nextPivot.columnFieldTable ?? "").trim())
66285
+ );
66279
66286
  const chartData = (0, import_react61.useMemo)(() => {
66280
66287
  if (!sourceReport) return void 0;
66281
66288
  const rowsForChart = Array.isArray(sourceReport.rows) ? sourceReport.rows : [];
66282
- const settledPivot = sourceReport.pivot ?? null;
66283
- const settledSourceRowField = String(
66284
- sourceReport.pivotResultSourceRowField ?? settledPivot?.rowField ?? ""
66285
- ).trim();
66286
- const pendingPivotChangesDimensions = pendingPivotRefresh && Boolean(nextPivot) && (settledSourceRowField !== String(nextPivot?.rowField ?? "").trim() || String(settledPivot?.rowFieldTable ?? "").trim() !== String(nextPivot?.rowFieldTable ?? "").trim() || String(settledPivot?.columnField ?? "").trim() !== String(nextPivot?.columnField ?? "").trim() || String(settledPivot?.columnFieldTable ?? "").trim() !== String(nextPivot?.columnFieldTable ?? "").trim());
66287
66289
  const chartPivot = pendingPivotChangesDimensions ? sourceReport.pivot ?? null : nextPivot ?? (!chartPivotHydratedFromSourceRef.current ? sourceReport.pivot ?? null : null);
66288
66290
  const chartPivotForDisplay = chartPivot && sourceReport.pivotResultRowField && sourceReport.pivotResultSourceRowField === chartPivot.rowField ? {
66289
66291
  ...chartPivot,
@@ -66310,7 +66312,7 @@ function useReport(reportIdArg, options = {}) {
66310
66312
  sourceReport,
66311
66313
  chartType,
66312
66314
  nextPivot,
66313
- pendingPivotRefresh,
66315
+ pendingPivotChangesDimensions,
66314
66316
  effectiveReportBuilderState,
66315
66317
  useInMemoryEngines,
66316
66318
  chartPivotHydrationEpoch
@@ -67209,6 +67211,12 @@ function useReport(reportIdArg, options = {}) {
67209
67211
  const tableColumnSettingsById = (0, import_react61.useMemo)(() => {
67210
67212
  const map = /* @__PURE__ */ new Map();
67211
67213
  const effectiveById = tableFormatMerge.formatByColumnOptionId;
67214
+ const mergedColumnByField = /* @__PURE__ */ new Map();
67215
+ for (const column of tableFormatMerge.columns) {
67216
+ if (!mergedColumnByField.has(column.field)) {
67217
+ mergedColumnByField.set(column.field, column);
67218
+ }
67219
+ }
67212
67220
  const chartColById = /* @__PURE__ */ new Map();
67213
67221
  if (isPivotTableChart && chart?.columns?.length) {
67214
67222
  for (const c of chart.columns) {
@@ -67289,9 +67297,8 @@ function useReport(reportIdArg, options = {}) {
67289
67297
  optionField
67290
67298
  );
67291
67299
  const effectiveFromId = effectiveById.get(columnId) ?? (encodedForMerge !== columnId ? effectiveById.get(encodedForMerge) : void 0) ?? "";
67292
- const mergeByFieldFormat = String(
67293
- tableFormatMerge.columns.find((c) => c.field === optionField)?.format ?? ""
67294
- ).trim();
67300
+ const mergedByField = mergedColumnByField.get(optionField);
67301
+ const mergeByFieldFormat = String(mergedByField?.format ?? "").trim();
67295
67302
  const columnPivotMeasureFormat = columnPivotMeasureFormatByAggregationField.get(optionField) ?? columnPivotMeasureFormatByAggregationField.get(columnId);
67296
67303
  const chartFallback = isPivotTableChart ? chartColById.get(columnId) ?? chartColById.get(encodedForMerge) ?? yAxisByField.get(optionField) ?? (columnPivotMeasureFormat ? {
67297
67304
  label: "",
@@ -67306,9 +67313,7 @@ function useReport(reportIdArg, options = {}) {
67306
67313
  isRowPivotCol ? rowAxisLabel : chartFallback?.label ?? ""
67307
67314
  ).trim();
67308
67315
  const persistedTableLabel = String(
67309
- tableFormatMerge.labelByColumnOptionId.get(columnId) ?? tableFormatMerge.columns.find(
67310
- (column) => column.field === optionField
67311
- )?.label ?? ""
67316
+ tableFormatMerge.labelByColumnOptionId.get(columnId) ?? mergedByField?.label ?? ""
67312
67317
  ).trim();
67313
67318
  const resolvedColFormat = isRowPivotCol ? String(resolvedXAxisFormat ?? "").trim() || effectiveFromId || mergeByFieldFormat || fromDisplay || String(chartFallback?.format ?? "").trim() || "string" : fromDisplay || effectiveFromId || mergeByFieldFormat;
67314
67319
  map.set(columnId, {
package/dist/index.js CHANGED
@@ -66488,14 +66488,16 @@ function useReport(reportIdArg, options = {}) {
66488
66488
  pivotRefreshQueryEnabled,
66489
66489
  effectiveReportId
66490
66490
  ]);
66491
+ const settledPivotForChart = sourceReport?.pivot ?? null;
66492
+ const settledSourceRowFieldForChart = String(
66493
+ sourceReport?.pivotResultSourceRowField ?? settledPivotForChart?.rowField ?? ""
66494
+ ).trim();
66495
+ const pendingPivotChangesDimensions = Boolean(
66496
+ sourceReport && pendingPivotRefresh && nextPivot && (settledSourceRowFieldForChart !== String(nextPivot.rowField ?? "").trim() || String(settledPivotForChart?.rowFieldTable ?? "").trim() !== String(nextPivot.rowFieldTable ?? "").trim() || String(settledPivotForChart?.columnField ?? "").trim() !== String(nextPivot.columnField ?? "").trim() || String(settledPivotForChart?.columnFieldTable ?? "").trim() !== String(nextPivot.columnFieldTable ?? "").trim())
66497
+ );
66491
66498
  const chartData = useMemo33(() => {
66492
66499
  if (!sourceReport) return void 0;
66493
66500
  const rowsForChart = Array.isArray(sourceReport.rows) ? sourceReport.rows : [];
66494
- const settledPivot = sourceReport.pivot ?? null;
66495
- const settledSourceRowField = String(
66496
- sourceReport.pivotResultSourceRowField ?? settledPivot?.rowField ?? ""
66497
- ).trim();
66498
- const pendingPivotChangesDimensions = pendingPivotRefresh && Boolean(nextPivot) && (settledSourceRowField !== String(nextPivot?.rowField ?? "").trim() || String(settledPivot?.rowFieldTable ?? "").trim() !== String(nextPivot?.rowFieldTable ?? "").trim() || String(settledPivot?.columnField ?? "").trim() !== String(nextPivot?.columnField ?? "").trim() || String(settledPivot?.columnFieldTable ?? "").trim() !== String(nextPivot?.columnFieldTable ?? "").trim());
66499
66501
  const chartPivot = pendingPivotChangesDimensions ? sourceReport.pivot ?? null : nextPivot ?? (!chartPivotHydratedFromSourceRef.current ? sourceReport.pivot ?? null : null);
66500
66502
  const chartPivotForDisplay = chartPivot && sourceReport.pivotResultRowField && sourceReport.pivotResultSourceRowField === chartPivot.rowField ? {
66501
66503
  ...chartPivot,
@@ -66522,7 +66524,7 @@ function useReport(reportIdArg, options = {}) {
66522
66524
  sourceReport,
66523
66525
  chartType,
66524
66526
  nextPivot,
66525
- pendingPivotRefresh,
66527
+ pendingPivotChangesDimensions,
66526
66528
  effectiveReportBuilderState,
66527
66529
  useInMemoryEngines,
66528
66530
  chartPivotHydrationEpoch
@@ -67421,6 +67423,12 @@ function useReport(reportIdArg, options = {}) {
67421
67423
  const tableColumnSettingsById = useMemo33(() => {
67422
67424
  const map = /* @__PURE__ */ new Map();
67423
67425
  const effectiveById = tableFormatMerge.formatByColumnOptionId;
67426
+ const mergedColumnByField = /* @__PURE__ */ new Map();
67427
+ for (const column of tableFormatMerge.columns) {
67428
+ if (!mergedColumnByField.has(column.field)) {
67429
+ mergedColumnByField.set(column.field, column);
67430
+ }
67431
+ }
67424
67432
  const chartColById = /* @__PURE__ */ new Map();
67425
67433
  if (isPivotTableChart && chart?.columns?.length) {
67426
67434
  for (const c of chart.columns) {
@@ -67501,9 +67509,8 @@ function useReport(reportIdArg, options = {}) {
67501
67509
  optionField
67502
67510
  );
67503
67511
  const effectiveFromId = effectiveById.get(columnId) ?? (encodedForMerge !== columnId ? effectiveById.get(encodedForMerge) : void 0) ?? "";
67504
- const mergeByFieldFormat = String(
67505
- tableFormatMerge.columns.find((c) => c.field === optionField)?.format ?? ""
67506
- ).trim();
67512
+ const mergedByField = mergedColumnByField.get(optionField);
67513
+ const mergeByFieldFormat = String(mergedByField?.format ?? "").trim();
67507
67514
  const columnPivotMeasureFormat = columnPivotMeasureFormatByAggregationField.get(optionField) ?? columnPivotMeasureFormatByAggregationField.get(columnId);
67508
67515
  const chartFallback = isPivotTableChart ? chartColById.get(columnId) ?? chartColById.get(encodedForMerge) ?? yAxisByField.get(optionField) ?? (columnPivotMeasureFormat ? {
67509
67516
  label: "",
@@ -67518,9 +67525,7 @@ function useReport(reportIdArg, options = {}) {
67518
67525
  isRowPivotCol ? rowAxisLabel : chartFallback?.label ?? ""
67519
67526
  ).trim();
67520
67527
  const persistedTableLabel = String(
67521
- tableFormatMerge.labelByColumnOptionId.get(columnId) ?? tableFormatMerge.columns.find(
67522
- (column) => column.field === optionField
67523
- )?.label ?? ""
67528
+ tableFormatMerge.labelByColumnOptionId.get(columnId) ?? mergedByField?.label ?? ""
67524
67529
  ).trim();
67525
67530
  const resolvedColFormat = isRowPivotCol ? String(resolvedXAxisFormat ?? "").trim() || effectiveFromId || mergeByFieldFormat || fromDisplay || String(chartFallback?.format ?? "").trim() || "string" : fromDisplay || effectiveFromId || mergeByFieldFormat;
67526
67531
  map.set(columnId, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/react",
3
- "version": "2.16.73",
3
+ "version": "2.16.74",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {