@qrvey/utils 1.9.0-6 → 1.9.0-7
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/cjs/constants/Charts.Const.d.ts +2 -1
- package/dist/cjs/constants/Charts.Const.js +1 -0
- package/dist/cjs/filters/services/UChartApi.d.ts +7 -0
- package/dist/cjs/filters/services/UChartApi.js +14 -3
- package/dist/cjs/filters/services/UChartPaginationApi.d.ts +7 -0
- package/dist/cjs/filters/services/UChartPaginationApi.js +14 -3
- package/dist/constants/Charts.Const.d.ts +2 -1
- package/dist/constants/Charts.Const.js +1 -0
- package/dist/filters/services/UChartApi.d.ts +7 -0
- package/dist/filters/services/UChartApi.js +14 -3
- package/dist/filters/services/UChartPaginationApi.d.ts +7 -0
- package/dist/filters/services/UChartPaginationApi.js +14 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,8 @@ export declare enum CHART_TYPE {
|
|
|
25
25
|
DIAL_METRIC = "DIAL",
|
|
26
26
|
BULLET_METRIC = "BULLET",
|
|
27
27
|
SUMMARY_CHART = "SUMMARY_CHART",
|
|
28
|
-
MINMAX_CHART = "MINMAX_CHART"
|
|
28
|
+
MINMAX_CHART = "MINMAX_CHART",
|
|
29
|
+
COMBINED_CHART = "COMBINED_CHART"
|
|
29
30
|
}
|
|
30
31
|
export declare enum CHART_DIMENSION {
|
|
31
32
|
CATEGORIES = "categories",
|
|
@@ -30,6 +30,7 @@ var CHART_TYPE;
|
|
|
30
30
|
CHART_TYPE["BULLET_METRIC"] = "BULLET";
|
|
31
31
|
CHART_TYPE["SUMMARY_CHART"] = "SUMMARY_CHART";
|
|
32
32
|
CHART_TYPE["MINMAX_CHART"] = "MINMAX_CHART";
|
|
33
|
+
CHART_TYPE["COMBINED_CHART"] = "COMBINED_CHART";
|
|
33
34
|
})(CHART_TYPE = exports.CHART_TYPE || (exports.CHART_TYPE = {}));
|
|
34
35
|
var CHART_DIMENSION;
|
|
35
36
|
(function (CHART_DIMENSION) {
|
|
@@ -89,6 +89,13 @@ export default class UChartApi {
|
|
|
89
89
|
* @returns The resulting data
|
|
90
90
|
*/
|
|
91
91
|
private _getDataFromResponse;
|
|
92
|
+
/**
|
|
93
|
+
* Tranform response in array of object with value key
|
|
94
|
+
* Null or undefined values are avoided
|
|
95
|
+
* @param records The data from preview response
|
|
96
|
+
* @returns the sumaries
|
|
97
|
+
*/
|
|
98
|
+
private static _getResponse;
|
|
92
99
|
/**
|
|
93
100
|
* Gets summaries from preview response
|
|
94
101
|
* @param records The data from preview response
|
|
@@ -57,9 +57,7 @@ class UChartApi {
|
|
|
57
57
|
else if (!UChartApi.isResultEmpty(response)) {
|
|
58
58
|
const records = (0, get_1._get)(response, "data");
|
|
59
59
|
data.data = (0, isEmpty_1.isEmpty)(uFilter.column.aggregate)
|
|
60
|
-
?
|
|
61
|
-
value: record.key.toString(),
|
|
62
|
-
}))
|
|
60
|
+
? UChartApi._getResponse(records)
|
|
63
61
|
: this._getResponseSummaries(records);
|
|
64
62
|
}
|
|
65
63
|
return data;
|
|
@@ -122,6 +120,19 @@ class UChartApi {
|
|
|
122
120
|
}
|
|
123
121
|
return filterCharts;
|
|
124
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Tranform response in array of object with value key
|
|
125
|
+
* Null or undefined values are avoided
|
|
126
|
+
* @param records The data from preview response
|
|
127
|
+
* @returns the sumaries
|
|
128
|
+
*/
|
|
129
|
+
static _getResponse(records) {
|
|
130
|
+
return records.reduce((store, record) => {
|
|
131
|
+
const value = record.key;
|
|
132
|
+
!(0, isEmpty_1.isEmpty)(value) && store.push({ value: String(value) });
|
|
133
|
+
return store;
|
|
134
|
+
}, []);
|
|
135
|
+
}
|
|
125
136
|
}
|
|
126
137
|
exports.default = UChartApi;
|
|
127
138
|
/**
|
|
@@ -95,6 +95,13 @@ export default class UChartPaginationApi {
|
|
|
95
95
|
* @returns The resulting data
|
|
96
96
|
*/
|
|
97
97
|
private _getDataFromResponse;
|
|
98
|
+
/**
|
|
99
|
+
* Tranform response in array of object with value key
|
|
100
|
+
* Null or undefined values are avoided
|
|
101
|
+
* @param records The data from preview response
|
|
102
|
+
* @returns the sumaries
|
|
103
|
+
*/
|
|
104
|
+
private static _getResponse;
|
|
98
105
|
/**
|
|
99
106
|
* Gets summaries from preview response
|
|
100
107
|
* @param records The data from preview response
|
|
@@ -56,9 +56,7 @@ class UChartPaginationApi {
|
|
|
56
56
|
if (!UChartPaginationApi.isResultPaginationEmpty(response)) {
|
|
57
57
|
const records = (0, get_1._get)(response, "data");
|
|
58
58
|
data.data = (0, isEmpty_1.isEmpty)(uFilter.column.aggregate)
|
|
59
|
-
?
|
|
60
|
-
value: record.key.toString(),
|
|
61
|
-
}))
|
|
59
|
+
? UChartPaginationApi._getResponse(records)
|
|
62
60
|
: UChartPaginationApi._getResponseSummaries(records);
|
|
63
61
|
data.data = (0, getUniqueArray_1.getUniqueArray)(data.data, "value");
|
|
64
62
|
data.total = (_a = (0, get_1._get)(response, "totalGroups", 0)) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -134,6 +132,19 @@ class UChartPaginationApi {
|
|
|
134
132
|
}
|
|
135
133
|
return filterCharts;
|
|
136
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Tranform response in array of object with value key
|
|
137
|
+
* Null or undefined values are avoided
|
|
138
|
+
* @param records The data from preview response
|
|
139
|
+
* @returns the sumaries
|
|
140
|
+
*/
|
|
141
|
+
static _getResponse(records) {
|
|
142
|
+
return records.reduce((store, record) => {
|
|
143
|
+
const value = record.key;
|
|
144
|
+
!(0, isEmpty_1.isEmpty)(value) && store.push({ value: String(value) });
|
|
145
|
+
return store;
|
|
146
|
+
}, []);
|
|
147
|
+
}
|
|
137
148
|
}
|
|
138
149
|
exports.default = UChartPaginationApi;
|
|
139
150
|
/**
|
|
@@ -25,7 +25,8 @@ export declare enum CHART_TYPE {
|
|
|
25
25
|
DIAL_METRIC = "DIAL",
|
|
26
26
|
BULLET_METRIC = "BULLET",
|
|
27
27
|
SUMMARY_CHART = "SUMMARY_CHART",
|
|
28
|
-
MINMAX_CHART = "MINMAX_CHART"
|
|
28
|
+
MINMAX_CHART = "MINMAX_CHART",
|
|
29
|
+
COMBINED_CHART = "COMBINED_CHART"
|
|
29
30
|
}
|
|
30
31
|
export declare enum CHART_DIMENSION {
|
|
31
32
|
CATEGORIES = "categories",
|
|
@@ -27,6 +27,7 @@ export var CHART_TYPE;
|
|
|
27
27
|
CHART_TYPE["BULLET_METRIC"] = "BULLET";
|
|
28
28
|
CHART_TYPE["SUMMARY_CHART"] = "SUMMARY_CHART";
|
|
29
29
|
CHART_TYPE["MINMAX_CHART"] = "MINMAX_CHART";
|
|
30
|
+
CHART_TYPE["COMBINED_CHART"] = "COMBINED_CHART";
|
|
30
31
|
})(CHART_TYPE || (CHART_TYPE = {}));
|
|
31
32
|
export var CHART_DIMENSION;
|
|
32
33
|
(function (CHART_DIMENSION) {
|
|
@@ -89,6 +89,13 @@ export default class UChartApi {
|
|
|
89
89
|
* @returns The resulting data
|
|
90
90
|
*/
|
|
91
91
|
private _getDataFromResponse;
|
|
92
|
+
/**
|
|
93
|
+
* Tranform response in array of object with value key
|
|
94
|
+
* Null or undefined values are avoided
|
|
95
|
+
* @param records The data from preview response
|
|
96
|
+
* @returns the sumaries
|
|
97
|
+
*/
|
|
98
|
+
private static _getResponse;
|
|
92
99
|
/**
|
|
93
100
|
* Gets summaries from preview response
|
|
94
101
|
* @param records The data from preview response
|
|
@@ -52,9 +52,7 @@ export default class UChartApi {
|
|
|
52
52
|
else if (!UChartApi.isResultEmpty(response)) {
|
|
53
53
|
const records = _get(response, "data");
|
|
54
54
|
data.data = isEmpty(uFilter.column.aggregate)
|
|
55
|
-
?
|
|
56
|
-
value: record.key.toString(),
|
|
57
|
-
}))
|
|
55
|
+
? UChartApi._getResponse(records)
|
|
58
56
|
: this._getResponseSummaries(records);
|
|
59
57
|
}
|
|
60
58
|
return data;
|
|
@@ -117,6 +115,19 @@ export default class UChartApi {
|
|
|
117
115
|
}
|
|
118
116
|
return filterCharts;
|
|
119
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Tranform response in array of object with value key
|
|
120
|
+
* Null or undefined values are avoided
|
|
121
|
+
* @param records The data from preview response
|
|
122
|
+
* @returns the sumaries
|
|
123
|
+
*/
|
|
124
|
+
static _getResponse(records) {
|
|
125
|
+
return records.reduce((store, record) => {
|
|
126
|
+
const value = record.key;
|
|
127
|
+
!isEmpty(value) && store.push({ value: String(value) });
|
|
128
|
+
return store;
|
|
129
|
+
}, []);
|
|
130
|
+
}
|
|
120
131
|
}
|
|
121
132
|
/**
|
|
122
133
|
* Gets request body structure
|
|
@@ -95,6 +95,13 @@ export default class UChartPaginationApi {
|
|
|
95
95
|
* @returns The resulting data
|
|
96
96
|
*/
|
|
97
97
|
private _getDataFromResponse;
|
|
98
|
+
/**
|
|
99
|
+
* Tranform response in array of object with value key
|
|
100
|
+
* Null or undefined values are avoided
|
|
101
|
+
* @param records The data from preview response
|
|
102
|
+
* @returns the sumaries
|
|
103
|
+
*/
|
|
104
|
+
private static _getResponse;
|
|
98
105
|
/**
|
|
99
106
|
* Gets summaries from preview response
|
|
100
107
|
* @param records The data from preview response
|
|
@@ -51,9 +51,7 @@ export default class UChartPaginationApi {
|
|
|
51
51
|
if (!UChartPaginationApi.isResultPaginationEmpty(response)) {
|
|
52
52
|
const records = _get(response, "data");
|
|
53
53
|
data.data = isEmpty(uFilter.column.aggregate)
|
|
54
|
-
?
|
|
55
|
-
value: record.key.toString(),
|
|
56
|
-
}))
|
|
54
|
+
? UChartPaginationApi._getResponse(records)
|
|
57
55
|
: UChartPaginationApi._getResponseSummaries(records);
|
|
58
56
|
data.data = getUniqueArray(data.data, "value");
|
|
59
57
|
data.total = (_a = _get(response, "totalGroups", 0)) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -129,6 +127,19 @@ export default class UChartPaginationApi {
|
|
|
129
127
|
}
|
|
130
128
|
return filterCharts;
|
|
131
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Tranform response in array of object with value key
|
|
132
|
+
* Null or undefined values are avoided
|
|
133
|
+
* @param records The data from preview response
|
|
134
|
+
* @returns the sumaries
|
|
135
|
+
*/
|
|
136
|
+
static _getResponse(records) {
|
|
137
|
+
return records.reduce((store, record) => {
|
|
138
|
+
const value = record.key;
|
|
139
|
+
!isEmpty(value) && store.push({ value: String(value) });
|
|
140
|
+
return store;
|
|
141
|
+
}, []);
|
|
142
|
+
}
|
|
132
143
|
}
|
|
133
144
|
/**
|
|
134
145
|
* Gets request body structure
|