@qrvey/utils 1.13.0-7 → 1.112.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 (144) hide show
  1. package/README.md +2173 -2649
  2. package/dist/charts/adapters/endpointData.js +1 -1
  3. package/dist/charts/adapters/endpointDataGet.js +1 -1
  4. package/dist/cjs/charts/adapters/endpointData.js +1 -1
  5. package/dist/cjs/charts/adapters/endpointDataGet.js +1 -1
  6. package/dist/cjs/dates/adapters/dateToMonthYear.js +1 -3
  7. package/dist/cjs/dates/constants/index.d.ts +0 -1
  8. package/dist/cjs/dates/constants/index.js +0 -1
  9. package/dist/cjs/dates/relative/RelativeStatementAdapter.d.ts +1 -1
  10. package/dist/cjs/dates/relative/RelativeStatementAdapter.js +1 -2
  11. package/dist/cjs/dates/relative/relative.d.ts +4 -3
  12. package/dist/cjs/dates/relative/relative.js +9 -5
  13. package/dist/cjs/filters/constants/common/FILTER_SCOPE.d.ts +8 -8
  14. package/dist/cjs/filters/services/Filters.api.js +7 -4
  15. package/dist/cjs/filters/services/UChartApi.d.ts +1 -1
  16. package/dist/cjs/filters/services/UChartApi.js +1 -2
  17. package/dist/cjs/filters/services/UChartPaginationApi.d.ts +1 -1
  18. package/dist/cjs/filters/services/UChartPaginationApi.js +2 -3
  19. package/dist/cjs/general/object/objectCopy.d.ts +5 -4
  20. package/dist/cjs/general/object/objectCopy.js +26 -16
  21. package/dist/cjs/services/api/getAllQrveys.api.d.ts +1 -1
  22. package/dist/cjs/services/helpers/getDefaultQuestionListOptionsAttributes.js +7 -7
  23. package/dist/cjs/services/interfaces/IPayloadQrveyAll.d.ts +1 -1
  24. package/dist/cjs/themes/constants/AUTOMATIC_CSS_VARIABLES.d.ts +0 -2
  25. package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.d.ts +0 -1
  26. package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.js +0 -1
  27. package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.d.ts +0 -1
  28. package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.js +0 -1
  29. package/dist/cjs/themes/constants/COLOR_TYPE.d.ts +0 -3
  30. package/dist/cjs/themes/constants/COLOR_TYPE.js +0 -3
  31. package/dist/cjs/themes/constants/CSS_VARIABLE_DESTINATION.d.ts +0 -3
  32. package/dist/cjs/themes/constants/CSS_VARIABLE_DESTINATION.js +0 -3
  33. package/dist/cjs/themes/constants/GLOBAL_CSS_VARIABLES.d.ts +1 -2
  34. package/dist/cjs/themes/constants/GLOBAL_CSS_VARIABLES.js +0 -1
  35. package/dist/cjs/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.d.ts +0 -3
  36. package/dist/cjs/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.js +0 -3
  37. package/dist/cjs/themes/constants/RGBA_REGULAR_EXPRESION.d.ts +0 -3
  38. package/dist/cjs/themes/constants/RGBA_REGULAR_EXPRESION.js +0 -3
  39. package/dist/cjs/themes/constants/index.d.ts +0 -4
  40. package/dist/cjs/themes/constants/index.js +0 -4
  41. package/dist/cjs/themes/helpers/getCSSVariablesByDestination.d.ts +6 -3
  42. package/dist/cjs/themes/helpers/getCSSVariablesByDestination.js +0 -3
  43. package/dist/cjs/themes/helpers/index.d.ts +1 -6
  44. package/dist/cjs/themes/helpers/index.js +1 -6
  45. package/dist/cjs/themes/helpers/isHexadecimalColor.js +1 -2
  46. package/dist/cjs/themes/helpers/isRGBAColor.js +1 -2
  47. package/dist/cjs/themes/helpers/lightOrDark.js +30 -14
  48. package/dist/cjs/themes/helpers/setAutomaticCSSVariablesForDark.js +1 -1
  49. package/dist/cjs/themes/interfaces/IColorCSSVariableDestination.d.ts +0 -3
  50. package/dist/cjs/themes/interfaces/IColorType.d.ts +0 -3
  51. package/dist/cjs/themes/interfaces/index.d.ts +0 -1
  52. package/dist/cjs/themes/interfaces/index.js +0 -1
  53. package/dist/dates/adapters/dateToMonthYear.js +1 -3
  54. package/dist/dates/constants/index.d.ts +0 -1
  55. package/dist/dates/constants/index.js +0 -1
  56. package/dist/dates/relative/RelativeStatementAdapter.d.ts +1 -1
  57. package/dist/dates/relative/RelativeStatementAdapter.js +1 -1
  58. package/dist/dates/relative/relative.d.ts +4 -3
  59. package/dist/dates/relative/relative.js +5 -4
  60. package/dist/filters/constants/common/FILTER_SCOPE.d.ts +8 -8
  61. package/dist/filters/services/Filters.api.js +2 -2
  62. package/dist/filters/services/UChartApi.d.ts +1 -1
  63. package/dist/filters/services/UChartApi.js +2 -1
  64. package/dist/filters/services/UChartPaginationApi.d.ts +1 -1
  65. package/dist/filters/services/UChartPaginationApi.js +3 -2
  66. package/dist/general/object/objectCopy.d.ts +5 -4
  67. package/dist/general/object/objectCopy.js +26 -16
  68. package/dist/services/api/getAllQrveys.api.d.ts +1 -1
  69. package/dist/services/helpers/getDefaultQuestionListOptionsAttributes.js +7 -7
  70. package/dist/services/interfaces/IPayloadQrveyAll.d.ts +1 -1
  71. package/dist/themes/constants/AUTOMATIC_CSS_VARIABLES.d.ts +0 -2
  72. package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.d.ts +0 -1
  73. package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.js +0 -1
  74. package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.d.ts +0 -1
  75. package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.js +0 -1
  76. package/dist/themes/constants/COLOR_TYPE.d.ts +0 -3
  77. package/dist/themes/constants/COLOR_TYPE.js +0 -3
  78. package/dist/themes/constants/CSS_VARIABLE_DESTINATION.d.ts +0 -3
  79. package/dist/themes/constants/CSS_VARIABLE_DESTINATION.js +0 -3
  80. package/dist/themes/constants/GLOBAL_CSS_VARIABLES.d.ts +1 -2
  81. package/dist/themes/constants/GLOBAL_CSS_VARIABLES.js +0 -1
  82. package/dist/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.d.ts +0 -3
  83. package/dist/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.js +0 -3
  84. package/dist/themes/constants/RGBA_REGULAR_EXPRESION.d.ts +0 -3
  85. package/dist/themes/constants/RGBA_REGULAR_EXPRESION.js +0 -3
  86. package/dist/themes/constants/index.d.ts +0 -4
  87. package/dist/themes/constants/index.js +0 -4
  88. package/dist/themes/helpers/getCSSVariablesByDestination.d.ts +6 -3
  89. package/dist/themes/helpers/getCSSVariablesByDestination.js +0 -3
  90. package/dist/themes/helpers/index.d.ts +1 -6
  91. package/dist/themes/helpers/index.js +1 -6
  92. package/dist/themes/helpers/isHexadecimalColor.js +1 -2
  93. package/dist/themes/helpers/isRGBAColor.js +1 -2
  94. package/dist/themes/helpers/lightOrDark.js +30 -14
  95. package/dist/themes/helpers/setAutomaticCSSVariablesForDark.js +1 -1
  96. package/dist/themes/interfaces/IColorCSSVariableDestination.d.ts +0 -3
  97. package/dist/themes/interfaces/IColorType.d.ts +0 -3
  98. package/dist/themes/interfaces/index.d.ts +0 -1
  99. package/dist/themes/interfaces/index.js +0 -1
  100. package/package.json +17 -20
  101. package/dist/cjs/dates/constants/INTL_DATE_FORMATS.d.ts +0 -1
  102. package/dist/cjs/dates/constants/INTL_DATE_FORMATS.js +0 -8
  103. package/dist/cjs/themes/constants/CHANNEL_BLACK_COLOR.d.ts +0 -5
  104. package/dist/cjs/themes/constants/CHANNEL_BLACK_COLOR.js +0 -12
  105. package/dist/cjs/themes/constants/CHANNEL_WHITE_COLOR.d.ts +0 -5
  106. package/dist/cjs/themes/constants/CHANNEL_WHITE_COLOR.js +0 -12
  107. package/dist/cjs/themes/constants/COLOR_NAME.d.ts +0 -154
  108. package/dist/cjs/themes/constants/COLOR_NAME.js +0 -157
  109. package/dist/cjs/themes/helpers/calculateHSP.d.ts +0 -8
  110. package/dist/cjs/themes/helpers/calculateHSP.js +0 -20
  111. package/dist/cjs/themes/helpers/getChannelsByHexadecimalColor.d.ts +0 -8
  112. package/dist/cjs/themes/helpers/getChannelsByHexadecimalColor.js +0 -26
  113. package/dist/cjs/themes/helpers/getChannelsByNameColor.d.ts +0 -8
  114. package/dist/cjs/themes/helpers/getChannelsByNameColor.js +0 -26
  115. package/dist/cjs/themes/helpers/getChannelsByRgbaColor.d.ts +0 -8
  116. package/dist/cjs/themes/helpers/getChannelsByRgbaColor.js +0 -25
  117. package/dist/cjs/themes/helpers/getHexadecimalOpacity.d.ts +0 -7
  118. package/dist/cjs/themes/helpers/getHexadecimalOpacity.js +0 -19
  119. package/dist/cjs/themes/helpers/getRgbaOpacity.d.ts +0 -7
  120. package/dist/cjs/themes/helpers/getRgbaOpacity.js +0 -21
  121. package/dist/cjs/themes/interfaces/IColorChannel.d.ts +0 -9
  122. package/dist/cjs/themes/interfaces/IColorChannel.js +0 -2
  123. package/dist/dates/constants/INTL_DATE_FORMATS.d.ts +0 -1
  124. package/dist/dates/constants/INTL_DATE_FORMATS.js +0 -5
  125. package/dist/themes/constants/CHANNEL_BLACK_COLOR.d.ts +0 -5
  126. package/dist/themes/constants/CHANNEL_BLACK_COLOR.js +0 -9
  127. package/dist/themes/constants/CHANNEL_WHITE_COLOR.d.ts +0 -5
  128. package/dist/themes/constants/CHANNEL_WHITE_COLOR.js +0 -9
  129. package/dist/themes/constants/COLOR_NAME.d.ts +0 -154
  130. package/dist/themes/constants/COLOR_NAME.js +0 -154
  131. package/dist/themes/helpers/calculateHSP.d.ts +0 -8
  132. package/dist/themes/helpers/calculateHSP.js +0 -16
  133. package/dist/themes/helpers/getChannelsByHexadecimalColor.d.ts +0 -8
  134. package/dist/themes/helpers/getChannelsByHexadecimalColor.js +0 -22
  135. package/dist/themes/helpers/getChannelsByNameColor.d.ts +0 -8
  136. package/dist/themes/helpers/getChannelsByNameColor.js +0 -22
  137. package/dist/themes/helpers/getChannelsByRgbaColor.d.ts +0 -8
  138. package/dist/themes/helpers/getChannelsByRgbaColor.js +0 -21
  139. package/dist/themes/helpers/getHexadecimalOpacity.d.ts +0 -7
  140. package/dist/themes/helpers/getHexadecimalOpacity.js +0 -15
  141. package/dist/themes/helpers/getRgbaOpacity.d.ts +0 -7
  142. package/dist/themes/helpers/getRgbaOpacity.js +0 -17
  143. package/dist/themes/interfaces/IColorChannel.d.ts +0 -9
  144. package/dist/themes/interfaces/IColorChannel.js +0 -1
