@qrvey/utils 1.3.0-10 → 1.3.0-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.
@@ -16,6 +16,7 @@ const columnTypeByChart_1 = require("./columnTypeByChart");
16
16
  const defineXYChartFormat = (column, settings) => {
17
17
  const { aggregate, type, defaultFormat, outputFormat, selectedFormat, dateGroup } = column;
18
18
  const { shelfType, withoutFormat } = settings;
19
+ const columnDefaultFormat = defaultFormat || outputFormat;
19
20
  //Defaults
20
21
  const defaultText = 'Default';
21
22
  //const defaultNumeric = { type: 'NUMERIC', format: 'Numeric' };
@@ -41,7 +42,7 @@ const defineXYChartFormat = (column, settings) => {
41
42
  return STRING_FORMAT_1.STRING_FORMAT.NONE;
42
43
  }
43
44
  else if (hasDefaultFormat) {
44
- return Object.assign(Object.assign({}, defaultFormat), { format: defaultText, originalFormat: Object.assign({}, outputFormat) });
45
+ return Object.assign(Object.assign({}, columnDefaultFormat), { format: defaultText, originalFormat: Object.assign({}, outputFormat) });
45
46
  }
46
47
  else {
47
48
  return selectedFormat;
@@ -62,7 +63,7 @@ const defineXYChartFormat = (column, settings) => {
62
63
  }
63
64
  else {
64
65
  if (withoutFormat === true) {
65
- return defaultFormat;
66
+ return columnDefaultFormat;
66
67
  }
67
68
  else if (hasDefaultFormat) {
68
69
  return Object.assign({}, outputFormat);
@@ -13,6 +13,7 @@ import { columnTypeByChart } from "./columnTypeByChart";
13
13
  export const defineXYChartFormat = (column, settings) => {
14
14
  const { aggregate, type, defaultFormat, outputFormat, selectedFormat, dateGroup } = column;
15
15
  const { shelfType, withoutFormat } = settings;
16
+ const columnDefaultFormat = defaultFormat || outputFormat;
16
17
  //Defaults
17
18
  const defaultText = 'Default';
18
19
  //const defaultNumeric = { type: 'NUMERIC', format: 'Numeric' };
@@ -38,7 +39,7 @@ export const defineXYChartFormat = (column, settings) => {
38
39
  return STRING_FORMAT.NONE;
39
40
  }
40
41
  else if (hasDefaultFormat) {
41
- return Object.assign(Object.assign({}, defaultFormat), { format: defaultText, originalFormat: Object.assign({}, outputFormat) });
42
+ return Object.assign(Object.assign({}, columnDefaultFormat), { format: defaultText, originalFormat: Object.assign({}, outputFormat) });
42
43
  }
43
44
  else {
44
45
  return selectedFormat;
@@ -59,7 +60,7 @@ export const defineXYChartFormat = (column, settings) => {
59
60
  }
60
61
  else {
61
62
  if (withoutFormat === true) {
62
- return defaultFormat;
63
+ return columnDefaultFormat;
63
64
  }
64
65
  else if (hasDefaultFormat) {
65
66
  return Object.assign({}, outputFormat);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.3.0-10",
3
+ "version": "1.3.0-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/index.js",
@@ -17,6 +17,7 @@ import { columnTypeByChart } from "./columnTypeByChart";
17
17
  export const defineXYChartFormat = (column: IChartColumn, settings: IColumnFormatSettings) : IColumnFormatReturnType => {
18
18
  const { aggregate, type, defaultFormat, outputFormat, selectedFormat, dateGroup } = column;
19
19
  const { shelfType, withoutFormat } = settings;
20
+ const columnDefaultFormat = defaultFormat || outputFormat;
20
21
 
21
22
  //Defaults
22
23
  const defaultText = 'Default';
@@ -47,7 +48,7 @@ export const defineXYChartFormat = (column: IChartColumn, settings: IColumnForma
47
48
  return STRING_FORMAT.NONE;
48
49
  }
49
50
  else if(hasDefaultFormat) {
50
- return { ...defaultFormat, format: defaultText, originalFormat: { ...outputFormat } };
51
+ return { ...columnDefaultFormat, format: defaultText, originalFormat: { ...outputFormat } };
51
52
  }
52
53
  else {
53
54
  return selectedFormat;
@@ -67,7 +68,7 @@ export const defineXYChartFormat = (column: IChartColumn, settings: IColumnForma
67
68
  else return outputFormat;
68
69
  } else {
69
70
  if(withoutFormat === true) {
70
- return defaultFormat;
71
+ return columnDefaultFormat;
71
72
  }
72
73
  else if(hasDefaultFormat) {
73
74
  return { ...outputFormat };