@qrvey/utils 1.18.8 → 1.18.9
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
|
@@ -104,7 +104,9 @@ function formatDeltaDefaultCaption(referencePeriod, compareTo, allDatesText, col
|
|
|
104
104
|
const ref = fmtPeriodFn(referencePeriod);
|
|
105
105
|
const cmp = fmtPeriodFn(compareTo);
|
|
106
106
|
const comparison = ref && cmp ? `${ref} vs ${cmp}` : ref || cmp;
|
|
107
|
-
const prefix = colLabel
|
|
107
|
+
const prefix = colLabel
|
|
108
|
+
? `${exports.DELTA_COLUMN_PREFIX} ${colLabel}`
|
|
109
|
+
: exports.DELTA_COLUMN_PREFIX;
|
|
108
110
|
return comparison ? `${prefix} - ${comparison}` : prefix;
|
|
109
111
|
}
|
|
110
112
|
function computeComparativeVirtualColumns(isGrouped, myBus, chart, getChartColumns) {
|
|
@@ -342,7 +344,7 @@ function buildComparativeChartComparison(myBus, chart, groups) {
|
|
|
342
344
|
return null;
|
|
343
345
|
const validationType = mapOperatorToValidationType(operatorLabel);
|
|
344
346
|
const expression = {
|
|
345
|
-
groupValue: "day",
|
|
347
|
+
groupValue: periodData.groupValue || "day",
|
|
346
348
|
questionid: dateColumn,
|
|
347
349
|
qrveyid,
|
|
348
350
|
questionType,
|
|
@@ -443,7 +445,9 @@ function computeDeltaCellContent(comparativeAnalisis, columnKey, rawValue, optio
|
|
|
443
445
|
const compValueProvided = options != null &&
|
|
444
446
|
Object.prototype.hasOwnProperty.call(options, "comparisonValue");
|
|
445
447
|
const compVal = options?.comparisonValue;
|
|
446
|
-
if (compValueProvided &&
|
|
448
|
+
if (compValueProvided &&
|
|
449
|
+
(compVal == null || (typeof compVal === "number" && isNaN(compVal))) &&
|
|
450
|
+
origNum != null) {
|
|
447
451
|
parts.push(options?.missingLabel ?? "Missing");
|
|
448
452
|
}
|
|
449
453
|
else if (origNum != null &&
|
|
@@ -86,7 +86,9 @@ export function formatDeltaDefaultCaption(referencePeriod, compareTo, allDatesTe
|
|
|
86
86
|
const ref = fmtPeriodFn(referencePeriod);
|
|
87
87
|
const cmp = fmtPeriodFn(compareTo);
|
|
88
88
|
const comparison = ref && cmp ? `${ref} vs ${cmp}` : ref || cmp;
|
|
89
|
-
const prefix = colLabel
|
|
89
|
+
const prefix = colLabel
|
|
90
|
+
? `${DELTA_COLUMN_PREFIX} ${colLabel}`
|
|
91
|
+
: DELTA_COLUMN_PREFIX;
|
|
90
92
|
return comparison ? `${prefix} - ${comparison}` : prefix;
|
|
91
93
|
}
|
|
92
94
|
export function computeComparativeVirtualColumns(isGrouped, myBus, chart, getChartColumns) {
|
|
@@ -324,7 +326,7 @@ export function buildComparativeChartComparison(myBus, chart, groups) {
|
|
|
324
326
|
return null;
|
|
325
327
|
const validationType = mapOperatorToValidationType(operatorLabel);
|
|
326
328
|
const expression = {
|
|
327
|
-
groupValue: "day",
|
|
329
|
+
groupValue: periodData.groupValue || "day",
|
|
328
330
|
questionid: dateColumn,
|
|
329
331
|
qrveyid,
|
|
330
332
|
questionType,
|
|
@@ -425,7 +427,9 @@ export function computeDeltaCellContent(comparativeAnalisis, columnKey, rawValue
|
|
|
425
427
|
const compValueProvided = options != null &&
|
|
426
428
|
Object.prototype.hasOwnProperty.call(options, "comparisonValue");
|
|
427
429
|
const compVal = options?.comparisonValue;
|
|
428
|
-
if (compValueProvided &&
|
|
430
|
+
if (compValueProvided &&
|
|
431
|
+
(compVal == null || (typeof compVal === "number" && isNaN(compVal))) &&
|
|
432
|
+
origNum != null) {
|
|
429
433
|
parts.push(options?.missingLabel ?? "Missing");
|
|
430
434
|
}
|
|
431
435
|
else if (origNum != null &&
|