@qrvey/utils 1.11.0 → 1.11.2

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.
Files changed (28) hide show
  1. package/README.md +1784 -1784
  2. package/dist/cjs/filters/helpers/common/mergeFilters.js +3 -3
  3. package/dist/cjs/general/object/mergeDeep.js +2 -2
  4. package/dist/cjs/general/object/objectCopy.d.ts +1 -0
  5. package/dist/cjs/general/object/objectCopy.js +1 -0
  6. package/dist/cjs/general/object/removeUndefinedDeep.js +2 -2
  7. package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderAxisStyle.d.ts +4 -0
  8. package/dist/cjs/globalization/interfaces/common/II18nRelativeDates.d.ts +8 -0
  9. package/dist/cjs/globalization/interfaces/common/II18nRelativeDates.js +2 -0
  10. package/dist/cjs/globalization/interfaces/common/II18nUnits.d.ts +6 -0
  11. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +4 -0
  12. package/dist/cjs/globalization/labels/common/I18N_COMMON.js +2 -10
  13. package/dist/cjs/globalization/labels/common/I18N_RELATIVE_DATES.d.ts +2 -0
  14. package/dist/cjs/globalization/labels/common/I18N_RELATIVE_DATES.js +11 -0
  15. package/dist/filters/helpers/common/mergeFilters.js +3 -3
  16. package/dist/general/object/mergeDeep.js +2 -2
  17. package/dist/general/object/objectCopy.d.ts +1 -0
  18. package/dist/general/object/objectCopy.js +1 -0
  19. package/dist/general/object/removeUndefinedDeep.js +2 -2
  20. package/dist/globalization/interfaces/chart_builder/II18nChartBuilderAxisStyle.d.ts +4 -0
  21. package/dist/globalization/interfaces/common/II18nRelativeDates.d.ts +8 -0
  22. package/dist/globalization/interfaces/common/II18nRelativeDates.js +1 -0
  23. package/dist/globalization/interfaces/common/II18nUnits.d.ts +6 -0
  24. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +4 -0
  25. package/dist/globalization/labels/common/I18N_COMMON.js +2 -10
  26. package/dist/globalization/labels/common/I18N_RELATIVE_DATES.d.ts +2 -0
  27. package/dist/globalization/labels/common/I18N_RELATIVE_DATES.js +8 -0
  28. package/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mergeFilters = void 0;
4
4
  const isEmpty_1 = require("../../../general/mix/isEmpty");
5
5
  const mergeDeep_1 = require("../../../general/object/mergeDeep");
6
- const objectCopy_1 = require("../../../general/object/objectCopy");
6
+ const cloneDeep_1 = require("../../../general/object/cloneDeep");
7
7
  const getFilterid_1 = require("./getFilterid");
8
8
  const getMergeFiltersSettings_1 = require("./getMergeFiltersSettings");
9
9
  const mergeValues_1 = require("./mergeValues");
@@ -29,8 +29,8 @@ function mergeFilters(filterData1, filterData2, settings) {
29
29
  }
30
30
  if ((0, isEmpty_1.isEmpty)(filterData2) || (0, isEmpty_1.isEmpty)(filterData2.scopes))
31
31
  return filterData1;
32
- const newFilterData1 = (0, objectCopy_1.objectCopy)(filterData1);
33
- const newFilterData2 = (0, objectCopy_1.objectCopy)(filterData2);
32
+ const newFilterData1 = (0, cloneDeep_1.cloneDeep)(filterData1);
33
+ const newFilterData2 = (0, cloneDeep_1.cloneDeep)(filterData2);
34
34
  const defaultSettings = (0, getMergeFiltersSettings_1.getMergeFiltersSettings)(settings);
35
35
  const scopes = mergeScopes(newFilterData1.scopes, newFilterData2.scopes, defaultSettings);
36
36
  if (defaultSettings.mergeFilterDataProps) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mergeDeep = void 0;
4
4
  const isObject_1 = require("./isObject");