@@ -3,10 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lightOrDark = void 0;
4
4
  const isEmpty_1 = require("../../general/mix/isEmpty");
5
5
  const COLOR_TYPE_1 = require("../constants/COLOR_TYPE");
6
- const calculateHSP_1 = require("./calculateHSP");
7
- const getChannelsByHexadecimalColor_1 = require("./getChannelsByHexadecimalColor");
8
- const getChannelsByNameColor_1 = require("./getChannelsByNameColor");
9
- const getChannelsByRgbaColor_1 = require("./getChannelsByRgbaColor");
6
+ const RGBA_REGULAR_EXPRESION_1 = require("../constants/RGBA_REGULAR_EXPRESION");
10
7
  const isHexadecimalColor_1 = require("./isHexadecimalColor");
11
8
  const isRGBAColor_1 = require("./isRGBAColor");
12
9
  /**
@@ -17,24 +14,43 @@ const isRGBAColor_1 = require("./isRGBAColor");
17
14
  * @returns the color type (Dark or Light)
18
15
  */
19
16
  function lightOrDark(color, brightnessThreshold = 127.5, opacityThreshold = 0.5) {
20
- if ((0, isEmpty_1.isEmpty)(color) || typeof color !== "string")
17
+ if ((0, isEmpty_1.isEmpty)(color))
21
18
  return COLOR_TYPE_1.COLOR_TYPE.LIGHT;
22
- let rgbaChannel = { r: 0, g: 0, b: 0, a: 1 };
23
19
  const rgbaColor = (0, isRGBAColor_1.isRGBAColor)(color);
24
20
  const hexadecimalColor = (0, isHexadecimalColor_1.isHexadecimalColor)(color);
21
+ if (!rgbaColor && !hexadecimalColor)
22
+ return;
23
+ let r, g, b, a;
25
24
  if (rgbaColor) {
26
- rgbaChannel = (0, getChannelsByRgbaColor_1.getChannelsByRgbaColor)(color);
25
+ const colors = color.match(RGBA_REGULAR_EXPRESION_1.RGBA_REGULAR_EXPRESSION);
26
+ r = Number(colors[1]);
27
+ g = Number(colors[2]);
28
+ b = Number(colors[3]);
29
+ a = rgbaOpacity(color);
27
30
  }
28
- else if (hexadecimalColor) {
29
- rgbaChannel = (0, getChannelsByHexadecimalColor_1.getChannelsByHexadecimalColor)(color);
31
+ if (hexadecimalColor) {
32
+ const colorCode = +`0x${color
33
+ .slice(1)
34
+ .replace(color.length < 5 && /./g, "$&$&")}`;
35
+ r = colorCode >> 16;
36
+ g = (colorCode >> 8) & 255;
37
+ b = colorCode & 255;
38
+ a = hexadecimalOpacity(color);
30
39
  }
31
- else {
32
- rgbaChannel = (0, getChannelsByNameColor_1.getChannelsByNameColor)(color);
33
- }
34
- const hsp = (0, calculateHSP_1.calculateHSP)(rgbaChannel);
35
- if (hsp > brightnessThreshold || rgbaChannel.a < opacityThreshold) {
40
+ // HSP equation from http://alienryderflex.com/hsp.html
41
+ const hsp = Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b));
42
+ if (hsp > brightnessThreshold || a < opacityThreshold) {
36
43
  return COLOR_TYPE_1.COLOR_TYPE.LIGHT;
37
44
  }
38
45
  return COLOR_TYPE_1.COLOR_TYPE.DARK;
39
46
  }
