@qrvey/utils 1.5.0-1 → 1.5.0-4
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 +1 -1
- package/dist/charts/adapters/endpointData.d.ts +90 -0
- package/dist/charts/adapters/endpointData.js +511 -0
- package/dist/charts/adapters/endpointDataGet.d.ts +14 -0
- package/dist/charts/adapters/endpointDataGet.js +428 -0
- package/dist/charts/adapters/endpointDataValidators.d.ts +4 -0
- package/dist/charts/adapters/endpointDataValidators.js +54 -0
- package/dist/charts/adapters/index.d.ts +3 -0
- package/dist/charts/adapters/index.js +3 -0
- package/dist/charts/index.d.ts +1 -0
- package/dist/charts/index.js +1 -0
- package/dist/cjs/charts/adapters/endpointData.d.ts +90 -0
- package/dist/cjs/charts/adapters/endpointData.js +517 -0
- package/dist/cjs/charts/adapters/endpointDataGet.d.ts +14 -0
- package/dist/cjs/charts/adapters/endpointDataGet.js +444 -0
- package/dist/cjs/charts/adapters/endpointDataValidators.d.ts +4 -0
- package/dist/cjs/charts/adapters/endpointDataValidators.js +61 -0
- package/dist/cjs/charts/adapters/index.d.ts +3 -0
- package/dist/cjs/charts/adapters/index.js +19 -0
- package/dist/cjs/charts/index.d.ts +1 -0
- package/dist/cjs/charts/index.js +1 -0
- package/dist/cjs/column_format/helpers/defineTableChartFormat.js +19 -10
- package/dist/cjs/constants/Charts.Const.d.ts +1 -0
- package/dist/cjs/constants/Charts.Const.js +1 -0
- package/dist/cjs/dates/constants/DATETIME_COLUMN_FORMAT.js +1 -0
- package/dist/cjs/filters/helpers/getTokensFromFilters.js +9 -4
- package/dist/cjs/globalization/interfaces/II18nResource.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderFormatValues.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +2 -0
- package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.d.ts +4 -0
- package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.js +2 -0
- package/dist/cjs/globalization/labels/I18N_DEFAULT.js +2 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER.js +1 -0
- package/dist/cjs/globalization/labels/common/I18N_COMMON.js +2 -0
- package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.d.ts +2 -0
- package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +7 -0
- package/dist/column_format/helpers/defineTableChartFormat.js +19 -10
- package/dist/constants/Charts.Const.d.ts +1 -0
- package/dist/constants/Charts.Const.js +1 -0
- package/dist/dates/constants/DATETIME_COLUMN_FORMAT.js +1 -0
- package/dist/filters/helpers/getTokensFromFilters.js +9 -4
- package/dist/globalization/interfaces/II18nResource.d.ts +2 -0
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderFormatValues.d.ts +1 -0
- package/dist/globalization/interfaces/common/II18nCommon.d.ts +2 -0
- package/dist/globalization/interfaces/tabular_view/II18nTabularView.d.ts +4 -0
- package/dist/globalization/interfaces/tabular_view/II18nTabularView.js +1 -0
- package/dist/globalization/labels/I18N_DEFAULT.js +2 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER.js +1 -0
- package/dist/globalization/labels/common/I18N_COMMON.js +2 -0
- package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.d.ts +2 -0
- package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +4 -0
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ import { II18nDayNames } from "./II18nDayNames";
|
|
|
7
7
|
import { II18nUnits } from "./II18nUnits";
|
|
8
8
|
import { II18nCalendar } from "../calendar/II18nCalendar";
|
|
9
9
|
export interface II18nCommon {
|
|
10
|
+
aggregates: string;
|
|
10
11
|
aggregate_labels: II18nAgreggateLabels;
|
|
11
12
|
calendar: II18nCalendar;
|
|
12
13
|
column_types: II18nColumnTypes;
|
|
@@ -16,5 +17,6 @@ export interface II18nCommon {
|
|
|
16
17
|
no_data_found: string;
|
|
17
18
|
properties: II18nColumnProperties;
|
|
18
19
|
search: string;
|
|
20
|
+
sort: string;
|
|
19
21
|
units: II18nUnits;
|
|
20
22
|
}
|
|
@@ -11,6 +11,7 @@ const formula_builder_1 = require("./formula_builder");
|
|
|
11
11
|
const I18N_FILTER_PANEL_1 = require("./filters/I18N_FILTER_PANEL");
|
|
12
12
|
const I18N_FILTER_DISPLAY_1 = require("./filters/I18N_FILTER_DISPLAY");
|
|
13
13
|
const I18N_BUCKET_BUILDER_1 = require("./bucket_builder/I18N_BUCKET_BUILDER");
|
|
14
|
+
const I18N_TABULAR_VIEW_1 = require("./tabular_view/I18N_TABULAR_VIEW");
|
|
14
15
|
const cross_tabs_1 = require("./cross_tabs");
|
|
15
16
|
const chart_builder_1 = require("./chart_builder");
|
|
16
17
|
const style_themes_1 = require("./style_themes");
|
|
@@ -28,4 +29,5 @@ exports.I18N_DEFAULT = {
|
|
|
28
29
|
panel: I18N_PANEL_1.I18N_PANEL,
|
|
29
30
|
style_themes: style_themes_1.I18N_STYLE_THEMES,
|
|
30
31
|
table_charts: table_charts_1.I18N_TABLE_CHARTS,
|
|
32
|
+
tabular_view: I18N_TABULAR_VIEW_1.I18N_TABULAR_VIEW
|
|
31
33
|
};
|
|
@@ -9,6 +9,7 @@ const I18N_COLUMN_PROPERTY_LABEL_1 = require("./I18N_COLUMN_PROPERTY_LABEL");
|
|
|
9
9
|
const I18N_DATE_GROUPING_1 = require("./I18N_DATE_GROUPING");
|
|
10
10
|
const I18N_DAY_NAMES_1 = require("./I18N_DAY_NAMES");
|
|
11
11
|
exports.I18N_COMMON = {
|
|
12
|
+
aggregates: "Aggregates",
|
|
12
13
|
aggregate_labels: I18N_AGGREGATE_LABEL_1.I18N_AGGREGATE_LABEL,
|
|
13
14
|
calendar: calendar_1.I18N_CALENDAR,
|
|
14
15
|
column_types: I18N_COLUMN_LABEL_1.I18N_COLUMN_LABEL,
|
|
@@ -23,6 +24,7 @@ exports.I18N_COMMON = {
|
|
|
23
24
|
no_data_found: "No Data Found",
|
|
24
25
|
properties: I18N_COLUMN_PROPERTY_LABEL_1.I18N_COLUMN_PROPERTY_LABEL,
|
|
25
26
|
search: "Search",
|
|
27
|
+
sort: "Sort",
|
|
26
28
|
units: {
|
|
27
29
|
day: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.DAY.label,
|
|
28
30
|
month: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.MONTH.label,
|
|
@@ -7,6 +7,7 @@ import { TABLE_TYPE } from "../constants/TABLE_TYPE";
|
|
|
7
7
|
import { columnTypeByChart } from "./columnTypeByChart";
|
|
8
8
|
import { CALCULATION_LABEL } from "../../qrvey/constants/CALCULATION_LABEL";
|
|
9
9
|
import { DATEGROUP_UNSUPPORT_FORMAT } from "../constants/DATEGROUP_UNSUPPORT_FORMAT";
|
|
10
|
+
import { DURATION_PARTS_LIST } from '../constants/DURATION_PARTS_LIST';
|
|
10
11
|
/**
|
|
11
12
|
* It returns the format of a column based on the column type, the chart type, and the chart settings
|
|
12
13
|
* @param {IChartColumn} column - IChartColumn
|
|
@@ -57,17 +58,25 @@ export const defineTableChartFormat = (column, settings) => {
|
|
|
57
58
|
case COLUMN.NUMERIC:
|
|
58
59
|
case COLUMN.RATING:
|
|
59
60
|
case COLUMN.SLIDEBAR: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return defaultPercentage;
|
|
64
|
-
if (hasDefaultFormat) {
|
|
65
|
-
if ((aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.COUNT ||
|
|
66
|
-
(aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.DISTINCTCOUNT)
|
|
67
|
-
return defaultNumeric;
|
|
68
|
-
return defaultFormat || defaultNumeric;
|
|
61
|
+
let output;
|
|
62
|
+
if (selectedFormat && selectedFormat.format !== "Default") {
|
|
63
|
+
output = selectedFormat;
|
|
69
64
|
}
|
|
70
|
-
|
|
65
|
+
else if ((calculation === null || calculation === void 0 ? void 0 : calculation.value) === CALCULATION_LABEL.PDIFF) {
|
|
66
|
+
output = defaultPercentage;
|
|
67
|
+
}
|
|
68
|
+
else if (isGroupedTable &&
|
|
69
|
+
((aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.COUNT ||
|
|
70
|
+
(aggregate === null || aggregate === void 0 ? void 0 : aggregate.label) === AGGREGATE.DISTINCTCOUNT)) {
|
|
71
|
+
output = defaultNumeric;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
output = defaultFormat || defaultNumeric;
|
|
75
|
+
}
|
|
76
|
+
if (DURATION_PARTS_LIST.includes(output === null || output === void 0 ? void 0 : output.format)) {
|
|
77
|
+
output = Object.assign(Object.assign({}, output), { template: output.format, format: "Duration" });
|
|
78
|
+
}
|
|
79
|
+
return output;
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
82
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var CHART_TYPE;
|
|
2
2
|
(function (CHART_TYPE) {
|
|
3
3
|
CHART_TYPE["BAR_CHART"] = "BAR_CHART";
|
|
4
|
+
CHART_TYPE["FUNNEL_CHART"] = "FUNNEL_CHART";
|
|
4
5
|
CHART_TYPE["BAR_CHART_MS"] = "BAR_CHART_MS";
|
|
5
6
|
CHART_TYPE["EXPANDABLE_TABLE_CHART"] = "EXPANDABLE_TABLE_CHART";
|
|
6
7
|
CHART_TYPE["SYMBOL_CHART"] = "SYMBOL_CHART";
|
|
@@ -9,7 +9,7 @@ import { isEmpty } from "../../general/mix/isEmpty";
|
|
|
9
9
|
* @returns {IFFilterTokens[]} An array of tokens that represents the filters object
|
|
10
10
|
*/
|
|
11
11
|
export function getTokensFromFilters(filters, options) {
|
|
12
|
-
var _a, _b;
|
|
12
|
+
var _a, _b, _c;
|
|
13
13
|
const tokens = [];
|
|
14
14
|
const i18nService = options.i18nService;
|
|
15
15
|
const settings = {
|
|
@@ -45,16 +45,21 @@ export function getTokensFromFilters(filters, options) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
for (const [index, filter] of Object.entries(database.filters)) {
|
|
48
|
-
if (!(filter === null || filter === void 0 ? void 0 : filter.enabled))
|
|
48
|
+
if (!(filter === null || filter === void 0 ? void 0 : filter.enabled)) {
|
|
49
|
+
if (((_a = tokens[tokens.length - 1]) === null || _a === void 0 ? void 0 : _a.type) ===
|
|
50
|
+
FILTER_TOKENS_STRUCTURE_TYPE.LOGICAL_OPERATOR) {
|
|
51
|
+
tokens.pop();
|
|
52
|
+
}
|
|
49
53
|
continue;
|
|
54
|
+
}
|
|
50
55
|
const values = getUIValues(filter, settings);
|
|
51
56
|
if (!thereIsFiltersWithValues)
|
|
52
57
|
thereIsFiltersWithValues = true;
|
|
53
58
|
let columnLabel = filter.column.label;
|
|
54
|
-
if ((
|
|
59
|
+
if ((_b = filter === null || filter === void 0 ? void 0 : filter.column) === null || _b === void 0 ? void 0 : _b.aggregate) {
|
|
55
60
|
columnLabel +=
|
|
56
61
|
" (" +
|
|
57
|
-
i18nService.translate(`common.aggregate_labels.${(
|
|
62
|
+
i18nService.translate(`common.aggregate_labels.${(_c = filter === null || filter === void 0 ? void 0 : filter.column) === null || _c === void 0 ? void 0 : _c.aggregate.toLowerCase()}`) +
|
|
58
63
|
")";
|
|
59
64
|
}
|
|
60
65
|
tokens.push({
|
|
@@ -11,6 +11,7 @@ import { II18nBucketBuilder } from "./bucket_builder/II18nBucketBuilder";
|
|
|
11
11
|
import { II18nCrossTabs } from "./cross_tabs";
|
|
12
12
|
import { II18nChartBuilder } from ".";
|
|
13
13
|
import { II18nStyleThemes } from "./style_themes/II18nStyleThemes";
|
|
14
|
+
import { II18nTabularView } from './tabular_view/II18nTabularView';
|
|
14
15
|
export interface II18nResource {
|
|
15
16
|
bucket_builder?: II18nBucketBuilder;
|
|
16
17
|
chart_builder?: II18nChartBuilder;
|
|
@@ -25,4 +26,5 @@ export interface II18nResource {
|
|
|
25
26
|
panel?: II18nPanel;
|
|
26
27
|
style_themes?: II18nStyleThemes;
|
|
27
28
|
table_charts?: II18nTableCharts;
|
|
29
|
+
tabular_view?: II18nTabularView;
|
|
28
30
|
}
|
|
@@ -7,6 +7,7 @@ import { II18nDayNames } from "./II18nDayNames";
|
|
|
7
7
|
import { II18nUnits } from "./II18nUnits";
|
|
8
8
|
import { II18nCalendar } from "../calendar/II18nCalendar";
|
|
9
9
|
export interface II18nCommon {
|
|
10
|
+
aggregates: string;
|
|
10
11
|
aggregate_labels: II18nAgreggateLabels;
|
|
11
12
|
calendar: II18nCalendar;
|
|
12
13
|
column_types: II18nColumnTypes;
|
|
@@ -16,5 +17,6 @@ export interface II18nCommon {
|
|
|
16
17
|
no_data_found: string;
|
|
17
18
|
properties: II18nColumnProperties;
|
|
18
19
|
search: string;
|
|
20
|
+
sort: string;
|
|
19
21
|
units: II18nUnits;
|
|
20
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,7 @@ import { I18N_FORMULA_BUILDER } from "./formula_builder";
|
|
|
8
8
|
import { I18N_FILTER_PANEL } from "./filters/I18N_FILTER_PANEL";
|
|
9
9
|
import { I18N_FILTER_DISPLAY } from "./filters/I18N_FILTER_DISPLAY";
|
|
10
10
|
import { I18N_BUCKET_BUILDER } from "./bucket_builder/I18N_BUCKET_BUILDER";
|
|
11
|
+
import { I18N_TABULAR_VIEW } from './tabular_view/I18N_TABULAR_VIEW';
|
|
11
12
|
import { I18N_CROSS_TABS } from "./cross_tabs";
|
|
12
13
|
import { I18N_CHART_BUILDER } from "./chart_builder";
|
|
13
14
|
import { I18N_STYLE_THEMES } from "./style_themes";
|
|
@@ -25,4 +26,5 @@ export const I18N_DEFAULT = {
|
|
|
25
26
|
panel: I18N_PANEL,
|
|
26
27
|
style_themes: I18N_STYLE_THEMES,
|
|
27
28
|
table_charts: I18N_TABLE_CHARTS,
|
|
29
|
+
tabular_view: I18N_TABULAR_VIEW
|
|
28
30
|
};
|
|
@@ -6,6 +6,7 @@ import { I18N_COLUMN_PROPERTY_LABEL } from "./I18N_COLUMN_PROPERTY_LABEL";
|
|
|
6
6
|
import { I18N_DATE_GROUPING } from "./I18N_DATE_GROUPING";
|
|
7
7
|
import { I18N_DAY_NAMES } from "./I18N_DAY_NAMES";
|
|
8
8
|
export const I18N_COMMON = {
|
|
9
|
+
aggregates: "Aggregates",
|
|
9
10
|
aggregate_labels: I18N_AGGREGATE_LABEL,
|
|
10
11
|
calendar: I18N_CALENDAR,
|
|
11
12
|
column_types: I18N_COLUMN_LABEL,
|
|
@@ -20,6 +21,7 @@ export const I18N_COMMON = {
|
|
|
20
21
|
no_data_found: "No Data Found",
|
|
21
22
|
properties: I18N_COLUMN_PROPERTY_LABEL,
|
|
22
23
|
search: "Search",
|
|
24
|
+
sort: "Sort",
|
|
23
25
|
units: {
|
|
24
26
|
day: RELATIVE_UNIT_INFO.DAY.label,
|
|
25
27
|
month: RELATIVE_UNIT_INFO.MONTH.label,
|