@qrvey/utils 1.18.10 → 1.18.11

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.10*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.18.11*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -71,13 +71,7 @@ function resolveComparativeColumnCaption(chartModel, columnKey, allDatesText) {
71
71
  }
72
72
  const diffCols = comparativeAnalisis?.styles?.columnDiffs?.[uniqueCode] ?? [];
73
73
  const diffCol = diffCols[deltaIndex];
74
- const hasConfiguredDiffs = comparativeAnalisis?.styles?.columnDiffs?.[uniqueCode] != null;
75
74
  const diffName = diffCol?.name?.trim() || null;
76
- if (hasConfiguredDiffs) {
77
- if (diffName)
78
- return formatDeltaColumnCaption(diffName);
79
- return formatDeltaDefaultCaption(comparativeAnalisis.referencePeriod, comparativeAnalisis.compareTo, fallbackAllDates, defaultName);
80
- }
81
75
  if (diffName)
82
76
  return formatDeltaColumnCaption(diffName);
83
77
  if (customLabels[dataFieldKey])
@@ -178,7 +172,6 @@ function expandColumnListWithComparativeColumns(columnList, comparativeVirtualCo
178
172
  { id: "default", name: "" },
179
173
  ])
180
174
  : [{ id: "default", name: "" }];
181
- const hasConfiguredDiffs = comparativeData?.styles?.columnDiffs?.[uniqueCode] != null;
182
175
  const compLabel = customLabels[vc.compDataField] ??
183
176
  formatComparativePeriodCaption(comparativeData.compareTo, fallbackAllDates, defaultName);
184
177
  result.push({
@@ -197,13 +190,9 @@ function expandColumnListWithComparativeColumns(columnList, comparativeVirtualCo
197
190
  });
198
191
  if (vc.deltaDataField) {
199
192
  const firstDiffName = diffCols[0]?.name?.trim() || "";
200
- const resolvedFirstName = firstDiffName || null;
201
- const deltaLabel = hasConfiguredDiffs
202
- ? (resolvedFirstName ??
203
- formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName))
204
- : (resolvedFirstName ??
205
- customLabels[vc.deltaDataField] ??
206
- formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName));
193
+ const deltaLabel = firstDiffName ||
194
+ customLabels[vc.deltaDataField] ||
195
+ formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName);
207
196
  result.push({
208
197
  ...col,
209
198
  dataField: vc.deltaDataField,
@@ -218,13 +207,9 @@ function expandColumnListWithComparativeColumns(columnList, comparativeVirtualCo
218
207
  (vc.extraDeltaDataFields ?? []).forEach((df, j) => {
219
208
  const styleIndex = j + 1;
220
209
  const extraDiffName = diffCols[styleIndex]?.name?.trim() || "";
221
- const resolvedExtraName = extraDiffName || null;
222
- const extraLabel = hasConfiguredDiffs
223
- ? (resolvedExtraName ??
224
- formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName))
225
- : (resolvedExtraName ??
226
- customLabels[df] ??
227
- formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName));
210
+ const extraLabel = extraDiffName ||
211
+ customLabels[df] ||
212
+ formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName);
228
213
  result.push({
229
214
  ...col,
230
215
  dataField: df,
@@ -53,13 +53,7 @@ export function resolveComparativeColumnCaption(chartModel, columnKey, allDatesT
53
53
  }
54
54
  const diffCols = comparativeAnalisis?.styles?.columnDiffs?.[uniqueCode] ?? [];
55
55
  const diffCol = diffCols[deltaIndex];
56
- const hasConfiguredDiffs = comparativeAnalisis?.styles?.columnDiffs?.[uniqueCode] != null;
57
56
  const diffName = diffCol?.name?.trim() || null;
58
- if (hasConfiguredDiffs) {
59
- if (diffName)
60
- return formatDeltaColumnCaption(diffName);
61
- return formatDeltaDefaultCaption(comparativeAnalisis.referencePeriod, comparativeAnalisis.compareTo, fallbackAllDates, defaultName);
62
- }
63
57
  if (diffName)
64
58
  return formatDeltaColumnCaption(diffName);
65
59
  if (customLabels[dataFieldKey])
@@ -160,7 +154,6 @@ export function expandColumnListWithComparativeColumns(columnList, comparativeVi
160
154
  { id: "default", name: "" },
161
155
  ])
162
156
  : [{ id: "default", name: "" }];
163
- const hasConfiguredDiffs = comparativeData?.styles?.columnDiffs?.[uniqueCode] != null;
164
157
  const compLabel = customLabels[vc.compDataField] ??
165
158
  formatComparativePeriodCaption(comparativeData.compareTo, fallbackAllDates, defaultName);
166
159
  result.push({
@@ -179,13 +172,9 @@ export function expandColumnListWithComparativeColumns(columnList, comparativeVi
179
172
  });
180
173
  if (vc.deltaDataField) {
181
174
  const firstDiffName = diffCols[0]?.name?.trim() || "";
182
- const resolvedFirstName = firstDiffName || null;
183
- const deltaLabel = hasConfiguredDiffs
184
- ? (resolvedFirstName ??
185
- formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName))
186
- : (resolvedFirstName ??
187
- customLabels[vc.deltaDataField] ??
188
- formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName));
175
+ const deltaLabel = firstDiffName ||
176
+ customLabels[vc.deltaDataField] ||
177
+ formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName);
189
178
  result.push({
190
179
  ...col,
191
180
  dataField: vc.deltaDataField,
@@ -200,13 +189,9 @@ export function expandColumnListWithComparativeColumns(columnList, comparativeVi
200
189
  (vc.extraDeltaDataFields ?? []).forEach((df, j) => {
201
190
  const styleIndex = j + 1;
202
191
  const extraDiffName = diffCols[styleIndex]?.name?.trim() || "";
203
- const resolvedExtraName = extraDiffName || null;
204
- const extraLabel = hasConfiguredDiffs
205
- ? (resolvedExtraName ??
206
- formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName))
207
- : (resolvedExtraName ??
208
- customLabels[df] ??
209
- formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName));
192
+ const extraLabel = extraDiffName ||
193
+ customLabels[df] ||
194
+ formatDeltaDefaultCaption(comparativeData.referencePeriod, comparativeData.compareTo, fallbackAllDates, defaultName);
210
195
  result.push({
211
196
  ...col,
212
197
  dataField: df,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.18.10",
3
+ "version": "1.18.11",
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",