@qrvey/utils 1.16.0-31 → 1.16.0-34

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.
@@ -33,6 +33,10 @@ const defineTableChartFormat = (column, settings) => {
33
33
  const hasDefaultFormat = (0, isEmpty_1.isEmpty)(selectedFormat) ||
34
34
  (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === defaultText ||
35
35
  (selectedFormat === null || selectedFormat === void 0 ? void 0 : selectedFormat.format) === defaultText;
36
+ const hasCalculationPDiff = [
37
+ calculation === null || calculation === void 0 ? void 0 : calculation.aggregate,
38
+ calculation === null || calculation === void 0 ? void 0 : calculation.value,
39
+ ].includes(CALCULATION_LABEL_1.CALCULATION_LABEL.PDIFF);
36
40
  switch (columnType) {
37
41
  case COLUMN_1.COLUMN.YES_NO:
38
42
  case COLUMN_1.COLUMN.PHONE:
@@ -73,7 +77,7 @@ const defineTableChartFormat = (column, settings) => {
73
77
  case COLUMN_1.COLUMN.NUMERIC:
74
78
  case COLUMN_1.COLUMN.RATING:
75
79
  case COLUMN_1.COLUMN.SLIDEBAR: {
76
- if ((calculation === null || calculation === void 0 ? void 0 : calculation.value) === CALCULATION_LABEL_1.CALCULATION_LABEL.PDIFF)
80
+ if (hasCalculationPDiff)
77
81
  return defaultPercentage;
78
82
  if (selectedFormat && selectedFormat.format !== defaultText)
79
83
  return selectedFormat;
@@ -44,6 +44,10 @@ const defineXYChartFormat = (column, settings) => {
44
44
  const hasDefaultFormat = (0, isEmpty_1.isEmpty)(selectedFormat) ||
45
45
  (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === defaultText ||
46
46
  (selectedFormat === null || selectedFormat === void 0 ? void 0 : selectedFormat.format) === defaultText;
47
+ const hasCalculationPDiff = [
48
+ calculation === null || calculation === void 0 ? void 0 : calculation.aggregate,
49
+ calculation === null || calculation === void 0 ? void 0 : calculation.value,
50
+ ].includes(CALCULATION_LABEL_1.CALCULATION_LABEL.PDIFF);
47
51
  switch (columnType) {
48
52
  case COLUMN_1.COLUMN.YES_NO:
49
53
  case COLUMN_1.COLUMN.PHONE:
@@ -74,7 +78,7 @@ const defineXYChartFormat = (column, settings) => {
74
78
  case COLUMN_1.COLUMN.NUMERIC:
75
79
  case COLUMN_1.COLUMN.RATING:
76
80
  case COLUMN_1.COLUMN.SLIDEBAR: {
77
- if ((calculation === null || calculation === void 0 ? void 0 : calculation.aggregate) === CALCULATION_LABEL_1.CALCULATION_LABEL.PDIFF)
81
+ if (hasCalculationPDiff)
78
82
  return defaultPercentage;
79
83
  if (((aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE_1.AGGREGATE.COUNT ||
80
84
  (aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE_1.AGGREGATE.DISTINCTCOUNT) &&
@@ -30,6 +30,10 @@ export const defineTableChartFormat = (column, settings) => {
30
30
  const hasDefaultFormat = isEmpty(selectedFormat) ||
31
31
  (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === defaultText ||
32
32
  (selectedFormat === null || selectedFormat === void 0 ? void 0 : selectedFormat.format) === defaultText;
33
+ const hasCalculationPDiff = [
34
+ calculation === null || calculation === void 0 ? void 0 : calculation.aggregate,
35
+ calculation === null || calculation === void 0 ? void 0 : calculation.value,
36
+ ].includes(CALCULATION_LABEL.PDIFF);
33
37
  switch (columnType) {
34
38
  case COLUMN.YES_NO:
35
39
  case COLUMN.PHONE:
@@ -70,7 +74,7 @@ export const defineTableChartFormat = (column, settings) => {
70
74
  case COLUMN.NUMERIC:
71
75
  case COLUMN.RATING:
72
76
  case COLUMN.SLIDEBAR: {
73
- if ((calculation === null || calculation === void 0 ? void 0 : calculation.value) === CALCULATION_LABEL.PDIFF)
77
+ if (hasCalculationPDiff)
74
78
  return defaultPercentage;
75
79
  if (selectedFormat && selectedFormat.format !== defaultText)
76
80
  return selectedFormat;
@@ -41,6 +41,10 @@ export const defineXYChartFormat = (column, settings) => {
41
41
  const hasDefaultFormat = isEmpty(selectedFormat) ||
42
42
  (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === defaultText ||
43
43
  (selectedFormat === null || selectedFormat === void 0 ? void 0 : selectedFormat.format) === defaultText;
44
+ const hasCalculationPDiff = [
45
+ calculation === null || calculation === void 0 ? void 0 : calculation.aggregate,
46
+ calculation === null || calculation === void 0 ? void 0 : calculation.value,
47
+ ].includes(CALCULATION_LABEL.PDIFF);
44
48
  switch (columnType) {
45
49
  case COLUMN.YES_NO:
46
50
  case COLUMN.PHONE:
@@ -71,7 +75,7 @@ export const defineXYChartFormat = (column, settings) => {
71
75
  case COLUMN.NUMERIC:
72
76
  case COLUMN.RATING:
73
77
  case COLUMN.SLIDEBAR: {
74
- if ((calculation === null || calculation === void 0 ? void 0 : calculation.aggregate) === CALCULATION_LABEL.PDIFF)
78
+ if (hasCalculationPDiff)
75
79
  return defaultPercentage;
76
80
  if (((aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.COUNT ||
77
81
  (aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.DISTINCTCOUNT) &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.16.0-31",
3
+ "version": "1.16.0-34",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",