@quillsql/react 2.16.72 → 2.16.73

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
@@ -62007,6 +62007,11 @@ function resolveTableColumnDefaultFormat({
62007
62007
  }
62008
62008
  return currentFormat;
62009
62009
  }
62010
+ function resolveTableColumnLabel(fieldRaw, labelRaw) {
62011
+ const field = String(fieldRaw ?? "").trim();
62012
+ const label = String(labelRaw ?? "").trim();
62013
+ return !label || label === field ? toTitleCaseLabel(field) : label;
62014
+ }
62010
62015
  function mergeDisplayAndSourceForTableFormats(args) {
62011
62016
  const {
62012
62017
  effectiveReportBuilderTableNames,
@@ -62060,6 +62065,7 @@ function mergeDisplayAndSourceForTableFormats(args) {
62060
62065
  };
62061
62066
  }).filter((column) => Boolean(column));
62062
62067
  const formatByColumnOptionId = /* @__PURE__ */ new Map();
62068
+ const labelByColumnOptionId = /* @__PURE__ */ new Map();
62063
62069
  let columnsWithTableMeta = [];
62064
62070
  if (normalizedSourceColumns.length > 0 && normalizedDisplayColumns.length > 0) {
62065
62071
  const sourceColumnsByKey = /* @__PURE__ */ new Map();
@@ -62161,21 +62167,27 @@ function mergeDisplayAndSourceForTableFormats(args) {
62161
62167
  const id = encodeColumnOptionValue(selection.table, selection.field);
62162
62168
  if (id) {
62163
62169
  formatByColumnOptionId.set(id, String(merged.format ?? "").trim());
62170
+ labelByColumnOptionId.set(
62171
+ id,
62172
+ resolveTableColumnLabel(merged.field, merged.label)
62173
+ );
62164
62174
  }
62165
62175
  }
62166
62176
  columnsWithTableMeta = selectedColumnsForTable;
62167
62177
  }
62168
62178
  const columns = columnsWithTableMeta.map((column) => {
62169
62179
  const field = column.field;
62170
- const rawLabel = String(column.label ?? "").trim();
62171
- const label = !rawLabel || rawLabel === field ? toTitleCaseLabel(field) : rawLabel;
62172
62180
  return {
62173
- label,
62181
+ label: resolveTableColumnLabel(field, column.label),
62174
62182
  field,
62175
62183
  format: column.format
62176
62184
  };
62177
62185
  });
62178
- return { columns, formatByColumnOptionId };
62186
+ return {
62187
+ columns,
62188
+ formatByColumnOptionId,
62189
+ labelByColumnOptionId
62190
+ };
62179
62191
  }
62180
62192
  function axisFormatToSelectLabel(format9) {
62181
62193
  const raw = String(format9 ?? "").trim();
@@ -67289,11 +67301,18 @@ function useReport(reportIdArg, options = {}) {
67289
67301
  selectedColumn?.format ?? chartFallback?.format ?? ""
67290
67302
  ).trim();
67291
67303
  const isRowPivotCol = isPivotTableChart && Boolean(pivotRowFieldForSettings) && optionField === pivotRowFieldForSettings && Boolean(rowAxisLabel);
67304
+ const selectedLabel = String(selectedColumn?.alias ?? "").trim();
67305
+ const pivotLabel = String(
67306
+ isRowPivotCol ? rowAxisLabel : chartFallback?.label ?? ""
67307
+ ).trim();
67308
+ const persistedTableLabel = String(
67309
+ tableFormatMerge.labelByColumnOptionId.get(columnId) ?? tableFormatMerge.columns.find(
67310
+ (column) => column.field === optionField
67311
+ )?.label ?? ""
67312
+ ).trim();
67292
67313
  const resolvedColFormat = isRowPivotCol ? String(resolvedXAxisFormat ?? "").trim() || effectiveFromId || mergeByFieldFormat || fromDisplay || String(chartFallback?.format ?? "").trim() || "string" : fromDisplay || effectiveFromId || mergeByFieldFormat;
67293
67314
  map.set(columnId, {
67294
- label: String(
67295
- selectedColumn?.alias ?? (isRowPivotCol ? rowAxisLabel : chartFallback?.label) ?? ""
67296
- ).trim(),
67315
+ label: selectedLabel || pivotLabel || (!isPivotTableChart ? persistedTableLabel : ""),
67297
67316
  format: resolvedColFormat
67298
67317
  });
67299
67318
  }
