@qrvey/filters 0.0.44 → 0.1.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/README.md +63 -1
- package/dist/cjs/classes/FilterAdapter.js +1 -80
- package/dist/cjs/classes/FilterBuilder.js +33 -251
- package/dist/cjs/classes/FilterManager.js +7 -64
- package/dist/cjs/classes/FilterResources.js +3 -116
- package/dist/cjs/classes/FilterSearcher.js +0 -77
- package/dist/cjs/classes/FilterValidation.js +0 -93
- package/dist/cjs/classes/FilterValues.js +0 -24
- package/dist/cjs/classes/index.js +8 -21
- package/dist/cjs/helpers/filter-adapt.helpers.js +3 -46
- package/dist/cjs/helpers/filter-adapt.legacy.helpers.js +6 -53
- package/dist/cjs/helpers/filter-adapt.logic.helpers.js +7 -128
- package/dist/cjs/helpers/filter-builder.helpers.js +1 -8
- package/dist/cjs/helpers/filter-settings.helpers.js +6 -41
- package/dist/cjs/helpers/filter-validators.helpers.js +15 -9
- package/dist/cjs/helpers/filter-verbose.helpers.js +211 -0
- package/dist/cjs/helpers/getAggregateFilters.js +11 -0
- package/dist/cjs/helpers/getFilterId.js +1 -17
- package/dist/cjs/helpers/getFilterType.js +1 -8
- package/dist/cjs/helpers/index.js +12 -20
- package/dist/cjs/helpers/isDateDistinctGrouping.js +15 -0
- package/dist/cjs/helpers/isRankingFilter.js +10 -0
- package/dist/cjs/helpers/resolveFilterConditions.js +2 -10
- package/dist/cjs/helpers/utils.helpers.js +2 -19
- package/dist/cjs/index.js +5 -18
- package/dist/cjs/models/index.js +4 -17
- package/dist/cjs/resources/filter-grouping.resources.js +0 -18
- package/dist/cjs/resources/filter-logic.resources.js +0 -3
- package/dist/cjs/resources/filter-scopes.resources.js +10 -27
- package/dist/cjs/resources/filter-validators.resources.js +0 -3
- package/dist/cjs/resources/filter-verbose.resources.js +13 -0
- package/dist/cjs/resources/filters.resources.js +0 -12
- package/dist/cjs/resources/index.js +12 -24
- package/dist/classes/FilterAdapter.d.ts +0 -80
- package/dist/classes/FilterAdapter.js +1 -80
- package/dist/classes/FilterBuilder.d.ts +2 -177
- package/dist/classes/FilterBuilder.js +33 -251
- package/dist/classes/FilterManager.d.ts +7 -62
- package/dist/classes/FilterManager.js +7 -64
- package/dist/classes/FilterResources.d.ts +1 -115
- package/dist/classes/FilterResources.js +3 -116
- package/dist/classes/FilterSearcher.d.ts +2 -77
- package/dist/classes/FilterSearcher.js +0 -77
- package/dist/classes/FilterValidation.d.ts +1 -47
- package/dist/classes/FilterValidation.js +0 -93
- package/dist/classes/FilterValues.d.ts +0 -25
- package/dist/classes/FilterValues.js +0 -24
- package/dist/classes/index.d.ts +0 -1
- package/dist/helpers/filter-adapt.helpers.d.ts +0 -15
- package/dist/helpers/filter-adapt.helpers.js +1 -43
- package/dist/helpers/filter-adapt.legacy.helpers.d.ts +0 -20
- package/dist/helpers/filter-adapt.legacy.helpers.js +3 -49
- package/dist/helpers/filter-adapt.logic.helpers.d.ts +0 -22
- package/dist/helpers/filter-adapt.logic.helpers.js +3 -123
- package/dist/helpers/filter-builder.helpers.d.ts +0 -7
- package/dist/helpers/filter-builder.helpers.js +0 -6
- package/dist/helpers/filter-settings.helpers.d.ts +0 -35
- package/dist/helpers/filter-settings.helpers.js +0 -34
- package/dist/helpers/filter-validators.helpers.d.ts +3 -6
- package/dist/helpers/filter-validators.helpers.js +11 -7
- package/dist/helpers/filter-verbose.helpers.d.ts +6 -0
- package/dist/helpers/filter-verbose.helpers.js +206 -0
- package/dist/helpers/getAggregateFilters.d.ts +3 -0
- package/dist/helpers/getAggregateFilters.js +7 -0
- package/dist/helpers/getFilterId.d.ts +0 -16
- package/dist/helpers/getFilterId.js +0 -15
- package/dist/helpers/getFilterType.d.ts +0 -7
- package/dist/helpers/getFilterType.js +0 -6
- package/dist/helpers/index.d.ts +5 -1
- package/dist/helpers/index.js +5 -0
- package/dist/helpers/isDateDistinctGrouping.d.ts +2 -0
- package/dist/helpers/isDateDistinctGrouping.js +12 -0
- package/dist/helpers/isRankingFilter.d.ts +2 -0
- package/dist/helpers/isRankingFilter.js +7 -0
- package/dist/helpers/resolveFilterConditions.d.ts +0 -8
- package/dist/helpers/resolveFilterConditions.js +1 -8
- package/dist/helpers/utils.helpers.d.ts +0 -17
- package/dist/helpers/utils.helpers.js +0 -16
- package/dist/index.d.ts +0 -1
- package/dist/models/filter-builder.models.d.ts +0 -156
- package/dist/models/filter-resources.models.d.ts +0 -53
- package/dist/models/filter-searcher.models.d.ts +5 -34
- package/dist/models/filter-validation.models.d.ts +0 -40
- package/dist/models/index.d.ts +0 -1
- package/dist/resources/filter-functions.resources.d.ts +0 -49
- package/dist/resources/filter-grouping.resources.d.ts +0 -7
- package/dist/resources/filter-grouping.resources.js +0 -18
- package/dist/resources/filter-logic.resources.d.ts +0 -79
- package/dist/resources/filter-logic.resources.js +0 -3
- package/dist/resources/filter-operators.resources.d.ts +0 -1
- package/dist/resources/filter-panel.interfaces.d.ts +0 -49
- package/dist/resources/filter-scopes.resources.d.ts +2 -25
- package/dist/resources/filter-scopes.resources.js +10 -27
- package/dist/resources/filter-validation.resources.d.ts +0 -1
- package/dist/resources/filter-validators.resources.d.ts +0 -1
- package/dist/resources/filter-validators.resources.js +0 -3
- package/dist/resources/filter-values.resources.d.ts +0 -13
- package/dist/resources/filter-verbose.resources.d.ts +23 -0
- package/dist/resources/filter-verbose.resources.js +10 -0
- package/dist/resources/filter-visual.resources.d.ts +0 -50
- package/dist/resources/filters.resources.d.ts +1 -102
- package/dist/resources/filters.resources.js +0 -12
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.js +1 -0
- package/package.json +59 -44
- package/.eslintignore +0 -6
- package/.eslintrc.json +0 -122
- package/.husky/pre-commit +0 -4
- package/.lintstagedrc +0 -7
- package/.prettierignore +0 -6
- package/.prettierrc.json +0 -1
- package/CHANGELOG.md +0 -268
- package/CODE_OF_CONDUCT.md +0 -132
- package/bitbucket-pipelines.yml +0 -92
- package/dist/cjs/classes/FilterAdapter.d.ts +0 -107
- package/dist/cjs/classes/FilterAdapter.d.ts.map +0 -1
- package/dist/cjs/classes/FilterBuilder.d.ts +0 -206
- package/dist/cjs/classes/FilterBuilder.d.ts.map +0 -1
- package/dist/cjs/classes/FilterManager.d.ts +0 -84
- package/dist/cjs/classes/FilterManager.d.ts.map +0 -1
- package/dist/cjs/classes/FilterResources.d.ts +0 -139
- package/dist/cjs/classes/FilterResources.d.ts.map +0 -1
- package/dist/cjs/classes/FilterSearcher.d.ts +0 -90
- package/dist/cjs/classes/FilterSearcher.d.ts.map +0 -1
- package/dist/cjs/classes/FilterValidation.d.ts +0 -58
- package/dist/cjs/classes/FilterValidation.d.ts.map +0 -1
- package/dist/cjs/classes/FilterValues.d.ts +0 -33
- package/dist/cjs/classes/FilterValues.d.ts.map +0 -1
- package/dist/cjs/classes/index.d.ts +0 -8
- package/dist/cjs/classes/index.d.ts.map +0 -1
- package/dist/cjs/helpers/filter-adapt.helpers.d.ts +0 -21
- package/dist/cjs/helpers/filter-adapt.helpers.d.ts.map +0 -1
- package/dist/cjs/helpers/filter-adapt.legacy.helpers.d.ts +0 -26
- package/dist/cjs/helpers/filter-adapt.legacy.helpers.d.ts.map +0 -1
- package/dist/cjs/helpers/filter-adapt.logic.helpers.d.ts +0 -29
- package/dist/cjs/helpers/filter-adapt.logic.helpers.d.ts.map +0 -1
- package/dist/cjs/helpers/filter-builder.helpers.d.ts +0 -11
- package/dist/cjs/helpers/filter-builder.helpers.d.ts.map +0 -1
- package/dist/cjs/helpers/filter-settings.helpers.d.ts +0 -42
- package/dist/cjs/helpers/filter-settings.helpers.d.ts.map +0 -1
- package/dist/cjs/helpers/filter-validators.helpers.d.ts +0 -8
- package/dist/cjs/helpers/filter-validators.helpers.d.ts.map +0 -1
- package/dist/cjs/helpers/getFilterId.d.ts +0 -18
- package/dist/cjs/helpers/getFilterId.d.ts.map +0 -1
- package/dist/cjs/helpers/getFilterType.d.ts +0 -11
- package/dist/cjs/helpers/getFilterType.d.ts.map +0 -1
- package/dist/cjs/helpers/index.d.ts +0 -7
- package/dist/cjs/helpers/index.d.ts.map +0 -1
- package/dist/cjs/helpers/resolveFilterConditions.d.ts +0 -11
- package/dist/cjs/helpers/resolveFilterConditions.d.ts.map +0 -1
- package/dist/cjs/helpers/utils.helpers.d.ts +0 -26
- package/dist/cjs/helpers/utils.helpers.d.ts.map +0 -1
- package/dist/cjs/index.d.ts +0 -5
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/models/filter-builder.models.d.ts +0 -203
- package/dist/cjs/models/filter-builder.models.d.ts.map +0 -1
- package/dist/cjs/models/filter-resources.models.d.ts +0 -71
- package/dist/cjs/models/filter-resources.models.d.ts.map +0 -1
- package/dist/cjs/models/filter-searcher.models.d.ts +0 -42
- package/dist/cjs/models/filter-searcher.models.d.ts.map +0 -1
- package/dist/cjs/models/filter-validation.models.d.ts +0 -59
- package/dist/cjs/models/filter-validation.models.d.ts.map +0 -1
- package/dist/cjs/models/index.d.ts +0 -4
- package/dist/cjs/models/index.d.ts.map +0 -1
- package/dist/cjs/resources/filter-functions.resources.d.ts +0 -94
- package/dist/cjs/resources/filter-functions.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filter-grouping.resources.d.ts +0 -103
- package/dist/cjs/resources/filter-grouping.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filter-logic.resources.d.ts +0 -135
- package/dist/cjs/resources/filter-logic.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filter-operators.resources.d.ts +0 -16
- package/dist/cjs/resources/filter-operators.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filter-panel.interfaces.d.ts +0 -80
- package/dist/cjs/resources/filter-panel.interfaces.d.ts.map +0 -1
- package/dist/cjs/resources/filter-scopes.resources.d.ts +0 -62
- package/dist/cjs/resources/filter-scopes.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filter-validation.resources.d.ts +0 -20
- package/dist/cjs/resources/filter-validation.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filter-validators.resources.d.ts +0 -80
- package/dist/cjs/resources/filter-validators.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filter-values.resources.d.ts +0 -40
- package/dist/cjs/resources/filter-values.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filter-visual.resources.d.ts +0 -77
- package/dist/cjs/resources/filter-visual.resources.d.ts.map +0 -1
- package/dist/cjs/resources/filters.resources.d.ts +0 -168
- package/dist/cjs/resources/filters.resources.d.ts.map +0 -1
- package/dist/cjs/resources/index.d.ts +0 -11
- package/dist/cjs/resources/index.d.ts.map +0 -1
- package/dist/classes/FilterAdapter.d.ts.map +0 -1
- package/dist/classes/FilterBuilder.d.ts.map +0 -1
- package/dist/classes/FilterManager.d.ts.map +0 -1
- package/dist/classes/FilterResources.d.ts.map +0 -1
- package/dist/classes/FilterSearcher.d.ts.map +0 -1
- package/dist/classes/FilterValidation.d.ts.map +0 -1
- package/dist/classes/FilterValues.d.ts.map +0 -1
- package/dist/classes/index.d.ts.map +0 -1
- package/dist/helpers/filter-adapt.helpers.d.ts.map +0 -1
- package/dist/helpers/filter-adapt.legacy.helpers.d.ts.map +0 -1
- package/dist/helpers/filter-adapt.logic.helpers.d.ts.map +0 -1
- package/dist/helpers/filter-builder.helpers.d.ts.map +0 -1
- package/dist/helpers/filter-settings.helpers.d.ts.map +0 -1
- package/dist/helpers/filter-validators.helpers.d.ts.map +0 -1
- package/dist/helpers/getFilterId.d.ts.map +0 -1
- package/dist/helpers/getFilterType.d.ts.map +0 -1
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/resolveFilterConditions.d.ts.map +0 -1
- package/dist/helpers/utils.helpers.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/models/filter-builder.models.d.ts.map +0 -1
- package/dist/models/filter-resources.models.d.ts.map +0 -1
- package/dist/models/filter-searcher.models.d.ts.map +0 -1
- package/dist/models/filter-validation.models.d.ts.map +0 -1
- package/dist/models/index.d.ts.map +0 -1
- package/dist/resources/filter-functions.resources.d.ts.map +0 -1
- package/dist/resources/filter-grouping.resources.d.ts.map +0 -1
- package/dist/resources/filter-logic.resources.d.ts.map +0 -1
- package/dist/resources/filter-operators.resources.d.ts.map +0 -1
- package/dist/resources/filter-panel.interfaces.d.ts.map +0 -1
- package/dist/resources/filter-scopes.resources.d.ts.map +0 -1
- package/dist/resources/filter-validation.resources.d.ts.map +0 -1
- package/dist/resources/filter-validators.resources.d.ts.map +0 -1
- package/dist/resources/filter-values.resources.d.ts.map +0 -1
- package/dist/resources/filter-visual.resources.d.ts.map +0 -1
- package/dist/resources/filters.resources.d.ts.map +0 -1
- package/dist/resources/index.d.ts.map +0 -1
- package/jest.config.js +0 -10
- package/jsdoc.config.json +0 -14
- package/scripts/clean-build/index.js +0 -62
- package/sonar-project.properties +0 -2
- package/src/classes/FilterAdapter.ts +0 -208
- package/src/classes/FilterBuilder.ts +0 -821
- package/src/classes/FilterManager.ts +0 -126
- package/src/classes/FilterResources.ts +0 -411
- package/src/classes/FilterSearcher.ts +0 -243
- package/src/classes/FilterValidation.ts +0 -221
- package/src/classes/FilterValues.ts +0 -89
- package/src/classes/index.ts +0 -7
- package/src/helpers/filter-adapt.helpers.ts +0 -204
- package/src/helpers/filter-adapt.legacy.helpers.ts +0 -298
- package/src/helpers/filter-adapt.logic.helpers.ts +0 -631
- package/src/helpers/filter-builder.helpers.ts +0 -28
- package/src/helpers/filter-settings.helpers.ts +0 -133
- package/src/helpers/filter-validators.helpers.ts +0 -15
- package/src/helpers/getFilterId.ts +0 -35
- package/src/helpers/getFilterType.ts +0 -23
- package/src/helpers/index.ts +0 -6
- package/src/helpers/resolveFilterConditions.ts +0 -29
- package/src/helpers/utils.helpers.ts +0 -37
- package/src/index.ts +0 -4
- package/src/models/filter-builder.models.ts +0 -256
- package/src/models/filter-resources.models.ts +0 -89
- package/src/models/filter-searcher.models.ts +0 -61
- package/src/models/filter-validation.models.ts +0 -71
- package/src/models/index.ts +0 -3
- package/src/resources/filter-functions.resources.ts +0 -132
- package/src/resources/filter-grouping.resources.ts +0 -531
- package/src/resources/filter-logic.resources.ts +0 -148
- package/src/resources/filter-operators.resources.ts +0 -40
- package/src/resources/filter-panel.interfaces.ts +0 -86
- package/src/resources/filter-scopes.resources.ts +0 -152
- package/src/resources/filter-validation.resources.ts +0 -90
- package/src/resources/filter-validators.resources.ts +0 -411
- package/src/resources/filter-values.resources.ts +0 -57
- package/src/resources/filter-visual.resources.ts +0 -86
- package/src/resources/filters.resources.ts +0 -232
- package/src/resources/index.ts +0 -10
- package/tests/classes/FilterAdapter.test.ts +0 -124
- package/tests/classes/FilterBuilder.test.ts +0 -903
- package/tests/classes/FilterResources.test.ts +0 -267
- package/tests/classes/FilterSearcher.test.ts +0 -188
- package/tests/classes/FilterValidation.test.ts +0 -54
- package/tests/helpers/getFilterId.test.ts +0 -121
- package/tests/mock/datasets.mock.ts +0 -61
- package/tests/mock/filters-adapter.mock.ts +0 -646
- package/tests/mock/filters-interactive-table.mock.ts +0 -59
- package/tests/mock/filters.mock.ts +0 -277
- package/tsconfig.doc.json +0 -4
- package/tsconfig.eslint.json +0 -4
- package/tsconfig.json +0 -113
|
@@ -2,58 +2,30 @@ import { isEmpty, isNaNV2, objectCopy } from "@qrvey/utils";
|
|
|
2
2
|
import { FilterSearcher } from "./FilterSearcher";
|
|
3
3
|
import { FilterValidation } from "./FilterValidation";
|
|
4
4
|
import { FilterValues } from "./FilterValues";
|
|
5
|
+
import { getFilterGrouping } from "../helpers/filter-builder.helpers";
|
|
5
6
|
import { getEditFiltersSettings, getFilterAddSettings, getFilterCreateSettings, getReplaceByParamsSettings, } from "../helpers/filter-settings.helpers";
|
|
6
7
|
import { getFilterId } from "../helpers/getFilterId";
|
|
7
8
|
import { getFilterType } from "../helpers/getFilterType";
|
|
8
9
|
import { FILTER_OPERATOR } from "../resources/filter-operators.resources";
|
|
9
10
|
import { DEFAULT_FILTER, FILTER_TYPE, } from "../resources/filters.resources";
|
|
10
|
-
import { getFilterGrouping } from "../helpers/filter-builder.helpers";
|
|
11
|
-
/**
|
|
12
|
-
* Class to build new filters and manipulate ones.
|
|
13
|
-
*/
|
|
14
11
|
export class FilterBuilder {
|
|
15
12
|
filters;
|
|
16
|
-
/**
|
|
17
|
-
* Instance to search filters
|
|
18
|
-
*/
|
|
19
13
|
searchEngine;
|
|
20
|
-
|
|
21
|
-
* Constructor
|
|
22
|
-
* @param filters the collection of filters
|
|
23
|
-
*/
|
|
24
|
-
constructor(filters = []) {
|
|
14
|
+
constructor(filters = [], searchEngine) {
|
|
25
15
|
this.filters = filters;
|
|
26
|
-
this.searchEngine = new FilterSearcher(filters);
|
|
16
|
+
this.searchEngine = searchEngine ?? new FilterSearcher(filters);
|
|
27
17
|
this.filters = objectCopy(Array.isArray(filters) ? filters : []);
|
|
18
|
+
this.searchEngine.setFilters(this.filters);
|
|
28
19
|
}
|
|
29
|
-
/**
|
|
30
|
-
* **************************************************************************************************
|
|
31
|
-
****************************************** Adding **************************************************
|
|
32
|
-
****************************************************************************************************
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* Adds various filter into the collection.
|
|
36
|
-
* Inserts them next to the last similar filter
|
|
37
|
-
* @param newFilters the filter to add
|
|
38
|
-
* @param inIndexes collection of indexes to add the new filters
|
|
39
|
-
* @param settings the settings object to setup this function
|
|
40
|
-
* @returns the new collection of filters
|
|
41
|
-
*/
|
|
42
20
|
addMultiple(newFilters, inIndexes, settings) {
|
|
43
21
|
if (isEmpty(newFilters))
|
|
44
22
|
return { resulting: this.filters };
|
|
45
23
|
const filters = objectCopy(this.filters);
|
|
46
24
|
const affected = [];
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
catch (_error) {
|
|
54
|
-
this.filters = filters;
|
|
55
|
-
return { resulting: filters };
|
|
56
|
-
}
|
|
25
|
+
newFilters.forEach((newFilter, index) => {
|
|
26
|
+
const affectedFilter = this.addSingle(newFilter, inIndexes?.[index], settings);
|
|
27
|
+
affected.push(affectedFilter.affected);
|
|
28
|
+
});
|
|
57
29
|
this.sync();
|
|
58
30
|
return {
|
|
59
31
|
resulting: this.filters,
|
|
@@ -61,17 +33,6 @@ export class FilterBuilder {
|
|
|
61
33
|
original: filters,
|
|
62
34
|
};
|
|
63
35
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Adds one filter into the collection.
|
|
66
|
-
* - Inserts it next to the last similar filter
|
|
67
|
-
* - If the new one is match with the last similar filter, the operator will change to OR
|
|
68
|
-
* - If the id is not provided, a new one is created.
|
|
69
|
-
* - If the inIndex nunber is provided, this will be the index where the filter is inserted
|
|
70
|
-
* @param filter the filter to add
|
|
71
|
-
* @param inIndex the index to add the new filter
|
|
72
|
-
* @param settings settings object to setup this function
|
|
73
|
-
* @returns the new collection of filters
|
|
74
|
-
*/
|
|
75
36
|
addSingle(filter, inIndex, settings) {
|
|
76
37
|
if (isEmpty(filter))
|
|
77
38
|
return { resulting: this.filters };
|
|
@@ -114,12 +75,6 @@ export class FilterBuilder {
|
|
|
114
75
|
original,
|
|
115
76
|
};
|
|
116
77
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Adds one value from filter
|
|
119
|
-
* @param id the ID to search the filter to add value
|
|
120
|
-
* @param value the value to add
|
|
121
|
-
* @returns the new filter collection
|
|
122
|
-
*/
|
|
123
78
|
addValue(id, value) {
|
|
124
79
|
const index = this.searchEngine.findIndexByParams({ id });
|
|
125
80
|
if (index < 0)
|
|
@@ -135,28 +90,15 @@ export class FilterBuilder {
|
|
|
135
90
|
original,
|
|
136
91
|
};
|
|
137
92
|
}
|
|
138
|
-
/**
|
|
139
|
-
* Adds various values on filter
|
|
140
|
-
* @param id the ID to search the filter to add value
|
|
141
|
-
* @param values the collection of value to add
|
|
142
|
-
* @returns the new filter collection
|
|
143
|
-
*/
|
|
144
93
|
addValues(id, values) {
|
|
145
94
|
const index = this.searchEngine.findIndexByParams({ id });
|
|
146
95
|
if (isEmpty(values) || index < 0)
|
|
147
96
|
return { resulting: this.filters };
|
|
148
|
-
const filters = objectCopy(this.filters);
|
|
149
97
|
const original = objectCopy(this.filters[index]);
|
|
150
98
|
let affected;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
catch (_error) {
|
|
157
|
-
this.filters = filters;
|
|
158
|
-
return { resulting: filters };
|
|
159
|
-
}
|
|
99
|
+
values.forEach((value) => {
|
|
100
|
+
affected = this.addValue(id, value).affected;
|
|
101
|
+
});
|
|
160
102
|
this.sync();
|
|
161
103
|
return {
|
|
162
104
|
resulting: this.filters,
|
|
@@ -164,17 +106,6 @@ export class FilterBuilder {
|
|
|
164
106
|
original,
|
|
165
107
|
};
|
|
166
108
|
}
|
|
167
|
-
/**
|
|
168
|
-
* **************************************************************************************************
|
|
169
|
-
**************************************** Deleting **************************************************
|
|
170
|
-
****************************************************************************************************
|
|
171
|
-
*/
|
|
172
|
-
/**
|
|
173
|
-
* Removes various filters by params
|
|
174
|
-
* @param params params to search the filters to delete
|
|
175
|
-
* @param settings settings for this function
|
|
176
|
-
* @returns the new collection of filters
|
|
177
|
-
*/
|
|
178
109
|
deleteByParams(params, settings) {
|
|
179
110
|
const original = objectCopy(this.filters);
|
|
180
111
|
const affected = this.searchEngine.filterByParams(params, settings);
|
|
@@ -186,26 +117,15 @@ export class FilterBuilder {
|
|
|
186
117
|
original,
|
|
187
118
|
};
|
|
188
119
|
}
|
|
189
|
-
/**
|
|
190
|
-
* Removes various filters from the collection
|
|
191
|
-
* @param ids a collection of ID to search filters to remove
|
|
192
|
-
* @returns the new filter collection
|
|
193
|
-
*/
|
|
194
120
|
deleteMultiple(ids) {
|
|
195
121
|
if (!Array.isArray(ids))
|
|
196
122
|
return { resulting: this.filters };
|
|
197
123
|
const filters = objectCopy(this.filters);
|
|
198
124
|
const affected = [];
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
catch (_error) {
|
|
206
|
-
this.filters = filters;
|
|
207
|
-
return { resulting: filters };
|
|
208
|
-
}
|
|
125
|
+
ids.forEach((id) => {
|
|
126
|
+
const deleted = this.deleteSingle(id);
|
|
127
|
+
affected.push(deleted.affected);
|
|
128
|
+
});
|
|
209
129
|
this.sync();
|
|
210
130
|
return {
|
|
211
131
|
resulting: this.filters,
|
|
@@ -213,11 +133,6 @@ export class FilterBuilder {
|
|
|
213
133
|
original: filters,
|
|
214
134
|
};
|
|
215
135
|
}
|
|
216
|
-
/**
|
|
217
|
-
* Removes one filter from the collection
|
|
218
|
-
* @param id the ID to search the filter to remove
|
|
219
|
-
* @returns the new filter collection
|
|
220
|
-
*/
|
|
221
136
|
deleteSingle(id) {
|
|
222
137
|
const index = this.searchEngine.findIndexByParams({ id });
|
|
223
138
|
const original = { ...this.filters[index] };
|
|
@@ -232,12 +147,6 @@ export class FilterBuilder {
|
|
|
232
147
|
original,
|
|
233
148
|
};
|
|
234
149
|
}
|
|
235
|
-
/**
|
|
236
|
-
* Removes one value from filter
|
|
237
|
-
* @param id the ID to search the filter to remove value
|
|
238
|
-
* @param index the index to search the value to remove
|
|
239
|
-
* @returns the new filter collection
|
|
240
|
-
*/
|
|
241
150
|
deleteValue(id, index) {
|
|
242
151
|
if (!Number.isInteger(index))
|
|
243
152
|
return { resulting: this.filters };
|
|
@@ -256,30 +165,16 @@ export class FilterBuilder {
|
|
|
256
165
|
original,
|
|
257
166
|
};
|
|
258
167
|
}
|
|
259
|
-
/**
|
|
260
|
-
* Removes various values from filter
|
|
261
|
-
* @param id the ID to search the filter to remove value
|
|
262
|
-
* @param indexes the index collection to search the value to remove
|
|
263
|
-
* @returns the new filter collection
|
|
264
|
-
*/
|
|
265
168
|
deleteValues(id, indexes) {
|
|
266
169
|
if (!Array.isArray(indexes))
|
|
267
170
|
return { resulting: this.filters };
|
|
268
|
-
|
|
269
|
-
sortedIndex = indexes.reverse();
|
|
270
|
-
const filters = objectCopy(this.filters);
|
|
171
|
+
const sortedIndex = indexes.sort().reverse();
|
|
271
172
|
const original = this.searchEngine.findByParams({
|
|
272
173
|
id,
|
|
273
174
|
});
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
catch (_error) {
|
|
280
|
-
this.filters = filters;
|
|
281
|
-
return { resulting: filters };
|
|
282
|
-
}
|
|
175
|
+
sortedIndex.forEach((index) => {
|
|
176
|
+
this.deleteValue(id, index);
|
|
177
|
+
});
|
|
283
178
|
this.sync();
|
|
284
179
|
const affected = this.searchEngine.findByParams({ id });
|
|
285
180
|
return {
|
|
@@ -288,18 +183,6 @@ export class FilterBuilder {
|
|
|
288
183
|
original,
|
|
289
184
|
};
|
|
290
185
|
}
|
|
291
|
-
/**
|
|
292
|
-
* **************************************************************************************************
|
|
293
|
-
****************************************** Editing *************************************************
|
|
294
|
-
****************************************************************************************************
|
|
295
|
-
*/
|
|
296
|
-
/**
|
|
297
|
-
* Edits various filters from the collection
|
|
298
|
-
* @param ids the collection of IDs to search filters to edit
|
|
299
|
-
* @param filters a collection of object with properties to edit
|
|
300
|
-
* @param settings settings object for the function
|
|
301
|
-
* @returns the new filter collection
|
|
302
|
-
*/
|
|
303
186
|
editMultiple(ids, filters, settings) {
|
|
304
187
|
if (!Array.isArray(ids) ||
|
|
305
188
|
!Array.isArray(filters) ||
|
|
@@ -307,16 +190,10 @@ export class FilterBuilder {
|
|
|
307
190
|
return { resulting: this.filters };
|
|
308
191
|
const originalFilters = objectCopy(this.filters);
|
|
309
192
|
const editedFilters = [];
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
catch (_error) {
|
|
317
|
-
this.filters = originalFilters;
|
|
318
|
-
return { resulting: originalFilters };
|
|
319
|
-
}
|
|
193
|
+
ids.forEach((id, index) => {
|
|
194
|
+
const editedFilter = this.editSingle(id, filters[index], settings);
|
|
195
|
+
editedFilters.push(editedFilter.affected);
|
|
196
|
+
});
|
|
320
197
|
this.sync();
|
|
321
198
|
return {
|
|
322
199
|
resulting: this.filters,
|
|
@@ -324,13 +201,6 @@ export class FilterBuilder {
|
|
|
324
201
|
original: originalFilters,
|
|
325
202
|
};
|
|
326
203
|
}
|
|
327
|
-
/**
|
|
328
|
-
* Edits one filter from the collection
|
|
329
|
-
* @param id the ID to search the filter to edit
|
|
330
|
-
* @param filter an object with properties to edit
|
|
331
|
-
* @param settings settings object for the function
|
|
332
|
-
* @returns the new filter collection
|
|
333
|
-
*/
|
|
334
204
|
editSingle(id, filter, settings) {
|
|
335
205
|
if (isEmpty(filter))
|
|
336
206
|
return { resulting: this.filters };
|
|
@@ -353,13 +223,6 @@ export class FilterBuilder {
|
|
|
353
223
|
original,
|
|
354
224
|
};
|
|
355
225
|
}
|
|
356
|
-
/**
|
|
357
|
-
* Edits one value from filter
|
|
358
|
-
* @param id the ID to search the filter to edit value
|
|
359
|
-
* @param value the value to edit
|
|
360
|
-
* @param index the value index to edit
|
|
361
|
-
* @returns the new filter collection
|
|
362
|
-
*/
|
|
363
226
|
editValue(id, value, index) {
|
|
364
227
|
const filterIndex = this.searchEngine.findIndexByParams({ id });
|
|
365
228
|
if (isEmpty(value) ||
|
|
@@ -377,29 +240,16 @@ export class FilterBuilder {
|
|
|
377
240
|
original,
|
|
378
241
|
};
|
|
379
242
|
}
|
|
380
|
-
/**
|
|
381
|
-
* Edits various values from filter
|
|
382
|
-
* @param id the ID to search the filter to edit value
|
|
383
|
-
* @param values the value collection to edit
|
|
384
|
-
* @param indexes the index collection to edit
|
|
385
|
-
* @returns the new filter collection
|
|
386
|
-
*/
|
|
387
243
|
editValues(id, values, indexes) {
|
|
388
244
|
const filterIndex = this.searchEngine.findIndexByParams({ id });
|
|
389
245
|
if (isEmpty(values) || filterIndex < 0 || !Array.isArray(indexes))
|
|
390
246
|
return { resulting: this.filters };
|
|
391
247
|
const original = objectCopy(this.filters);
|
|
392
248
|
let finalAffectedFilter;
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
catch (_error) {
|
|
400
|
-
this.filters = original;
|
|
401
|
-
return { resulting: original };
|
|
402
|
-
}
|
|
249
|
+
values.forEach((value, index) => {
|
|
250
|
+
const affectedFilter = this.editValue(id, value, indexes[index]);
|
|
251
|
+
finalAffectedFilter = affectedFilter.affected;
|
|
252
|
+
});
|
|
403
253
|
this.sync();
|
|
404
254
|
return {
|
|
405
255
|
resulting: this.filters,
|
|
@@ -407,17 +257,6 @@ export class FilterBuilder {
|
|
|
407
257
|
original: original[filterIndex],
|
|
408
258
|
};
|
|
409
259
|
}
|
|
410
|
-
/**
|
|
411
|
-
* **************************************************************************************************
|
|
412
|
-
****************************************** Merging *************************************************
|
|
413
|
-
****************************************************************************************************
|
|
414
|
-
*/
|
|
415
|
-
/**
|
|
416
|
-
* Merge the filter into the collection by some filter parameters
|
|
417
|
-
* @param filter the filter to merge
|
|
418
|
-
* @param settings the settings object to setup this function
|
|
419
|
-
* @returns the new filter collection
|
|
420
|
-
*/
|
|
421
260
|
mergeSingle(filter, settings) {
|
|
422
261
|
if (isEmpty(filter))
|
|
423
262
|
return { resulting: this.filters };
|
|
@@ -430,7 +269,7 @@ export class FilterBuilder {
|
|
|
430
269
|
validator: filter.validator,
|
|
431
270
|
});
|
|
432
271
|
let original = filter;
|
|
433
|
-
let affected
|
|
272
|
+
let affected;
|
|
434
273
|
if (filterIndex > -1) {
|
|
435
274
|
original = objectCopy(this.filters[filterIndex]);
|
|
436
275
|
const { affected: affectedMergeFilter } = this.mergeValues(this.filters[filterIndex].id, filter.values);
|
|
@@ -446,27 +285,15 @@ export class FilterBuilder {
|
|
|
446
285
|
original,
|
|
447
286
|
};
|
|
448
287
|
}
|
|
449
|
-
/**
|
|
450
|
-
* Merge the filters into the collection by some filter parameters
|
|
451
|
-
* @param filters the filter collection to merge
|
|
452
|
-
* @param settings the settings object to setup this function
|
|
453
|
-
* @returns the new filter collection
|
|
454
|
-
*/
|
|
455
288
|
mergeMultiple(filters, settings) {
|
|
456
289
|
if (!Array.isArray(filters) || isEmpty(filters))
|
|
457
290
|
return { resulting: this.filters };
|
|
458
291
|
const originalFilters = objectCopy(this.filters);
|
|
459
292
|
const mergedFilters = [];
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
catch (_error) {
|
|
467
|
-
this.filters = originalFilters;
|
|
468
|
-
return { resulting: originalFilters };
|
|
469
|
-
}
|
|
293
|
+
filters.forEach((filter) => {
|
|
294
|
+
const mergedFilter = this.mergeSingle(filter, settings);
|
|
295
|
+
mergedFilters.push(mergedFilter.affected);
|
|
296
|
+
});
|
|
470
297
|
this.sync();
|
|
471
298
|
return {
|
|
472
299
|
resulting: this.filters,
|
|
@@ -474,12 +301,6 @@ export class FilterBuilder {
|
|
|
474
301
|
original: originalFilters,
|
|
475
302
|
};
|
|
476
303
|
}
|
|
477
|
-
/**
|
|
478
|
-
* Merge values from filter
|
|
479
|
-
* @param id the ID to search the filter to merge values
|
|
480
|
-
* @param values the value collection to merge
|
|
481
|
-
* @returns the new filter collection
|
|
482
|
-
*/
|
|
483
304
|
mergeValues(id, values) {
|
|
484
305
|
const filterIndex = this.searchEngine.findIndexByParams({ id });
|
|
485
306
|
if (isEmpty(values) || filterIndex < 0)
|
|
@@ -518,17 +339,6 @@ export class FilterBuilder {
|
|
|
518
339
|
original,
|
|
519
340
|
};
|
|
520
341
|
}
|
|
521
|
-
/**
|
|
522
|
-
* **************************************************************************************************
|
|
523
|
-
****************************************** Others **************************************************
|
|
524
|
-
****************************************************************************************************
|
|
525
|
-
*/
|
|
526
|
-
/**
|
|
527
|
-
* Builds an filter structure based on given params
|
|
528
|
-
* @param filter the partial filter params
|
|
529
|
-
* @param settings the settings object to setup this function
|
|
530
|
-
* @returns the complete filter structure
|
|
531
|
-
*/
|
|
532
342
|
static createFilter(filter, settings) {
|
|
533
343
|
const newSettings = getFilterCreateSettings(settings);
|
|
534
344
|
const newFilter = {
|
|
@@ -544,6 +354,7 @@ export class FilterBuilder {
|
|
|
544
354
|
editable: filter.editable ?? DEFAULT_FILTER.editable,
|
|
545
355
|
enableable: filter.enableable ?? DEFAULT_FILTER.enableable,
|
|
546
356
|
enabled: filter.enabled ?? DEFAULT_FILTER.enabled,
|
|
357
|
+
formulaType: filter.formulaType ?? DEFAULT_FILTER.formulaType,
|
|
547
358
|
id: filter.id || "",
|
|
548
359
|
operator: filter.operator || DEFAULT_FILTER.operator,
|
|
549
360
|
scope: filter.scope || DEFAULT_FILTER.scope,
|
|
@@ -561,14 +372,6 @@ export class FilterBuilder {
|
|
|
561
372
|
}
|
|
562
373
|
return newFilter;
|
|
563
374
|
}
|
|
564
|
-
/**
|
|
565
|
-
* Sets the given filters by param
|
|
566
|
-
* - Remove the filters by the sucesfull conditions and replace the given ones
|
|
567
|
-
* @param filters the filters to set
|
|
568
|
-
* @param params params to search the filters
|
|
569
|
-
* @param settings settings for this function
|
|
570
|
-
* @returns the new collection of filters
|
|
571
|
-
*/
|
|
572
375
|
replaceByParams(filters, params, settings) {
|
|
573
376
|
const original = objectCopy(this.filters);
|
|
574
377
|
const newSettings = getReplaceByParamsSettings(settings);
|
|
@@ -588,33 +391,12 @@ export class FilterBuilder {
|
|
|
588
391
|
original,
|
|
589
392
|
};
|
|
590
393
|
}
|
|
591
|
-
/**
|
|
592
|
-
* Method to sync the Filter instances
|
|
593
|
-
*/
|
|
594
394
|
sync() {
|
|
595
395
|
this.searchEngine.setFilters(this.filters);
|
|
596
396
|
}
|
|
597
|
-
/**
|
|
598
|
-
* **************************************************************************************************
|
|
599
|
-
****************************************** Getters *************************************************
|
|
600
|
-
****************************************************************************************************
|
|
601
|
-
*/
|
|
602
|
-
/**
|
|
603
|
-
* Gets the filter collection
|
|
604
|
-
* @returns the collection of filters of the context
|
|
605
|
-
*/
|
|
606
397
|
getFilters() {
|
|
607
398
|
return this.filters;
|
|
608
399
|
}
|
|
609
|
-
/**
|
|
610
|
-
* **************************************************************************************************
|
|
611
|
-
****************************************** Setters *************************************************
|
|
612
|
-
****************************************************************************************************
|
|
613
|
-
*/
|
|
614
|
-
/**
|
|
615
|
-
* Sets the filters
|
|
616
|
-
* @param filters the new collection of filters to set
|
|
617
|
-
*/
|
|
618
400
|
setFilters(filters) {
|
|
619
401
|
this.filters = objectCopy(filters);
|
|
620
402
|
this.sync();
|
|
@@ -4,81 +4,26 @@ import { FilterBuilder } from "./FilterBuilder";
|
|
|
4
4
|
import { FilterSearcher } from "./FilterSearcher";
|
|
5
5
|
import { IFilterPanelInteractiveTable } from "../resources";
|
|
6
6
|
import { IFilter } from "../resources/filters.resources";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
interface IFilterManagerDependencies {
|
|
8
|
+
adapt?: FilterAdapter;
|
|
9
|
+
builder?: FilterBuilder;
|
|
10
|
+
searchEngine?: FilterSearcher;
|
|
11
|
+
}
|
|
10
12
|
export declare class FilterManager {
|
|
11
13
|
protected _filters: IFilter[];
|
|
12
14
|
protected datasets: IDataset[];
|
|
13
15
|
private _interactiveTable?;
|
|
14
|
-
/**
|
|
15
|
-
* Instance to adapt filters
|
|
16
|
-
*/
|
|
17
16
|
private _adapt;
|
|
18
|
-
/**
|
|
19
|
-
* Instance to build filters
|
|
20
|
-
*/
|
|
21
17
|
private _builder;
|
|
22
|
-
/**
|
|
23
|
-
* Instance to search filters
|
|
24
|
-
*/
|
|
25
18
|
private _searchEngine;
|
|
26
|
-
|
|
27
|
-
* Constructor
|
|
28
|
-
* @param _filters the collection of filters
|
|
29
|
-
* @param datasets the collection of datasets info
|
|
30
|
-
* @param _interactiveTable table of interaction properties for each section
|
|
31
|
-
*/
|
|
32
|
-
constructor(_filters?: IFilter[], datasets?: IDataset[], _interactiveTable?: IFilterPanelInteractiveTable | undefined);
|
|
33
|
-
/**
|
|
34
|
-
* **************************************************************************************************
|
|
35
|
-
****************************************** Getters *************************************************
|
|
36
|
-
****************************************************************************************************
|
|
37
|
-
*/
|
|
38
|
-
/**
|
|
39
|
-
* Gets the adapt methods
|
|
40
|
-
* @returns the adapt methods
|
|
41
|
-
*/
|
|
19
|
+
constructor(_filters?: IFilter[], datasets?: IDataset[], _interactiveTable?: IFilterPanelInteractiveTable | undefined, dependencies?: IFilterManagerDependencies);
|
|
42
20
|
get adapt(): FilterAdapter;
|
|
43
|
-
/**
|
|
44
|
-
* Gets the builder methods
|
|
45
|
-
* @returns the builder methods
|
|
46
|
-
*/
|
|
47
21
|
get builder(): FilterBuilder;
|
|
48
|
-
/**
|
|
49
|
-
* Gets the filter collections
|
|
50
|
-
* @returns the filters
|
|
51
|
-
*/
|
|
52
22
|
get filters(): IFilter[];
|
|
53
|
-
/**
|
|
54
|
-
* Gets the interactive table
|
|
55
|
-
* @returns the interactive table
|
|
56
|
-
*/
|
|
57
23
|
get interactiveTable(): IFilterPanelInteractiveTable | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Gets the search methods
|
|
60
|
-
* @returns the search methods
|
|
61
|
-
*/
|
|
62
24
|
get search(): FilterSearcher;
|
|
63
|
-
/**
|
|
64
|
-
* **************************************************************************************************
|
|
65
|
-
****************************************** Setters *************************************************
|
|
66
|
-
****************************************************************************************************
|
|
67
|
-
*/
|
|
68
|
-
/**
|
|
69
|
-
* Sets the datasets
|
|
70
|
-
* @param datasets the collection of dataset info
|
|
71
|
-
*/
|
|
72
25
|
setDatasets(datasets: IDataset[]): void;
|
|
73
|
-
/**
|
|
74
|
-
* Sets the filters
|
|
75
|
-
* @param filters the new collection of filters to set
|
|
76
|
-
*/
|
|
77
26
|
setFilters(filters?: IFilter[]): void;
|
|
78
|
-
/**
|
|
79
|
-
* Sets the table of interactive table
|
|
80
|
-
* @param interactiveTable table of interaction properties for each section
|
|
81
|
-
*/
|
|
82
27
|
setInteractiveTable(interactiveTable: IFilterPanelInteractiveTable): void;
|
|
83
28
|
}
|
|
84
|
-
|
|
29
|
+
export {};
|
|
@@ -1,105 +1,48 @@
|
|
|
1
1
|
import { FilterAdapter } from "./FilterAdapter";
|
|
2
2
|
import { FilterBuilder } from "./FilterBuilder";
|
|
3
3
|
import { FilterSearcher } from "./FilterSearcher";
|
|
4
|
-
/**
|
|
5
|
-
* Class to manage the filters
|
|
6
|
-
*/
|
|
7
4
|
export class FilterManager {
|
|
8
5
|
_filters;
|
|
9
6
|
datasets;
|
|
10
7
|
_interactiveTable;
|
|
11
|
-
/**
|
|
12
|
-
* Instance to adapt filters
|
|
13
|
-
*/
|
|
14
8
|
_adapt;
|
|
15
|
-
/**
|
|
16
|
-
* Instance to build filters
|
|
17
|
-
*/
|
|
18
9
|
_builder;
|
|
19
|
-
/**
|
|
20
|
-
* Instance to search filters
|
|
21
|
-
*/
|
|
22
10
|
_searchEngine;
|
|
23
|
-
|
|
24
|
-
* Constructor
|
|
25
|
-
* @param _filters the collection of filters
|
|
26
|
-
* @param datasets the collection of datasets info
|
|
27
|
-
* @param _interactiveTable table of interaction properties for each section
|
|
28
|
-
*/
|
|
29
|
-
constructor(_filters = [], datasets = [], _interactiveTable) {
|
|
11
|
+
constructor(_filters = [], datasets = [], _interactiveTable, dependencies) {
|
|
30
12
|
this._filters = _filters;
|
|
31
13
|
this.datasets = datasets;
|
|
32
14
|
this._interactiveTable = _interactiveTable;
|
|
33
|
-
this._searchEngine =
|
|
34
|
-
|
|
35
|
-
this.
|
|
15
|
+
this._searchEngine =
|
|
16
|
+
dependencies?.searchEngine ?? new FilterSearcher(_filters);
|
|
17
|
+
this._builder = dependencies?.builder ?? new FilterBuilder(_filters);
|
|
18
|
+
this._adapt =
|
|
19
|
+
dependencies?.adapt ??
|
|
20
|
+
new FilterAdapter(_filters, datasets, _interactiveTable);
|
|
36
21
|
}
|
|
37
|
-
/**
|
|
38
|
-
* **************************************************************************************************
|
|
39
|
-
****************************************** Getters *************************************************
|
|
40
|
-
****************************************************************************************************
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* Gets the adapt methods
|
|
44
|
-
* @returns the adapt methods
|
|
45
|
-
*/
|
|
46
22
|
get adapt() {
|
|
47
23
|
return this._adapt;
|
|
48
24
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Gets the builder methods
|
|
51
|
-
* @returns the builder methods
|
|
52
|
-
*/
|
|
53
25
|
get builder() {
|
|
54
26
|
return this._builder;
|
|
55
27
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Gets the filter collections
|
|
58
|
-
* @returns the filters
|
|
59
|
-
*/
|
|
60
28
|
get filters() {
|
|
61
29
|
return this._filters;
|
|
62
30
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Gets the interactive table
|
|
65
|
-
* @returns the interactive table
|
|
66
|
-
*/
|
|
67
31
|
get interactiveTable() {
|
|
68
32
|
return this._interactiveTable;
|
|
69
33
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Gets the search methods
|
|
72
|
-
* @returns the search methods
|
|
73
|
-
*/
|
|
74
34
|
get search() {
|
|
75
35
|
return this._searchEngine;
|
|
76
36
|
}
|
|
77
|
-
/**
|
|
78
|
-
* **************************************************************************************************
|
|
79
|
-
****************************************** Setters *************************************************
|
|
80
|
-
****************************************************************************************************
|
|
81
|
-
*/
|
|
82
|
-
/**
|
|
83
|
-
* Sets the datasets
|
|
84
|
-
* @param datasets the collection of dataset info
|
|
85
|
-
*/
|
|
86
37
|
setDatasets(datasets) {
|
|
87
38
|
this._adapt.setDatasets(datasets);
|
|
88
39
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Sets the filters
|
|
91
|
-
* @param filters the new collection of filters to set
|
|
92
|
-
*/
|
|
93
40
|
setFilters(filters = []) {
|
|
94
41
|
this._filters = filters;
|
|
95
42
|
this._builder.setFilters(filters);
|
|
96
43
|
this._searchEngine.setFilters(filters);
|
|
97
44
|
this._adapt.setFilters(filters);
|
|
98
45
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Sets the table of interactive table
|
|
101
|
-
* @param interactiveTable table of interaction properties for each section
|
|
102
|
-
*/
|
|
103
46
|
setInteractiveTable(interactiveTable) {
|
|
104
47
|
this._interactiveTable = interactiveTable;
|
|
105
48
|
this._adapt.setInteractiveTable(this._interactiveTable);
|