@qrvey/utils 1.18.5 → 1.18.7

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.18.5*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.18.7*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -21,10 +21,10 @@ const format_1 = require("../format/format");
21
21
  exports.DELTA_COLUMN_PREFIX = "\u0394";
22
22
  exports.REFERENCE_COLUMN_MARKER = "\u25CF";
23
23
  function formatDeltaColumnCaption(caption) {
24
- return `${exports.DELTA_COLUMN_PREFIX} ${caption}`;
24
+ return `${exports.DELTA_COLUMN_PREFIX} ${stripColumnMarker(caption)}`;
25
25
  }
26
26
  function formatReferenceColumnCaption(caption) {
27
- return `${exports.REFERENCE_COLUMN_MARKER} ${caption}`;
27
+ return `${exports.REFERENCE_COLUMN_MARKER} ${stripColumnMarker(caption)}`;
28
28
  }
29
29
  function stripColumnMarker(caption) {
30
30
  const markers = exports.DELTA_COLUMN_PREFIX + exports.REFERENCE_COLUMN_MARKER;
@@ -63,7 +63,10 @@ function resolveComparativeColumnCaption(chartModel, columnKey, allDatesText) {
63
63
  ? `${refDataField}__${suffixType}`
64
64
  : columnKey;
65
65
  if (suffixType === "comp") {
66
- return (customLabels[dataFieldKey] ??
66
+ const customLabel = customLabels[dataFieldKey]
67
+ ? stripColumnMarker(customLabels[dataFieldKey])
68
+ : null;
69
+ return (customLabel ??
67
70
  formatComparativePeriodCaption(comparativeAnalisis.compareTo, fallbackAllDates, defaultName));
68
71
  }
69
72
  const diffCols = comparativeAnalisis?.styles?.columnDiffs?.[uniqueCode] ?? [];
@@ -160,7 +163,7 @@ function expandColumnListWithComparativeColumns(columnList, comparativeVirtualCo
160
163
  col.label.trim().length > 0 &&
161
164
  col.label.trim() !== defaultName.trim();
162
165
  const refLabel = hasCustomLabel
163
- ? col.label
166
+ ? stripColumnMarker(col.label)
164
167
  : formatComparativePeriodCaption(comparativeData.referencePeriod, fallbackAllDates, defaultName);
165
168
  const customLabels = (0, get_1._get)(myBus, "store.comparativeAnalisis.customColumnLabels") ??
166
169
  (0, get_1._get)(chart, "data.v2.comparativeAnalisis.customColumnLabels") ??
@@ -253,7 +256,7 @@ function applyComparativeHeaderBorders(columns, myBus, chart) {
253
256
  if (col._comparativeLabel) {
254
257
  const titleEl = columnHeader.querySelector(".an-header-title-text");
255
258
  if (titleEl)
256
- titleEl.textContent = `${exports.REFERENCE_COLUMN_MARKER} ${col._comparativeLabel}`;
259
+ titleEl.textContent = formatReferenceColumnCaption(col._comparativeLabel);
257
260
  }
258
261
  const totalCols = cellInfo.component?.columnCount?.() ?? 0;
259
262
  if (hasVerticalBorder && cellInfo.columnIndex < totalCols - 1) {
@@ -3,10 +3,10 @@ import { addFormat } from "../format/format";
3
3
  export const DELTA_COLUMN_PREFIX = "\u0394";
4
4
  export const REFERENCE_COLUMN_MARKER = "\u25CF";
5
5
  export function formatDeltaColumnCaption(caption) {
6
- return `${DELTA_COLUMN_PREFIX} ${caption}`;
6
+ return `${DELTA_COLUMN_PREFIX} ${stripColumnMarker(caption)}`;
7
7
  }
8
8
  export function formatReferenceColumnCaption(caption) {
9
- return `${REFERENCE_COLUMN_MARKER} ${caption}`;
9
+ return `${REFERENCE_COLUMN_MARKER} ${stripColumnMarker(caption)}`;
10
10
  }
11
11
  export function stripColumnMarker(caption) {
12
12
  const markers = DELTA_COLUMN_PREFIX + REFERENCE_COLUMN_MARKER;
@@ -45,7 +45,10 @@ export function resolveComparativeColumnCaption(chartModel, columnKey, allDatesT
45
45
  ? `${refDataField}__${suffixType}`
46
46
  : columnKey;
47
47
  if (suffixType === "comp") {
48
- return (customLabels[dataFieldKey] ??
48
+ const customLabel = customLabels[dataFieldKey]
49
+ ? stripColumnMarker(customLabels[dataFieldKey])
50
+ : null;
51
+ return (customLabel ??
49
52
  formatComparativePeriodCaption(comparativeAnalisis.compareTo, fallbackAllDates, defaultName));
50
53
  }
51
54
  const diffCols = comparativeAnalisis?.styles?.columnDiffs?.[uniqueCode] ?? [];
@@ -142,7 +145,7 @@ export function expandColumnListWithComparativeColumns(columnList, comparativeVi
142
145
  col.label.trim().length > 0 &&
143
146
  col.label.trim() !== defaultName.trim();
144
147
  const refLabel = hasCustomLabel
145
- ? col.label
148
+ ? stripColumnMarker(col.label)
146
149
  : formatComparativePeriodCaption(comparativeData.referencePeriod, fallbackAllDates, defaultName);
147
150
  const customLabels = _get(myBus, "store.comparativeAnalisis.customColumnLabels") ??
148
151
  _get(chart, "data.v2.comparativeAnalisis.customColumnLabels") ??
@@ -235,7 +238,7 @@ export function applyComparativeHeaderBorders(columns, myBus, chart) {
235
238
  if (col._comparativeLabel) {
236
239
  const titleEl = columnHeader.querySelector(".an-header-title-text");
237
240
  if (titleEl)
238
- titleEl.textContent = `${REFERENCE_COLUMN_MARKER} ${col._comparativeLabel}`;
241
+ titleEl.textContent = formatReferenceColumnCaption(col._comparativeLabel);
239
242
  }
240
243
  const totalCols = cellInfo.component?.columnCount?.() ?? 0;
241
244
  if (hasVerticalBorder && cellInfo.columnIndex < totalCols - 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.18.5",
3
+ "version": "1.18.7",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/cjs/index.js",