@qrvey/utils 1.3.0-7 → 1.3.0
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/.eslintrc.json +2 -0
- package/README.md +503 -49
- package/bitbucket-pipelines.yml +24 -16
- package/dist/cjs/column_format/helpers/columnTypeByChart.d.ts +1 -1
- package/dist/cjs/column_format/helpers/defineXYChartFormat.js +4 -3
- package/dist/cjs/columns/helpers/getDatasetColumnByDatasets.d.ts +10 -0
- package/dist/cjs/columns/helpers/{getDatasetColumnyDatasets.js → getDatasetColumnByDatasets.js} +8 -1
- package/dist/cjs/columns/helpers/index.d.ts +1 -2
- package/dist/cjs/columns/helpers/index.js +1 -2
- package/dist/cjs/dates/adapters/index.d.ts +6 -0
- package/dist/cjs/dates/adapters/index.js +6 -0
- package/dist/cjs/filters/adapters/FDToLogic.js +3 -3
- package/dist/cjs/filters/helpers/backend/getLogicByDatasets.d.ts +11 -0
- package/dist/cjs/filters/helpers/backend/getLogicByDatasets.js +34 -0
- package/dist/cjs/filters/helpers/backend/getLogicByDatasetsColumns.d.ts +12 -0
- package/dist/cjs/filters/helpers/backend/getLogicByDatasetsColumns.js +47 -0
- package/dist/cjs/filters/helpers/backend/index.d.ts +2 -0
- package/dist/cjs/filters/helpers/backend/index.js +2 -0
- package/dist/cjs/filters/helpers/common/excludeFiltersByParams.js +1 -1
- package/dist/cjs/filters/helpers/common/getFiltersByDatasetsColumns.d.ts +10 -0
- package/dist/cjs/filters/helpers/common/getFiltersByDatasetsColumns.js +32 -0
- package/dist/cjs/filters/helpers/common/index.d.ts +1 -0
- package/dist/cjs/filters/helpers/common/index.js +1 -0
- package/dist/cjs/filters/helpers/getAvailableScopes.js +5 -5
- package/dist/cjs/filters/interfaces/backend/IFBExpression.d.ts +1 -0
- package/dist/cjs/filters/interfaces/common/IFSAvailableScope.d.ts +1 -0
- package/dist/cjs/filters/interfaces/functions/IFFGetLogicByDatasets.d.ts +6 -0
- package/dist/cjs/filters/interfaces/functions/IFFGetLogicByDatasets.js +2 -0
- package/dist/cjs/filters/interfaces/functions/IFFGetLogicByDatasetsColumns.d.ts +7 -0
- package/dist/cjs/filters/interfaces/functions/IFFGetLogicByDatasetsColumns.js +2 -0
- package/dist/cjs/filters/interfaces/functions/IFFiltersGetData.d.ts +1 -1
- package/dist/cjs/filters/interfaces/functions/index.d.ts +2 -0
- package/dist/cjs/filters/interfaces/functions/index.js +2 -0
- package/dist/cjs/filters/interfaces/index.d.ts +1 -0
- package/dist/cjs/filters/interfaces/index.js +1 -0
- package/dist/cjs/filters/services/Filters.api.js +11 -6
- package/dist/cjs/globalization/helpers/getI18nDateGroupLabel.js +1 -1
- package/dist/cjs/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +10 -0
- package/dist/cjs/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +1 -0
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
- package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +10 -0
- package/dist/cjs/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
- package/dist/cjs/qrvey/helpers/getDatasetByColumn.d.ts +9 -0
- package/dist/cjs/{columns → qrvey}/helpers/getDatasetByColumn.js +8 -2
- package/dist/cjs/qrvey/helpers/index.d.ts +1 -0
- package/dist/cjs/qrvey/helpers/index.js +1 -0
- package/dist/cjs/services/adapters/BBranchesMapToUIBranchesMap.adapter.js +3 -3
- package/dist/cjs/services/adapters/BColumnsToUIColumns.adapter.js +5 -4
- package/dist/cjs/services/adapters/BDatasetsToUIDatasets.adapter.js +3 -2
- package/dist/cjs/services/adapters/BModelToUIModel.adapter.js +1 -1
- package/dist/column_format/helpers/defineXYChartFormat.js +4 -3
- package/dist/columns/helpers/getDatasetColumnByDatasets.d.ts +10 -0
- package/dist/columns/helpers/getDatasetColumnByDatasets.js +15 -0
- package/dist/columns/helpers/index.d.ts +1 -2
- package/dist/columns/helpers/index.js +1 -2
- package/dist/dates/adapters/index.d.ts +6 -0
- package/dist/dates/adapters/index.js +6 -0
- package/dist/filters/adapters/FDToLogic.js +3 -3
- package/dist/filters/helpers/backend/getLogicByDatasets.d.ts +11 -0
- package/dist/filters/helpers/backend/getLogicByDatasets.js +30 -0
- package/dist/filters/helpers/backend/getLogicByDatasetsColumns.d.ts +12 -0
- package/dist/filters/helpers/backend/getLogicByDatasetsColumns.js +43 -0
- package/dist/filters/helpers/backend/index.d.ts +2 -0
- package/dist/filters/helpers/backend/index.js +2 -0
- package/dist/filters/helpers/common/excludeFiltersByParams.js +1 -1
- package/dist/filters/helpers/common/getFiltersByDatasetsColumns.d.ts +10 -0
- package/dist/filters/helpers/common/getFiltersByDatasetsColumns.js +28 -0
- package/dist/filters/helpers/common/index.d.ts +1 -0
- package/dist/filters/helpers/common/index.js +1 -0
- package/dist/filters/helpers/getAvailableScopes.js +5 -5
- package/dist/filters/interfaces/backend/IFBExpression.d.ts +1 -0
- package/dist/filters/interfaces/common/IFSAvailableScope.d.ts +1 -0
- package/dist/filters/interfaces/functions/IFFGetLogicByDatasets.d.ts +6 -0
- package/dist/filters/interfaces/functions/IFFGetLogicByDatasets.js +1 -0
- package/dist/filters/interfaces/functions/IFFGetLogicByDatasetsColumns.d.ts +7 -0
- package/dist/filters/interfaces/functions/IFFGetLogicByDatasetsColumns.js +1 -0
- package/dist/filters/interfaces/functions/IFFiltersGetData.d.ts +1 -1
- package/dist/filters/interfaces/functions/index.d.ts +2 -0
- package/dist/filters/interfaces/functions/index.js +2 -0
- package/dist/filters/interfaces/index.d.ts +1 -0
- package/dist/filters/interfaces/index.js +1 -0
- package/dist/filters/services/Filters.api.js +11 -6
- package/dist/globalization/helpers/getI18nDateGroupLabel.js +1 -1
- package/dist/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.d.ts +10 -0
- package/dist/globalization/interfaces/style_themes/II18nStyleThemesTheme.d.ts +1 -0
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.js +1 -1
- package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.js +10 -0
- package/dist/globalization/labels/style_themes/I18N_STYLE_THEMES.js +1 -0
- package/dist/qrvey/helpers/getDatasetByColumn.d.ts +9 -0
- package/dist/qrvey/helpers/getDatasetByColumn.js +12 -0
- package/dist/qrvey/helpers/index.d.ts +1 -0
- package/dist/qrvey/helpers/index.js +1 -0
- package/dist/services/adapters/BBranchesMapToUIBranchesMap.adapter.js +3 -3
- package/dist/services/adapters/BColumnsToUIColumns.adapter.js +5 -4
- package/dist/services/adapters/BDatasetsToUIDatasets.adapter.js +3 -2
- package/dist/services/adapters/BModelToUIModel.adapter.js +1 -1
- package/jest.config.js +1 -1
- package/package.json +5 -4
- package/src/column_format/helpers/defineXYChartFormat.ts +4 -5
- package/src/columns/helpers/{getDatasetColumnyDatasets.ts → getDatasetColumnByDatasets.ts} +9 -1
- package/src/columns/helpers/index.ts +1 -2
- package/src/dates/adapters/index.ts +6 -0
- package/src/filters/adapters/FDToLogic.ts +5 -5
- package/src/filters/helpers/backend/getLogicByDatasets.ts +37 -0
- package/src/filters/helpers/backend/getLogicByDatasetsColumns.ts +52 -0
- package/src/filters/helpers/backend/index.ts +2 -0
- package/src/filters/helpers/common/excludeFiltersByParams.ts +1 -1
- package/src/filters/helpers/common/getFiltersByDatasetsColumns.ts +40 -0
- package/src/filters/helpers/common/index.ts +1 -0
- package/src/filters/helpers/getAvailableScopes.ts +4 -4
- package/src/filters/interfaces/backend/IFBExpression.ts +1 -0
- package/src/filters/interfaces/common/IFSAvailableScope.ts +1 -0
- package/src/filters/interfaces/functions/IFFGetLogicByDatasets.ts +6 -0
- package/src/filters/interfaces/functions/IFFGetLogicByDatasetsColumns.ts +7 -0
- package/src/filters/interfaces/functions/IFFiltersGetData.ts +1 -1
- package/src/filters/interfaces/functions/index.ts +2 -0
- package/src/filters/interfaces/index.ts +1 -0
- package/src/filters/services/Filters.api.ts +11 -3
- package/src/globalization/helpers/getI18nDateGroupLabel.ts +1 -1
- package/src/globalization/interfaces/chart_builder/II18nChartBuilderStyleOptions.ts +10 -0
- package/src/globalization/interfaces/style_themes/II18nStyleThemesTheme.ts +1 -0
- package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.ts +1 -1
- package/src/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.ts +10 -0
- package/src/globalization/labels/style_themes/I18N_STYLE_THEMES.ts +1 -0
- package/src/qrvey/helpers/getDatasetByColumn.ts +15 -0
- package/src/qrvey/helpers/index.ts +1 -0
- package/src/services/adapters/BBranchesMapToUIBranchesMap.adapter.ts +3 -3
- package/src/services/adapters/BColumnsToUIColumns.adapter.ts +5 -4
- package/src/services/adapters/BDatasetsToUIDatasets.adapter.ts +3 -2
- package/src/services/adapters/BModelToUIModel.adapter.ts +1 -1
- package/test/filters/backend/getLogicByDatasetsColumns.test.js +312 -0
- package/test/tokens/isTokenLabel.test.js +259 -0
- package/tsconfig.json +1 -4
- package/dist/cjs/columns/helpers/getDatasetByColumn.d.ts +0 -3
- package/dist/cjs/columns/helpers/getDatasetColumnyDatasets.d.ts +0 -3
- package/dist/columns/helpers/getDatasetByColumn.d.ts +0 -3
- package/dist/columns/helpers/getDatasetByColumn.js +0 -6
- package/dist/columns/helpers/getDatasetColumnyDatasets.d.ts +0 -3
- package/dist/columns/helpers/getDatasetColumnyDatasets.js +0 -8
- package/src/columns/helpers/getDatasetByColumn.ts +0 -9
- package/test/tokens/isTokenLabel.test.ts +0 -129
|
@@ -16,6 +16,7 @@ const columnTypeByChart_1 = require("./columnTypeByChart");
|
|
|
16
16
|
const defineXYChartFormat = (column, settings) => {
|
|
17
17
|
const { aggregate, type, defaultFormat, outputFormat, selectedFormat, dateGroup } = column;
|
|
18
18
|
const { shelfType, withoutFormat } = settings;
|
|
19
|
+
const columnDefaultFormat = defaultFormat || outputFormat;
|
|
19
20
|
//Defaults
|
|
20
21
|
const defaultText = 'Default';
|
|
21
22
|
//const defaultNumeric = { type: 'NUMERIC', format: 'Numeric' };
|
|
@@ -23,7 +24,7 @@ const defineXYChartFormat = (column, settings) => {
|
|
|
23
24
|
const columnType = (0, columnTypeByChart_1.columnTypeByChart)(column, shelfType, CHART_GROUP_1.CHART_GROUPS.XY);
|
|
24
25
|
const noFormatSupported = DATEGROUP_UNSUPPORT_FORMAT_1.DATEGROUP_UNSUPPORT_FORMAT.some(gp => gp === (dateGroup === null || dateGroup === void 0 ? void 0 : dateGroup.label));
|
|
25
26
|
const isUsedAsNumericColumn = type !== columnType;
|
|
26
|
-
const hasDefaultFormat = (
|
|
27
|
+
const hasDefaultFormat = (0, __1.isEmpty)(selectedFormat) || ((outputFormat === null || outputFormat === void 0 ? void 0 : outputFormat.format) === defaultText) || ((selectedFormat === null || selectedFormat === void 0 ? void 0 : selectedFormat.format) === defaultText);
|
|
27
28
|
switch (columnType) {
|
|
28
29
|
case __1.COLUMN.YES_NO:
|
|
29
30
|
case __1.COLUMN.PHONE:
|
|
@@ -41,7 +42,7 @@ const defineXYChartFormat = (column, settings) => {
|
|
|
41
42
|
return STRING_FORMAT_1.STRING_FORMAT.NONE;
|
|
42
43
|
}
|
|
43
44
|
else if (hasDefaultFormat) {
|
|
44
|
-
return Object.assign(Object.assign({},
|
|
45
|
+
return Object.assign(Object.assign({}, columnDefaultFormat), { format: defaultText, originalFormat: Object.assign({}, outputFormat) });
|
|
45
46
|
}
|
|
46
47
|
else {
|
|
47
48
|
return selectedFormat;
|
|
@@ -62,7 +63,7 @@ const defineXYChartFormat = (column, settings) => {
|
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
65
|
if (withoutFormat === true) {
|
|
65
|
-
return
|
|
66
|
+
return columnDefaultFormat;
|
|
66
67
|
}
|
|
67
68
|
else if (hasDefaultFormat) {
|
|
68
69
|
return Object.assign({}, outputFormat);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDataset } from "../../qrvey/interfaces/IDataset";
|
|
2
|
+
import { IColumn } from "../interfaces/IColumn";
|
|
3
|
+
/**
|
|
4
|
+
* Gets a column from a dataset.
|
|
5
|
+
* Recieves a partial column object and received a full column object from the Dataset
|
|
6
|
+
* @param column a partial column object
|
|
7
|
+
* @param datasets the datasets to look for the colun
|
|
8
|
+
* @returns the Column object
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDatasetColumnByDatasets(column: Partial<IColumn>, datasets: IDataset[]): IColumn;
|
package/dist/cjs/columns/helpers/{getDatasetColumnyDatasets.js → getDatasetColumnByDatasets.js}
RENAMED
|
@@ -3,10 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getDatasetColumnByDatasets = void 0;
|
|
4
4
|
const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
5
5
|
const getDatasetColumn_1 = require("./getDatasetColumn");
|
|
6
|
+
/**
|
|
7
|
+
* Gets a column from a dataset.
|
|
8
|
+
* Recieves a partial column object and received a full column object from the Dataset
|
|
9
|
+
* @param column a partial column object
|
|
10
|
+
* @param datasets the datasets to look for the colun
|
|
11
|
+
* @returns the Column object
|
|
12
|
+
*/
|
|
6
13
|
function getDatasetColumnByDatasets(column, datasets) {
|
|
7
14
|
if ((0, isEmpty_1.isEmpty)(column) || (0, isEmpty_1.isEmpty)(datasets))
|
|
8
15
|
return;
|
|
9
|
-
const dataset = datasets.find(
|
|
16
|
+
const dataset = datasets.find(_dataset => _dataset.qrveyid === column.qrveyid);
|
|
10
17
|
return (0, getDatasetColumn_1.getDatasetColumn)(column, dataset);
|
|
11
18
|
}
|
|
12
19
|
exports.getDatasetColumnByDatasets = getDatasetColumnByDatasets;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './getColumnsLabel';
|
|
2
|
-
export * from './getDatasetByColumn';
|
|
3
2
|
export * from './getDatasetColumn';
|
|
4
|
-
export * from './
|
|
3
|
+
export * from './getDatasetColumnByDatasets';
|
|
5
4
|
export * from './getModelColumn';
|
|
6
5
|
export * from './isComplexColumn';
|
|
7
6
|
export * from './isDateColumn';
|
|
@@ -15,9 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./getColumnsLabel"), exports);
|
|
18
|
-
__exportStar(require("./getDatasetByColumn"), exports);
|
|
19
18
|
__exportStar(require("./getDatasetColumn"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./getDatasetColumnByDatasets"), exports);
|
|
21
20
|
__exportStar(require("./getModelColumn"), exports);
|
|
22
21
|
__exportStar(require("./isComplexColumn"), exports);
|
|
23
22
|
__exportStar(require("./isDateColumn"), exports);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export * from './dateToHms';
|
|
2
|
+
export * from './dateToMdyDate';
|
|
3
|
+
export * from './dateToMonthYear';
|
|
4
|
+
export * from './dateToQuarterYear';
|
|
5
|
+
export * from './dateToWeekYear';
|
|
6
|
+
export * from './dateToYear';
|
|
1
7
|
export * from './mdyDateToDate';
|
|
2
8
|
export * from './monthYearToDate';
|
|
3
9
|
export * from './quarterYearToDate';
|
|
@@ -14,6 +14,12 @@ 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("./dateToHms"), exports);
|
|
18
|
+
__exportStar(require("./dateToMdyDate"), exports);
|
|
19
|
+
__exportStar(require("./dateToMonthYear"), exports);
|
|
20
|
+
__exportStar(require("./dateToQuarterYear"), exports);
|
|
21
|
+
__exportStar(require("./dateToWeekYear"), exports);
|
|
22
|
+
__exportStar(require("./dateToYear"), exports);
|
|
17
23
|
__exportStar(require("./mdyDateToDate"), exports);
|
|
18
24
|
__exportStar(require("./monthYearToDate"), exports);
|
|
19
25
|
__exportStar(require("./quarterYearToDate"), exports);
|
|
@@ -29,8 +29,9 @@ exports.FDToLogic = FDToLogic;
|
|
|
29
29
|
* @returns a filter logic array
|
|
30
30
|
*/
|
|
31
31
|
function getLogicBodyFromFD21(filterData) {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
if ((0, isEmpty_1.isEmpty)(filterData))
|
|
33
|
+
return [];
|
|
34
|
+
return filterData.scopes.reduce((logics, scope) => {
|
|
34
35
|
const logic = buildLogic(scope);
|
|
35
36
|
let filters = [];
|
|
36
37
|
if (scope.datasets.length > 0) {
|
|
@@ -42,7 +43,6 @@ function getLogicBodyFromFD21(filterData) {
|
|
|
42
43
|
logics.push(Object.assign(Object.assign({}, logic), { filters }));
|
|
43
44
|
return logics;
|
|
44
45
|
}, []);
|
|
45
|
-
return logics;
|
|
46
46
|
}
|
|
47
47
|
function buildLogic(scopeSection) {
|
|
48
48
|
return {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IFBLogic } from "../../interfaces/backend/IFBLogic";
|
|
2
|
+
import { IFFGetLogicByDatasets } from "../../interfaces/functions/IFFGetLogicByDatasets";
|
|
3
|
+
/**
|
|
4
|
+
* [TODO: Add filterEmptyArrays to the filterNestedTree filter condition. Firstly, that function should accept this argument]
|
|
5
|
+
* Filters the logic by a qrveyids array
|
|
6
|
+
* If an qrveyid is not provided in the expression the filter passes normally
|
|
7
|
+
* @param logic The logic of the filter
|
|
8
|
+
* @param datasets The collection of qrveyids
|
|
9
|
+
* @returns a new filtered logic
|
|
10
|
+
*/
|
|
11
|
+
export declare function getLogicByDatasets(logic: IFBLogic[], datasets?: string[], settings?: IFFGetLogicByDatasets): IFBLogic[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLogicByDatasets = void 0;
|
|
4
|
+
const general_1 = require("../../../general");
|
|
5
|
+
const isEmpty_1 = require("../../../general/mix/isEmpty");
|
|
6
|
+
/**
|
|
7
|
+
* [TODO: Add filterEmptyArrays to the filterNestedTree filter condition. Firstly, that function should accept this argument]
|
|
8
|
+
* Filters the logic by a qrveyids array
|
|
9
|
+
* If an qrveyid is not provided in the expression the filter passes normally
|
|
10
|
+
* @param logic The logic of the filter
|
|
11
|
+
* @param datasets The collection of qrveyids
|
|
12
|
+
* @returns a new filtered logic
|
|
13
|
+
*/
|
|
14
|
+
function getLogicByDatasets(logic, datasets = [], settings) {
|
|
15
|
+
if ((0, isEmpty_1.isEmpty)(logic))
|
|
16
|
+
return;
|
|
17
|
+
if ((0, isEmpty_1.isEmpty)(datasets))
|
|
18
|
+
return logic;
|
|
19
|
+
settings = getGetLogicByDatasetsSettings(settings);
|
|
20
|
+
return logic.map(_l => (Object.assign(Object.assign({}, _l), { filters: (0, general_1.filterNestedTree)(_l.filters, 'expressions', (expression) => {
|
|
21
|
+
const dataset = datasets.find(_data => _data === expression.qrveyid);
|
|
22
|
+
return (settings.letPassUndefinedProperties.qrveyid && !(0, general_1._hasProperty)(expression, 'qrveyid')) || !(0, isEmpty_1.isEmpty)(dataset);
|
|
23
|
+
}) })));
|
|
24
|
+
}
|
|
25
|
+
exports.getLogicByDatasets = getLogicByDatasets;
|
|
26
|
+
function getGetLogicByDatasetsSettings(settings) {
|
|
27
|
+
var _a, _b, _c;
|
|
28
|
+
return {
|
|
29
|
+
filterEmptyArrays: (_a = settings === null || settings === void 0 ? void 0 : settings.filterEmptyArrays) !== null && _a !== void 0 ? _a : true,
|
|
30
|
+
letPassUndefinedProperties: {
|
|
31
|
+
qrveyid: (_c = (_b = settings === null || settings === void 0 ? void 0 : settings.letPassUndefinedProperties) === null || _b === void 0 ? void 0 : _b.qrveyid) !== null && _c !== void 0 ? _c : true
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IDataset } from "../../../qrvey/interfaces/IDataset";
|
|
2
|
+
import { IFBLogic } from "../../interfaces/backend/IFBLogic";
|
|
3
|
+
import { IFFGetLogicByDatasetsColumns } from "../../interfaces/functions/IFFGetLogicByDatasetsColumns";
|
|
4
|
+
/**
|
|
5
|
+
* @todo MODULE NO READY
|
|
6
|
+
* Filters the logic by a datasets array
|
|
7
|
+
* If an qrveyid is not provided in the expression a the filter passes normally
|
|
8
|
+
* @param logic The logic of the filter
|
|
9
|
+
* @param datasets The collection of datasets
|
|
10
|
+
* @returns a new filtered logic
|
|
11
|
+
*/
|
|
12
|
+
export declare function getLogicByDatasetsColumns(logic: IFBLogic[], datasets?: IDataset[], settings?: IFFGetLogicByDatasetsColumns): IFBLogic[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLogicByDatasetsColumns = void 0;
|
|
4
|
+
const filterNestedTree_1 = require("../../../general/array/filterNestedTree");
|
|
5
|
+
const isEmpty_1 = require("../../../general/mix/isEmpty");
|
|
6
|
+
const hasProperty_1 = require("../../../general/object/hasProperty");
|
|
7
|
+
/**
|
|
8
|
+
* @todo MODULE NO READY
|
|
9
|
+
* Filters the logic by a datasets array
|
|
10
|
+
* If an qrveyid is not provided in the expression a the filter passes normally
|
|
11
|
+
* @param logic The logic of the filter
|
|
12
|
+
* @param datasets The collection of datasets
|
|
13
|
+
* @returns a new filtered logic
|
|
14
|
+
*/
|
|
15
|
+
function getLogicByDatasetsColumns(logic, datasets = [], settings) {
|
|
16
|
+
if ((0, isEmpty_1.isEmpty)(logic))
|
|
17
|
+
return;
|
|
18
|
+
if ((0, isEmpty_1.isEmpty)(datasets))
|
|
19
|
+
return logic;
|
|
20
|
+
settings = getGetLogicByDatasetsSettings(settings);
|
|
21
|
+
return logic.map(_l => (Object.assign(Object.assign({}, _l), { filters: (0, filterNestedTree_1.filterNestedTree)(_l.filters, 'expressions', (expression) => {
|
|
22
|
+
const letQrveyidPass = settings.letPassUndefinedProperties.qrveyid || (0, hasProperty_1._hasProperty)(expression, 'qrveyid');
|
|
23
|
+
let letQuestionidPass = settings.letPassUndefinedProperties.questionid || (0, hasProperty_1._hasProperty)(expression, 'questionid');
|
|
24
|
+
const dataset = letQrveyidPass ? datasets.find(_data => _data.qrveyid === expression.qrveyid) : undefined;
|
|
25
|
+
if (!(0, isEmpty_1.isEmpty)(dataset)) {
|
|
26
|
+
const column = letQuestionidPass ? (dataset.options || []).find(option => option.id === expression.questionid) : undefined;
|
|
27
|
+
letQuestionidPass = letQuestionidPass || !(0, isEmpty_1.isEmpty)(column);
|
|
28
|
+
}
|
|
29
|
+
return (letQrveyidPass && !(0, isEmpty_1.isEmpty)(dataset)) && letQuestionidPass;
|
|
30
|
+
}) })));
|
|
31
|
+
}
|
|
32
|
+
exports.getLogicByDatasetsColumns = getLogicByDatasetsColumns;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the default settings for the getLogicByDatasetsColumn function
|
|
35
|
+
* @param settings the settings given by the implementer
|
|
36
|
+
* @returns an object with all properties set
|
|
37
|
+
*/
|
|
38
|
+
function getGetLogicByDatasetsSettings(settings) {
|
|
39
|
+
var _a, _b, _c, _d, _e;
|
|
40
|
+
return {
|
|
41
|
+
filterEmptyArrays: (_a = settings === null || settings === void 0 ? void 0 : settings.filterEmptyArrays) !== null && _a !== void 0 ? _a : true,
|
|
42
|
+
letPassUndefinedProperties: {
|
|
43
|
+
qrveyid: (_c = (_b = settings === null || settings === void 0 ? void 0 : settings.letPassUndefinedProperties) === null || _b === void 0 ? void 0 : _b.qrveyid) !== null && _c !== void 0 ? _c : true,
|
|
44
|
+
questionid: (_e = (_d = settings === null || settings === void 0 ? void 0 : settings.letPassUndefinedProperties) === null || _d === void 0 ? void 0 : _d.questionid) !== null && _e !== void 0 ? _e : true
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -6,5 +6,7 @@ export * from './getBackendGroupValue';
|
|
|
6
6
|
export * from './getBackendProperty';
|
|
7
7
|
export * from './getBackendValidator';
|
|
8
8
|
export * from './getBackendValues';
|
|
9
|
+
export * from './getLogicByDatasets';
|
|
10
|
+
export * from './getLogicByDatasetsColumns';
|
|
9
11
|
export * from './getLogicByScopes';
|
|
10
12
|
export * from './getLogicByScopesHierarchy';
|
|
@@ -22,6 +22,8 @@ __exportStar(require("./getBackendGroupValue"), exports);
|
|
|
22
22
|
__exportStar(require("./getBackendProperty"), exports);
|
|
23
23
|
__exportStar(require("./getBackendValidator"), exports);
|
|
24
24
|
__exportStar(require("./getBackendValues"), exports);
|
|
25
|
+
__exportStar(require("./getLogicByDatasets"), exports);
|
|
26
|
+
__exportStar(require("./getLogicByDatasetsColumns"), exports);
|
|
25
27
|
__exportStar(require("./getLogicByScopes"), exports);
|
|
26
28
|
__exportStar(require("./getLogicByScopesHierarchy"), exports);
|
|
27
29
|
// export * from './hasDatasetRelatedFilters';
|
|
@@ -31,7 +31,7 @@ function excludeFiltersByParams(filterData, params) {
|
|
|
31
31
|
return Object.assign(Object.assign({}, filter), { values: (filter.values || []).map((value) => {
|
|
32
32
|
if (Array.isArray(value) && value.length > 0) {
|
|
33
33
|
const rankingValues = value;
|
|
34
|
-
rankingValues.map(rValue => {
|
|
34
|
+
return rankingValues.map(rValue => {
|
|
35
35
|
if (params.enableds == null || params.enableds === rValue.enabled)
|
|
36
36
|
return rValue;
|
|
37
37
|
}).filter(Boolean);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDataset } from "../../../qrvey/interfaces/IDataset";
|
|
2
|
+
import { IFUData } from "../../interfaces/ui/IFUData";
|
|
3
|
+
/**
|
|
4
|
+
* Filtering the filters by the columns of datasets.
|
|
5
|
+
* Module specially for CLS.
|
|
6
|
+
* @param data the filter data
|
|
7
|
+
* @param datasets the collection of datasets and their columns
|
|
8
|
+
* @returns A new filter data with the filtered filters by columns
|
|
9
|
+
*/
|
|
10
|
+
export declare function getFiltersByDatasetsColumns(data: IFUData, datasets?: IDataset[]): IFUData;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFiltersByDatasetsColumns = void 0;
|
|
4
|
+
const isEmpty_1 = require("../../../general/mix/isEmpty");
|
|
5
|
+
/**
|
|
6
|
+
* Filtering the filters by the columns of datasets.
|
|
7
|
+
* Module specially for CLS.
|
|
8
|
+
* @param data the filter data
|
|
9
|
+
* @param datasets the collection of datasets and their columns
|
|
10
|
+
* @returns A new filter data with the filtered filters by columns
|
|
11
|
+
*/
|
|
12
|
+
function getFiltersByDatasetsColumns(data, datasets = []) {
|
|
13
|
+
if ((0, isEmpty_1.isEmpty)(data) || (0, isEmpty_1.isEmpty)(data.scopes))
|
|
14
|
+
return;
|
|
15
|
+
if ((0, isEmpty_1.isEmpty)(datasets))
|
|
16
|
+
return data;
|
|
17
|
+
const newData = Object.assign(Object.assign({}, data), { scopes: data.scopes.map(scope => (Object.assign(Object.assign({}, scope), { datasets: scope.datasets.map(filterDataset => {
|
|
18
|
+
const dataset = datasets.find(_data => _data.qrveyid === filterDataset.qrveyid);
|
|
19
|
+
if (!(0, isEmpty_1.isEmpty)(dataset)) {
|
|
20
|
+
return Object.assign(Object.assign({}, filterDataset), { filters: filterDataset.filters.map(filter => {
|
|
21
|
+
const column = (dataset.options || []).find(cInfo => cInfo.id === filter.column.id && cInfo.qrveyid === filter.column.qrveyid);
|
|
22
|
+
if (!(0, isEmpty_1.isEmpty)(column)) {
|
|
23
|
+
return Object.assign({}, filter);
|
|
24
|
+
}
|
|
25
|
+
}).filter(Boolean) });
|
|
26
|
+
}
|
|
27
|
+
}).filter(dataset => !(0, isEmpty_1.isEmpty)(dataset) && dataset.filters.length > 0) }))).filter(scope => !(0, isEmpty_1.isEmpty)(scope) && scope.datasets.length > 0) });
|
|
28
|
+
if (!(0, isEmpty_1.isEmpty)(newData) && newData.scopes.length > 0) {
|
|
29
|
+
return newData;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.getFiltersByDatasetsColumns = getFiltersByDatasetsColumns;
|
|
@@ -6,6 +6,7 @@ export * from './getFilterColumnLabel';
|
|
|
6
6
|
export * from './getFilterid';
|
|
7
7
|
export * from './getFilterLabel';
|
|
8
8
|
export * from './getFiltersByAggregateColumn';
|
|
9
|
+
export * from './getFiltersByDatasetsColumns';
|
|
9
10
|
export * from './getFiltersByParams';
|
|
10
11
|
export * from './getFiltersByScopes';
|
|
11
12
|
export * from './getFiltersByScopesIds';
|
|
@@ -22,6 +22,7 @@ __exportStar(require("./getFilterColumnLabel"), exports);
|
|
|
22
22
|
__exportStar(require("./getFilterid"), exports);
|
|
23
23
|
__exportStar(require("./getFilterLabel"), exports);
|
|
24
24
|
__exportStar(require("./getFiltersByAggregateColumn"), exports);
|
|
25
|
+
__exportStar(require("./getFiltersByDatasetsColumns"), exports);
|
|
25
26
|
__exportStar(require("./getFiltersByParams"), exports);
|
|
26
27
|
__exportStar(require("./getFiltersByScopes"), exports);
|
|
27
28
|
__exportStar(require("./getFiltersByScopesIds"), exports);
|
|
@@ -17,18 +17,18 @@ function getAvailableScopes(config) {
|
|
|
17
17
|
if (!(0, isEmpty_1.isEmpty)(config.predefinedScopes))
|
|
18
18
|
scopes = config.predefinedScopes;
|
|
19
19
|
scopes = [...scopes, { label: FILTER_SCOPE_1.FILTER_SCOPE.GLOBAL, id: undefined }];
|
|
20
|
-
if (config.tabid != null || config.pageid != null) {
|
|
20
|
+
if (config.tabid != null || config.pageid != null || config.panelid != null) {
|
|
21
21
|
if (config.pageid)
|
|
22
22
|
scopes = [...scopes, { label: FILTER_SCOPE_1.FILTER_SCOPE.PAGE, id: config.pageid }];
|
|
23
23
|
if (config.tabid)
|
|
24
24
|
scopes = [...scopes, { label: FILTER_SCOPE_1.FILTER_SCOPE.TAB, id: config.tabid }];
|
|
25
25
|
if (config.defaultid)
|
|
26
26
|
scopes = [...scopes, { label: FILTER_SCOPE_1.FILTER_SCOPE.DEFAULT, id: config.defaultid }];
|
|
27
|
-
|
|
27
|
+
if (config.panelid || config.tabid || config.pageid)
|
|
28
|
+
scopes = [...scopes, { label: FILTER_SCOPE_1.FILTER_SCOPE.CHART, id: config.panelid || config.tabid || config.pageid }];
|
|
28
29
|
}
|
|
29
|
-
else {
|
|
30
|
-
|
|
31
|
-
scopes = [...scopes, { label: FILTER_SCOPE_1.FILTER_SCOPE.DEFAULT, id: config.defaultid }];
|
|
30
|
+
else if (config.defaultid) {
|
|
31
|
+
scopes = [...scopes, { label: FILTER_SCOPE_1.FILTER_SCOPE.DEFAULT, id: config.defaultid }];
|
|
32
32
|
}
|
|
33
33
|
return scopes;
|
|
34
34
|
}
|
|
@@ -6,7 +6,7 @@ import { IFUChartSettings } from "../ui/IFUChartSettings";
|
|
|
6
6
|
import { IFUFlattenedFilter } from "../ui/IFUFlattenedFilter";
|
|
7
7
|
export interface IFFiltersGetData {
|
|
8
8
|
chartRequest?: IFUChartSettings;
|
|
9
|
-
|
|
9
|
+
datasets: IDataset[];
|
|
10
10
|
filterData?: IFSData;
|
|
11
11
|
filter: IFUFlattenedFilter;
|
|
12
12
|
pageid?: string;
|
|
@@ -14,6 +14,8 @@ 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("./IFFGetLogicByDatasets"), exports);
|
|
18
|
+
__exportStar(require("./IFFGetLogicByDatasetsColumns"), exports);
|
|
17
19
|
__exportStar(require("./IFFiltersGetData"), exports);
|
|
18
20
|
__exportStar(require("./IFFiltersGetValuesFromDataset"), exports);
|
|
19
21
|
__exportStar(require("./IFFiltersGetValuesFromModel"), exports);
|
|
@@ -31,6 +31,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
31
31
|
__exportStar(require("./backend/index"), exports);
|
|
32
32
|
__exportStar(require("./builder/index"), exports);
|
|
33
33
|
__exportStar(require("./common/index"), exports);
|
|
34
|
+
__exportStar(require("./functions/index"), exports);
|
|
34
35
|
__exportStar(require("./panel/index"), exports);
|
|
35
36
|
__exportStar(require("./ui/index"), exports);
|
|
36
37
|
__exportStar(require("./IFDateProperty"), exports);
|
|
@@ -30,6 +30,9 @@ const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
|
30
30
|
const getModel_api_1 = require("../../services/api/getModel.api");
|
|
31
31
|
const areStaticColumnValues_1 = require("../../qrvey/helpers/areStaticColumnValues");
|
|
32
32
|
const getValuesFromDataset_1 = require("../helpers/common/getValuesFromDataset");
|
|
33
|
+
const getDatasetByColumn_1 = require("../../qrvey/helpers/getDatasetByColumn");
|
|
34
|
+
const getLogicByDatasets_1 = require("../helpers/backend/getLogicByDatasets");
|
|
35
|
+
const getFiltersByParams_1 = require("../helpers/common/getFiltersByParams");
|
|
33
36
|
class FiltersApi {
|
|
34
37
|
constructor(cfg) {
|
|
35
38
|
this.setConfig(cfg);
|
|
@@ -57,14 +60,14 @@ class FiltersApi {
|
|
|
57
60
|
// return DataTokensApi.getAll(config);
|
|
58
61
|
// }
|
|
59
62
|
getData(config, resetApi = false) {
|
|
60
|
-
var _a, _b, _c, _d, _e;
|
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
|
61
64
|
let promise;
|
|
62
65
|
if ((0, areStaticColumnValues_1.areStaticColumnValues)((_a = config.filter) === null || _a === void 0 ? void 0 : _a.column) && (0, isEmpty_1.isEmpty)((_b = config.filter) === null || _b === void 0 ? void 0 : _b.column.aggregate)) {
|
|
63
66
|
promise = (0, getValuesFromDataset_1.getValuesFromDataset)({
|
|
64
67
|
column: (_c = config.filter) === null || _c === void 0 ? void 0 : _c.column,
|
|
65
68
|
property: (_d = config.filter) === null || _d === void 0 ? void 0 : _d.property,
|
|
66
69
|
lookupDisplay: (_e = config.filter) === null || _e === void 0 ? void 0 : _e.lookupDisplayIndex,
|
|
67
|
-
dataset: config.
|
|
70
|
+
dataset: (0, getDatasetByColumn_1.getDatasetByColumn)((_f = config.filter) === null || _f === void 0 ? void 0 : _f.column, config.datasets),
|
|
68
71
|
value: config.valueText,
|
|
69
72
|
});
|
|
70
73
|
}
|
|
@@ -98,12 +101,14 @@ class FiltersApi {
|
|
|
98
101
|
var _a;
|
|
99
102
|
const scopes = this.getAvailableScopeIds(config);
|
|
100
103
|
let filterData = (0, getFiltersByVisibility_1.getFiltersByVisibility)(config.filterData, scopes);
|
|
104
|
+
const dataset = config.datasets.find(d => { var _a; return d.qrveyid === ((_a = config.filter) === null || _a === void 0 ? void 0 : _a.column.qrveyid); });
|
|
105
|
+
filterData = (0, getFiltersByParams_1.getFiltersByParams)(filterData, { qrveyid: dataset.qrveyid }, { letPassUndefinedProperties: { filter: true }, filterEmptyArrays: { filter: false } });
|
|
101
106
|
filterData = (0, excludeFiltersByAggregateColumn_1.excludeFiltersByAggregateColumn)(filterData);
|
|
102
107
|
const logics = (0, FDToLogic_1.FDToLogic)(filterData);
|
|
103
108
|
const hierarchyLogic = (0, getLogicByScopesHierarchy_1.getLogicByScopesHierarchy)(logics, scopes, (_a = config.filter) === null || _a === void 0 ? void 0 : _a.extras.scope);
|
|
104
109
|
return [
|
|
105
110
|
...hierarchyLogic,
|
|
106
|
-
...(0, buildUserFilters_1.buildUserFilters)(config.userFilters) || [],
|
|
111
|
+
...(0, getLogicByDatasets_1.getLogicByDatasets)((0, buildUserFilters_1.buildUserFilters)(config.userFilters), (0, isEmpty_1.isEmpty)(dataset) ? [] : [dataset.qrveyid]) || [],
|
|
107
112
|
];
|
|
108
113
|
}
|
|
109
114
|
getFilter(config) {
|
|
@@ -119,9 +124,9 @@ class FiltersApi {
|
|
|
119
124
|
* @returns a collection of the pair Scopes and Scope IDs
|
|
120
125
|
*/
|
|
121
126
|
getAvailableScopeIds(config) {
|
|
122
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
123
|
-
return (0, getAvailableScopes_1.getAvailableScopes)(Object.assign(Object.assign({}, (0, getAvailableScopesIDsByConfig_1.getAvailableScopesIDsByConfig)(config)), {
|
|
124
|
-
{ label: FILTER_SCOPE_1.FILTER_SCOPE.DATA, id: (
|
|
127
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
128
|
+
return (0, getAvailableScopes_1.getAvailableScopes)(Object.assign(Object.assign({}, (0, getAvailableScopesIDsByConfig_1.getAvailableScopesIDsByConfig)(config)), { panelid: FILTER_SCOPE_1.FILTER_SCOPE.CHART === ((_a = config.filter) === null || _a === void 0 ? void 0 : _a.extras.scope) ? (_b = config.filter) === null || _b === void 0 ? void 0 : _b.extras.scopeid : undefined, scopeid: (_c = config.filter) === null || _c === void 0 ? void 0 : _c.extras.scopeid, qrveyid: (_e = (_d = config.filter) === null || _d === void 0 ? void 0 : _d.column) === null || _e === void 0 ? void 0 : _e.qrveyid, defaultid: (_g = (_f = config.filter) === null || _f === void 0 ? void 0 : _f.column) === null || _g === void 0 ? void 0 : _g.qrveyid, scope: undefined, predefinedScopes: [
|
|
129
|
+
{ label: FILTER_SCOPE_1.FILTER_SCOPE.DATA, id: (_j = (_h = config.filter) === null || _h === void 0 ? void 0 : _h.column) === null || _j === void 0 ? void 0 : _j.qrveyid }
|
|
125
130
|
] }));
|
|
126
131
|
}
|
|
127
132
|
/**
|
|
@@ -29,7 +29,7 @@ function getI18nMonthLabel(label, translate) {
|
|
|
29
29
|
}
|
|
30
30
|
function getI18nYearMonthLabel(label, translate) {
|
|
31
31
|
if (!(0, isTokenLabel_1.isTokenLabel)(label) && !(0, isEmpty_1.isEmpty)(translate)) {
|
|
32
|
-
const month = getI18nMonthPropertyByIndex(DATE_YEAR_MONTHS_1.DATE_YEAR_MONTHS.findIndex(
|
|
32
|
+
const month = getI18nMonthPropertyByIndex(DATE_YEAR_MONTHS_1.DATE_YEAR_MONTHS.findIndex(_month => _month === label));
|
|
33
33
|
if (!(0, isEmpty_1.isEmpty)(month))
|
|
34
34
|
label = translate('common.date_grouping.' + month + '_mmm');
|
|
35
35
|
}
|
|
@@ -11,6 +11,16 @@ export interface II18nChartBuilderStyleOptions {
|
|
|
11
11
|
chart_type_disabled_message: string;
|
|
12
12
|
comparision_color: string;
|
|
13
13
|
data_labels_check: string;
|
|
14
|
+
data_labels_clustering: string;
|
|
15
|
+
data_labels_format: string;
|
|
16
|
+
data_labels_position: string;
|
|
17
|
+
data_labels_position_inside: string;
|
|
18
|
+
data_labels_position_outside: string;
|
|
19
|
+
data_labels_show_as: string;
|
|
20
|
+
data_labels_show_as_category: string;
|
|
21
|
+
data_labels_show_as_percentage: string;
|
|
22
|
+
data_labels_show_as_placeholder: string;
|
|
23
|
+
data_labels_show_as_value: string;
|
|
14
24
|
default_format_title: string;
|
|
15
25
|
display_outliers_check: string;
|
|
16
26
|
line_opacity: string;
|
|
@@ -12,7 +12,7 @@ exports.I18N_CHART_BUILDER_LAYER_OPTIONS = {
|
|
|
12
12
|
type_logarithmic: 'Logarithmic',
|
|
13
13
|
type_moving_average_trendline: 'Moving Average Trendline',
|
|
14
14
|
type_polynomial: 'Polynomial',
|
|
15
|
-
type_standard_regression: '
|
|
15
|
+
type_standard_regression: 'Standard Regression',
|
|
16
16
|
intercept: 'Intercept',
|
|
17
17
|
slope: 'Slope',
|
|
18
18
|
legend: 'Trend Line'
|
|
@@ -15,6 +15,16 @@ exports.I18N_CHART_BUILDER_STYLE_OPTIONS = {
|
|
|
15
15
|
chart_type_disabled_message: '<i>Type</i> selection is disabled because stacked type configuration is in use.',
|
|
16
16
|
comparision_color: 'Comparision Color',
|
|
17
17
|
data_labels_check: 'Data Labels',
|
|
18
|
+
data_labels_clustering: '<i>Clustering</i> is inactive, enable it to use <i>{{text}}</i>.',
|
|
19
|
+
data_labels_format: '<i>% Difference</i> is active, disable it to set a different formatting.',
|
|
20
|
+
data_labels_position: 'Label Position',
|
|
21
|
+
data_labels_position_inside: 'Inside',
|
|
22
|
+
data_labels_position_outside: 'Outside',
|
|
23
|
+
data_labels_show_as: 'Show as',
|
|
24
|
+
data_labels_show_as_category: 'Category',
|
|
25
|
+
data_labels_show_as_percentage: 'Percentage',
|
|
26
|
+
data_labels_show_as_placeholder: 'Select Option',
|
|
27
|
+
data_labels_show_as_value: 'Value',
|
|
18
28
|
default_format_title: 'Format',
|
|
19
29
|
display_outliers_check: 'Display Outliers',
|
|
20
30
|
line_opacity: 'Line Opacity',
|
|
@@ -43,6 +43,7 @@ exports.I18N_STYLE_THEMES = {
|
|
|
43
43
|
qrvey_theme: 'Qrvey Theme',
|
|
44
44
|
restore_to_default: 'Restore to Default',
|
|
45
45
|
save_theme: 'Save Theme',
|
|
46
|
+
show_header: 'Show Header',
|
|
46
47
|
show_title: 'Show Title',
|
|
47
48
|
table_header_styles: 'Table Header Styles',
|
|
48
49
|
text_styles: 'Text Styles',
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
|
+
import { IDataset } from "../interfaces/IDataset";
|
|
3
|
+
/**
|
|
4
|
+
* Gets a dataset by a given partial column
|
|
5
|
+
* @param column the partial column
|
|
6
|
+
* @param datasets the collection of dataset to look for one.
|
|
7
|
+
* @returns the found dataset or undefined
|
|
8
|
+
*/
|
|
9
|
+
export declare function getDatasetByColumn(column: Partial<IColumn>, datasets?: IDataset[]): IDataset;
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDatasetByColumn = void 0;
|
|
4
4
|
const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Gets a dataset by a given partial column
|
|
7
|
+
* @param column the partial column
|
|
8
|
+
* @param datasets the collection of dataset to look for one.
|
|
9
|
+
* @returns the found dataset or undefined
|
|
10
|
+
*/
|
|
11
|
+
function getDatasetByColumn(column, datasets = []) {
|
|
6
12
|
if ((0, isEmpty_1.isEmpty)(column) || (0, isEmpty_1.isEmpty)(datasets))
|
|
7
13
|
return;
|
|
8
|
-
return datasets.find(dataset => dataset.qrveyid === column.qrveyid
|
|
14
|
+
return datasets.find(dataset => dataset.qrveyid === column.qrveyid);
|
|
9
15
|
}
|
|
10
16
|
exports.getDatasetByColumn = getDatasetByColumn;
|