@qrvey/utils 1.1.2-0 → 1.1.4
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 +458 -378
- package/dist/cjs/constants/COLUMN_PROPERTY.d.ts +6 -6
- package/dist/cjs/constants/COLUMN_PROPERTY_VALUE.d.ts +1 -2
- package/dist/cjs/constants/COLUMN_PROPERTY_VALUE.js +3 -8
- package/dist/cjs/date/constants/DATE_PROPERTY_VALUE.d.ts +6 -6
- package/dist/cjs/date/constants/DATE_PROPERTY_VALUE.js +6 -6
- package/dist/cjs/date/constants/DATE_P_PROPERTIES.js +6 -6
- package/dist/cjs/date/constants/DATE_P_VALUES.js +3 -3
- package/dist/cjs/date/constants/DATE_TIME_P_VALUES.js +3 -3
- package/dist/cjs/date/constants/DATE_TIME_VALUES.js +3 -3
- package/dist/cjs/date/constants/DATE_VALUES.d.ts +6 -0
- package/dist/cjs/date/constants/DATE_VALUES.js +10 -0
- package/dist/cjs/filters/adapters/FDToFlatUI.js +3 -1
- package/dist/cjs/filters/adapters/FDToUI.js +3 -1
- package/dist/cjs/filters/adapters/UIToFlatUI.js +3 -1
- package/dist/cjs/filters/adapters/UIToOldLogic.js +3 -1
- package/dist/cjs/filters/adapters/adaptDateGroupingProperty.d.ts +8 -0
- package/dist/cjs/filters/adapters/adaptDateGroupingProperty.js +19 -0
- package/dist/cjs/filters/adapters/adaptFilterData.js +1 -1
- package/dist/cjs/filters/adapters/flatUIToFD.js +3 -1
- package/dist/cjs/filters/adapters/flatUIToOldLogic.js +1 -5
- package/dist/cjs/filters/adapters/flatUIToUI.js +3 -1
- package/dist/cjs/filters/adapters/index.d.ts +1 -0
- package/dist/cjs/filters/adapters/index.js +1 -0
- package/dist/cjs/filters/adapters/logicToFlatUI.js +77 -63
- package/dist/cjs/filters/helpers/backend/getBackendGroupValue.js +4 -3
- package/dist/cjs/filters/helpers/backend/getBackendProperty.js +1 -5
- package/dist/cjs/filters/helpers/ui/getFilterPropertyLabel.d.ts +7 -0
- package/dist/cjs/filters/helpers/ui/getFilterPropertyLabel.js +13 -0
- package/dist/cjs/filters/helpers/ui/index.d.ts +1 -0
- package/dist/cjs/filters/helpers/ui/index.js +1 -0
- package/dist/cjs/general/array/filterNestedTree.d.ts +5 -2
- package/dist/cjs/general/array/filterNestedTree.js +13 -5
- package/dist/cjs/general/mix/getTag.d.ts +7 -0
- package/dist/cjs/general/mix/getTag.js +16 -0
- package/dist/cjs/general/mix/index.d.ts +1 -0
- package/dist/cjs/general/mix/index.js +1 -0
- package/dist/cjs/general/mix/isEmpty.js +8 -4
- package/dist/cjs/general/mix/isNull.js +1 -1
- package/dist/cjs/general/mix/randomId.d.ts +6 -3
- package/dist/cjs/general/mix/randomId.js +24 -7
- package/dist/cjs/general/mix/size.d.ts +5 -5
- package/dist/cjs/general/mix/size.js +9 -6
- package/dist/cjs/general/object/get.d.ts +1 -1
- package/dist/cjs/general/object/getAttribute.d.ts +9 -2
- package/dist/cjs/general/object/getAttribute.js +39 -8
- package/dist/cjs/general/object/hasProperty.d.ts +1 -1
- package/dist/cjs/general/object/hasProperty.js +10 -2
- package/dist/cjs/general/object/index.d.ts +1 -0
- package/dist/cjs/general/object/index.js +1 -0
- package/dist/cjs/general/object/isObject.js +2 -1
- package/dist/cjs/general/object/objectCopy.d.ts +7 -0
- package/dist/cjs/general/object/objectCopy.js +32 -0
- package/dist/cjs/general/string/capitalize.d.ts +3 -3
- package/dist/cjs/general/string/capitalize.js +6 -3
- package/dist/cjs/qrvey/getPropertyLabel.d.ts +2 -0
- package/dist/cjs/qrvey/getPropertyLabel.js +14 -0
- package/dist/cjs/qrvey/index.d.ts +1 -0
- package/dist/cjs/qrvey/index.js +1 -0
- package/dist/constants/COLUMN_PROPERTY.d.ts +6 -6
- package/dist/constants/COLUMN_PROPERTY_VALUE.d.ts +1 -2
- package/dist/constants/COLUMN_PROPERTY_VALUE.js +4 -9
- package/dist/date/constants/DATE_PROPERTY_VALUE.d.ts +6 -6
- package/dist/date/constants/DATE_PROPERTY_VALUE.js +6 -6
- package/dist/date/constants/DATE_P_PROPERTIES.js +6 -6
- package/dist/date/constants/DATE_P_VALUES.js +3 -3
- package/dist/date/constants/DATE_TIME_P_VALUES.js +3 -3
- package/dist/date/constants/DATE_TIME_VALUES.js +3 -3
- package/dist/date/constants/DATE_VALUES.d.ts +6 -0
- package/dist/date/constants/DATE_VALUES.js +7 -0
- package/dist/filters/adapters/FDToFlatUI.js +3 -1
- package/dist/filters/adapters/FDToUI.js +3 -1
- package/dist/filters/adapters/UIToFlatUI.js +3 -1
- package/dist/filters/adapters/UIToOldLogic.js +3 -1
- package/dist/filters/adapters/adaptDateGroupingProperty.d.ts +8 -0
- package/dist/filters/adapters/adaptDateGroupingProperty.js +15 -0
- package/dist/filters/adapters/adaptFilterData.js +1 -1
- package/dist/filters/adapters/flatUIToFD.js +3 -1
- package/dist/filters/adapters/flatUIToOldLogic.js +1 -5
- package/dist/filters/adapters/flatUIToUI.js +3 -1
- package/dist/filters/adapters/index.d.ts +1 -0
- package/dist/filters/adapters/index.js +1 -0
- package/dist/filters/adapters/logicToFlatUI.js +79 -65
- package/dist/filters/helpers/backend/getBackendGroupValue.js +4 -3
- package/dist/filters/helpers/backend/getBackendProperty.js +2 -6
- package/dist/filters/helpers/ui/getFilterPropertyLabel.d.ts +7 -0
- package/dist/filters/helpers/ui/getFilterPropertyLabel.js +9 -0
- package/dist/filters/helpers/ui/index.d.ts +1 -0
- package/dist/filters/helpers/ui/index.js +1 -0
- package/dist/general/array/filterNestedTree.d.ts +5 -2
- package/dist/general/array/filterNestedTree.js +13 -5
- package/dist/general/mix/getTag.d.ts +7 -0
- package/dist/general/mix/getTag.js +12 -0
- package/dist/general/mix/index.d.ts +1 -0
- package/dist/general/mix/index.js +1 -0
- package/dist/general/mix/isEmpty.js +8 -4
- package/dist/general/mix/isNull.js +1 -1
- package/dist/general/mix/randomId.d.ts +6 -3
- package/dist/general/mix/randomId.js +24 -7
- package/dist/general/mix/size.d.ts +5 -5
- package/dist/general/mix/size.js +9 -6
- package/dist/general/object/get.d.ts +1 -1
- package/dist/general/object/getAttribute.d.ts +9 -2
- package/dist/general/object/getAttribute.js +39 -8
- package/dist/general/object/hasProperty.d.ts +1 -1
- package/dist/general/object/hasProperty.js +8 -0
- package/dist/general/object/index.d.ts +1 -0
- package/dist/general/object/index.js +1 -0
- package/dist/general/object/isObject.js +2 -1
- package/dist/general/object/objectCopy.d.ts +7 -0
- package/dist/general/object/objectCopy.js +28 -0
- package/dist/general/string/capitalize.d.ts +3 -3
- package/dist/general/string/capitalize.js +6 -3
- package/dist/qrvey/getPropertyLabel.d.ts +2 -0
- package/dist/qrvey/getPropertyLabel.js +10 -0
- package/dist/qrvey/index.d.ts +1 -0
- package/dist/qrvey/index.js +1 -0
- package/package.json +1 -1
- package/src/constants/COLUMN_PROPERTY.ts +7 -7
- package/src/constants/COLUMN_PROPERTY_VALUE.ts +4 -10
- package/src/date/constants/DATE_P_VALUES.ts +3 -3
- package/src/date/constants/DATE_TIME_P_VALUES.ts +3 -3
- package/src/date/constants/DATE_TIME_VALUES.ts +3 -3
- package/src/date/constants/DATE_VALUES.ts +9 -0
- package/src/filters/adapters/FDToFlatUI.ts +3 -1
- package/src/filters/adapters/FDToUI.ts +4 -0
- package/src/filters/adapters/UIToFlatUI.ts +3 -1
- package/src/filters/adapters/UIToOldLogic.ts +4 -1
- package/src/filters/adapters/adaptDateGroupingProperty.ts +18 -0
- package/src/filters/adapters/adaptFilterData.ts +1 -1
- package/src/filters/adapters/flatUIToFD.ts +4 -1
- package/src/filters/adapters/flatUIToOldLogic.ts +1 -3
- package/src/filters/adapters/flatUIToUI.ts +4 -1
- package/src/filters/adapters/index.ts +1 -0
- package/src/filters/adapters/logicToFlatUI.ts +87 -70
- package/src/filters/helpers/backend/getAggFiltersBySummaryIndex.ts +1 -1
- package/src/filters/helpers/backend/getBackendGroupValue.ts +4 -3
- package/src/filters/helpers/backend/getBackendProperty.ts +2 -4
- package/src/filters/helpers/ui/getFilterPropertyLabel.ts +11 -0
- package/src/filters/helpers/ui/index.ts +1 -0
- package/src/general/array/filterNestedTree.ts +13 -4
- package/src/general/mix/getTag.ts +12 -0
- package/src/general/mix/index.ts +1 -0
- package/src/general/mix/isEmpty.ts +9 -4
- package/src/general/mix/isNull.ts +1 -1
- package/src/general/mix/randomId.ts +24 -7
- package/src/general/mix/size.ts +10 -6
- package/src/general/object/get.ts +1 -1
- package/src/general/object/getAttribute.ts +47 -9
- package/src/general/object/hasProperty.ts +10 -1
- package/src/general/object/index.ts +1 -0
- package/src/general/object/isObject.ts +3 -1
- package/src/general/object/objectCopy.ts +35 -0
- package/src/general/string/capitalize.ts +7 -3
- package/src/qrvey/getPropertyLabel.ts +9 -0
- package/src/qrvey/index.ts +1 -0
- package/test/general/array/filterNestedTree.test.js +115 -0
- package/test/general/mix/getTag.test.js +101 -0
- package/test/general/mix/isEmpty.test.js +30 -24
- package/test/general/mix/isNull.test.js +72 -0
- package/test/general/mix/randomId.test.js +134 -0
- package/test/general/mix/size.test.js +87 -0
- package/test/general/object/cloneDeep.test.js +8 -16
- package/test/general/object/getAttribute.test.js +316 -0
- package/test/general/object/hasProperty.test.js +103 -0
- package/test/general/object/objectCopy.test.js +105 -0
- package/test/general/string/capitalize.test.js +87 -0
|
@@ -7,12 +7,12 @@ export declare const enum COLUMN_PROPERTY {
|
|
|
7
7
|
DATE_HOUR = "hour",
|
|
8
8
|
DATE_MINUTE = "minute",
|
|
9
9
|
DATE_SECOND = "second",
|
|
10
|
-
DATE_YEAR_QUARTER = "
|
|
11
|
-
DATE_YEAR_MONTH = "
|
|
12
|
-
DATE_MONTH_DAY = "
|
|
13
|
-
DATE_DAY_HOUR = "
|
|
14
|
-
DATE_HOUR_MINUTE = "
|
|
15
|
-
DATE_MINUTE_SECOND = "
|
|
10
|
+
DATE_YEAR_QUARTER = "quarter_only",
|
|
11
|
+
DATE_YEAR_MONTH = "month_only",
|
|
12
|
+
DATE_MONTH_DAY = "day_only",
|
|
13
|
+
DATE_DAY_HOUR = "hour_only",
|
|
14
|
+
DATE_HOUR_MINUTE = "minute_only",
|
|
15
|
+
DATE_MINUTE_SECOND = "second_only",
|
|
16
16
|
NAME_FIRST = "first_name",
|
|
17
17
|
NAME_LAST = "last_name",
|
|
18
18
|
ADDRESS_STREET = "street_address",
|
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.COLUMN_PROPERTY_VALUE = void 0;
|
|
4
4
|
const date_1 = require("../date");
|
|
5
|
+
const DATE_VALUES_1 = require("../date/constants/DATE_VALUES");
|
|
5
6
|
const COLUMN_1 = require("./COLUMN");
|
|
6
7
|
const COLUMN_COMPLEX_VALUE_1 = require("./COLUMN_COMPLEX_VALUE");
|
|
7
8
|
const setTabStructure = compound => ({ value: compound.property, label: compound.shortLabel });
|
|
8
9
|
const C = {
|
|
9
|
-
[COLUMN_1.COLUMN.DATE]:
|
|
10
|
-
{ value: "day" /* DATE_DAY */, label: 'Complete Date', display: true },
|
|
11
|
-
{ value: "year" /* DATE_YEAR */, label: 'Year', display: true },
|
|
12
|
-
{ value: "quarter" /* DATE_QUARTER */, label: 'Quarter', display: true },
|
|
13
|
-
{ value: "month" /* DATE_MONTH */, label: 'Month', display: true },
|
|
14
|
-
{ value: "week" /* DATE_WEEK */, label: 'Weeks', display: true }
|
|
15
|
-
],
|
|
10
|
+
[COLUMN_1.COLUMN.DATE]: DATE_VALUES_1.DATE_VALUES,
|
|
16
11
|
[COLUMN_1.COLUMN.LOOKUP]: [
|
|
17
12
|
{ value: 'display', label: 'Display', display: true },
|
|
18
13
|
{ value: 'value', label: 'Value', display: true }
|
|
@@ -26,5 +21,5 @@ const C = {
|
|
|
26
21
|
[COLUMN_1.COLUMN.EXPRESSION]: COLUMN_COMPLEX_VALUE_1.COLUMN_COMPLEX_VALUE.EXPRESSION.map(setTabStructure),
|
|
27
22
|
[COLUMN_1.COLUMN.IMAGEUPLOAD]: COLUMN_COMPLEX_VALUE_1.COLUMN_COMPLEX_VALUE.IMAGEUPLOAD.map(setTabStructure),
|
|
28
23
|
};
|
|
29
|
-
C[COLUMN_1.COLUMN.DATE + '-complete'] = C[COLUMN_1.COLUMN.DATE].concat(date_1.DATE_P_VALUES).concat(date_1.DATE_TIME_P_VALUES);
|
|
24
|
+
C[COLUMN_1.COLUMN.DATE + '-complete'] = C[COLUMN_1.COLUMN.DATE].concat(date_1.DATE_TIME_VALUES).concat(date_1.DATE_P_VALUES).concat(date_1.DATE_TIME_P_VALUES);
|
|
30
25
|
exports.COLUMN_PROPERTY_VALUE = C;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const DATE_PROPERTY_VALUE: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
quarter_only: string[];
|
|
3
|
+
month_only: string[];
|
|
4
|
+
day_only: string[];
|
|
5
|
+
hour_only: string[];
|
|
6
|
+
minute_only: string[];
|
|
7
|
+
second_only: string[];
|
|
8
8
|
};
|
|
@@ -8,10 +8,10 @@ const DATE_MONTH_DAYS_1 = require("./DATE_MONTH_DAYS");
|
|
|
8
8
|
const DATE_YEAR_MONTHS_1 = require("./DATE_YEAR_MONTHS");
|
|
9
9
|
const DATE_YEAR_QUARTERS_1 = require("./DATE_YEAR_QUARTERS");
|
|
10
10
|
exports.DATE_PROPERTY_VALUE = {
|
|
11
|
-
["
|
|
12
|
-
["
|
|
13
|
-
["
|
|
14
|
-
["
|
|
15
|
-
["
|
|
16
|
-
["
|
|
11
|
+
["quarter_only" /* DATE_YEAR_QUARTER */]: DATE_YEAR_QUARTERS_1.DATE_YEAR_QUARTERS,
|
|
12
|
+
["month_only" /* DATE_YEAR_MONTH */]: DATE_YEAR_MONTHS_1.DATE_YEAR_MONTHS,
|
|
13
|
+
["day_only" /* DATE_MONTH_DAY */]: DATE_MONTH_DAYS_1.DATE_MONTH_DAYS,
|
|
14
|
+
["hour_only" /* DATE_DAY_HOUR */]: DATE_DAY_HOURS_1.DATE_DAY_HOURS,
|
|
15
|
+
["minute_only" /* DATE_HOUR_MINUTE */]: DATE_HOUR_MINUTES_1.DATE_HOUR_MINUTES,
|
|
16
|
+
["second_only" /* DATE_MINUTE_SECOND */]: DATE_MINUTE_SECONDS_1.DATE_MINUTE_SECONDS,
|
|
17
17
|
};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DATE_P_PROPERTIES = void 0;
|
|
4
4
|
exports.DATE_P_PROPERTIES = [
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
5
|
+
"quarter_only" /* DATE_YEAR_QUARTER */,
|
|
6
|
+
"month_only" /* DATE_YEAR_MONTH */,
|
|
7
|
+
"day_only" /* DATE_MONTH_DAY */,
|
|
8
|
+
"hour_only" /* DATE_DAY_HOUR */,
|
|
9
|
+
"minute_only" /* DATE_HOUR_MINUTE */,
|
|
10
|
+
"second_only" /* DATE_MINUTE_SECOND */,
|
|
11
11
|
];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DATE_P_VALUES = void 0;
|
|
4
4
|
exports.DATE_P_VALUES = [
|
|
5
|
-
{ value: "
|
|
6
|
-
{ value: "
|
|
7
|
-
{ value: "
|
|
5
|
+
{ value: "quarter_only" /* DATE_YEAR_QUARTER */, label: 'Quarter', display: true },
|
|
6
|
+
{ value: "month_only" /* DATE_YEAR_MONTH */, label: 'Month', display: true },
|
|
7
|
+
{ value: "day_only" /* DATE_MONTH_DAY */, label: 'Day (Month)', display: true },
|
|
8
8
|
];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DATE_TIME_P_VALUES = void 0;
|
|
4
4
|
exports.DATE_TIME_P_VALUES = [
|
|
5
|
-
{ value: "
|
|
6
|
-
{ value: "
|
|
7
|
-
{ value: "
|
|
5
|
+
{ value: "hour_only" /* DATE_DAY_HOUR */, label: 'Hour', display: true },
|
|
6
|
+
{ value: "minute_only" /* DATE_HOUR_MINUTE */, label: 'Minute', display: true },
|
|
7
|
+
{ value: "second_only" /* DATE_MINUTE_SECOND */, label: 'Second', display: true },
|
|
8
8
|
];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DATE_TIME_VALUES = void 0;
|
|
4
4
|
exports.DATE_TIME_VALUES = [
|
|
5
|
-
{ label: '
|
|
6
|
-
{ label: '
|
|
7
|
-
{ label: '
|
|
5
|
+
{ label: 'Date, Hour', value: "hour" /* DATE_HOUR */, display: true },
|
|
6
|
+
{ label: 'Date, Minute', value: "minute" /* DATE_MINUTE */, display: true },
|
|
7
|
+
{ label: 'Date, Second', value: "second" /* DATE_SECOND */, display: true },
|
|
8
8
|
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DATE_VALUES = void 0;
|
|
4
|
+
exports.DATE_VALUES = [
|
|
5
|
+
{ value: "day" /* DATE_DAY */, label: 'Full Date', display: true },
|
|
6
|
+
{ value: "year" /* DATE_YEAR */, label: 'Year', display: true },
|
|
7
|
+
{ value: "quarter" /* DATE_QUARTER */, label: 'Quarter, Year', display: true },
|
|
8
|
+
{ value: "month" /* DATE_MONTH */, label: 'Month, Year', display: true },
|
|
9
|
+
{ value: "week" /* DATE_WEEK */, label: 'Week, Year', display: true }
|
|
10
|
+
];
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FDToFlatUI = void 0;
|
|
4
4
|
const general_1 = require("../../general");
|
|
5
5
|
const helpers_1 = require("../helpers");
|
|
6
|
+
const adaptDateGroupingProperty_1 = require("./adaptDateGroupingProperty");
|
|
6
7
|
/**
|
|
7
8
|
* Generates a Flattened UI filter structure from Filter Data structure.
|
|
8
9
|
* @param filterData The filter data object.
|
|
@@ -43,6 +44,7 @@ function FD21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
43
44
|
if (!general_1.isEmpty(datasetInfo))
|
|
44
45
|
columnInfo = datasetInfo.options.find(cInfo => cInfo.id === filter.column.id && cInfo.qrveyid === filter.column.qrveyid && cInfo.linkid === filter.column.linkid);
|
|
45
46
|
const info = !general_1.isEmpty(filter.extras.info) ? { icon: filter.extras.info.icon, label: filter.extras.info.label } : undefined;
|
|
47
|
+
const property = adaptDateGroupingProperty_1.adaptDateGroupingProperty(filter.property);
|
|
46
48
|
const uFilter = {
|
|
47
49
|
collapsed: filter.collapsed,
|
|
48
50
|
column: {
|
|
@@ -79,7 +81,7 @@ function FD21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
79
81
|
lookupDisplayIndex: filter.lookupDisplayIndex,
|
|
80
82
|
nullValues: filter.nullValues,
|
|
81
83
|
operator: filter.operator,
|
|
82
|
-
property:
|
|
84
|
+
property: property,
|
|
83
85
|
uiValues: helpers_1.getUIValues(filter),
|
|
84
86
|
validator: filter.validator,
|
|
85
87
|
values: filter.values,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FDToUI = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
4
5
|
const general_1 = require("../../general");
|
|
5
6
|
const constants_1 = require("../constants");
|
|
6
7
|
const helpers_1 = require("../helpers");
|
|
@@ -47,6 +48,7 @@ function FD21ToUI(scopes = [], section = "ANYWHERE" /* ANYWHERE */, enabled = tr
|
|
|
47
48
|
let columnInfo;
|
|
48
49
|
if (!general_1.isEmpty(datasetInfo))
|
|
49
50
|
columnInfo = datasetInfo.options.find(cInfo => cInfo.id === filter.column.id && cInfo.qrveyid === filter.column.qrveyid && cInfo.linkid === filter.column.linkid);
|
|
51
|
+
const property = _1.adaptDateGroupingProperty(filter.property);
|
|
50
52
|
return Object.assign(Object.assign({}, filter), { column: {
|
|
51
53
|
aggregate: filter.column.aggregate,
|
|
52
54
|
calculation: filter.column.calculation,
|
|
@@ -58,7 +60,7 @@ function FD21ToUI(scopes = [], section = "ANYWHERE" /* ANYWHERE */, enabled = tr
|
|
|
58
60
|
outputFormat: general_1._get(datasetInfo, 'outputFormat'),
|
|
59
61
|
qrveyid: filter.column.qrveyid,
|
|
60
62
|
type: (columnInfo === null || columnInfo === void 0 ? void 0 : columnInfo.type) || filter.column.type,
|
|
61
|
-
}, uiValues: helpers_1.getUIValues(filter) });
|
|
63
|
+
}, property, uiValues: helpers_1.getUIValues(filter) });
|
|
62
64
|
}) });
|
|
63
65
|
}) })));
|
|
64
66
|
return ufData;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UIToFlatUI = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
4
5
|
const general_1 = require("../../general");
|
|
5
6
|
const helpers_1 = require("../helpers");
|
|
6
7
|
/**
|
|
@@ -42,6 +43,7 @@ function UI21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
42
43
|
if (!general_1.isEmpty(datasetInfo))
|
|
43
44
|
columnInfo = datasetInfo.options.find(cInfo => cInfo.id === filter.column.id && cInfo.qrveyid === filter.column.qrveyid && cInfo.linkid === filter.column.linkid);
|
|
44
45
|
const info = !general_1.isEmpty(filter.extras.info) ? { icon: filter.extras.info.icon, label: filter.extras.info.label } : undefined;
|
|
46
|
+
const property = _1.adaptDateGroupingProperty(filter.property);
|
|
45
47
|
const uFilter = {
|
|
46
48
|
collapsed: filter.collapsed,
|
|
47
49
|
column: {
|
|
@@ -78,7 +80,7 @@ function UI21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
78
80
|
lookupDisplayIndex: filter.lookupDisplayIndex,
|
|
79
81
|
nullValues: filter.nullValues,
|
|
80
82
|
operator: filter.operator,
|
|
81
|
-
property
|
|
83
|
+
property,
|
|
82
84
|
uiValues: helpers_1.getUIValues(filter),
|
|
83
85
|
validator: filter.validator,
|
|
84
86
|
values: filter.values,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UIToOldLogic = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
4
5
|
const general_1 = require("../../general");
|
|
5
6
|
const helpers_1 = require("../helpers");
|
|
6
7
|
const flatUIToOldLogic_1 = require("./flatUIToOldLogic");
|
|
@@ -103,6 +104,7 @@ const getFilterDetail = (filter, scope, dataset) => {
|
|
|
103
104
|
label: filter.extras.info.label,
|
|
104
105
|
};
|
|
105
106
|
}
|
|
107
|
+
const property = _1.adaptDateGroupingProperty(filter.property);
|
|
106
108
|
return {
|
|
107
109
|
collapsed: filter.collapsed,
|
|
108
110
|
column: {
|
|
@@ -130,7 +132,7 @@ const getFilterDetail = (filter, scope, dataset) => {
|
|
|
130
132
|
lookupDisplayIndex: filter.lookupDisplayIndex,
|
|
131
133
|
nullValues: filter.nullValues,
|
|
132
134
|
operator: filter.operator,
|
|
133
|
-
property
|
|
135
|
+
property,
|
|
134
136
|
scope: scope.scope,
|
|
135
137
|
scopeid: filter.extras.scopeid,
|
|
136
138
|
scopeEnabled: scope.enabled,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IFProperty } from "..";
|
|
2
|
+
/**
|
|
3
|
+
* [TODO: For 2022, eliminate this adapter]
|
|
4
|
+
* Get the new property base on the old date grouping properties
|
|
5
|
+
* @param property
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function adaptDateGroupingProperty(property: IFProperty | any): IFProperty;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adaptDateGroupingProperty = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* [TODO: For 2022, eliminate this adapter]
|
|
6
|
+
* Get the new property base on the old date grouping properties
|
|
7
|
+
* @param property
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
function adaptDateGroupingProperty(property) {
|
|
11
|
+
return property === 'p&quarter' ? "quarter_only" /* DATE_YEAR_QUARTER */ :
|
|
12
|
+
property === 'p&month' ? "month_only" /* DATE_YEAR_MONTH */ :
|
|
13
|
+
property === 'p&day' ? "day_only" /* DATE_MONTH_DAY */ :
|
|
14
|
+
property === 'p&hour' ? "hour_only" /* DATE_DAY_HOUR */ :
|
|
15
|
+
property === 'p&minute' ? "minute_only" /* DATE_HOUR_MINUTE */ :
|
|
16
|
+
property === 'p&second' ? "second_only" /* DATE_MINUTE_SECOND */ :
|
|
17
|
+
property;
|
|
18
|
+
}
|
|
19
|
+
exports.adaptDateGroupingProperty = adaptDateGroupingProperty;
|
|
@@ -13,7 +13,7 @@ const UIToFD_1 = require("./UIToFD");
|
|
|
13
13
|
* @param datasetsInfo Collection of datasets information. If getUIFilterData is true, the datasetsInfo should be mandatory
|
|
14
14
|
* @returns A new filter data structure v2.1
|
|
15
15
|
*/
|
|
16
|
-
function adaptFilterData(filterData, getUIFilterData =
|
|
16
|
+
function adaptFilterData(filterData, getUIFilterData = true, datasetsInfo = []) {
|
|
17
17
|
if (general_1.isEmpty(filterData))
|
|
18
18
|
return;
|
|
19
19
|
filterData = general_1.cloneDeep(filterData);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.flatUIToFD = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
4
5
|
const general_1 = require("../../general");
|
|
5
6
|
const constants_1 = require("../constants");
|
|
6
7
|
/**
|
|
@@ -80,6 +81,7 @@ function buildDataset(uFilter) {
|
|
|
80
81
|
*/
|
|
81
82
|
function buildFilter(uFilter) {
|
|
82
83
|
const info = !general_1.isEmpty(uFilter.extras.info) ? { icon: uFilter.extras.info.icon, label: uFilter.extras.info.label } : undefined;
|
|
84
|
+
const property = _1.adaptDateGroupingProperty(uFilter.property);
|
|
83
85
|
return {
|
|
84
86
|
collapsed: uFilter.collapsed,
|
|
85
87
|
column: {
|
|
@@ -98,7 +100,7 @@ function buildFilter(uFilter) {
|
|
|
98
100
|
lookupDisplayIndex: uFilter.lookupDisplayIndex,
|
|
99
101
|
nullValues: uFilter.nullValues,
|
|
100
102
|
operator: uFilter.operator,
|
|
101
|
-
property
|
|
103
|
+
property,
|
|
102
104
|
validator: uFilter.validator,
|
|
103
105
|
values: uFilter.values,
|
|
104
106
|
};
|
|
@@ -171,14 +171,10 @@ function getGroupValue(props) {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
function getProperty(props) {
|
|
174
|
-
var _a;
|
|
175
174
|
if (general_1.isEmpty(props.column.aggregate)) {
|
|
176
|
-
if (helpers_1.isNullValidator(props.validator)) {
|
|
175
|
+
if (helpers_1.isNullValidator(props.validator) || isDateColumn_1.isDateColumn(props.column)) {
|
|
177
176
|
return undefined;
|
|
178
177
|
}
|
|
179
|
-
else if (isDateColumn_1.isDateColumn(props.column)) {
|
|
180
|
-
return helpers_1.arePropertiesDateP(props.column, props.property) ? (_a = props.property) === null || _a === void 0 ? void 0 : _a.split('p&')[1] : undefined;
|
|
181
|
-
}
|
|
182
178
|
else if (props.column.type === constants_2.COLUMN.EXPRESSION && props.property != null) {
|
|
183
179
|
return undefined;
|
|
184
180
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.flatUIToUI = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
4
5
|
const general_1 = require("../../general");
|
|
5
6
|
const constants_1 = require("../constants");
|
|
6
7
|
const helpers_1 = require("../helpers");
|
|
@@ -87,6 +88,7 @@ function buildDataset(uFilter) {
|
|
|
87
88
|
*/
|
|
88
89
|
function buildFilter(uFilter) {
|
|
89
90
|
const info = !general_1.isEmpty(uFilter.extras.info) ? { icon: uFilter.extras.info.icon, label: uFilter.extras.info.label } : undefined;
|
|
91
|
+
const property = _1.adaptDateGroupingProperty(uFilter.property);
|
|
90
92
|
return {
|
|
91
93
|
collapsed: uFilter.collapsed,
|
|
92
94
|
column: {
|
|
@@ -112,7 +114,7 @@ function buildFilter(uFilter) {
|
|
|
112
114
|
lookupDisplayIndex: uFilter.lookupDisplayIndex,
|
|
113
115
|
nullValues: uFilter.nullValues,
|
|
114
116
|
operator: uFilter.operator,
|
|
115
|
-
property
|
|
117
|
+
property,
|
|
116
118
|
uiValues: helpers_1.getUIValues(uFilter),
|
|
117
119
|
validator: uFilter.validator,
|
|
118
120
|
values: uFilter.values,
|
|
@@ -11,6 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./transformFilters"), exports);
|
|
14
|
+
__exportStar(require("./adaptDateGroupingProperty"), exports);
|
|
14
15
|
__exportStar(require("./adaptFilterData"), exports);
|
|
15
16
|
__exportStar(require("./FDToFlatUI"), exports);
|
|
16
17
|
__exportStar(require("./FDToLogic"), exports);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// TO Logic structure = Cleaner logic structure
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.logicToFlatUI = void 0;
|
|
6
|
+
const _1 = require(".");
|
|
6
7
|
const constants_1 = require("../../constants");
|
|
7
8
|
const general_1 = require("../../general");
|
|
8
9
|
const constants_2 = require("../constants");
|
|
@@ -19,76 +20,89 @@ function logicToFlatUI(logics = []) {
|
|
|
19
20
|
logics.forEach(scopeItem => {
|
|
20
21
|
if (scopeItem.filters.length > 0) {
|
|
21
22
|
scopeItem.filters.forEach(filterItem => {
|
|
22
|
-
filterItem.expressions
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (index === -1 && (!uiExtras.nullValues || expression.validationType !== "IS_EMPTY" /* IS_NULL */)) {
|
|
27
|
-
const scopeid = scopeItem.scope !== "GLOBAL" /* GLOBAL */ ? general_1._get(scopeItem, 'uiExtras.scopeid') : undefined;
|
|
28
|
-
const info = !general_1.isEmpty(uiExtras.info) ? { icon: uiExtras.info.icon, label: uiExtras.info.label } : undefined;
|
|
29
|
-
const uFilter = {
|
|
30
|
-
collapsed: uiExtras.collapsed,
|
|
31
|
-
column: {
|
|
32
|
-
id: (_a = uiExtras.column) === null || _a === void 0 ? void 0 : _a.id,
|
|
33
|
-
formulaType: (_b = uiExtras.column) === null || _b === void 0 ? void 0 : _b.formulaType,
|
|
34
|
-
linkid: (_c = uiExtras.column) === null || _c === void 0 ? void 0 : _c.linkid,
|
|
35
|
-
linked: (_d = uiExtras.column) === null || _d === void 0 ? void 0 : _d.linked,
|
|
36
|
-
qrveyid: (_e = uiExtras.column) === null || _e === void 0 ? void 0 : _e.qrveyid,
|
|
37
|
-
aggregate: (_g = (_f = uiExtras.column) === null || _f === void 0 ? void 0 : _f.aggregate) === null || _g === void 0 ? void 0 : _g.label,
|
|
38
|
-
calculation: (_j = (_h = uiExtras.column) === null || _h === void 0 ? void 0 : _h.calculation) === null || _j === void 0 ? void 0 : _j.value,
|
|
39
|
-
label: (_k = uiExtras.column) === null || _k === void 0 ? void 0 : _k.text,
|
|
40
|
-
property: uiExtras.column.property,
|
|
41
|
-
sorting: uiExtras.column.sorting,
|
|
42
|
-
outputFormat: (_l = uiExtras.column) === null || _l === void 0 ? void 0 : _l.outputFormat,
|
|
43
|
-
type: (_m = uiExtras.column) === null || _m === void 0 ? void 0 : _m.type,
|
|
44
|
-
},
|
|
45
|
-
dateSection: uiExtras.dateSection,
|
|
46
|
-
displayed: true,
|
|
47
|
-
enabled: expression.enabled,
|
|
48
|
-
extras: Object.assign(Object.assign({}, uiExtras.extras), { panelid: uiExtras.panelid, filterLabel: uiExtras.panelName, info,
|
|
49
|
-
scopeid, scope: scopeItem.scope, section: uiExtras.section, scopeInfo: {
|
|
50
|
-
collapsed: (_o = scopeItem.uiExtras) === null || _o === void 0 ? void 0 : _o.collapsed,
|
|
51
|
-
enabled: scopeItem.enabled,
|
|
52
|
-
displayed: true,
|
|
53
|
-
scope: scopeItem.scope,
|
|
54
|
-
scopeid,
|
|
55
|
-
}, dataset: {
|
|
56
|
-
collapsed: false,
|
|
57
|
-
enabled: true,
|
|
58
|
-
displayed: true,
|
|
59
|
-
qrveyid: (_p = uiExtras.column) === null || _p === void 0 ? void 0 : _p.qrveyid,
|
|
60
|
-
label: (_r = (_q = uiExtras.column) === null || _q === void 0 ? void 0 : _q.dataset) === null || _r === void 0 ? void 0 : _r.name,
|
|
61
|
-
linkid: (_s = uiExtras.column) === null || _s === void 0 ? void 0 : _s.linkid,
|
|
62
|
-
} }),
|
|
63
|
-
filterid: undefined,
|
|
64
|
-
lookupDisplayIndex: uiExtras.lookupDisplayIndex,
|
|
65
|
-
nullValues: uiExtras.nullValues,
|
|
66
|
-
operator: uiExtras.operator,
|
|
67
|
-
property: uiExtras.property,
|
|
68
|
-
uiValues: helpers_1.getUIValues(uiExtras),
|
|
69
|
-
validator: uiExtras.validator,
|
|
70
|
-
values: getValues(uiExtras),
|
|
71
|
-
};
|
|
72
|
-
uFilter.filterid = helpers_1.getFilterid(uFilter);
|
|
73
|
-
uFilters.push(uFilter);
|
|
74
|
-
}
|
|
75
|
-
if (uiExtras.column.type === constants_1.COLUMN.RANKING && general_1.isEmpty(uiExtras.column.aggregate)) {
|
|
76
|
-
// Restore uiExtras.values array into single IFilterDetail object values array
|
|
77
|
-
if (index > -1)
|
|
78
|
-
uFilters[index].values.push(uiExtras.values[0]);
|
|
79
|
-
const refinedRankingValues = refineRankingValues((index > -1 ? uFilters[index].values : uiExtras.values), uiExtras.uiValue);
|
|
80
|
-
if (index > -1)
|
|
81
|
-
uFilters[index].values = refinedRankingValues;
|
|
82
|
-
else
|
|
83
|
-
uFilters[uFilters.length - 1].values = refinedRankingValues;
|
|
84
|
-
}
|
|
23
|
+
filterItem.expressions.forEach((expression1) => {
|
|
24
|
+
general_1._hasProperty(expression1, 'expressions') ? expression1.expressions.forEach((expression2) => {
|
|
25
|
+
buildFilterByExpression(expression2, scopeItem, uFilters);
|
|
26
|
+
}) : buildFilterByExpression(expression1, scopeItem, uFilters);
|
|
85
27
|
});
|
|
28
|
+
// (filterItem.expressions[0].expressions as OLD_IFilterExpression[]).forEach((expression: OLD_IFilterExpression) => {
|
|
29
|
+
// buildFilterByExpression(expression, scopeItem, uFilters);
|
|
30
|
+
// });
|
|
86
31
|
});
|
|
87
32
|
}
|
|
88
33
|
});
|
|
89
34
|
return uFilters;
|
|
90
35
|
}
|
|
91
36
|
exports.logicToFlatUI = logicToFlatUI;
|
|
37
|
+
function buildFilterByExpression(expression, scopeItem, uFilters) {
|
|
38
|
+
const uiExtras = expression.uiExtras;
|
|
39
|
+
const index = uiExtras.column.type === constants_1.COLUMN.RANKING ? getFilter(uFilters, expression.uiExtras, true) : -1;
|
|
40
|
+
if (index === -1 && (!uiExtras.nullValues || expression.validationType !== "IS_EMPTY" /* IS_NULL */)) {
|
|
41
|
+
const uFilter = getFilterByExpression(expression, scopeItem);
|
|
42
|
+
uFilter.filterid = helpers_1.getFilterid(uFilter);
|
|
43
|
+
uFilters.push(uFilter);
|
|
44
|
+
}
|
|
45
|
+
if (uiExtras.column.type === constants_1.COLUMN.RANKING && general_1.isEmpty(uiExtras.column.aggregate)) {
|
|
46
|
+
// Restore uiExtras.values array into single IFilterDetail object values array
|
|
47
|
+
if (index > -1)
|
|
48
|
+
uFilters[index].values.push(uiExtras.values[0]);
|
|
49
|
+
const refinedRankingValues = refineRankingValues((index > -1 ? uFilters[index].values : uiExtras.values), uiExtras.uiValue);
|
|
50
|
+
if (index > -1)
|
|
51
|
+
uFilters[index].values = refinedRankingValues;
|
|
52
|
+
else
|
|
53
|
+
uFilters[uFilters.length - 1].values = refinedRankingValues;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function getFilterByExpression(expression, scopeItem) {
|
|
57
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
58
|
+
const uiExtras = expression.uiExtras;
|
|
59
|
+
const scopeid = scopeItem.scope !== "GLOBAL" /* GLOBAL */ ? general_1._get(scopeItem, 'uiExtras.scopeid') : undefined;
|
|
60
|
+
const info = !general_1.isEmpty(uiExtras.info) ? { icon: uiExtras.info.icon, label: uiExtras.info.label } : undefined;
|
|
61
|
+
const property = _1.adaptDateGroupingProperty(uiExtras.property);
|
|
62
|
+
return {
|
|
63
|
+
collapsed: uiExtras.collapsed,
|
|
64
|
+
column: {
|
|
65
|
+
id: (_a = uiExtras.column) === null || _a === void 0 ? void 0 : _a.id,
|
|
66
|
+
formulaType: (_b = uiExtras.column) === null || _b === void 0 ? void 0 : _b.formulaType,
|
|
67
|
+
linkid: (_c = uiExtras.column) === null || _c === void 0 ? void 0 : _c.linkid,
|
|
68
|
+
linked: (_d = uiExtras.column) === null || _d === void 0 ? void 0 : _d.linked,
|
|
69
|
+
qrveyid: (_e = uiExtras.column) === null || _e === void 0 ? void 0 : _e.qrveyid,
|
|
70
|
+
aggregate: (_g = (_f = uiExtras.column) === null || _f === void 0 ? void 0 : _f.aggregate) === null || _g === void 0 ? void 0 : _g.label,
|
|
71
|
+
calculation: (_j = (_h = uiExtras.column) === null || _h === void 0 ? void 0 : _h.calculation) === null || _j === void 0 ? void 0 : _j.value,
|
|
72
|
+
label: (_k = uiExtras.column) === null || _k === void 0 ? void 0 : _k.text,
|
|
73
|
+
property: uiExtras.column.property,
|
|
74
|
+
sorting: uiExtras.column.sorting,
|
|
75
|
+
outputFormat: (_l = uiExtras.column) === null || _l === void 0 ? void 0 : _l.outputFormat,
|
|
76
|
+
type: (_m = uiExtras.column) === null || _m === void 0 ? void 0 : _m.type,
|
|
77
|
+
},
|
|
78
|
+
dateSection: uiExtras.dateSection,
|
|
79
|
+
displayed: true,
|
|
80
|
+
enabled: expression.enabled,
|
|
81
|
+
extras: Object.assign(Object.assign({}, uiExtras.extras), { panelid: uiExtras.panelid, filterLabel: uiExtras.panelName, info,
|
|
82
|
+
scopeid, scope: scopeItem.scope, section: uiExtras.section, scopeInfo: {
|
|
83
|
+
collapsed: (_o = scopeItem.uiExtras) === null || _o === void 0 ? void 0 : _o.collapsed,
|
|
84
|
+
enabled: scopeItem.enabled,
|
|
85
|
+
displayed: true,
|
|
86
|
+
scope: scopeItem.scope,
|
|
87
|
+
scopeid,
|
|
88
|
+
}, dataset: {
|
|
89
|
+
collapsed: false,
|
|
90
|
+
enabled: true,
|
|
91
|
+
displayed: true,
|
|
92
|
+
qrveyid: (_p = uiExtras.column) === null || _p === void 0 ? void 0 : _p.qrveyid,
|
|
93
|
+
label: (_r = (_q = uiExtras.column) === null || _q === void 0 ? void 0 : _q.dataset) === null || _r === void 0 ? void 0 : _r.name,
|
|
94
|
+
linkid: (_s = uiExtras.column) === null || _s === void 0 ? void 0 : _s.linkid,
|
|
95
|
+
} }),
|
|
96
|
+
filterid: undefined,
|
|
97
|
+
lookupDisplayIndex: uiExtras.lookupDisplayIndex,
|
|
98
|
+
nullValues: uiExtras.nullValues,
|
|
99
|
+
operator: uiExtras.operator,
|
|
100
|
+
property,
|
|
101
|
+
uiValues: helpers_1.getUIValues(uiExtras),
|
|
102
|
+
validator: uiExtras.validator,
|
|
103
|
+
values: getValues(uiExtras),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
92
106
|
function getValues(uiExtras) {
|
|
93
107
|
if (helpers_1.isNullValidator(uiExtras.validator) && general_1.isEmpty(uiExtras.values)) {
|
|
94
108
|
return [{ value: constants_2.FILTER_VALIDATOR_VALUE[uiExtras.validator].label, enabled: uiExtras.uiValue[0].enabled != null ? uiExtras.uiValue[0].enabled : true }];
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBackendGroupValue = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
4
5
|
const general_1 = require("../../../general");
|
|
5
6
|
const isDateColumn_1 = require("../../../qrvey/isDateColumn");
|
|
6
|
-
const common_1 = require("../common");
|
|
7
7
|
/**
|
|
8
8
|
* Gets a group value for the backend logic structure
|
|
9
9
|
* @param filter The filter
|
|
10
10
|
* @returns a property
|
|
11
11
|
*/
|
|
12
12
|
function getBackendGroupValue(filter) {
|
|
13
|
-
if (
|
|
14
|
-
|
|
13
|
+
if (general_1.isEmpty(filter.column.aggregate) && isDateColumn_1.isDateColumn(filter.column) && filter.property != null) {
|
|
14
|
+
const property = __1.adaptDateGroupingProperty(filter.property);
|
|
15
|
+
return property;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
exports.getBackendGroupValue = getBackendGroupValue;
|
|
@@ -11,14 +11,10 @@ const common_1 = require("../common");
|
|
|
11
11
|
* @returns a property
|
|
12
12
|
*/
|
|
13
13
|
function getBackendProperty(filter) {
|
|
14
|
-
var _a;
|
|
15
14
|
if (general_1.isEmpty(filter.column.aggregate)) {
|
|
16
|
-
if (common_1.isNullValidator(filter.validator)) {
|
|
15
|
+
if (common_1.isNullValidator(filter.validator) || isDateColumn_1.isDateColumn(filter.column)) {
|
|
17
16
|
return undefined;
|
|
18
17
|
}
|
|
19
|
-
else if (isDateColumn_1.isDateColumn(filter.column)) {
|
|
20
|
-
return common_1.arePropertiesDateP(filter.column, filter.property) ? (_a = filter.property) === null || _a === void 0 ? void 0 : _a.split('p&')[1] : undefined;
|
|
21
|
-
}
|
|
22
18
|
else if (filter.column.type === constants_1.COLUMN.EXPRESSION && filter.property != null) {
|
|
23
19
|
return undefined;
|
|
24
20
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IFSFilter, IFUFilter } from "../..";
|
|
2
|
+
/**
|
|
3
|
+
* Gets the label of the filter property
|
|
4
|
+
* @param filter The UI Filter
|
|
5
|
+
* @returns a string of the filter property label
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFilterPropertyLabel(filter: IFUFilter | IFSFilter): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFilterPropertyLabel = void 0;
|
|
4
|
+
const __1 = require("../../..");
|
|
5
|
+
/**
|
|
6
|
+
* Gets the label of the filter property
|
|
7
|
+
* @param filter The UI Filter
|
|
8
|
+
* @returns a string of the filter property label
|
|
9
|
+
*/
|
|
10
|
+
function getFilterPropertyLabel(filter) {
|
|
11
|
+
return __1.getPropertyLabel(filter.column, filter.property);
|
|
12
|
+
}
|
|
13
|
+
exports.getFilterPropertyLabel = getFilterPropertyLabel;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './excludeUIFiltersByAggregate';
|
|
2
2
|
export * from './excludeUIFlatFiltersByScopes';
|
|
3
|
+
export * from './getFilterPropertyLabel';
|
|
3
4
|
export * from './getOutputFormatByColumn';
|
|
4
5
|
export * from './getUIFlatFilterByParams';
|
|
5
6
|
export * from './getUIFlatFiltersByParams';
|