40
47
  exports.lightOrDark = lightOrDark;
48
+ function hexadecimalOpacity(hexadecimal) {
49
+ const opacityHexa = hexadecimal.slice(7) || "FF";
50
+ return parseInt(opacityHexa, 16) / 255;
51
+ }
52
+ function rgbaOpacity(rgba) {
53
+ var _a;
54
+ const colors = rgba.match(RGBA_REGULAR_EXPRESION_1.RGBA_REGULAR_EXPRESSION);
55
+ return (_a = Number(colors[4])) !== null && _a !== void 0 ? _a : 1;
56
+ }
@@ -11,7 +11,7 @@ const getCSSVariablesByDestination_1 = require("./getCSSVariablesByDestination")
11
11
  * @param wrapperTags the html elements to set the CSS variables
12
12
  */
13
13
  function setAutomaticCSSVariablesForDark(colorType, wrapperTags, destination = CSS_VARIABLE_DESTINATION_1.CSS_VARIABLE_DESTINATION.GLOBAL) {
14
- if ((0, isEmpty_1.isEmpty)(colorType) || !Array.isArray(wrapperTags))
14
+ if ((0, isEmpty_1.isEmpty)(colorType) || (0, isEmpty_1.isEmpty)(wrapperTags))
15
15
  return;
16
16
  const cssVariables = (0, getCSSVariablesByDestination_1.getCSSVariablesByDestination)(destination);
17
17
  const cssVariablesKeys = Object.keys(cssVariables[colorType] || {});
@@ -1,5 +1,2 @@
1
1
  import { CSS_VARIABLE_DESTINATION } from "../constants/CSS_VARIABLE_DESTINATION";
2
- /**
3
- * CSS Variable Destination types
4
- */
5
2
  export type IColorCSSVariableDestination = CSS_VARIABLE_DESTINATION;
@@ -1,5 +1,2 @@
1
1
  import { COLOR_TYPE } from "../constants/COLOR_TYPE";
2
- /**
3
- * Color types
4
- */
5
2
  export type IColorType = COLOR_TYPE;
@@ -1,3 +1,2 @@
1
- export * from "./IColorChannel";
2
1
  export * from "./IColorCSSVariableDestination";
3
2
  export * from "./IColorType";
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./IColorChannel"), exports);
18
17
  __exportStar(require("./IColorCSSVariableDestination"), exports);
19
18
  __exportStar(require("./IColorType"), exports);
@@ -1,5 +1,4 @@
1
1
  import { DATE_YEAR_MONTHS } from "../constants/DATE_YEAR_MONTHS";
2
- import { INTL_YEAR_FORMAT } from "../constants/INTL_DATE_FORMATS";
3
2
  import { getDateByTimezone } from "../helpers/getDateByTimezone";
4
3
  import { getDefaultDateSettings } from "../helpers/getDefaultDateSettings";
5
4
  import { isValidDateObject } from "../helpers/isValidDateObject";
@@ -18,6 +17,5 @@ export function dateToMonthYear(date, settings) {
18
17
  const dt = new Date(timezonedDate.valueOf());
19
18
  if (!isValidDateObject(dt))
20
19
  return date;
21
- const year = INTL_YEAR_FORMAT.format(dt.getFullYear());
22
- return `${DATE_YEAR_MONTHS[dt.getMonth()]} ${year}`;
20
+ return `${DATE_YEAR_MONTHS[dt.getMonth()]} ${dt.getFullYear()}`;
23
21
  }
@@ -42,4 +42,3 @@ export * from "./ISO_8601_REGEX";
42
42
  export * from "./TIME_GROUPING_PROPERTY_INFO_LIST";
43
43
  export * from "./TIME_GROUPING_PROPERTY_INFO";
44
44
  export * from "./TIME_GROUPING_PROPERTY_LABEL";
45
- export * from "./INTL_DATE_FORMATS";
@@ -42,4 +42,3 @@ export * from "./ISO_8601_REGEX";
42
42
  export * from "./TIME_GROUPING_PROPERTY_INFO_LIST";
43
43
  export * from "./TIME_GROUPING_PROPERTY_INFO";
44
44
  export * from "./TIME_GROUPING_PROPERTY_LABEL";
45
- export * from "./INTL_DATE_FORMATS";
@@ -1,7 +1,7 @@
1
1
  import { AbsoluteStatement } from "./interfaces/AbsoluteStatement";
2
2
  import { RelativeInput } from "./interfaces/RelativeInput";
3
3
  import { RelativeToAbsoluteStruct } from "./interfaces/RelativeToAbsoluteStruct";
4
- export declare class RelativeStatementAdapter {
4
+ export default class RelativeStatementAdapter {
5
5
  statement: RelativeInput;
6
6
  now: Date;
7
7
  constructor(statement: RelativeInput, now?: Date);
@@ -6,7 +6,7 @@ import { getStatementCase } from "./helpers/getStatementCase";
6
6
  import { DATE_GROUPING_PROPERTY } from "../constants/DATE_GROUPING_PROPERTY";
7
7
  import { parseDate } from "./helpers/parseDate";
8
8
  import { DATETIME_FORMAT } from "./constants/DATE_FORMATS";
9
- export class RelativeStatementAdapter {
9
+ export default class RelativeStatementAdapter {
10
10
  constructor(statement, now = new Date()) {
11
11
  this.statement =
12
12
  typeof statement === "string" ? statement : formatStatement(statement);
@@ -14,8 +14,9 @@ import { RelativeStatement } from "./interfaces/RelativeStatement";
14
14
  *
15
15
  * Output:
16
16
  * { gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
17
- * @param statements - Raw statements/values
18
- * @param clock - Clock/time reference for relative date resolution
19
- * @returns
17
+ *
18
+ * @param {RelativeStatement[]|string[]} statements - Raw statements/values
19
+ * @param {Date} clock - Clock/time reference for relative date resolution
20
+ * @returns {AbsoluteRange[]|string[]}
20
21
  */
21
22
  export declare function resolveRelative(statements: RelativeStatement[], clock?: Date): (string | import("./interfaces").AbsoluteStatement)[];
@@ -1,4 +1,4 @@
1
- import { RelativeStatementAdapter } from "./RelativeStatementAdapter";
1
+ import RelativeStatementAdapter from "./RelativeStatementAdapter";
2
2
  /**
3
3
  * Resolve a list of relative statements according to operator
4
4
  * @example
@@ -14,9 +14,10 @@ import { RelativeStatementAdapter } from "./RelativeStatementAdapter";
14
14
  *
15
15
  * Output:
16
16
  * { gte: "03/06/2021 00:00:00", lte: "03/05/2022 23:59:59" }
17
- * @param statements - Raw statements/values
18
- * @param clock - Clock/time reference for relative date resolution
19
- * @returns
17
+ *
18
+ * @param {RelativeStatement[]|string[]} statements - Raw statements/values
19
+ * @param {Date} clock - Clock/time reference for relative date resolution
20
+ * @returns {AbsoluteRange[]|string[]}
20
21
  */
21
22
  export function resolveRelative(statements, clock = new Date()) {
22
23
  return statements.map((s) => new RelativeStatementAdapter(s, clock).value());
@@ -1,11 +1,11 @@
1
1
  export declare enum FILTER_SCOPE {
2
- ADMIN = "ADMIN",// Admin filters (TBD)
3
- DATA = "DATA",// User Management Filters a.k.a. Super Filters
4
- GLOBAL = "GLOBAL",// Analyze Filters | Filters for all pages on PB/EU
5
- PAGE = "PAGE",// PB/EU Filters for a single page
6
- TAB = "TAB",// PB/EU Filters for a single tab
7
- DEFAULT = "DEFAULT",// Filters created on Chart Builder
8
- CHART = "CHART",// PB/EU Filters for panels inside a page/tab
9
- ACTION = "ACTION",// Filters created with FilterBY or other actions
2
+ ADMIN = "ADMIN",
3
+ DATA = "DATA",
4
+ GLOBAL = "GLOBAL",
5
+ PAGE = "PAGE",
6
+ TAB = "TAB",
7
+ DEFAULT = "DEFAULT",
8
+ CHART = "CHART",
9
+ ACTION = "ACTION",
10
10
  FLOW = "FLOW"
11
11
  }
@@ -7,8 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { UChartPaginationApi } from "./UChartPaginationApi";
11
- import { UChartApi } from "./UChartApi";
10
+ import UChartPaginationApi from "./UChartPaginationApi";
11
+ import UChartApi from "./UChartApi";
12
12
  import { isRangeValidator } from "../helpers/common/isRangeValidator";
13
13
  import { getFiltersByVisibility } from "../helpers/common/getFiltersByVisibility";
14
14
  import { excludeFiltersByAggregateColumn } from "../helpers/common/excludeFiltersByAggregateColumn";
@@ -3,7 +3,7 @@ import { IFilterConfig } from "../interfaces/common/IFilterConfig";
3
3
  import { IFUFlattenedFilter } from "../interfaces/ui/IFUFlattenedFilter";
4
4
  import { IFBLogic } from "../interfaces/backend/IFBLogic";
5
5
  import { IFUChartSettings } from "../interfaces/ui/IFUChartSettings";
6
- export declare class UChartApi {
6
+ export default class UChartApi {
7
7
  /**
8
8
  * Gets a promise with a resulting data
9
9
  * @param config the config
@@ -11,7 +11,7 @@ import { FILTER_VALIDATOR } from "../constants/common/FILTER_VALIDATOR";
11
11
  import { flatUIToOldLogic } from "../adapters/flatUIToOldLogic";
12
12
  import ChartsApi from "../../services/api/Charts.api";
13
13
  import { getAggFilters } from "../helpers/OLD_getAggFilters";
14
- export class UChartApi {
14
+ class UChartApi {
15
15
  constructor() {
16
16
  /**
17
17
  * Gets a promise with a resulting data
@@ -294,3 +294,4 @@ UChartApi.isResultEmpty = (resultObject, validateNesteddata = false) => {
294
294
  }
295
295
  return validation;
296
296
  };
297
+ export default UChartApi;
@@ -4,7 +4,7 @@ import { IFUFlattenedFilter } from "../interfaces/ui/IFUFlattenedFilter";
4
4
  import { IFBLogic } from "../interfaces/backend/IFBLogic";
5
5
  import { IFUChartSettings } from "../interfaces/ui/IFUChartSettings";
6
6
  import { IFUColumn } from "../interfaces/ui/IFUColumn";
7
- export declare class UChartPaginationApi {
7
+ export default class UChartPaginationApi {
8
8
  afterKey: any;
9
9
  uFilter: IFUFlattenedFilter;
10
10
  /**
@@ -12,7 +12,7 @@ import { AGGREGATE } from "../../charts/constants/AGGREGATE";
12
12
  import { objectCopy } from "../../general/object/objectCopy";
13
13
  import { FILTER_VALIDATOR } from "../constants/common/FILTER_VALIDATOR";
14
14
  import { flatUIToOldLogic } from "../adapters/flatUIToOldLogic";
15
- export class UChartPaginationApi {
15
+ class UChartPaginationApi {
16
16
  constructor() {
17
17
  /**
18
18
  * Gets afterKey object
@@ -97,7 +97,7 @@ export class UChartPaginationApi {
97
97
  let searchLogic;
98
98
  if (!isEmpty(uFilter.values)) {
99
99
  searchLogic = flatUIToOldLogic([
100
- Object.assign(Object.assign({}, uFilter), { enabled: true, validator: UChartPaginationApi._getValidationType(uFilter.column, uFilter.validator), column: Object.assign({}, uFilter.column) }),
100
+ Object.assign(Object.assign({}, uFilter), { validator: UChartPaginationApi._getValidationType(uFilter.column, uFilter.validator), column: Object.assign({}, uFilter.column) }),
101
101
  ]);
102
102
  }
103
103
  return searchLogic;
@@ -326,3 +326,4 @@ UChartPaginationApi.isResultPaginationEmpty = (resultObject) => {
326
326
  const result = _get(resultObject, "data");
327
327
  return isEmpty(result);
328
328
  };
329
+ export default UChartPaginationApi;
@@ -1,6 +1,7 @@
1
1
  /**
2
- * The `objectCopy` function is a TypeScript function that creates a deep copy of an object or array.
3
- * @param {T} obj - The `obj` parameter is the object that you want to make a copy of.
4
- * @returns The function `objectCopy` returns a deep copy of the input object `obj`.
2
+ * Created a new reference of the given argument
3
+ * @param entity The variable to be copied
4
+ * @param cache
5
+ * @returns A new reference of the given argument
5
6
  */
6
- export declare function objectCopy<T = any>(obj: T): T;
7
+ export declare function objectCopy<T = any>(entity: T, cache?: WeakMap<object, any>): T;
@@ -1,21 +1,31 @@
1
1
  /**
2
- * The `objectCopy` function is a TypeScript function that creates a deep copy of an object or array.
3
- * @param {T} obj - The `obj` parameter is the object that you want to make a copy of.
4
- * @returns The function `objectCopy` returns a deep copy of the input object `obj`.
2
+ * Created a new reference of the given argument
3
+ * @param entity The variable to be copied
4
+ * @param cache
5
+ * @returns A new reference of the given argument
5
6
  */
6
- export function objectCopy(obj) {
7
- if (obj === null || typeof obj !== "object") {
8
- return obj;
7
+ export function objectCopy(entity, cache) {
8
+ if (!isClonable(entity))
9
+ return entity;
10
+ const newCache = cache ? cache : new WeakMap();
11
+ if (newCache.has(entity))
12
+ return newCache.get(entity);
13
+ const c = new entity.constructor();
14
+ if (c.name === "Date")
15
+ return new Date(entity);
16
+ if (entity instanceof Map) {
17
+ entity.forEach((value, key) => c.set(objectCopy(key, newCache), objectCopy(value, newCache)));
9
18
  }
10
- if (Array.isArray(obj)) {
11
- const newArray = obj.map((item) => objectCopy(item));
12
- return newArray;
19
+ if (entity instanceof Set) {
20
+ entity.forEach((value) => c.add(objectCopy(value, newCache)));
13
21
  }
14
- const clonedObj = {};
15
- for (const key in obj) {
16
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
17
- clonedObj[key] = objectCopy(obj[key]);
18
- }
19
- }
20
- return clonedObj;
22
+ newCache.set(entity, c);
23
+ return Object.assign(c, ...Object.keys(entity).map((prop) => ({
24
+ [prop]: objectCopy(entity[prop], newCache),
25
+ })));
26
+ }
27
+ function isClonable(entity) {
28
+ const referenceTypes = ["Array", "Object", "Map", "Set", "Date"];
29
+ const entityName = entity && entity.constructor.name;
30
+ return referenceTypes.includes(entityName);
21
31
  }
@@ -1,4 +1,4 @@
1
- import { IPayloadQrveyAll } from "../interfaces/IPayloadQrveyAll";
1
+ import IPayloadQrveyAll from "../interfaces/IPayloadQrveyAll";
2
2
  /**
3
3
  * Request function for getting Qrveys such as Web Forms and Datasets. Use params for getting precise data
4
4
  * @param config Configuration
@@ -10,13 +10,13 @@ export function getDefaultQuestionListOptionsAttributes() {
10
10
  "formulaType",
11
11
  "geogroup",
12
12
  "outputFormat",
13
- "answers", // For multiples webform column types
14
- "imageUploadOption", // For Image upload
15
- "sliderVal", // For slidebar
16
- "value", // For lookup
17
- "activeCat", // For Expressions
18
- "words", // For Expressions with disabled categories
19
- "negative", // For Expressions with enabled categories
13
+ "answers",
14
+ "imageUploadOption",
15
+ "sliderVal",
16
+ "value",
17
+ "activeCat",
18
+ "words",
19
+ "negative",
20
20
  "positive", // For Expressions with enabled categories
21
21
  ];
22
22
  }
@@ -1,4 +1,4 @@
1
- export interface IPayloadQrveyAll {
1
+ export default interface IPayloadQrveyAll {
2
2
  sortby?: string;
3
3
  sortdir?: string;
4
4
  status: string | string[];
@@ -14,7 +14,6 @@ export declare const AUTOMATIC_CANVAS_CSS_VARIABLES: {
14
14
  "--qv-global-text-color": string;
15
15
  "--qv-global-text-secondary-color": string;
16
16
  "--qv-global-text-tertiary-color": string;
17
- "--qv-global-info-color": string;
18
17
  };
19
18
  LIGHT: {
20
19
  "--qv-global-header-background-color": string;
@@ -27,7 +26,6 @@ export declare const AUTOMATIC_CANVAS_CSS_VARIABLES: {
27
26
  "--qv-global-text-color": any;
28
27
  "--qv-global-text-secondary-color": string;
29
28
  "--qv-global-text-tertiary-color": string;
30
- "--qv-global-info-color": any;
31
29
  };
32
30
  };
33
31
  CANVAS: {
@@ -12,5 +12,4 @@ export declare const AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK: {
12
12
  "--qv-global-text-color": string;
13
13
  "--qv-global-text-secondary-color": string;
14
14
  "--qv-global-text-tertiary-color": string;
15
- "--qv-global-info-color": string;
16
15
  };
@@ -13,5 +13,4 @@ export const AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK = {
13
13
  [GLOBAL_CSS_VARIABLES.TEXT_COLOR]: "#FFFFFF",
14
14
  [GLOBAL_CSS_VARIABLES.TEXT_SECONDARY_COLOR]: "#FFFFFF90",
15
15
  [GLOBAL_CSS_VARIABLES.TEXT_TERTIARY_COLOR]: "#FFFFFF80",
16
- [GLOBAL_CSS_VARIABLES.INFO_COLOR]: "#FFFFFFCC",
17
16
  };
@@ -12,5 +12,4 @@ export declare const AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT: {
12
12
  "--qv-global-text-color": any;
13
13
  "--qv-global-text-secondary-color": string;
14
14
  "--qv-global-text-tertiary-color": string;
15
- "--qv-global-info-color": any;
16
15
  };
@@ -13,5 +13,4 @@ export const AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT = {
13
13
  [GLOBAL_CSS_VARIABLES.TEXT_COLOR]: undefined,
14
14
  [GLOBAL_CSS_VARIABLES.TEXT_SECONDARY_COLOR]: "#00000080",
15
15
  [GLOBAL_CSS_VARIABLES.TEXT_TERTIARY_COLOR]: "#00000070",
16
- [GLOBAL_CSS_VARIABLES.INFO_COLOR]: undefined,
17
16
  };
@@ -1,6 +1,3 @@
1
- /**
2
- * The color luminosity type
3
- */
4
1
  export declare enum COLOR_TYPE {
5
2
  DARK = "DARK",
6
3
  LIGHT = "LIGHT"
@@ -1,6 +1,3 @@
1
- /**
2
- * The color luminosity type
3
- */
4
1
  export var COLOR_TYPE;
5
2
  (function (COLOR_TYPE) {
6
3
  COLOR_TYPE["DARK"] = "DARK";
@@ -1,6 +1,3 @@
1
- /**
2
- * The Destination places to inject the css variables
3
- */
4
1
  export declare enum CSS_VARIABLE_DESTINATION {
5
2
  CANVAS = "CANVAS",
6
3
  GLOBAL = "GLOBAL"
@@ -1,6 +1,3 @@
1
- /**
2
- * The Destination places to inject the css variables
3
- */
4
1
  export var CSS_VARIABLE_DESTINATION;
5
2
  (function (CSS_VARIABLE_DESTINATION) {
6
3
  CSS_VARIABLE_DESTINATION["CANVAS"] = "CANVAS";
@@ -11,6 +11,5 @@ export declare enum GLOBAL_CSS_VARIABLES {
11
11
  PILLS_BACKGROUND_COLOR = "--qv-pills-background-color",
12
12
  TEXT_COLOR = "--qv-global-text-color",
13
13
  TEXT_SECONDARY_COLOR = "--qv-global-text-secondary-color",
14
- TEXT_TERTIARY_COLOR = "--qv-global-text-tertiary-color",
15
- INFO_COLOR = "--qv-global-info-color"
14
+ TEXT_TERTIARY_COLOR = "--qv-global-text-tertiary-color"
16
15
  }
@@ -13,5 +13,4 @@ export var GLOBAL_CSS_VARIABLES;
13
13
  GLOBAL_CSS_VARIABLES["TEXT_COLOR"] = "--qv-global-text-color";
14
14
  GLOBAL_CSS_VARIABLES["TEXT_SECONDARY_COLOR"] = "--qv-global-text-secondary-color";
15
15
  GLOBAL_CSS_VARIABLES["TEXT_TERTIARY_COLOR"] = "--qv-global-text-tertiary-color";
16
- GLOBAL_CSS_VARIABLES["INFO_COLOR"] = "--qv-global-info-color";
17
16
  })(GLOBAL_CSS_VARIABLES || (GLOBAL_CSS_VARIABLES = {}));
@@ -1,4 +1 @@
1
- /**
2
- * Hexadecimal Regular Expression
3
- */
4
1
  export declare const HEXADECIMAL_REGULAR_EXPRESSION: RegExp;
@@ -1,4 +1 @@
1
- /**
2
- * Hexadecimal Regular Expression
3
- */
4
1
  export const HEXADECIMAL_REGULAR_EXPRESSION = /^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/;
@@ -1,4 +1 @@
1
- /**
2
- * RGBA Regular Expression
3
- */
4
1
  export declare const RGBA_REGULAR_EXPRESSION: RegExp;
@@ -1,4 +1 @@
1
- /**
2
- * RGBA Regular Expression
3
- */
4
1
  export const RGBA_REGULAR_EXPRESSION = /^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/;
@@ -3,10 +3,6 @@ export * from "./AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT";
3
3
  export * from "./AUTOMATIC_CSS_VARIABLES";
4
4
  export * from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK";
5
5
  export * from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT";
6
- export * from "./CANVAS_CSS_VARIABLES";
7
- export * from "./CHANNEL_BLACK_COLOR";
8
- export * from "./CHANNEL_WHITE_COLOR";
9
- export * from "./COLOR_NAME";
10
6
  export * from "./COLOR_TYPE";
11
7
  export * from "./CSS_VARIABLE_DESTINATION";
12
8
  export * from "./GLOBAL_CSS_VARIABLES";
@@ -3,10 +3,6 @@ export * from "./AUTOMATIC_CANVAS_CSS_VARIABLES_FOR_LIGHT";
3
3
  export * from "./AUTOMATIC_CSS_VARIABLES";
4
4
  export * from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK";
5
5
  export * from "./AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT";
6
- export * from "./CANVAS_CSS_VARIABLES";
7
- export * from "./CHANNEL_BLACK_COLOR";
8
- export * from "./CHANNEL_WHITE_COLOR";
9
- export * from "./COLOR_NAME";
10
6
  export * from "./COLOR_TYPE";
11
7
  export * from "./CSS_VARIABLE_DESTINATION";
12
8
  export * from "./GLOBAL_CSS_VARIABLES";
@@ -7,7 +7,12 @@ import { IColorCSSVariableDestination } from "../interfaces/IColorCSSVariableDes
7
7
  */
8
8
  export declare function getCSSVariablesByDestination(destination?: IColorCSSVariableDestination): {
9
9
  DARK: {
10
- "--qv-global-header-background-color": string;
10
+ "--qv-global-header-background-color": string; /**
11
+ * Gets CSS variables depending on the destination of them.
12
+ * - Destination is the place where the CSS variables are going to be applied. With this, the right CSS variables are searched and set.
13
+ * @param destination the string of the destination.
14
+ * @returns the CSS variables and their values.
15
+ */
11
16
  "--qv-global-opacity-black-color": string;
12
17
  "--qv-global-border-color": string;
13
18
  "--qv-global-divider-color": string;
@@ -17,7 +22,6 @@ export declare function getCSSVariablesByDestination(destination?: IColorCSSVari
17
22
  "--qv-global-text-color": string;
18
23
  "--qv-global-text-secondary-color": string;
19
24
  "--qv-global-text-tertiary-color": string;
20
- "--qv-global-info-color": string;
21
25
  };
22
26
  LIGHT: {
23
27
  "--qv-global-header-background-color": string;
@@ -30,7 +34,6 @@ export declare function getCSSVariablesByDestination(destination?: IColorCSSVari
30
34
  "--qv-global-text-color": any;
31
35
  "--qv-global-text-secondary-color": string;
32
36
  "--qv-global-text-tertiary-color": string;
33
- "--qv-global-info-color": any;
34
37
  };
35
38
  } | {
36
39
  DARK: {
@@ -1,4 +1,3 @@
1
- import { isEmpty } from "../../general/mix/isEmpty";
2
1
  import { AUTOMATIC_CANVAS_CSS_VARIABLES } from "../constants/AUTOMATIC_CSS_VARIABLES";
3
2
  import { CSS_VARIABLE_DESTINATION } from "../constants/CSS_VARIABLE_DESTINATION";
4
3
  /**
@@ -8,7 +7,5 @@ import { CSS_VARIABLE_DESTINATION } from "../constants/CSS_VARIABLE_DESTINATION"
8
7
  * @returns the CSS variables and their values.
9
8
  */
10
9
  export function getCSSVariablesByDestination(destination = CSS_VARIABLE_DESTINATION.GLOBAL) {
11
- if (isEmpty(destination))
12
- return AUTOMATIC_CANVAS_CSS_VARIABLES[CSS_VARIABLE_DESTINATION.GLOBAL];
13
10
  return AUTOMATIC_CANVAS_CSS_VARIABLES[destination];
14
11
  }
@@ -1,10 +1,5 @@
1
- export * from "./calculateHSP";
2
- export * from "./getChannelsByHexadecimalColor";
3
- export * from "./getChannelsByNameColor";
4
- export * from "./getChannelsByRgbaColor";
5
1
  export * from "./getCSSVariablesByDestination";
6
- export * from "./getHexadecimalOpacity";
7
- export * from "./getRgbaOpacity";
2
+ export * from "./lightOrDark";
8
3
  export * from "./isDarkColor";
9
4
  export * from "./isHexadecimalColor";
10
5
  export * from "./isRGBAColor";
@@ -1,10 +1,5 @@
1
- export * from "./calculateHSP";
2
- export * from "./getChannelsByHexadecimalColor";
3
- export * from "./getChannelsByNameColor";
4
- export * from "./getChannelsByRgbaColor";
5
1
  export * from "./getCSSVariablesByDestination";
6
- export * from "./getHexadecimalOpacity";
7
- export * from "./getRgbaOpacity";
2
+ export * from "./lightOrDark";
8
3
  export * from "./isDarkColor";
9
4
  export * from "./isHexadecimalColor";
10
5
  export * from "./isRGBAColor";
@@ -6,6 +6,5 @@ import { HEXADECIMAL_REGULAR_EXPRESSION } from "../constants/HEXADECIMAL_REGULAR
6
6
  * @returns true: the color is an hexadecimal type
7
7
  */
8
8
  export function isHexadecimalColor(color = "") {
9
- return (typeof color === "string" &&
10
- !isEmpty(color.match(HEXADECIMAL_REGULAR_EXPRESSION)));
9
+ return !isEmpty(color === null || color === void 0 ? void 0 : color.match(HEXADECIMAL_REGULAR_EXPRESSION));
11
10
  }
@@ -6,6 +6,5 @@ import { RGBA_REGULAR_EXPRESSION } from "../constants/RGBA_REGULAR_EXPRESION";
6
6
  * @returns true: the color is an RGBA type
7
7
  */
8
8
  export function isRGBAColor(color = "") {
9
- return (typeof color === "string" &&
10
- !isEmpty(color.toLowerCase().match(RGBA_REGULAR_EXPRESSION)));
9
+ return !isEmpty(color === null || color === void 0 ? void 0 : color.match(RGBA_REGULAR_EXPRESSION));
11
10
  }