5
- const objectCopy_1 = require("./objectCopy");
5
+ const cloneDeep_1 = require("./cloneDeep");
6
6
  /**
7
7
  * Merges two objects into a new one.
8
8
  * The second given argument to the first given argument.
@@ -14,7 +14,7 @@ const objectCopy_1 = require("./objectCopy");
14
14
  function mergeDeep(obj1, obj2, settings) {
15
15
  const defaultSettings = getParamsToMergeDeep(settings);
16
16
  if (!isValid(obj1, obj2))
17
- return (0, objectCopy_1.objectCopy)(obj1);
17
+ return (0, cloneDeep_1.cloneDeep)(obj1);
18
18
  const result = Array.isArray(obj1) ? [] : {};
19
19
  for (const i in obj1) {
20
20
  if ((0, isObject_1.isObject)(obj1[i]) || Array.isArray(obj1[i])) {
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @deprecated since version 1.11.1. Qrvey version 8.2. This module generates a memory leak, so use a different solution at possible (cloneDeep)
2
3
  * Created a new reference of the given argument
3
4
  * @param entity The variable to be copied
4
5
  * @param cache
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.objectCopy = void 0;
4
4
  /**
5
+ * @deprecated since version 1.11.1. Qrvey version 8.2. This module generates a memory leak, so use a different solution at possible (cloneDeep)
5
6
  * Created a new reference of the given argument
6
7
  * @param entity The variable to be copied
7
8
  * @param cache
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeUndefinedDeep = void 0;
4
4
  const isObject_1 = require("./isObject");
5
- const objectCopy_1 = require("./objectCopy");
5
+ const cloneDeep_1 = require("./cloneDeep");
6
6
  /**
7
7
  * Removes and returns the given object cleaning the undefined values
8
8
  * @param obj an object
@@ -12,7 +12,7 @@ function removeUndefinedDeep(obj) {
12
12
  const isArray = Array.isArray(obj);
13
13
  if (obj == null || (!(0, isObject_1.isObject)(obj) && !isArray))
14
14
  return obj;
15
- let _obj = (0, objectCopy_1.objectCopy)(obj);
15
+ let _obj = (0, cloneDeep_1.cloneDeep)(obj);
16
16
  if (isArray)
17
17
  _obj = _obj.filter(Boolean);
18
18
  Object.keys(_obj).forEach((key) => {
@@ -4,10 +4,13 @@ export interface II18nChartBuilderAxisStyle {
4
4
  axis_position_left: string;
5
5
  axis_position_primary_axis: string;
6
6
  axis_position_right: string;
7
+ calendar_dates: string;
7
8
  custom_axis_label: string;
8
9
  custom_label: string;
9
10
  custom_label_placeholder: string;
11
+ end_date: string;
10
12
  format_title: string;
13
+ include_starting: string;
11
14
  max_range: string;
12
15
  max_range_placeholder: string;
13
16
  min_range: string;
@@ -17,6 +20,7 @@ export interface II18nChartBuilderAxisStyle {
17
20
  scale_type_linear: string;
18
21
  scale_type_logarithm: string;
19
22
  scale_type_placeholder: string;
23
+ start_date: string;
20
24
  steps: string;
21
25
  steps_placeholder: string;
22
26
  type_label: string;
@@ -0,0 +1,8 @@
1
+ export interface II18nRelativeDates {
2
+ auto: string;
3
+ current_date: string;
4
+ fixed: string;
5
+ in_this: string;
6
+ the_last: string;
7
+ the_next: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,4 +7,10 @@ export interface II18nUnits {
7
7
  second: string;
8
8
  week: string;
9
9
  year: string;
10
+ auto: string;
11
+ current_date: string;
12
+ fixed: string;
13
+ in_this: string;
14
+ the_last: string;
15
+ the_next: string;
10
16
  }
@@ -79,10 +79,13 @@ exports.I18N_CHART_BUILDER_STYLE_OPTIONS = {
79
79
  axis_position_left: "Left",
80
80
  axis_position_primary_axis: "Use Primary Axis",
81
81
  axis_position_right: "Right",
82
+ calendar_dates: "Calendar dates",
82
83
  custom_axis_label: "Axis Label",
83
84
  custom_label: "Label",
84
85
  custom_label_placeholder: "Type custom label",
86
+ end_date: "End Date",
85
87
  format_title: "Format",
88
+ include_starting: "Include starting date",
86
89
  max_range: "Max Range",
87
90
  max_range_placeholder: "Auto",
88
91
  min_range: "Min Range",
@@ -92,6 +95,7 @@ exports.I18N_CHART_BUILDER_STYLE_OPTIONS = {
92
95
  scale_type_linear: "Linear",
93
96
  scale_type_logarithm: "Logarithm",
94
97
  scale_type_placeholder: "Select color type",
98
+ start_date: "Start Date",
95
99
  steps: "Steps",
96
100
  steps_placeholder: "Auto",
97
101
  type_label: "Type",
@@ -8,6 +8,7 @@ const I18N_COLUMN_LABEL_1 = require("./I18N_COLUMN_LABEL");
8
8
  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
+ const I18N_RELATIVE_DATES_1 = require("./I18N_RELATIVE_DATES");
11
12
  exports.I18N_COMMON = {
12
13
  aggregates: "Aggregates",
13
14
  aggregate_labels: I18N_AGGREGATE_LABEL_1.I18N_AGGREGATE_LABEL,
@@ -38,14 +39,5 @@ exports.I18N_COMMON = {
38
39
  tokens: "Show Internationalization Labels",
39
40
  },
40
41
  },
41
- units: {
42
- day: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.DAY.label,
43
- hour: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.HOUR.label,
44
- minute: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.MINUTE.label,
45
- month: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.MONTH.label,
46
- quarter: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.QUARTER.label,
47
- second: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.SECOND.label,
48
- week: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.WEEK.label,
49
- year: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.YEAR.label,
50
- },
42
+ units: Object.assign({ day: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.DAY.label, hour: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.HOUR.label, minute: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.MINUTE.label, month: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.MONTH.label, quarter: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.QUARTER.label, second: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.SECOND.label, week: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.WEEK.label, year: RELATIVE_UNIT_INFO_1.RELATIVE_UNIT_INFO.YEAR.label }, I18N_RELATIVE_DATES_1.I18N_RELATIVE_DATES),
51
43
  };
@@ -0,0 +1,2 @@
1
+ import { II18nRelativeDates } from "../../interfaces/common/II18nRelativeDates";
2
+ export declare const I18N_RELATIVE_DATES: II18nRelativeDates;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.I18N_RELATIVE_DATES = void 0;
4
+ exports.I18N_RELATIVE_DATES = {
5
+ auto: "Auto",
6
+ current_date: "Current Date",
7
+ fixed: "Fixed",
8
+ in_this: "In This",
9
+ the_last: "The Last",
10
+ the_next: "The Next",
11
+ };
@@ -1,6 +1,6 @@
1
1
  import { isEmpty } from "../../../general/mix/isEmpty";
2
2
  import { mergeDeep } from "../../../general/object/mergeDeep";
3
- import { objectCopy } from "../../../general/object/objectCopy";
3
+ import { cloneDeep } from "../../../general/object/cloneDeep";
4
4
  import { getFilterid } from "./getFilterid";
5
5
  import { getMergeFiltersSettings } from "./getMergeFiltersSettings";
6
6
  import { mergeValues } from "./mergeValues";
@@ -26,8 +26,8 @@ export function mergeFilters(filterData1, filterData2, settings) {
26
26
  }
27
27
  if (isEmpty(filterData2) || isEmpty(filterData2.scopes))
28
28
  return filterData1;
29
- const newFilterData1 = objectCopy(filterData1);
30
- const newFilterData2 = objectCopy(filterData2);
29
+ const newFilterData1 = cloneDeep(filterData1);
30
+ const newFilterData2 = cloneDeep(filterData2);
31
31
  const defaultSettings = getMergeFiltersSettings(settings);
32
32
  const scopes = mergeScopes(newFilterData1.scopes, newFilterData2.scopes, defaultSettings);
33
33
  if (defaultSettings.mergeFilterDataProps) {
@@ -1,5 +1,5 @@
1
1
  import { isObject } from "./isObject";
2
- import { objectCopy } from "./objectCopy";
2
+ import { cloneDeep } from "./cloneDeep";
3
3
  /**
4
4
  * Merges two objects into a new one.
5
5
  * The second given argument to the first given argument.
@@ -11,7 +11,7 @@ import { objectCopy } from "./objectCopy";
11
11
  export function mergeDeep(obj1, obj2, settings) {
12
12
  const defaultSettings = getParamsToMergeDeep(settings);
13
13
  if (!isValid(obj1, obj2))
14
- return objectCopy(obj1);
14
+ return cloneDeep(obj1);
15
15
  const result = Array.isArray(obj1) ? [] : {};
16
16
  for (const i in obj1) {
17
17
  if (isObject(obj1[i]) || Array.isArray(obj1[i])) {
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @deprecated since version 1.11.1. Qrvey version 8.2. This module generates a memory leak, so use a different solution at possible (cloneDeep)
2
3
  * Created a new reference of the given argument
3
4
  * @param entity The variable to be copied
4
5
  * @param cache
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @deprecated since version 1.11.1. Qrvey version 8.2. This module generates a memory leak, so use a different solution at possible (cloneDeep)
2
3
  * Created a new reference of the given argument
3
4
  * @param entity The variable to be copied
4
5
  * @param cache
@@ -1,5 +1,5 @@
1
1
  import { isObject } from "./isObject";
2
- import { objectCopy } from "./objectCopy";
2
+ import { cloneDeep } from "./cloneDeep";
3
3
  /**
4
4
  * Removes and returns the given object cleaning the undefined values
5
5
  * @param obj an object
@@ -9,7 +9,7 @@ export function removeUndefinedDeep(obj) {
9
9
  const isArray = Array.isArray(obj);
10
10
  if (obj == null || (!isObject(obj) && !isArray))
11
11
  return obj;
12
- let _obj = objectCopy(obj);
12
+ let _obj = cloneDeep(obj);
13
13
  if (isArray)
14
14
  _obj = _obj.filter(Boolean);
15
15
  Object.keys(_obj).forEach((key) => {
@@ -4,10 +4,13 @@ export interface II18nChartBuilderAxisStyle {
4
4
  axis_position_left: string;
5
5
  axis_position_primary_axis: string;
6
6
  axis_position_right: string;
7
+ calendar_dates: string;
7
8
  custom_axis_label: string;
8
9
  custom_label: string;
9
10
  custom_label_placeholder: string;
11
+ end_date: string;
10
12
  format_title: string;
13
+ include_starting: string;
11
14
  max_range: string;
12
15
  max_range_placeholder: string;
13
16
  min_range: string;
@@ -17,6 +20,7 @@ export interface II18nChartBuilderAxisStyle {
17
20
  scale_type_linear: string;
18
21
  scale_type_logarithm: string;
19
22
  scale_type_placeholder: string;
23
+ start_date: string;
20
24
  steps: string;
21
25
  steps_placeholder: string;
22
26
  type_label: string;
@@ -0,0 +1,8 @@
1
+ export interface II18nRelativeDates {
2
+ auto: string;
3
+ current_date: string;
4
+ fixed: string;
5
+ in_this: string;
6
+ the_last: string;
7
+ the_next: string;
8
+ }
@@ -7,4 +7,10 @@ export interface II18nUnits {
7
7
  second: string;
8
8
  week: string;
9
9
  year: string;
10
+ auto: string;
11
+ current_date: string;
12
+ fixed: string;
13
+ in_this: string;
14
+ the_last: string;
15
+ the_next: string;
10
16
  }
@@ -76,10 +76,13 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS = {
76
76
  axis_position_left: "Left",
77
77
  axis_position_primary_axis: "Use Primary Axis",
78
78
  axis_position_right: "Right",
79
+ calendar_dates: "Calendar dates",
79
80
  custom_axis_label: "Axis Label",
80
81
  custom_label: "Label",
81
82
  custom_label_placeholder: "Type custom label",
83
+ end_date: "End Date",
82
84
  format_title: "Format",
85
+ include_starting: "Include starting date",
83
86
  max_range: "Max Range",
84
87
  max_range_placeholder: "Auto",
85
88
  min_range: "Min Range",
@@ -89,6 +92,7 @@ export const I18N_CHART_BUILDER_STYLE_OPTIONS = {
89
92
  scale_type_linear: "Linear",
90
93
  scale_type_logarithm: "Logarithm",
91
94
  scale_type_placeholder: "Select color type",
95
+ start_date: "Start Date",
92
96
  steps: "Steps",
93
97
  steps_placeholder: "Auto",
94
98
  type_label: "Type",
@@ -5,6 +5,7 @@ import { I18N_COLUMN_LABEL } from "./I18N_COLUMN_LABEL";
5
5
  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
+ import { I18N_RELATIVE_DATES } from "./I18N_RELATIVE_DATES";
8
9
  export const I18N_COMMON = {
9
10
  aggregates: "Aggregates",
10
11
  aggregate_labels: I18N_AGGREGATE_LABEL,
@@ -35,14 +36,5 @@ export const I18N_COMMON = {
35
36
  tokens: "Show Internationalization Labels",
36
37
  },
37
38
  },
38
- units: {
39
- day: RELATIVE_UNIT_INFO.DAY.label,
40
- hour: RELATIVE_UNIT_INFO.HOUR.label,
41
- minute: RELATIVE_UNIT_INFO.MINUTE.label,
42
- month: RELATIVE_UNIT_INFO.MONTH.label,
43
- quarter: RELATIVE_UNIT_INFO.QUARTER.label,
44
- second: RELATIVE_UNIT_INFO.SECOND.label,
45
- week: RELATIVE_UNIT_INFO.WEEK.label,
46
- year: RELATIVE_UNIT_INFO.YEAR.label,
47
- },
39
+ units: Object.assign({ day: RELATIVE_UNIT_INFO.DAY.label, hour: RELATIVE_UNIT_INFO.HOUR.label, minute: RELATIVE_UNIT_INFO.MINUTE.label, month: RELATIVE_UNIT_INFO.MONTH.label, quarter: RELATIVE_UNIT_INFO.QUARTER.label, second: RELATIVE_UNIT_INFO.SECOND.label, week: RELATIVE_UNIT_INFO.WEEK.label, year: RELATIVE_UNIT_INFO.YEAR.label }, I18N_RELATIVE_DATES),
48
40
  };
@@ -0,0 +1,2 @@
1
+ import { II18nRelativeDates } from "../../interfaces/common/II18nRelativeDates";
2
+ export declare const I18N_RELATIVE_DATES: II18nRelativeDates;
@@ -0,0 +1,8 @@
1
+ export const I18N_RELATIVE_DATES = {
2
+ auto: "Auto",
3
+ current_date: "Current Date",
4
+ fixed: "Fixed",
5
+ in_this: "In This",
6
+ the_last: "The Last",
7
+ the_next: "The Next",
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
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",