@qrvey/utils 1.8.0-4 → 1.8.0-6
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/RequestAdapterMetric.js +1 -1
- package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +3 -1
- package/dist/cjs/charts/adapters/RequestAdapterMetric.js +1 -1
- package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +3 -1
- package/dist/cjs/column_format/helpers/defineXYChartFormat.js +6 -1
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderComparisionOptions.d.ts +5 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_COMPARISION_OPTIONS.js +5 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +1 -1
- package/dist/column_format/helpers/defineXYChartFormat.js +6 -1
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderComparisionOptions.d.ts +5 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_COMPARISION_OPTIONS.js +5 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ const isComparison = (data) => Boolean(data === null || data === void 0 ? void 0
|
|
|
56
56
|
export const metricMakeTimeData = (dateColumn, timeData, range) => {
|
|
57
57
|
const relativObject = getConfigRelativeObjectBytimeLabel(timeData.label, range);
|
|
58
58
|
if (!isEmpty(relativObject))
|
|
59
|
-
return Object.assign(Object.assign({}, relativObject), { questionid: dateColumn.id });
|
|
59
|
+
return Object.assign(Object.assign({}, relativObject), { questionid: dateColumn.id, type: dateColumn === null || dateColumn === void 0 ? void 0 : dateColumn.type });
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* Given a time label and a custom range, return a relative date config or a metric custom range.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBColumn } from "../../columns";
|
|
1
|
+
import { IBColumn, IColumnType } from "../../columns";
|
|
2
2
|
import { IDateGroupingProperty, RelativeCursor } from "../../dates";
|
|
3
3
|
import { IFBLogic } from "../../filters";
|
|
4
4
|
import { TimePeriod, TP_CUSTOM_RANGE } from "../../interfaces";
|
|
@@ -43,6 +43,7 @@ export declare type RelativeDateConfig = {
|
|
|
43
43
|
unit: IDateGroupingProperty;
|
|
44
44
|
includeCurrent?: boolean;
|
|
45
45
|
isCalendarDate?: boolean;
|
|
46
|
+
type?: IColumnType;
|
|
46
47
|
};
|
|
47
48
|
/**
|
|
48
49
|
* `MetricCustomRange` is a type that has a property called `customRange` that is of type
|
|
@@ -51,6 +52,7 @@ export declare type RelativeDateConfig = {
|
|
|
51
52
|
*/
|
|
52
53
|
export declare type MetricCustomRange = {
|
|
53
54
|
customRange: CustomRange;
|
|
55
|
+
type?: IColumnType;
|
|
54
56
|
};
|
|
55
57
|
/**
|
|
56
58
|
* `CustomRangeConfig` is an object with optional properties `startingDate`, `endDate`, and `label`.
|
|
@@ -60,7 +60,7 @@ const isComparison = (data) => Boolean(data === null || data === void 0 ? void 0
|
|
|
60
60
|
const metricMakeTimeData = (dateColumn, timeData, range) => {
|
|
61
61
|
const relativObject = getConfigRelativeObjectBytimeLabel(timeData.label, range);
|
|
62
62
|
if (!(0, general_1.isEmpty)(relativObject))
|
|
63
|
-
return Object.assign(Object.assign({}, relativObject), { questionid: dateColumn.id });
|
|
63
|
+
return Object.assign(Object.assign({}, relativObject), { questionid: dateColumn.id, type: dateColumn === null || dateColumn === void 0 ? void 0 : dateColumn.type });
|
|
64
64
|
};
|
|
65
65
|
exports.metricMakeTimeData = metricMakeTimeData;
|
|
66
66
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBColumn } from "../../columns";
|
|
1
|
+
import { IBColumn, IColumnType } from "../../columns";
|
|
2
2
|
import { IDateGroupingProperty, RelativeCursor } from "../../dates";
|
|
3
3
|
import { IFBLogic } from "../../filters";
|
|
4
4
|
import { TimePeriod, TP_CUSTOM_RANGE } from "../../interfaces";
|
|
@@ -43,6 +43,7 @@ export declare type RelativeDateConfig = {
|
|
|
43
43
|
unit: IDateGroupingProperty;
|
|
44
44
|
includeCurrent?: boolean;
|
|
45
45
|
isCalendarDate?: boolean;
|
|
46
|
+
type?: IColumnType;
|
|
46
47
|
};
|
|
47
48
|
/**
|
|
48
49
|
* `MetricCustomRange` is a type that has a property called `customRange` that is of type
|
|
@@ -51,6 +52,7 @@ export declare type RelativeDateConfig = {
|
|
|
51
52
|
*/
|
|
52
53
|
export declare type MetricCustomRange = {
|
|
53
54
|
customRange: CustomRange;
|
|
55
|
+
type?: IColumnType;
|
|
54
56
|
};
|
|
55
57
|
/**
|
|
56
58
|
* `CustomRangeConfig` is an object with optional properties `startingDate`, `endDate`, and `label`.
|
|
@@ -31,7 +31,12 @@ const defineXYChartFormat = (column, settings) => {
|
|
|
31
31
|
format: "Percentage" /* LOCALE_FORMATS.PERCENTAGE */,
|
|
32
32
|
};
|
|
33
33
|
const columnType = (0, columnTypeByChart_1.columnTypeByChart)(column, shelfType, CHART_GROUP_1.CHART_GROUPS.XY);
|
|
34
|
-
|
|
34
|
+
let stringDateGroupForDrillCategory;
|
|
35
|
+
if (typeof dateGroup === "string")
|
|
36
|
+
stringDateGroupForDrillCategory = dateGroup;
|
|
37
|
+
const noFormatSupported = DATEGROUP_UNSUPPORT_FORMAT_1.DATEGROUP_UNSUPPORT_FORMAT.some((gp) => gp === (dateGroup === null || dateGroup === void 0 ? void 0 : dateGroup.label) ||
|
|
38
|
+
gp === (timeGroup === null || timeGroup === void 0 ? void 0 : timeGroup.label) ||
|
|
39
|
+
gp === stringDateGroupForDrillCategory);
|
|
35
40
|
const isUsedAsNumericColumn = type !== columnType;
|
|
36
41
|
const columnCurrentFormat = isUsedAsNumericColumn
|
|
37
42
|
? selectedFormat
|
package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderComparisionOptions.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export interface II18nChartBuilderComparisionOptions {
|
|
2
|
+
add_column: string;
|
|
2
3
|
comparison: string;
|
|
3
4
|
change_triangle_up: string;
|
|
4
5
|
change_triangle_down: string;
|
|
5
6
|
change_none: string;
|
|
6
7
|
change_circle: string;
|
|
8
|
+
column_title: string;
|
|
9
|
+
default_column_name: string;
|
|
7
10
|
date_column: string;
|
|
8
11
|
difference_higher: string;
|
|
9
12
|
difference_lower: string;
|
|
@@ -16,7 +19,9 @@ export interface II18nChartBuilderComparisionOptions {
|
|
|
16
19
|
increasing_change: string;
|
|
17
20
|
no_change: string;
|
|
18
21
|
preposition_than: string;
|
|
22
|
+
remove: string;
|
|
19
23
|
select_option: string;
|
|
24
|
+
show_value: string;
|
|
20
25
|
type: string;
|
|
21
26
|
time_period: string;
|
|
22
27
|
type_change: string;
|
package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_COMPARISION_OPTIONS.js
CHANGED
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.I18N_CHART_BUILDER_COMPARISION_OPTIONS = void 0;
|
|
4
4
|
exports.I18N_CHART_BUILDER_COMPARISION_OPTIONS = {
|
|
5
5
|
comparison_options: {
|
|
6
|
+
add_column: "Add Comparison Column",
|
|
6
7
|
comparison: "Comparison",
|
|
7
8
|
change_triangle_up: "Triangle Up",
|
|
8
9
|
change_triangle_down: "Triangle Down",
|
|
9
10
|
change_none: "None",
|
|
10
11
|
change_circle: "Circle",
|
|
12
|
+
column_title: "Column",
|
|
13
|
+
default_column_name: "Comparison Column",
|
|
11
14
|
date_column: "Date Column",
|
|
12
15
|
difference_higher: "higher",
|
|
13
16
|
difference_lower: "lower",
|
|
@@ -20,7 +23,9 @@ exports.I18N_CHART_BUILDER_COMPARISION_OPTIONS = {
|
|
|
20
23
|
increasing_change: "Increasing Change",
|
|
21
24
|
no_change: "No Change",
|
|
22
25
|
preposition_than: "than",
|
|
26
|
+
remove: "Remove",
|
|
23
27
|
select_option: "Select Option",
|
|
28
|
+
show_value: "Show Value",
|
|
24
29
|
type: "Type",
|
|
25
30
|
time_period: "Time Period",
|
|
26
31
|
type_change: "% Change",
|
|
@@ -259,6 +259,6 @@ exports.I18N_CHART_BUILDER_GENERAL = {
|
|
|
259
259
|
distribution_missing: "A <i>Distribution</i> column is needed for this chart when the <i>Value</i> column is of non-numeric datatype.",
|
|
260
260
|
},
|
|
261
261
|
messages_combined: {
|
|
262
|
-
column_missing: "A <i>Category</i>, a <i>Series</i> and at least two <i>
|
|
262
|
+
column_missing: "A <i>Category</i>, a <i>Series</i> and at least two <i>Values</i> are needed for this chart.",
|
|
263
263
|
},
|
|
264
264
|
};
|
|
@@ -28,7 +28,12 @@ export const defineXYChartFormat = (column, settings) => {
|
|
|
28
28
|
format: "Percentage" /* LOCALE_FORMATS.PERCENTAGE */,
|
|
29
29
|
};
|
|
30
30
|
const columnType = columnTypeByChart(column, shelfType, CHART_GROUPS.XY);
|
|
31
|
-
|
|
31
|
+
let stringDateGroupForDrillCategory;
|
|
32
|
+
if (typeof dateGroup === "string")
|
|
33
|
+
stringDateGroupForDrillCategory = dateGroup;
|
|
34
|
+
const noFormatSupported = DATEGROUP_UNSUPPORT_FORMAT.some((gp) => gp === (dateGroup === null || dateGroup === void 0 ? void 0 : dateGroup.label) ||
|
|
35
|
+
gp === (timeGroup === null || timeGroup === void 0 ? void 0 : timeGroup.label) ||
|
|
36
|
+
gp === stringDateGroupForDrillCategory);
|
|
32
37
|
const isUsedAsNumericColumn = type !== columnType;
|
|
33
38
|
const columnCurrentFormat = isUsedAsNumericColumn
|
|
34
39
|
? selectedFormat
|
package/dist/globalization/interfaces/chart_builder/II18nChartBuilderComparisionOptions.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export interface II18nChartBuilderComparisionOptions {
|
|
2
|
+
add_column: string;
|
|
2
3
|
comparison: string;
|
|
3
4
|
change_triangle_up: string;
|
|
4
5
|
change_triangle_down: string;
|
|
5
6
|
change_none: string;
|
|
6
7
|
change_circle: string;
|
|
8
|
+
column_title: string;
|
|
9
|
+
default_column_name: string;
|
|
7
10
|
date_column: string;
|
|
8
11
|
difference_higher: string;
|
|
9
12
|
difference_lower: string;
|
|
@@ -16,7 +19,9 @@ export interface II18nChartBuilderComparisionOptions {
|
|
|
16
19
|
increasing_change: string;
|
|
17
20
|
no_change: string;
|
|
18
21
|
preposition_than: string;
|
|
22
|
+
remove: string;
|
|
19
23
|
select_option: string;
|
|
24
|
+
show_value: string;
|
|
20
25
|
type: string;
|
|
21
26
|
time_period: string;
|
|
22
27
|
type_change: string;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export const I18N_CHART_BUILDER_COMPARISION_OPTIONS = {
|
|
2
2
|
comparison_options: {
|
|
3
|
+
add_column: "Add Comparison Column",
|
|
3
4
|
comparison: "Comparison",
|
|
4
5
|
change_triangle_up: "Triangle Up",
|
|
5
6
|
change_triangle_down: "Triangle Down",
|
|
6
7
|
change_none: "None",
|
|
7
8
|
change_circle: "Circle",
|
|
9
|
+
column_title: "Column",
|
|
10
|
+
default_column_name: "Comparison Column",
|
|
8
11
|
date_column: "Date Column",
|
|
9
12
|
difference_higher: "higher",
|
|
10
13
|
difference_lower: "lower",
|
|
@@ -17,7 +20,9 @@ export const I18N_CHART_BUILDER_COMPARISION_OPTIONS = {
|
|
|
17
20
|
increasing_change: "Increasing Change",
|
|
18
21
|
no_change: "No Change",
|
|
19
22
|
preposition_than: "than",
|
|
23
|
+
remove: "Remove",
|
|
20
24
|
select_option: "Select Option",
|
|
25
|
+
show_value: "Show Value",
|
|
21
26
|
type: "Type",
|
|
22
27
|
time_period: "Time Period",
|
|
23
28
|
type_change: "% Change",
|
|
@@ -256,6 +256,6 @@ export const I18N_CHART_BUILDER_GENERAL = {
|
|
|
256
256
|
distribution_missing: "A <i>Distribution</i> column is needed for this chart when the <i>Value</i> column is of non-numeric datatype.",
|
|
257
257
|
},
|
|
258
258
|
messages_combined: {
|
|
259
|
-
column_missing: "A <i>Category</i>, a <i>Series</i> and at least two <i>
|
|
259
|
+
column_missing: "A <i>Category</i>, a <i>Series</i> and at least two <i>Values</i> are needed for this chart.",
|
|
260
260
|
},
|
|
261
261
|
};
|