@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.
- package/README.md +2173 -2649
- package/dist/charts/adapters/endpointData.js +1 -1
- package/dist/charts/adapters/endpointDataGet.js +1 -1
- package/dist/cjs/charts/adapters/endpointData.js +1 -1
- package/dist/cjs/charts/adapters/endpointDataGet.js +1 -1
- package/dist/cjs/dates/adapters/dateToMonthYear.js +1 -3
- package/dist/cjs/dates/constants/index.d.ts +0 -1
- package/dist/cjs/dates/constants/index.js +0 -1
- package/dist/cjs/dates/relative/RelativeStatementAdapter.d.ts +1 -1
- package/dist/cjs/dates/relative/RelativeStatementAdapter.js +1 -2
- package/dist/cjs/dates/relative/relative.d.ts +4 -3
- package/dist/cjs/dates/relative/relative.js +9 -5
- package/dist/cjs/filters/constants/common/FILTER_SCOPE.d.ts +8 -8
- package/dist/cjs/filters/services/Filters.api.js +7 -4
- package/dist/cjs/filters/services/UChartApi.d.ts +1 -1
- package/dist/cjs/filters/services/UChartApi.js +1 -2
- package/dist/cjs/filters/services/UChartPaginationApi.d.ts +1 -1
- package/dist/cjs/filters/services/UChartPaginationApi.js +2 -3
- package/dist/cjs/general/object/objectCopy.d.ts +5 -4
- package/dist/cjs/general/object/objectCopy.js +26 -16
- package/dist/cjs/services/api/getAllQrveys.api.d.ts +1 -1
- package/dist/cjs/services/helpers/getDefaultQuestionListOptionsAttributes.js +7 -7
- package/dist/cjs/services/interfaces/IPayloadQrveyAll.d.ts +1 -1
- package/dist/cjs/themes/constants/AUTOMATIC_CSS_VARIABLES.d.ts +0 -2
- package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.d.ts +0 -1
- package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.js +0 -1
- package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.d.ts +0 -1
- package/dist/cjs/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.js +0 -1
- package/dist/cjs/themes/constants/COLOR_TYPE.d.ts +0 -3
- package/dist/cjs/themes/constants/COLOR_TYPE.js +0 -3
- package/dist/cjs/themes/constants/CSS_VARIABLE_DESTINATION.d.ts +0 -3
- package/dist/cjs/themes/constants/CSS_VARIABLE_DESTINATION.js +0 -3
- package/dist/cjs/themes/constants/GLOBAL_CSS_VARIABLES.d.ts +1 -2
- package/dist/cjs/themes/constants/GLOBAL_CSS_VARIABLES.js +0 -1
- package/dist/cjs/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.d.ts +0 -3
- package/dist/cjs/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.js +0 -3
- package/dist/cjs/themes/constants/RGBA_REGULAR_EXPRESION.d.ts +0 -3
- package/dist/cjs/themes/constants/RGBA_REGULAR_EXPRESION.js +0 -3
- package/dist/cjs/themes/constants/index.d.ts +0 -4
- package/dist/cjs/themes/constants/index.js +0 -4
- package/dist/cjs/themes/helpers/getCSSVariablesByDestination.d.ts +6 -3
- package/dist/cjs/themes/helpers/getCSSVariablesByDestination.js +0 -3
- package/dist/cjs/themes/helpers/index.d.ts +1 -6
- package/dist/cjs/themes/helpers/index.js +1 -6
- package/dist/cjs/themes/helpers/isHexadecimalColor.js +1 -2
- package/dist/cjs/themes/helpers/isRGBAColor.js +1 -2
- package/dist/cjs/themes/helpers/lightOrDark.js +30 -14
- package/dist/cjs/themes/helpers/setAutomaticCSSVariablesForDark.js +1 -1
- package/dist/cjs/themes/interfaces/IColorCSSVariableDestination.d.ts +0 -3
- package/dist/cjs/themes/interfaces/IColorType.d.ts +0 -3
- package/dist/cjs/themes/interfaces/index.d.ts +0 -1
- package/dist/cjs/themes/interfaces/index.js +0 -1
- package/dist/dates/adapters/dateToMonthYear.js +1 -3
- package/dist/dates/constants/index.d.ts +0 -1
- package/dist/dates/constants/index.js +0 -1
- package/dist/dates/relative/RelativeStatementAdapter.d.ts +1 -1
- package/dist/dates/relative/RelativeStatementAdapter.js +1 -1
- package/dist/dates/relative/relative.d.ts +4 -3
- package/dist/dates/relative/relative.js +5 -4
- package/dist/filters/constants/common/FILTER_SCOPE.d.ts +8 -8
- package/dist/filters/services/Filters.api.js +2 -2
- package/dist/filters/services/UChartApi.d.ts +1 -1
- package/dist/filters/services/UChartApi.js +2 -1
- package/dist/filters/services/UChartPaginationApi.d.ts +1 -1
- package/dist/filters/services/UChartPaginationApi.js +3 -2
- package/dist/general/object/objectCopy.d.ts +5 -4
- package/dist/general/object/objectCopy.js +26 -16
- package/dist/services/api/getAllQrveys.api.d.ts +1 -1
- package/dist/services/helpers/getDefaultQuestionListOptionsAttributes.js +7 -7
- package/dist/services/interfaces/IPayloadQrveyAll.d.ts +1 -1
- package/dist/themes/constants/AUTOMATIC_CSS_VARIABLES.d.ts +0 -2
- package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.d.ts +0 -1
- package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_DARK.js +0 -1
- package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.d.ts +0 -1
- package/dist/themes/constants/AUTOMATIC_GLOBAL_CSS_VARIABLES_FOR_LIGHT.js +0 -1
- package/dist/themes/constants/COLOR_TYPE.d.ts +0 -3
- package/dist/themes/constants/COLOR_TYPE.js +0 -3
- package/dist/themes/constants/CSS_VARIABLE_DESTINATION.d.ts +0 -3
- package/dist/themes/constants/CSS_VARIABLE_DESTINATION.js +0 -3
- package/dist/themes/constants/GLOBAL_CSS_VARIABLES.d.ts +1 -2
- package/dist/themes/constants/GLOBAL_CSS_VARIABLES.js +0 -1
- package/dist/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.d.ts +0 -3
- package/dist/themes/constants/HEXADECIMAL_REGULAR_EXPRESSION.js +0 -3
- package/dist/themes/constants/RGBA_REGULAR_EXPRESION.d.ts +0 -3
- package/dist/themes/constants/RGBA_REGULAR_EXPRESION.js +0 -3
- package/dist/themes/constants/index.d.ts +0 -4
- package/dist/themes/constants/index.js +0 -4
- package/dist/themes/helpers/getCSSVariablesByDestination.d.ts +6 -3
- package/dist/themes/helpers/getCSSVariablesByDestination.js +0 -3
- package/dist/themes/helpers/index.d.ts +1 -6
- package/dist/themes/helpers/index.js +1 -6
- package/dist/themes/helpers/isHexadecimalColor.js +1 -2
- package/dist/themes/helpers/isRGBAColor.js +1 -2
- package/dist/themes/helpers/lightOrDark.js +30 -14
- package/dist/themes/helpers/setAutomaticCSSVariablesForDark.js +1 -1
- package/dist/themes/interfaces/IColorCSSVariableDestination.d.ts +0 -3
- package/dist/themes/interfaces/IColorType.d.ts +0 -3
- package/dist/themes/interfaces/index.d.ts +0 -1
- package/dist/themes/interfaces/index.js +0 -1
- package/package.json +17 -20
- package/dist/cjs/dates/constants/INTL_DATE_FORMATS.d.ts +0 -1
- package/dist/cjs/dates/constants/INTL_DATE_FORMATS.js +0 -8
- package/dist/cjs/themes/constants/CHANNEL_BLACK_COLOR.d.ts +0 -5
- package/dist/cjs/themes/constants/CHANNEL_BLACK_COLOR.js +0 -12
- package/dist/cjs/themes/constants/CHANNEL_WHITE_COLOR.d.ts +0 -5
- package/dist/cjs/themes/constants/CHANNEL_WHITE_COLOR.js +0 -12
- package/dist/cjs/themes/constants/COLOR_NAME.d.ts +0 -154
- package/dist/cjs/themes/constants/COLOR_NAME.js +0 -157
- package/dist/cjs/themes/helpers/calculateHSP.d.ts +0 -8
- package/dist/cjs/themes/helpers/calculateHSP.js +0 -20
- package/dist/cjs/themes/helpers/getChannelsByHexadecimalColor.d.ts +0 -8
- package/dist/cjs/themes/helpers/getChannelsByHexadecimalColor.js +0 -26
- package/dist/cjs/themes/helpers/getChannelsByNameColor.d.ts +0 -8
- package/dist/cjs/themes/helpers/getChannelsByNameColor.js +0 -26
- package/dist/cjs/themes/helpers/getChannelsByRgbaColor.d.ts +0 -8
- package/dist/cjs/themes/helpers/getChannelsByRgbaColor.js +0 -25
- package/dist/cjs/themes/helpers/getHexadecimalOpacity.d.ts +0 -7
- package/dist/cjs/themes/helpers/getHexadecimalOpacity.js +0 -19
- package/dist/cjs/themes/helpers/getRgbaOpacity.d.ts +0 -7
- package/dist/cjs/themes/helpers/getRgbaOpacity.js +0 -21
- package/dist/cjs/themes/interfaces/IColorChannel.d.ts +0 -9
- package/dist/cjs/themes/interfaces/IColorChannel.js +0 -2
- package/dist/dates/constants/INTL_DATE_FORMATS.d.ts +0 -1
- package/dist/dates/constants/INTL_DATE_FORMATS.js +0 -5
- package/dist/themes/constants/CHANNEL_BLACK_COLOR.d.ts +0 -5
- package/dist/themes/constants/CHANNEL_BLACK_COLOR.js +0 -9
- package/dist/themes/constants/CHANNEL_WHITE_COLOR.d.ts +0 -5
- package/dist/themes/constants/CHANNEL_WHITE_COLOR.js +0 -9
- package/dist/themes/constants/COLOR_NAME.d.ts +0 -154
- package/dist/themes/constants/COLOR_NAME.js +0 -154
- package/dist/themes/helpers/calculateHSP.d.ts +0 -8
- package/dist/themes/helpers/calculateHSP.js +0 -16
- package/dist/themes/helpers/getChannelsByHexadecimalColor.d.ts +0 -8
- package/dist/themes/helpers/getChannelsByHexadecimalColor.js +0 -22
- package/dist/themes/helpers/getChannelsByNameColor.d.ts +0 -8
- package/dist/themes/helpers/getChannelsByNameColor.js +0 -22
- package/dist/themes/helpers/getChannelsByRgbaColor.d.ts +0 -8
- package/dist/themes/helpers/getChannelsByRgbaColor.js +0 -21
- package/dist/themes/helpers/getHexadecimalOpacity.d.ts +0 -7
- package/dist/themes/helpers/getHexadecimalOpacity.js +0 -15
- package/dist/themes/helpers/getRgbaOpacity.d.ts +0 -7
- package/dist/themes/helpers/getRgbaOpacity.js +0 -17
- package/dist/themes/interfaces/IColorChannel.d.ts +0 -9
- 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
|
|
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)
|
|
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
|
-
|
|
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
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
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) ||
|
|
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] || {});
|
|
@@ -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
|
-
|
|
22
|
-
return `${DATE_YEAR_MONTHS[dt.getMonth()]} ${year}`;
|
|
20
|
+
return `${DATE_YEAR_MONTHS[dt.getMonth()]} ${dt.getFullYear()}`;
|
|
23
21
|
}
|
|
@@ -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
|
|
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
|
-
*
|
|
18
|
-
* @param
|
|
19
|
-
* @
|
|
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
|
|
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
|
-
*
|
|
18
|
-
* @param
|
|
19
|
-
* @
|
|
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"
|
|
3
|
-
DATA = "DATA"
|
|
4
|
-
GLOBAL = "GLOBAL"
|
|
5
|
-
PAGE = "PAGE"
|
|
6
|
-
TAB = "TAB"
|
|
7
|
-
DEFAULT = "DEFAULT"
|
|
8
|
-
CHART = "CHART"
|
|
9
|
-
ACTION = "ACTION"
|
|
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
|
|
11
|
-
import
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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), {
|
|
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
|
-
*
|
|
3
|
-
* @param
|
|
4
|
-
* @
|
|
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>(
|
|
7
|
+
export declare function objectCopy<T = any>(entity: T, cache?: WeakMap<object, any>): T;
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param
|
|
4
|
-
* @
|
|
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(
|
|
7
|
-
if (
|
|
8
|
-
return
|
|
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 (
|
|
11
|
-
|
|
12
|
-
return newArray;
|
|
19
|
+
if (entity instanceof Set) {
|
|
20
|
+
entity.forEach((value) => c.add(objectCopy(value, newCache)));
|
|
13
21
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
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",
|
|
14
|
-
"imageUploadOption",
|
|
15
|
-
"sliderVal",
|
|
16
|
-
"value",
|
|
17
|
-
"activeCat",
|
|
18
|
-
"words",
|
|
19
|
-
"negative",
|
|
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
|
}
|
|
@@ -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: {
|
|
@@ -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
|
};
|
|
@@ -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
|
};
|
|
@@ -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 = {}));
|
|
@@ -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 "./
|
|
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 "./
|
|
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 (
|
|
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 (
|
|
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
|
}
|