@qrvey/utils 1.2.9-38 → 1.2.9-39
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/dist/cjs/filters/helpers/ui/getUIValues.d.ts +4 -5
- package/dist/cjs/filters/helpers/ui/getUIValues.js +15 -6
- package/dist/cjs/filters/interfaces/ui/IFUUIValueSettings.d.ts +2 -0
- package/dist/filters/helpers/ui/getUIValues.d.ts +4 -5
- package/dist/filters/helpers/ui/getUIValues.js +15 -6
- package/dist/filters/interfaces/ui/IFUUIValueSettings.d.ts +2 -0
- package/package.json +1 -1
|
@@ -2,10 +2,9 @@ import { IFSFilter } from "../../interfaces/common/IFSFilter";
|
|
|
2
2
|
import { IFUValue } from "../../interfaces/ui/IFUValue";
|
|
3
3
|
import { IFUUIValueSettings } from "../../interfaces/ui/IFUUIValueSettings";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param filter
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
9
|
-
* @returns
|
|
5
|
+
* Gets the UI Values from the filter object
|
|
6
|
+
* @param filter The filter object
|
|
7
|
+
* @param settings configuration for this function
|
|
8
|
+
* @returns an array of values
|
|
10
9
|
*/
|
|
11
10
|
export declare function getUIValues(filter: IFSFilter, settings?: IFUUIValueSettings): IFUValue[];
|
|
@@ -10,11 +10,10 @@ const flattenDeep_1 = require("../../../general/array/flattenDeep");
|
|
|
10
10
|
const RELATIVE_CURSOR_INFO_1 = require("../../../dates/relative/constants/RELATIVE_CURSOR_INFO");
|
|
11
11
|
const __1 = require("../../..");
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @param filter
|
|
15
|
-
* @param
|
|
16
|
-
* @
|
|
17
|
-
* @returns
|
|
13
|
+
* Gets the UI Values from the filter object
|
|
14
|
+
* @param filter The filter object
|
|
15
|
+
* @param settings configuration for this function
|
|
16
|
+
* @returns an array of values
|
|
18
17
|
*/
|
|
19
18
|
function getUIValues(filter, settings) {
|
|
20
19
|
var _a;
|
|
@@ -39,7 +38,7 @@ function getUIValues(filter, settings) {
|
|
|
39
38
|
case FILTER_VALIDATOR_1.FILTER_VALIDATOR.BETWEEN_INCLUSIVE:
|
|
40
39
|
case FILTER_VALIDATOR_1.FILTER_VALIDATOR.BETWEEN_EXCLUSIVE:
|
|
41
40
|
return filter.values.map(value => ({
|
|
42
|
-
value: `${getValueLabel(value.min, filter, settings)}
|
|
41
|
+
value: `${getValueLabel(value.min, filter, settings)} ${getRangeSeparator(settings)} ${getValueLabel(value.max, filter, settings)}`,
|
|
43
42
|
enabled: settings.addEnableds ? value.enabled != null ? value.enabled : true : undefined,
|
|
44
43
|
}));
|
|
45
44
|
case FILTER_VALIDATOR_1.FILTER_VALIDATOR.IS_NULL:
|
|
@@ -78,6 +77,8 @@ function getUiValuesSettings(settings) {
|
|
|
78
77
|
var _a;
|
|
79
78
|
return {
|
|
80
79
|
addEnableds: (_a = settings === null || settings === void 0 ? void 0 : settings.addEnableds) !== null && _a !== void 0 ? _a : false,
|
|
80
|
+
rangeSeparator: (settings === null || settings === void 0 ? void 0 : settings.rangeSeparator) || '-',
|
|
81
|
+
rangeSeparatorPath: settings === null || settings === void 0 ? void 0 : settings.rangeSeparatorPath,
|
|
81
82
|
rankingGroupIndex: settings === null || settings === void 0 ? void 0 : settings.rankingGroupIndex,
|
|
82
83
|
translate: settings === null || settings === void 0 ? void 0 : settings.translate,
|
|
83
84
|
};
|
|
@@ -95,3 +96,11 @@ function getRankingUIValues(values, addEnableds = false, rankingGroupIndex) {
|
|
|
95
96
|
enabled: addEnableds ? rankingValue.enabled : undefined
|
|
96
97
|
}));
|
|
97
98
|
}
|
|
99
|
+
function getRangeSeparator(settings) {
|
|
100
|
+
if (!(0, isEmpty_1.isEmpty)(settings.translate) && !(0, isEmpty_1.isEmpty)(settings.rangeSeparatorPath)) {
|
|
101
|
+
return settings.translate(settings.rangeSeparatorPath);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
return settings.rangeSeparator;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -2,5 +2,7 @@ import { II18nServiceTranslate } from "../../../globalization/interfaces/II18nSe
|
|
|
2
2
|
export interface IFUUIValueSettings {
|
|
3
3
|
addEnableds?: boolean;
|
|
4
4
|
rankingGroupIndex?: number;
|
|
5
|
+
rangeSeparator?: string;
|
|
6
|
+
rangeSeparatorPath?: string;
|
|
5
7
|
translate?: II18nServiceTranslate;
|
|
6
8
|
}
|
|
@@ -2,10 +2,9 @@ import { IFSFilter } from "../../interfaces/common/IFSFilter";
|
|
|
2
2
|
import { IFUValue } from "../../interfaces/ui/IFUValue";
|
|
3
3
|
import { IFUUIValueSettings } from "../../interfaces/ui/IFUUIValueSettings";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param filter
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
9
|
-
* @returns
|
|
5
|
+
* Gets the UI Values from the filter object
|
|
6
|
+
* @param filter The filter object
|
|
7
|
+
* @param settings configuration for this function
|
|
8
|
+
* @returns an array of values
|
|
10
9
|
*/
|
|
11
10
|
export declare function getUIValues(filter: IFSFilter, settings?: IFUUIValueSettings): IFUValue[];
|
|
@@ -7,11 +7,10 @@ import { flattenDeep } from "../../../general/array/flattenDeep";
|
|
|
7
7
|
import { RELATIVE_CURSOR_INFO } from "../../../dates/relative/constants/RELATIVE_CURSOR_INFO";
|
|
8
8
|
import { getI18nDateGroupLabel } from "../../..";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param filter
|
|
12
|
-
* @param
|
|
13
|
-
* @
|
|
14
|
-
* @returns
|
|
10
|
+
* Gets the UI Values from the filter object
|
|
11
|
+
* @param filter The filter object
|
|
12
|
+
* @param settings configuration for this function
|
|
13
|
+
* @returns an array of values
|
|
15
14
|
*/
|
|
16
15
|
export function getUIValues(filter, settings) {
|
|
17
16
|
var _a;
|
|
@@ -36,7 +35,7 @@ export function getUIValues(filter, settings) {
|
|
|
36
35
|
case FILTER_VALIDATOR.BETWEEN_INCLUSIVE:
|
|
37
36
|
case FILTER_VALIDATOR.BETWEEN_EXCLUSIVE:
|
|
38
37
|
return filter.values.map(value => ({
|
|
39
|
-
value: `${getValueLabel(value.min, filter, settings)}
|
|
38
|
+
value: `${getValueLabel(value.min, filter, settings)} ${getRangeSeparator(settings)} ${getValueLabel(value.max, filter, settings)}`,
|
|
40
39
|
enabled: settings.addEnableds ? value.enabled != null ? value.enabled : true : undefined,
|
|
41
40
|
}));
|
|
42
41
|
case FILTER_VALIDATOR.IS_NULL:
|
|
@@ -74,6 +73,8 @@ function getUiValuesSettings(settings) {
|
|
|
74
73
|
var _a;
|
|
75
74
|
return {
|
|
76
75
|
addEnableds: (_a = settings === null || settings === void 0 ? void 0 : settings.addEnableds) !== null && _a !== void 0 ? _a : false,
|
|
76
|
+
rangeSeparator: (settings === null || settings === void 0 ? void 0 : settings.rangeSeparator) || '-',
|
|
77
|
+
rangeSeparatorPath: settings === null || settings === void 0 ? void 0 : settings.rangeSeparatorPath,
|
|
77
78
|
rankingGroupIndex: settings === null || settings === void 0 ? void 0 : settings.rankingGroupIndex,
|
|
78
79
|
translate: settings === null || settings === void 0 ? void 0 : settings.translate,
|
|
79
80
|
};
|
|
@@ -91,3 +92,11 @@ function getRankingUIValues(values, addEnableds = false, rankingGroupIndex) {
|
|
|
91
92
|
enabled: addEnableds ? rankingValue.enabled : undefined
|
|
92
93
|
}));
|
|
93
94
|
}
|
|
95
|
+
function getRangeSeparator(settings) {
|
|
96
|
+
if (!isEmpty(settings.translate) && !isEmpty(settings.rangeSeparatorPath)) {
|
|
97
|
+
return settings.translate(settings.rangeSeparatorPath);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
return settings.rangeSeparator;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -2,5 +2,7 @@ import { II18nServiceTranslate } from "../../../globalization/interfaces/II18nSe
|
|
|
2
2
|
export interface IFUUIValueSettings {
|
|
3
3
|
addEnableds?: boolean;
|
|
4
4
|
rankingGroupIndex?: number;
|
|
5
|
+
rangeSeparator?: string;
|
|
6
|
+
rangeSeparatorPath?: string;
|
|
5
7
|
translate?: II18nServiceTranslate;
|
|
6
8
|
}
|