@qrvey/utils 1.9.0-6 → 1.9.0-8

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 CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.9.0-6*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.9.0-8*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -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
- ? records.map((record) => ({
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
- ? records.map((record) => ({
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
  /**
@@ -1,4 +1,21 @@
1
1
  export interface II18nTabularView {
2
- all: string;
2
+ add_access_point: string;
3
+ add_modal_title: string;
4
+ add_modal_add_option: string;
5
+ add_modal_cancel_option: string;
6
+ delete_access_point: string;
7
+ delete_modal_title: string;
8
+ delete_modal_description_one: string;
9
+ delete_modal_description_other: string;
10
+ delete_modal_delete_option: string;
11
+ delete_modal_cancel_option: string;
12
+ edit_access_point: string;
13
+ edit_modal_title: string;
14
+ edit_modal_edit_option: string;
15
+ edit_modal_cancel_option: string;
16
+ filter_access_point: string;
17
+ no_records_found_message: string;
18
+ select_columns_all_option: string;
3
19
  select_columns: string;
20
+ sort_access_point: string;
4
21
  }
@@ -2,6 +2,23 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.I18N_TABULAR_VIEW = void 0;
4
4
  exports.I18N_TABULAR_VIEW = {
5
- all: "Todas",
5
+ add_access_point: "Add",
6
+ add_modal_title: "Add Record",
7
+ add_modal_add_option: "Add",
8
+ add_modal_cancel_option: "Cancel",
9
+ delete_access_point: "Delete",
10
+ delete_modal_title: "Delete Record",
11
+ delete_modal_description_one: "I confirm I want to delete {{number_records}} record",
12
+ delete_modal_description_other: "I confirm I want to delete {{number_records}} records",
13
+ delete_modal_delete_option: "Delete",
14
+ delete_modal_cancel_option: "Cancel",
15
+ edit_access_point: "Edit",
16
+ edit_modal_title: "Edit Record",
17
+ edit_modal_edit_option: "Update",
18
+ edit_modal_cancel_option: "Edit",
19
+ filter_access_point: "Filter",
20
+ no_records_found_message: "No Records Found",
21
+ select_columns_all_option: "All",
6
22
  select_columns: "Select Columns",
23
+ sort_access_point: "Sort",
7
24
  };
@@ -51,6 +51,7 @@ function getOutputFormat(settings) {
51
51
  }
52
52
  else if ((0, isNumericalColumn_1.isNumericalColumn)(settings.column)) {
53
53
  type = "NUMERIC";
54
+ format = "Default";
54
55
  }
55
56
  return {
56
57
  type,
@@ -59,11 +60,11 @@ function getOutputFormat(settings) {
59
60
  };
60
61
  }
61
62
  /**
62
- * Gets the format config
63
+ * Gets the format config if the locale exists in i18n settings
63
64
  * @param settings The settings of the transformValue function
64
65
  * @returns the format config
65
66
  */
66
67
  function getFormatConfig(settings) {
67
- var _a;
68
- return { lang: (_a = settings.i18n) === null || _a === void 0 ? void 0 : _a.locale };
68
+ var _a, _b;
69
+ return ((_a = settings.i18n) === null || _a === void 0 ? void 0 : _a.locale) && { lang: (_b = settings.i18n) === null || _b === void 0 ? void 0 : _b.locale };
69
70
  }
@@ -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
- ? records.map((record) => ({
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
- ? records.map((record) => ({
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
@@ -1,4 +1,21 @@
1
1
  export interface II18nTabularView {
2
- all: string;
2
+ add_access_point: string;
3
+ add_modal_title: string;
4
+ add_modal_add_option: string;
5
+ add_modal_cancel_option: string;
6
+ delete_access_point: string;
7
+ delete_modal_title: string;
8
+ delete_modal_description_one: string;
9
+ delete_modal_description_other: string;
10
+ delete_modal_delete_option: string;
11
+ delete_modal_cancel_option: string;
12
+ edit_access_point: string;
13
+ edit_modal_title: string;
14
+ edit_modal_edit_option: string;
15
+ edit_modal_cancel_option: string;
16
+ filter_access_point: string;
17
+ no_records_found_message: string;
18
+ select_columns_all_option: string;
3
19
  select_columns: string;
20
+ sort_access_point: string;
4
21
  }
@@ -1,4 +1,21 @@
1
1
  export const I18N_TABULAR_VIEW = {
2
- all: "Todas",
2
+ add_access_point: "Add",
3
+ add_modal_title: "Add Record",
4
+ add_modal_add_option: "Add",
5
+ add_modal_cancel_option: "Cancel",
6
+ delete_access_point: "Delete",
7
+ delete_modal_title: "Delete Record",
8
+ delete_modal_description_one: "I confirm I want to delete {{number_records}} record",
9
+ delete_modal_description_other: "I confirm I want to delete {{number_records}} records",
10
+ delete_modal_delete_option: "Delete",
11
+ delete_modal_cancel_option: "Cancel",
12
+ edit_access_point: "Edit",
13
+ edit_modal_title: "Edit Record",
14
+ edit_modal_edit_option: "Update",
15
+ edit_modal_cancel_option: "Edit",
16
+ filter_access_point: "Filter",
17
+ no_records_found_message: "No Records Found",
18
+ select_columns_all_option: "All",
3
19
  select_columns: "Select Columns",
20
+ sort_access_point: "Sort",
4
21
  };
@@ -47,6 +47,7 @@ function getOutputFormat(settings) {
47
47
  }
48
48
  else if (isNumericalColumn(settings.column)) {
49
49
  type = "NUMERIC";
50
+ format = "Default";
50
51
  }
51
52
  return {
52
53
  type,
@@ -55,11 +56,11 @@ function getOutputFormat(settings) {
55
56
  };
56
57
  }
57
58
  /**
58
- * Gets the format config
59
+ * Gets the format config if the locale exists in i18n settings
59
60
  * @param settings The settings of the transformValue function
60
61
  * @returns the format config
61
62
  */
62
63
  function getFormatConfig(settings) {
63
- var _a;
64
- return { lang: (_a = settings.i18n) === null || _a === void 0 ? void 0 : _a.locale };
64
+ var _a, _b;
65
+ return ((_a = settings.i18n) === null || _a === void 0 ? void 0 : _a.locale) && { lang: (_b = settings.i18n) === null || _b === void 0 ? void 0 : _b.locale };
65
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.9.0-6",
3
+ "version": "1.9.0-8",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",