package/dist/index.js CHANGED
@@ -62219,6 +62219,11 @@ function resolveTableColumnDefaultFormat({
62219
62219
  }
62220
62220
  return currentFormat;
62221
62221
  }
62222
+ function resolveTableColumnLabel(fieldRaw, labelRaw) {
62223
+ const field = String(fieldRaw ?? "").trim();
62224
+ const label = String(labelRaw ?? "").trim();
62225
+ return !label || label === field ? toTitleCaseLabel(field) : label;
62226
+ }
62222
62227
  function mergeDisplayAndSourceForTableFormats(args) {
62223
62228
  const {
62224
62229
  effectiveReportBuilderTableNames,
@@ -62272,6 +62277,7 @@ function mergeDisplayAndSourceForTableFormats(args) {
62272
62277
  };
62273
62278
  }).filter((column) => Boolean(column));
62274
62279
  const formatByColumnOptionId = /* @__PURE__ */ new Map();
62280
+ const labelByColumnOptionId = /* @__PURE__ */ new Map();
62275
62281
  let columnsWithTableMeta = [];
62276
62282
  if (normalizedSourceColumns.length > 0 && normalizedDisplayColumns.length > 0) {
62277
62283
  const sourceColumnsByKey = /* @__PURE__ */ new Map();
@@ -62373,21 +62379,27 @@ function mergeDisplayAndSourceForTableFormats(args) {
62373
62379
  const id = encodeColumnOptionValue(selection.table, selection.field);
62374
62380
  if (id) {
62375
62381
  formatByColumnOptionId.set(id, String(merged.format ?? "").trim());
62382
+ labelByColumnOptionId.set(
62383
+ id,
62384
+ resolveTableColumnLabel(merged.field, merged.label)
62385
+ );
62376
62386
  }
62377
62387
  }
62378
62388
  columnsWithTableMeta = selectedColumnsForTable;
62379
62389
  }
62380
62390
  const columns = columnsWithTableMeta.map((column) => {
62381
62391
  const field = column.field;
62382
- const rawLabel = String(column.label ?? "").trim();
62383
- const label = !rawLabel || rawLabel === field ? toTitleCaseLabel(field) : rawLabel;
62384
62392
  return {
62385
- label,
62393
+ label: resolveTableColumnLabel(field, column.label),
62386
62394
  field,
62387
62395
  format: column.format
62388
62396
  };
62389
62397
  });
62390
- return { columns, formatByColumnOptionId };
62398
+ return {
62399
+ columns,
62400
+ formatByColumnOptionId,
62401
+ labelByColumnOptionId
62402
+ };
62391
62403
  }
62392
62404
  function axisFormatToSelectLabel(format9) {
62393
62405
  const raw = String(format9 ?? "").trim();
@@ -67501,11 +67513,18 @@ function useReport(reportIdArg, options = {}) {
67501
67513
  selectedColumn?.format ?? chartFallback?.format ?? ""
67502
67514
  ).trim();
67503
67515
  const isRowPivotCol = isPivotTableChart && Boolean(pivotRowFieldForSettings) && optionField === pivotRowFieldForSettings && Boolean(rowAxisLabel);
67516
+ const selectedLabel = String(selectedColumn?.alias ?? "").trim();
67517
+ const pivotLabel = String(
67518
+ isRowPivotCol ? rowAxisLabel : chartFallback?.label ?? ""
67519
+ ).trim();
67520
+ const persistedTableLabel = String(
67521
+ tableFormatMerge.labelByColumnOptionId.get(columnId) ?? tableFormatMerge.columns.find(
67522
+ (column) => column.field === optionField
67523
+ )?.label ?? ""
67524
+ ).trim();
67504
67525
  const resolvedColFormat = isRowPivotCol ? String(resolvedXAxisFormat ?? "").trim() || effectiveFromId || mergeByFieldFormat || fromDisplay || String(chartFallback?.format ?? "").trim() || "string" : fromDisplay || effectiveFromId || mergeByFieldFormat;
67505
67526
  map.set(columnId, {
67506
- label: String(
67507
- selectedColumn?.alias ?? (isRowPivotCol ? rowAxisLabel : chartFallback?.label) ?? ""
67508
- ).trim(),
67527
+ label: selectedLabel || pivotLabel || (!isPivotTableChart ? persistedTableLabel : ""),
67509
67528
  format: resolvedColFormat
67510
67529
  });
67511
67530
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/react",
3
- "version": "2.16.72",
3
+ "version": "2.16.73",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {