@qrvey/utils 1.3.0-4 → 1.3.0-5

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.
Files changed (148) hide show
  1. package/dist/cjs/column_format/constants/CHART_GROUP.d.ts +4 -0
  2. package/dist/cjs/column_format/constants/CHART_GROUP.js +8 -0
  3. package/dist/cjs/column_format/constants/DATEGROUP_UNSUPPORT_FORMAT.d.ts +2 -0
  4. package/dist/cjs/column_format/constants/DATEGROUP_UNSUPPORT_FORMAT.js +16 -0
  5. package/dist/cjs/column_format/constants/DATEGROUP_WITHOUT_FORMAT.d.ts +12 -0
  6. package/dist/cjs/column_format/constants/DATEGROUP_WITHOUT_FORMAT.js +16 -0
  7. package/dist/cjs/column_format/constants/SHELF_TYPE.d.ts +7 -0
  8. package/dist/cjs/column_format/constants/SHELF_TYPE.js +11 -0
  9. package/dist/cjs/column_format/constants/STRING_FORMAT.d.ts +3 -0
  10. package/dist/cjs/column_format/constants/STRING_FORMAT.js +7 -0
  11. package/dist/cjs/column_format/constants/TABLE_TYPE.d.ts +5 -0
  12. package/dist/cjs/column_format/constants/TABLE_TYPE.js +9 -0
  13. package/dist/cjs/column_format/constants/index.d.ts +6 -0
  14. package/dist/cjs/column_format/constants/index.js +22 -0
  15. package/dist/cjs/column_format/helpers/columnTypeByChart.d.ts +16 -0
  16. package/dist/cjs/column_format/helpers/columnTypeByChart.js +28 -0
  17. package/dist/cjs/column_format/helpers/defineFormatV2.d.ts +11 -0
  18. package/dist/cjs/column_format/helpers/defineFormatV2.js +17 -0
  19. package/dist/cjs/column_format/helpers/defineTableChartFormat.d.ts +9 -0
  20. package/dist/cjs/column_format/helpers/defineTableChartFormat.js +71 -0
  21. package/dist/cjs/column_format/helpers/defineXYChartFormat.d.ts +11 -0
  22. package/dist/cjs/column_format/helpers/defineXYChartFormat.js +76 -0
  23. package/dist/cjs/column_format/helpers/index.d.ts +5 -0
  24. package/dist/cjs/column_format/helpers/index.js +21 -0
  25. package/dist/cjs/column_format/helpers/parseFormulaTypeByCharts.d.ts +7 -0
  26. package/dist/cjs/column_format/helpers/parseFormulaTypeByCharts.js +20 -0
  27. package/dist/cjs/column_format/index.d.ts +3 -0
  28. package/dist/cjs/column_format/index.js +19 -0
  29. package/dist/cjs/column_format/interfaces/IChartColumn.d.ts +23 -0
  30. package/dist/cjs/column_format/interfaces/IChartColumn.js +2 -0
  31. package/dist/cjs/column_format/interfaces/IChartGroupType.d.ts +2 -0
  32. package/dist/cjs/column_format/interfaces/IChartGroupType.js +2 -0
  33. package/dist/cjs/column_format/interfaces/IChartShelfType.d.ts +2 -0
  34. package/dist/cjs/column_format/interfaces/IChartShelfType.js +2 -0
  35. package/dist/cjs/column_format/interfaces/IChartTableType.d.ts +2 -0
  36. package/dist/cjs/column_format/interfaces/IChartTableType.js +2 -0
  37. package/dist/cjs/column_format/interfaces/IColumnFormatReturnType.d.ts +3 -0
  38. package/dist/cjs/column_format/interfaces/IColumnFormatReturnType.js +2 -0
  39. package/dist/cjs/column_format/interfaces/IColumnFormatSettings.d.ts +9 -0
  40. package/dist/cjs/column_format/interfaces/IColumnFormatSettings.js +2 -0
  41. package/dist/cjs/column_format/interfaces/IFormatStringType.d.ts +2 -0
  42. package/dist/cjs/column_format/interfaces/IFormatStringType.js +2 -0
  43. package/dist/cjs/column_format/interfaces/index.d.ts +7 -0
  44. package/dist/cjs/column_format/interfaces/index.js +23 -0
  45. package/dist/cjs/columns/interfaces/IColumnAggregate.d.ts +7 -0
  46. package/dist/cjs/columns/interfaces/IColumnAggregate.js +2 -0
  47. package/dist/cjs/columns/interfaces/IColumnDateGroupSettings.d.ts +7 -0
  48. package/dist/cjs/columns/interfaces/IColumnDateGroupSettings.js +2 -0
  49. package/dist/cjs/columns/interfaces/IColumnScale.d.ts +5 -0
  50. package/dist/cjs/columns/interfaces/IColumnScale.js +2 -0
  51. package/dist/cjs/filters/helpers/common/resolveFilterConditions.js +5 -5
  52. package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilter.d.ts +1 -1
  53. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +3 -3
  54. package/dist/cjs/index.d.ts +1 -0
  55. package/dist/cjs/index.js +1 -0
  56. package/dist/cjs/interfaces/format/IFormatDefaultFormat.d.ts +5 -0
  57. package/dist/cjs/interfaces/format/IFormatDefaultFormat.js +2 -0
  58. package/dist/cjs/interfaces/format/IFormatOutputFormat.Interface.d.ts +3 -5
  59. package/dist/column_format/constants/CHART_GROUP.d.ts +4 -0
  60. package/dist/column_format/constants/CHART_GROUP.js +5 -0
  61. package/dist/column_format/constants/DATEGROUP_UNSUPPORT_FORMAT.d.ts +2 -0
  62. package/dist/column_format/constants/DATEGROUP_UNSUPPORT_FORMAT.js +13 -0
  63. package/dist/column_format/constants/DATEGROUP_WITHOUT_FORMAT.d.ts +12 -0
  64. package/dist/column_format/constants/DATEGROUP_WITHOUT_FORMAT.js +13 -0
  65. package/dist/column_format/constants/SHELF_TYPE.d.ts +7 -0
  66. package/dist/column_format/constants/SHELF_TYPE.js +8 -0
  67. package/dist/column_format/constants/STRING_FORMAT.d.ts +3 -0
  68. package/dist/column_format/constants/STRING_FORMAT.js +4 -0
  69. package/dist/column_format/constants/TABLE_TYPE.d.ts +5 -0
  70. package/dist/column_format/constants/TABLE_TYPE.js +6 -0
  71. package/dist/column_format/constants/index.d.ts +6 -0
  72. package/dist/column_format/constants/index.js +6 -0
  73. package/dist/column_format/helpers/columnTypeByChart.d.ts +16 -0
  74. package/dist/column_format/helpers/columnTypeByChart.js +24 -0
  75. package/dist/column_format/helpers/defineFormatV2.d.ts +11 -0
  76. package/dist/column_format/helpers/defineFormatV2.js +13 -0
  77. package/dist/column_format/helpers/defineTableChartFormat.d.ts +9 -0
  78. package/dist/column_format/helpers/defineTableChartFormat.js +67 -0
  79. package/dist/column_format/helpers/defineXYChartFormat.d.ts +11 -0
  80. package/dist/column_format/helpers/defineXYChartFormat.js +72 -0
  81. package/dist/column_format/helpers/index.d.ts +5 -0
  82. package/dist/column_format/helpers/index.js +5 -0
  83. package/dist/column_format/helpers/parseFormulaTypeByCharts.d.ts +7 -0
  84. package/dist/column_format/helpers/parseFormulaTypeByCharts.js +16 -0
  85. package/dist/column_format/index.d.ts +3 -0
  86. package/dist/column_format/index.js +3 -0
  87. package/dist/column_format/interfaces/IChartColumn.d.ts +23 -0
  88. package/dist/column_format/interfaces/IChartColumn.js +1 -0
  89. package/dist/column_format/interfaces/IChartGroupType.d.ts +2 -0
  90. package/dist/column_format/interfaces/IChartGroupType.js +1 -0
  91. package/dist/column_format/interfaces/IChartShelfType.d.ts +2 -0
  92. package/dist/column_format/interfaces/IChartShelfType.js +1 -0
  93. package/dist/column_format/interfaces/IChartTableType.d.ts +2 -0
  94. package/dist/column_format/interfaces/IChartTableType.js +1 -0
  95. package/dist/column_format/interfaces/IColumnFormatReturnType.d.ts +3 -0
  96. package/dist/column_format/interfaces/IColumnFormatReturnType.js +1 -0
  97. package/dist/column_format/interfaces/IColumnFormatSettings.d.ts +9 -0
  98. package/dist/column_format/interfaces/IColumnFormatSettings.js +1 -0
  99. package/dist/column_format/interfaces/IFormatStringType.d.ts +2 -0
  100. package/dist/column_format/interfaces/IFormatStringType.js +1 -0
  101. package/dist/column_format/interfaces/index.d.ts +7 -0
  102. package/dist/column_format/interfaces/index.js +7 -0
  103. package/dist/columns/interfaces/IColumnAggregate.d.ts +7 -0
  104. package/dist/columns/interfaces/IColumnAggregate.js +1 -0
  105. package/dist/columns/interfaces/IColumnDateGroupSettings.d.ts +7 -0
  106. package/dist/columns/interfaces/IColumnDateGroupSettings.js +1 -0
  107. package/dist/columns/interfaces/IColumnScale.d.ts +5 -0
  108. package/dist/columns/interfaces/IColumnScale.js +1 -0
  109. package/dist/filters/helpers/common/resolveFilterConditions.js +5 -5
  110. package/dist/filters/interfaces/common/IFSParamsToGetFilter.d.ts +1 -1
  111. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +3 -3
  112. package/dist/index.d.ts +1 -0
  113. package/dist/index.js +1 -0
  114. package/dist/interfaces/format/IFormatDefaultFormat.d.ts +5 -0
  115. package/dist/interfaces/format/IFormatDefaultFormat.js +1 -0
  116. package/dist/interfaces/format/IFormatOutputFormat.Interface.d.ts +3 -5
  117. package/package.json +1 -1
  118. package/src/column_format/constants/CHART_GROUP.ts +4 -0
  119. package/src/column_format/constants/DATEGROUP_UNSUPPORT_FORMAT.ts +14 -0
  120. package/src/column_format/constants/DATEGROUP_WITHOUT_FORMAT.ts +12 -0
  121. package/src/column_format/constants/SHELF_TYPE.ts +7 -0
  122. package/src/column_format/constants/STRING_FORMAT.ts +3 -0
  123. package/src/column_format/constants/TABLE_TYPE.ts +5 -0
  124. package/src/column_format/constants/index.ts +6 -0
  125. package/src/column_format/helpers/columnTypeByChart.ts +27 -0
  126. package/src/column_format/helpers/defineFormatV2.ts +17 -0
  127. package/src/column_format/helpers/defineTableChartFormat.ts +70 -0
  128. package/src/column_format/helpers/defineXYChartFormat.ts +81 -0
  129. package/src/column_format/helpers/index.ts +5 -0
  130. package/src/column_format/helpers/parseFormulaTypeByCharts.ts +17 -0
  131. package/src/column_format/index.ts +3 -0
  132. package/src/column_format/interfaces/IChartColumn.ts +24 -0
  133. package/src/column_format/interfaces/IChartGroupType.ts +3 -0
  134. package/src/column_format/interfaces/IChartShelfType.ts +3 -0
  135. package/src/column_format/interfaces/IChartTableType.ts +3 -0
  136. package/src/column_format/interfaces/IColumnFormatReturnType.ts +4 -0
  137. package/src/column_format/interfaces/IColumnFormatSettings.ts +11 -0
  138. package/src/column_format/interfaces/IFormatStringType.ts +3 -0
  139. package/src/column_format/interfaces/index.ts +7 -0
  140. package/src/columns/interfaces/IColumnAggregate.ts +7 -0
  141. package/src/columns/interfaces/IColumnDateGroupSettings.ts +7 -0
  142. package/src/columns/interfaces/IColumnScale.ts +5 -0
  143. package/src/filters/helpers/common/resolveFilterConditions.ts +4 -4
  144. package/src/filters/interfaces/common/IFSParamsToGetFilter.ts +2 -2
  145. package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +3 -3
  146. package/src/index.ts +1 -0
  147. package/src/interfaces/format/IFormatDefaultFormat.ts +5 -0
  148. package/src/interfaces/format/IFormatOutputFormat.Interface.ts +3 -5
@@ -0,0 +1,4 @@
1
+ export declare enum CHART_GROUPS {
2
+ TABLES = "tables",
3
+ XY = "xy"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHART_GROUPS = void 0;
4
+ var CHART_GROUPS;
5
+ (function (CHART_GROUPS) {
6
+ CHART_GROUPS["TABLES"] = "tables";
7
+ CHART_GROUPS["XY"] = "xy";
8
+ })(CHART_GROUPS = exports.CHART_GROUPS || (exports.CHART_GROUPS = {}));
@@ -0,0 +1,2 @@
1
+ import { DATEGROUP_WITHOUT_FORMAT } from "./DATEGROUP_WITHOUT_FORMAT";
2
+ export declare const DATEGROUP_UNSUPPORT_FORMAT: DATEGROUP_WITHOUT_FORMAT[];
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DATEGROUP_UNSUPPORT_FORMAT = void 0;
4
+ const DATEGROUP_WITHOUT_FORMAT_1 = require("./DATEGROUP_WITHOUT_FORMAT");
5
+ exports.DATEGROUP_UNSUPPORT_FORMAT = [
6
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.YEAR,
7
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.QUARTER,
8
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.MONTH,
9
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.WEEK,
10
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.QUARTER_ONLY,
11
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.MONTH_ONLY,
12
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.DAY_ONLY,
13
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.HOUR_ONLY,
14
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.MINUTE_ONLY,
15
+ DATEGROUP_WITHOUT_FORMAT_1.DATEGROUP_WITHOUT_FORMAT.SECOND_ONLY
16
+ ];
@@ -0,0 +1,12 @@
1
+ export declare enum DATEGROUP_WITHOUT_FORMAT {
2
+ YEAR = "YEAR",
3
+ QUARTER = "QUARTER",
4
+ MONTH = "MONTH",
5
+ WEEK = "WEEK",
6
+ QUARTER_ONLY = "QUARTER_ONLY",
7
+ MONTH_ONLY = "MONTH_ONLY",
8
+ DAY_ONLY = "DAY_ONLY",
9
+ HOUR_ONLY = "HOUR_ONLY",
10
+ MINUTE_ONLY = "MINUTE_ONLY",
11
+ SECOND_ONLY = "SECOND_ONLY"
12
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DATEGROUP_WITHOUT_FORMAT = void 0;
4
+ var DATEGROUP_WITHOUT_FORMAT;
5
+ (function (DATEGROUP_WITHOUT_FORMAT) {
6
+ DATEGROUP_WITHOUT_FORMAT["YEAR"] = "YEAR";
7
+ DATEGROUP_WITHOUT_FORMAT["QUARTER"] = "QUARTER";
8
+ DATEGROUP_WITHOUT_FORMAT["MONTH"] = "MONTH";
9
+ DATEGROUP_WITHOUT_FORMAT["WEEK"] = "WEEK";
10
+ DATEGROUP_WITHOUT_FORMAT["QUARTER_ONLY"] = "QUARTER_ONLY";
11
+ DATEGROUP_WITHOUT_FORMAT["MONTH_ONLY"] = "MONTH_ONLY";
12
+ DATEGROUP_WITHOUT_FORMAT["DAY_ONLY"] = "DAY_ONLY";
13
+ DATEGROUP_WITHOUT_FORMAT["HOUR_ONLY"] = "HOUR_ONLY";
14
+ DATEGROUP_WITHOUT_FORMAT["MINUTE_ONLY"] = "MINUTE_ONLY";
15
+ DATEGROUP_WITHOUT_FORMAT["SECOND_ONLY"] = "SECOND_ONLY";
16
+ })(DATEGROUP_WITHOUT_FORMAT = exports.DATEGROUP_WITHOUT_FORMAT || (exports.DATEGROUP_WITHOUT_FORMAT = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum SHELF_TYPE {
2
+ CATEGORY = "category",
3
+ VALUE = "value",
4
+ GROUPS = "groups",
5
+ COLUMNS = "columns",
6
+ SERIES = "series"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SHELF_TYPE = void 0;
4
+ var SHELF_TYPE;
5
+ (function (SHELF_TYPE) {
6
+ SHELF_TYPE["CATEGORY"] = "category";
7
+ SHELF_TYPE["VALUE"] = "value";
8
+ SHELF_TYPE["GROUPS"] = "groups";
9
+ SHELF_TYPE["COLUMNS"] = "columns";
10
+ SHELF_TYPE["SERIES"] = "series";
11
+ })(SHELF_TYPE = exports.SHELF_TYPE || (exports.SHELF_TYPE = {}));
@@ -0,0 +1,3 @@
1
+ export declare enum STRING_FORMAT {
2
+ NONE = "none"
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STRING_FORMAT = void 0;
4
+ var STRING_FORMAT;
5
+ (function (STRING_FORMAT) {
6
+ STRING_FORMAT["NONE"] = "none";
7
+ })(STRING_FORMAT = exports.STRING_FORMAT || (exports.STRING_FORMAT = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum TABLE_TYPE {
2
+ SIMPLE = "simple",
3
+ GROUPED = "grouped",
4
+ EXPANDABLE = "expandable"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TABLE_TYPE = void 0;
4
+ var TABLE_TYPE;
5
+ (function (TABLE_TYPE) {
6
+ TABLE_TYPE["SIMPLE"] = "simple";
7
+ TABLE_TYPE["GROUPED"] = "grouped";
8
+ TABLE_TYPE["EXPANDABLE"] = "expandable";
9
+ })(TABLE_TYPE = exports.TABLE_TYPE || (exports.TABLE_TYPE = {}));
@@ -0,0 +1,6 @@
1
+ export * from './CHART_GROUP';
2
+ export * from './DATEGROUP_UNSUPPORT_FORMAT';
3
+ export * from './DATEGROUP_WITHOUT_FORMAT';
4
+ export * from './SHELF_TYPE';
5
+ export * from './STRING_FORMAT';
6
+ export * from './TABLE_TYPE';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CHART_GROUP"), exports);
18
+ __exportStar(require("./DATEGROUP_UNSUPPORT_FORMAT"), exports);
19
+ __exportStar(require("./DATEGROUP_WITHOUT_FORMAT"), exports);
20
+ __exportStar(require("./SHELF_TYPE"), exports);
21
+ __exportStar(require("./STRING_FORMAT"), exports);
22
+ __exportStar(require("./TABLE_TYPE"), exports);
@@ -0,0 +1,16 @@
1
+ import { NUMERICAL_COLUMN } from "../..";
2
+ import { COLUMN } from "../../columns";
3
+ import { IChartColumn } from "../interfaces/IChartColumn";
4
+ import { IChartGroupType } from "../interfaces/IChartGroupType";
5
+ import { IChartShelfType } from "../interfaces/IChartShelfType";
6
+ /**
7
+ * It returns the column type for a given column, shelf type, chart group, and whether the table is
8
+ * grouped or not
9
+ * @param {IChartColumn} column - IChartColumn
10
+ * @param {IChartShelfType} shelfType - IChartShelfType
11
+ * @param {IChartGroupType} chartGroup - IChartGroupType
12
+ * @param {boolean} [isGroupedTable] - boolean - this is a boolean that is true if the table is
13
+ * grouped.
14
+ * @returns The column type of the column.
15
+ */
16
+ export declare const columnTypeByChart: (column: IChartColumn, shelfType: IChartShelfType, chartGroup: IChartGroupType, isGroupedTable?: boolean) => import("../..").COMPLEX_COLUMN | import("../..").COMPOUND_COLUMN | NUMERICAL_COLUMN | COLUMN.SINGLE_CHOICE | COLUMN.MULTIPLE_CHOICE | COLUMN.YES_NO | COLUMN.RANKING | COLUMN.DATE | COLUMN.SIGNATURE | COLUMN.DROPDOWN | COLUMN.IMAGE | COLUMN.EMAIL_FORM | COLUMN.PHONE | COLUMN.PASSWORD | COLUMN.CHECKLIST | COLUMN.NPS_SCORE | COLUMN.NPS_FEEDBACK | COLUMN.TEXT_LABEL | COLUMN.TEXT_CATEGORY | COLUMN.LOOKUP | COLUMN.HEADLINE | COLUMN.SECTION | COLUMN.AGGREGATED_FORMULA | COLUMN.BUCKET | COLUMN.SLIDEBAR | COLUMN.NUMERIC | COLUMN.NUMERICC | COLUMN.NUMERICP | COLUMN.NUMERICG | COLUMN.RATING | COLUMN.TEXTFIELD | COLUMN.LONGTEXT | COLUMN.IMAGEUPLOAD | COLUMN.FILEUPLOAD | COLUMN.EXPRESSION | COLUMN.NAME | COLUMN.USADDRESS | COLUMN.ADDRESS | "DATE" | "NUMERIC" | "TEXT_LABEL";
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.columnTypeByChart = void 0;
4
+ const __1 = require("../..");
5
+ const columns_1 = require("../../columns");
6
+ const CHART_GROUP_1 = require("../constants/CHART_GROUP");
7
+ const SHELF_TYPE_1 = require("../constants/SHELF_TYPE");
8
+ const parseFormulaTypeByCharts_1 = require("./parseFormulaTypeByCharts");
9
+ /**
10
+ * It returns the column type for a given column, shelf type, chart group, and whether the table is
11
+ * grouped or not
12
+ * @param {IChartColumn} column - IChartColumn
13
+ * @param {IChartShelfType} shelfType - IChartShelfType
14
+ * @param {IChartGroupType} chartGroup - IChartGroupType
15
+ * @param {boolean} [isGroupedTable] - boolean - this is a boolean that is true if the table is
16
+ * grouped.
17
+ * @returns The column type of the column.
18
+ */
19
+ const columnTypeByChart = (column, shelfType, chartGroup, isGroupedTable) => {
20
+ if (!column)
21
+ return;
22
+ const currentType = column.type === columns_1.COLUMN.FORMULA ? (0, parseFormulaTypeByCharts_1.parseFormulaTypeByCharts)(column.formulaType) : column.type;
23
+ const isNumericalColumn = __1.NUMERICAL_COLUMNS.some(colType => colType === currentType)
24
+ || ((chartGroup === CHART_GROUP_1.CHART_GROUPS.TABLES) && (isGroupedTable === true) && (shelfType === SHELF_TYPE_1.SHELF_TYPE.COLUMNS))
25
+ || ((chartGroup === CHART_GROUP_1.CHART_GROUPS.XY) && (shelfType === SHELF_TYPE_1.SHELF_TYPE.VALUE || shelfType === SHELF_TYPE_1.SHELF_TYPE.SERIES));
26
+ return isNumericalColumn === true ? __1.NUMERICAL_COLUMN.NUMERIC : currentType;
27
+ };
28
+ exports.columnTypeByChart = columnTypeByChart;
@@ -0,0 +1,11 @@
1
+ import { IChartColumn } from "../interfaces/IChartColumn";
2
+ import { IColumnFormatReturnType } from "../interfaces/IColumnFormatReturnType";
3
+ import { IColumnFormatSettings } from "../interfaces/IColumnFormatSettings";
4
+ /**
5
+ * > If the chart is a table chart, then define the format for a table chart, otherwise define the
6
+ * format for an XY chart
7
+ * @param {IChartColumn} column - IChartColumn - this is the column object that is passed to the chart.
8
+ * @param {IColumnFormatSettings} settings - IColumnFormatSettings
9
+ * @returns IColumnFormatReturnType
10
+ */
11
+ export declare const defineFormatV2: (column: IChartColumn, settings: IColumnFormatSettings) => IColumnFormatReturnType;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineFormatV2 = void 0;
4
+ const defineTableChartFormat_1 = require("./defineTableChartFormat");
5
+ const defineXYChartFormat_1 = require("./defineXYChartFormat");
6
+ /**
7
+ * > If the chart is a table chart, then define the format for a table chart, otherwise define the
8
+ * format for an XY chart
9
+ * @param {IChartColumn} column - IChartColumn - this is the column object that is passed to the chart.
10
+ * @param {IColumnFormatSettings} settings - IColumnFormatSettings
11
+ * @returns IColumnFormatReturnType
12
+ */
13
+ const defineFormatV2 = (column, settings) => {
14
+ const { isTableChart, isXYChart } = settings;
15
+ return isTableChart && !isXYChart ? (0, defineTableChartFormat_1.defineTableChartFormat)(column, settings) : (0, defineXYChartFormat_1.defineXYChartFormat)(column, settings);
16
+ };
17
+ exports.defineFormatV2 = defineFormatV2;
@@ -0,0 +1,9 @@
1
+ import { IChartColumn } from "../interfaces/IChartColumn";
2
+ import { IColumnFormatReturnType } from "../interfaces/IColumnFormatReturnType";
3
+ import { IColumnFormatSettings } from "../interfaces/IColumnFormatSettings";
4
+ /**
5
+ * It returns the format of a column based on the column type, the chart type, and the chart settings
6
+ * @param {IChartColumn} column - IChartColumn
7
+ * @param {IColumnFormatSettings} settings - IColumnFormatSettings
8
+ */
9
+ export declare const defineTableChartFormat: (column: IChartColumn, settings: IColumnFormatSettings) => IColumnFormatReturnType;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineTableChartFormat = void 0;
4
+ const __1 = require("../..");
5
+ const CHART_GROUP_1 = require("../constants/CHART_GROUP");
6
+ const DATEGROUP_UNSUPPORT_FORMAT_1 = require("../constants/DATEGROUP_UNSUPPORT_FORMAT");
7
+ const STRING_FORMAT_1 = require("../constants/STRING_FORMAT");
8
+ const TABLE_TYPE_1 = require("../constants/TABLE_TYPE");
9
+ const columnTypeByChart_1 = require("./columnTypeByChart");
10
+ /**
11
+ * It returns the format of a column based on the column type, the chart type, and the chart settings
12
+ * @param {IChartColumn} column - IChartColumn
13
+ * @param {IColumnFormatSettings} settings - IColumnFormatSettings
14
+ */
15
+ const defineTableChartFormat = (column, settings) => {
16
+ const { aggregate, type, defaultFormat, outputFormat, selectedFormat, dateGroup } = column;
17
+ const { tableType, shelfType } = settings;
18
+ //Defaults
19
+ const defaultText = 'Default';
20
+ const defaultNumeric = { type: 'NUMERIC', format: 'Numeric' };
21
+ const defaultAbb = { type: 'NUMERIC', format: 'Abbreviated' };
22
+ const isGroupedTable = tableType === TABLE_TYPE_1.TABLE_TYPE.GROUPED;
23
+ const columnType = (0, columnTypeByChart_1.columnTypeByChart)(column, shelfType, CHART_GROUP_1.CHART_GROUPS.TABLES, isGroupedTable);
24
+ const noFormatSupported = DATEGROUP_UNSUPPORT_FORMAT_1.DATEGROUP_UNSUPPORT_FORMAT.some(gp => gp === (dateGroup === null || dateGroup === void 0 ? void 0 : dateGroup.label));
25
+ const hasDefaultFormat = (0, __1.isEmpty)(selectedFormat) && (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === defaultText;
26
+ const isUsedAsNumericColumn = type !== columnType;
27
+ switch (columnType) {
28
+ case __1.COLUMN.YES_NO:
29
+ case __1.COLUMN.PHONE:
30
+ case __1.COLUMN.SINGLE_CHOICE:
31
+ case __1.COLUMN.LONGTEXT:
32
+ case __1.COLUMN.DROPDOWN:
33
+ case __1.COLUMN.EXPRESSION:
34
+ case __1.COLUMN.NAME:
35
+ case __1.COLUMN.EMAIL_FORM:
36
+ case __1.COLUMN.IMAGE:
37
+ case __1.COLUMN.TEXT_LABEL:
38
+ return STRING_FORMAT_1.STRING_FORMAT.NONE;
39
+ case __1.COLUMN.DATE: {
40
+ if (noFormatSupported) {
41
+ return STRING_FORMAT_1.STRING_FORMAT.NONE;
42
+ }
43
+ else if (hasDefaultFormat) {
44
+ return Object.assign(Object.assign({}, defaultFormat), { format: defaultText, originalFormat: Object.assign({}, column.outputFormat) });
45
+ }
46
+ else {
47
+ return selectedFormat;
48
+ }
49
+ }
50
+ case __1.COLUMN.NUMERIC:
51
+ case __1.COLUMN.RATING:
52
+ case __1.COLUMN.SLIDEBAR: {
53
+ if (isUsedAsNumericColumn) {
54
+ if ((aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === __1.AGGREGATE.COUNT && hasDefaultFormat)
55
+ return defaultNumeric;
56
+ else if (hasDefaultFormat)
57
+ return defaultAbb;
58
+ else
59
+ return outputFormat;
60
+ }
61
+ else {
62
+ if (hasDefaultFormat) {
63
+ return Object.assign(Object.assign({}, defaultFormat), { format: defaultText, originalFormat: Object.assign({}, column.outputFormat) });
64
+ }
65
+ else
66
+ return selectedFormat;
67
+ }
68
+ }
69
+ }
70
+ };
71
+ exports.defineTableChartFormat = defineTableChartFormat;
@@ -0,0 +1,11 @@
1
+ import { IChartColumn } from "../interfaces/IChartColumn";
2
+ import { IColumnFormatReturnType } from "../interfaces/IColumnFormatReturnType";
3
+ import { IColumnFormatSettings } from "../interfaces/IColumnFormatSettings";
4
+ /**
5
+ * > It returns the format of a column based on the column's type, the chart's type, and the column's
6
+ * aggregate
7
+ * > Also, if the settings contains the prop withoutFormat as true, returns the default format
8
+ * @param {IChartColumn} column - IChartColumn
9
+ * @param {IColumnFormatSettings} settings - IColumnFormatSettings
10
+ */
11
+ export declare const defineXYChartFormat: (column: IChartColumn, settings: IColumnFormatSettings) => IColumnFormatReturnType;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineXYChartFormat = void 0;
4
+ const __1 = require("../..");
5
+ const CHART_GROUP_1 = require("../constants/CHART_GROUP");
6
+ const DATEGROUP_UNSUPPORT_FORMAT_1 = require("../constants/DATEGROUP_UNSUPPORT_FORMAT");
7
+ const STRING_FORMAT_1 = require("../constants/STRING_FORMAT");
8
+ const columnTypeByChart_1 = require("./columnTypeByChart");
9
+ /**
10
+ * > It returns the format of a column based on the column's type, the chart's type, and the column's
11
+ * aggregate
12
+ * > Also, if the settings contains the prop withoutFormat as true, returns the default format
13
+ * @param {IChartColumn} column - IChartColumn
14
+ * @param {IColumnFormatSettings} settings - IColumnFormatSettings
15
+ */
16
+ const defineXYChartFormat = (column, settings) => {
17
+ const { aggregate, type, defaultFormat, outputFormat, selectedFormat, dateGroup } = column;
18
+ const { shelfType, withoutFormat } = settings;
19
+ //Defaults
20
+ const defaultText = 'Default';
21
+ //const defaultNumeric = { type: 'NUMERIC', format: 'Numeric' };
22
+ const defaultAbb = { type: 'NUMERIC', format: 'Abbreviated' };
23
+ const columnType = (0, columnTypeByChart_1.columnTypeByChart)(column, shelfType, CHART_GROUP_1.CHART_GROUPS.XY);
24
+ const noFormatSupported = DATEGROUP_UNSUPPORT_FORMAT_1.DATEGROUP_UNSUPPORT_FORMAT.some(gp => gp === (dateGroup === null || dateGroup === void 0 ? void 0 : dateGroup.label));
25
+ const isUsedAsNumericColumn = type !== columnType;
26
+ const hasDefaultFormat = ((0, __1.isEmpty)(selectedFormat) && (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === defaultText) || ((selectedFormat === null || selectedFormat === void 0 ? void 0 : selectedFormat.format) === defaultText);
27
+ switch (columnType) {
28
+ case __1.COLUMN.YES_NO:
29
+ case __1.COLUMN.PHONE:
30
+ case __1.COLUMN.SINGLE_CHOICE:
31
+ case __1.COLUMN.LONGTEXT:
32
+ case __1.COLUMN.DROPDOWN:
33
+ case __1.COLUMN.EXPRESSION:
34
+ case __1.COLUMN.NAME:
35
+ case __1.COLUMN.EMAIL_FORM:
36
+ case __1.COLUMN.IMAGE:
37
+ case __1.COLUMN.TEXT_LABEL:
38
+ return STRING_FORMAT_1.STRING_FORMAT.NONE;
39
+ case __1.COLUMN.DATE: {
40
+ if (noFormatSupported) {
41
+ return STRING_FORMAT_1.STRING_FORMAT.NONE;
42
+ }
43
+ else if (hasDefaultFormat) {
44
+ return Object.assign(Object.assign({}, defaultFormat), { format: defaultText, originalFormat: Object.assign({}, outputFormat) });
45
+ }
46
+ else {
47
+ return selectedFormat;
48
+ }
49
+ }
50
+ case __1.COLUMN.NUMERIC:
51
+ case __1.COLUMN.RATING:
52
+ case __1.COLUMN.SLIDEBAR: {
53
+ if (isUsedAsNumericColumn) {
54
+ if (((aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === __1.AGGREGATE.COUNT && hasDefaultFormat)
55
+ ||
56
+ (isUsedAsNumericColumn && (outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.type) !== __1.COLUMN.NUMERIC)
57
+ ||
58
+ withoutFormat)
59
+ return defaultAbb;
60
+ else
61
+ return outputFormat;
62
+ }
63
+ else {
64
+ if (withoutFormat === true) {
65
+ return defaultFormat;
66
+ }
67
+ else if (hasDefaultFormat) {
68
+ return Object.assign({}, outputFormat);
69
+ }
70
+ else
71
+ return selectedFormat;
72
+ }
73
+ }
74
+ }
75
+ };
76
+ exports.defineXYChartFormat = defineXYChartFormat;
@@ -0,0 +1,5 @@
1
+ export * from './columnTypeByChart';
2
+ export * from './defineFormatV2';
3
+ export * from './defineTableChartFormat';
4
+ export * from './defineXYChartFormat';
5
+ export * from './parseFormulaTypeByCharts';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./columnTypeByChart"), exports);
18
+ __exportStar(require("./defineFormatV2"), exports);
19
+ __exportStar(require("./defineTableChartFormat"), exports);
20
+ __exportStar(require("./defineXYChartFormat"), exports);
21
+ __exportStar(require("./parseFormulaTypeByCharts"), exports);
@@ -0,0 +1,7 @@
1
+ import { IFormulaType } from "../..";
2
+ /**
3
+ * It takes a string and returns a string
4
+ * @param {IFormulaType} type - IFormulaType - this is the type of the formula.
5
+ * @returns The type of the formula.
6
+ */
7
+ export declare const parseFormulaTypeByCharts: (type: IFormulaType) => "DATE" | "NUMERIC" | "TEXT_LABEL";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseFormulaTypeByCharts = void 0;
4
+ const __1 = require("../..");
5
+ /**
6
+ * It takes a string and returns a string
7
+ * @param {IFormulaType} type - IFormulaType - this is the type of the formula.
8
+ * @returns The type of the formula.
9
+ */
10
+ const parseFormulaTypeByCharts = (type) => {
11
+ switch (type) {
12
+ case __1.FORMULA.NUMBER:
13
+ return 'NUMERIC';
14
+ case __1.FORMULA.DATE:
15
+ return 'DATE';
16
+ default:
17
+ return 'TEXT_LABEL';
18
+ }
19
+ };
20
+ exports.parseFormulaTypeByCharts = parseFormulaTypeByCharts;
@@ -0,0 +1,3 @@
1
+ export * from './constants/index';
2
+ export * from './helpers/index';
3
+ export * from './interfaces/index';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants/index"), exports);
18
+ __exportStar(require("./helpers/index"), exports);
19
+ __exportStar(require("./interfaces/index"), exports);
@@ -0,0 +1,23 @@
1
+ import { IColumnSortingSettings, IColumnType, IFormatOutputFormat, IFormulaType } from "../..";
2
+ import { IColumnAggregate } from "../../columns/interfaces/IColumnAggregate";
3
+ import { IColumnDateGroupSettings } from "../../columns/interfaces/IColumnDateGroupSettings";
4
+ import { IColumnScale } from "../../columns/interfaces/IColumnScale";
5
+ import { IFormatDefaultFormat } from "../../interfaces/format/IFormatDefaultFormat";
6
+ export interface IChartColumn {
7
+ aggregate: IColumnAggregate;
8
+ colIndex: number;
9
+ dateGroup?: IColumnDateGroupSettings;
10
+ defaultFormat: IFormatDefaultFormat;
11
+ format?: string;
12
+ formulaType?: IFormulaType;
13
+ groupAgg: string;
14
+ id: string;
15
+ isGroup: string;
16
+ outputFormat: IFormatOutputFormat;
17
+ property: string;
18
+ scaleType?: IColumnScale;
19
+ selectedFormat?: IFormatDefaultFormat;
20
+ sorting?: IColumnSortingSettings;
21
+ text: string;
22
+ type: IColumnType;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { CHART_GROUPS } from "../constants/CHART_GROUP";
2
+ export declare type IChartGroupType = CHART_GROUPS;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { SHELF_TYPE } from "../constants/SHELF_TYPE";
2
+ export declare type IChartShelfType = SHELF_TYPE;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { TABLE_TYPE } from "../constants/TABLE_TYPE";
2
+ export declare type IChartTableType = TABLE_TYPE;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { IFormatOutputFormat } from "../..";
2
+ import { IFormatStringType } from "./IFormatStringType";
3
+ export declare type IColumnFormatReturnType = IFormatStringType | IFormatOutputFormat;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { IChartShelfType } from "./IChartShelfType";
2
+ import { IChartTableType } from "./IChartTableType";
3
+ export interface IColumnFormatSettings {
4
+ tableType?: IChartTableType;
5
+ isTableChart?: boolean;
6
+ isXYChart?: boolean;
7
+ shelfType: IChartShelfType;
8
+ withoutFormat: boolean;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { STRING_FORMAT } from "../constants/STRING_FORMAT";
2
+ export declare type IFormatStringType = STRING_FORMAT;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export * from './IChartColumn';
2
+ export * from './IChartGroupType';
3
+ export * from './IChartShelfType';
4
+ export * from './IChartTableType';
5
+ export * from './IColumnFormatReturnType';
6
+ export * from './IColumnFormatSettings';
7
+ export * from './IFormatStringType';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./IChartColumn"), exports);
18
+ __exportStar(require("./IChartGroupType"), exports);
19
+ __exportStar(require("./IChartShelfType"), exports);
20
+ __exportStar(require("./IChartTableType"), exports);
21
+ __exportStar(require("./IColumnFormatReturnType"), exports);
22
+ __exportStar(require("./IColumnFormatSettings"), exports);
23
+ __exportStar(require("./IFormatStringType"), exports);
@@ -0,0 +1,7 @@
1
+ export interface IColumnAggregate {
2
+ abbreviation: string;
3
+ id: string;
4
+ key: string;
5
+ label: string;
6
+ text: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface IColumnDateGroupSettings {
2
+ default: boolean;
3
+ format: string;
4
+ label: string;
5
+ secondatyText: string;
6
+ text: string;
7
+ }