@qrvey/utils 1.5.0-2 → 1.5.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.
- 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/format/duration/durationFormatter.js +1 -1
- package/dist/cjs/globalization/interfaces/common/II18nCommon.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/panel/II18nPanelMenu.d.ts +1 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +1 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +2 -2
- package/dist/cjs/globalization/labels/common/I18N_COMMON.js +1 -0
- package/dist/cjs/globalization/labels/panel/I18N_PANEL.js +1 -0
- package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -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/format/duration/durationFormatter.js +1 -1
- package/dist/globalization/interfaces/common/II18nCommon.d.ts +1 -0
- package/dist/globalization/interfaces/panel/II18nPanelMenu.d.ts +1 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +1 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +2 -2
- package/dist/globalization/labels/common/I18N_COMMON.js +1 -0
- package/dist/globalization/labels/panel/I18N_PANEL.js +1 -0
- package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
- package/package.json +1 -1
|
@@ -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";
|
|
@@ -126,7 +126,7 @@ export class DurationFormatter {
|
|
|
126
126
|
return "";
|
|
127
127
|
number *= this.numberFactor;
|
|
128
128
|
const durationParts = this.parts.reduce((store, part) => {
|
|
129
|
-
store[part.symbol] = number / part.ms;
|
|
129
|
+
store[part.symbol] = Math.floor(number / part.ms);
|
|
130
130
|
number %= part.ms;
|
|
131
131
|
return store;
|
|
132
132
|
}, {});
|
|
@@ -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;
|
|
@@ -215,8 +215,8 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS = {
|
|
|
215
215
|
border_outer: "Outer Borders",
|
|
216
216
|
expandable_color: "Header Color",
|
|
217
217
|
expandable_font_color: "Header Font Color",
|
|
218
|
-
crosstab_color: "
|
|
219
|
-
crosstab_font_color: "
|
|
218
|
+
crosstab_color: "BG Color",
|
|
219
|
+
crosstab_font_color: "Font Color",
|
|
220
220
|
},
|
|
221
221
|
table_body: {
|
|
222
222
|
title: "Body",
|
|
@@ -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,
|