@sisense/sdk-ui 1.24.0 → 1.26.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/dist/ai.cjs +54 -52
- package/dist/ai.js +997 -844
- package/dist/analytics-composer.cjs +45 -45
- package/dist/analytics-composer.js +567 -536
- package/dist/derive-chart-family-DOmv279l.cjs +271 -0
- package/dist/derive-chart-family-ZvvF5lty.js +44444 -0
- package/dist/index.cjs +112 -132
- package/dist/index.js +8146 -7238
- package/dist/packages/sdk-ui/src/ai/api/types.d.ts +6 -1
- package/dist/packages/sdk-ui/src/ai/chat-config.d.ts +4 -2
- package/dist/packages/sdk-ui/src/ai/icons/close-dialog-icon.d.ts +3 -1
- package/dist/packages/sdk-ui/src/ai/icons/sisense-logo.d.ts +2 -4
- package/dist/packages/sdk-ui/src/ai/use-chat-session.d.ts +2 -1
- package/dist/packages/sdk-ui/src/analytics-composer/common/stringify-props.d.ts +5 -0
- package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/execute-query/execute-query-composer.d.ts +15 -0
- package/dist/packages/sdk-ui/src/analytics-composer/execute-query/to-execute-query-code.d.ts +3 -0
- package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +5 -0
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +15 -2
- package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +1 -1
- package/dist/packages/sdk-ui/src/api/rest-api.d.ts +26 -2
- package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +9 -4
- package/dist/packages/sdk-ui/src/chart/helpers/use-synced-data.d.ts +14 -1
- package/dist/packages/sdk-ui/src/chart-data-processor/data-table-date-period.d.ts +1 -4
- package/dist/packages/sdk-ui/src/common-filters/cascading-utils.d.ts +3 -1
- package/dist/packages/sdk-ui/src/common-filters/common-filters-connector.d.ts +4 -3
- package/dist/packages/sdk-ui/src/common-filters/types.d.ts +25 -0
- package/dist/packages/sdk-ui/src/common-filters/use-common-filters.d.ts +8 -9
- package/dist/packages/sdk-ui/src/common-filters/use-convert-filter-relations.d.ts +26 -0
- package/dist/packages/sdk-ui/src/dashboard/dashboard-helpers.d.ts +40 -10
- package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +2 -2
- package/dist/packages/sdk-ui/src/dashboard/types.d.ts +5 -5
- package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +4 -4
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +3 -3
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/helpers.d.ts +122 -0
- package/dist/packages/sdk-ui/src/filters/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/models/dashboard/get-dashboard-model.d.ts +2 -1
- package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +11 -3
- package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +3 -0
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +2 -2
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +2 -0
- package/dist/packages/sdk-ui/src/query/date-formats/apply-date-format.d.ts +1 -0
- package/dist/packages/sdk-ui/src/query-execution/utils.d.ts +3 -0
- package/dist/packages/sdk-ui/src/utils/extract-widget-ids.d.ts +2 -0
- package/dist/packages/sdk-ui/src/utils/filter-relations.d.ts +64 -0
- package/dist/packages/sdk-ui/src/utils/filters-comparator.d.ts +5 -0
- package/dist/packages/sdk-ui/src/utils/filters.d.ts +0 -1
- package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +178 -178
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-filters.d.ts +17 -17
- package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +14 -2
- package/dist/packages/sdk-ui/src/widget-by-id/use-get-dashboard-model-and-widget-model.d.ts +13 -0
- package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +4 -4
- package/dist/useQuery-9lk4MNnb.cjs +889 -0
- package/dist/useQuery-BtpTzoxI.js +81219 -0
- package/dist/widget-composer-DbpSzSub.cjs +298 -0
- package/dist/{widget-composer-L8kmRhgX.js → widget-composer-ygehKLLR.js} +232 -163
- package/package.json +8 -8
- package/dist/useQuery-CIeSzN0Z.js +0 -7945
- package/dist/useQuery-LqaaNBLw.cjs +0 -175
- package/dist/widget-composer-CvgsMHyb.cjs +0 -237
- package/dist/widget-model-translator-CYeCKnTa.js +0 -116687
- package/dist/widget-model-translator-_Z-8UaTN.cjs +0 -917
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a function that adds a filter to existing filters or filter relations.
|
|
4
|
+
*
|
|
5
|
+
* @param filter - The filter to add.
|
|
6
|
+
* @returns A function that takes existing filters or filter relations and returns updated filters or filter relations with the new filter added.
|
|
7
|
+
* @group Filter Utilities
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Using with an array of filters
|
|
11
|
+
* const originalFilters = [filterByAgeRange];
|
|
12
|
+
* const updatedFilters = withAddedFilter(filterByCost)(originalFilters);
|
|
13
|
+
* // [filterByAgeRange, filterByCost]
|
|
14
|
+
*
|
|
15
|
+
* // Using with filter relations
|
|
16
|
+
* const originalFilterRelations = filterFactory.logic.or(filterByAgeRange, filterByRevenue);
|
|
17
|
+
* const updatedFilterRelations = withAddedFilter(filterByCost)(originalFilterRelations);
|
|
18
|
+
* // (filterByAgeRange OR filterByRevenue) AND filterByCost
|
|
19
|
+
* ```
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function withAddedFilter(filter: Filter): (filters: Filter[] | FilterRelations | undefined) => Filter[] | FilterRelations;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a function that adds multiple filters to existing filters or filter relations.
|
|
25
|
+
*
|
|
26
|
+
* @param filtersToAdd - An array of filters to add.
|
|
27
|
+
* @returns A function that takes existing filters or filter relations and returns updated filters or filter relations with the new filters added.
|
|
28
|
+
* @group Filter Utilities
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* // Using with an array of filters
|
|
32
|
+
* const originalFilters = [filterByAgeRange];
|
|
33
|
+
* const updatedFilters = withAddedFilters([filterByCost, filterByRevenue])(originalFilters);
|
|
34
|
+
* // [filterByAgeRange, filterByCost, filterByRevenue]
|
|
35
|
+
*
|
|
36
|
+
* // Using with filter relations
|
|
37
|
+
* const originalFilterRelations = filterFactory.logic.or(filterByAgeRange, filterByRevenue);
|
|
38
|
+
* const updatedFilterRelations = withAddedFilters([filterByCost, filterByRevenue])(originalFilterRelations);
|
|
39
|
+
* // (filterByAgeRange OR filterByRevenue) AND filterByCost AND filterByRevenue
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare function withAddedFilters(filtersToAdd: Filter[]): (filters: Filter[] | FilterRelations | undefined) => Filter[] | FilterRelations;
|
|
45
|
+
/**
|
|
46
|
+
* Returns a function that removes a filter from existing filters or filter relations.
|
|
47
|
+
*
|
|
48
|
+
* @param filterToRemove - The filter to remove.
|
|
49
|
+
* @returns A function that takes existing filters or filter relations and returns updated filters or filter relations without the specified filter.
|
|
50
|
+
* @group Filter Utilities
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* // Using with an array of filters
|
|
54
|
+
* const originalFilters = [filterByAgeRange, filterByRevenue, filterByCost];
|
|
55
|
+
* const updatedFilters = withoutFilter(filterByCost)(originalFilters);
|
|
56
|
+
* // [filterByAgeRange, filterByRevenue]
|
|
57
|
+
*
|
|
58
|
+
* // Using with filter relations
|
|
59
|
+
* const originalFilterRelations = filterFactory.logic.or(filterByAgeRange, filterByRevenue);
|
|
60
|
+
* const updatedFiltersRelations = withoutFilter(filterByRevenue)(originalFilterRelations);
|
|
61
|
+
* // filterByAgeRange
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
export declare function withoutFilter(filterToRemove: Filter): (filters: Filter[] | FilterRelations | undefined) => Filter[] | FilterRelations;
|
|
67
|
+
/**
|
|
68
|
+
* Returns a function that removes multiple filters from existing filters or filter relations.
|
|
69
|
+
*
|
|
70
|
+
* @param filtersToRemove - An array of filters to remove.
|
|
71
|
+
* @returns A function that takes existing filters or filter relations and returns updated filters or filter relations without the specified filters.
|
|
72
|
+
* @group Filter Utilities
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* // Using with an array of filters
|
|
76
|
+
* const originalFilters = [filterByAgeRange, filterByRevenue, filterByCost];
|
|
77
|
+
* const updatedFilters = withRemovedFilters([filterByRevenue, filterByCost])(originalFilters);
|
|
78
|
+
* // [filterByAgeRange]
|
|
79
|
+
*
|
|
80
|
+
* // Using with filter relations
|
|
81
|
+
* const originalFilterRelations = filterFactory.logic.or(filterByAgeRange, filterByRevenue);
|
|
82
|
+
* const updatedFiltersRelations = withRemovedFilters([filterByRevenue])(originalFilterRelations);
|
|
83
|
+
* // filterByAgeRange
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
export declare function withoutFilters(filtersToRemove: Filter[]): (filters: Filter[] | FilterRelations | undefined) => Filter[] | FilterRelations;
|
|
89
|
+
/**
|
|
90
|
+
* Returns a function that replaces a filter with a new filter in existing filters or filter relations.
|
|
91
|
+
*
|
|
92
|
+
* @param filterToReplace - The filter to replace.
|
|
93
|
+
* @param newFilter - The new filter to use as a replacement.
|
|
94
|
+
* @returns A function that takes existing filters or filter relations and returns updated filters or filter relations with the filter replaced.
|
|
95
|
+
* @group Filter Utilities
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* // Using with an array of filters
|
|
99
|
+
* const originalFilters = [filterByAgeRange, filterByRevenue];
|
|
100
|
+
* const updatedFilters = withReplacedFilter(filterByRevenue, filterByCost)(originalFilters);
|
|
101
|
+
* // [filterByAgeRange, filterByCost]
|
|
102
|
+
*
|
|
103
|
+
* // Using with filter relations
|
|
104
|
+
* const originalFilterRelations = filterFactory.logic.or(filterByAgeRange, filterByRevenue);
|
|
105
|
+
* const updatedFilterRelations = withReplacedFilter(filterByRevenue, filterByCost)(originalFilterRelations);
|
|
106
|
+
* // (filterByAgeRange OR filterByCost)
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
export declare function withReplacedFilter(filterToReplace: Filter, newFilter: Filter): (filters: Filter[] | FilterRelations | undefined) => Filter[] | FilterRelations;
|
|
112
|
+
/**
|
|
113
|
+
* Finds a filter in an array of filters or filter relations.
|
|
114
|
+
* Returns the first filter that satisfies the provided search function.
|
|
115
|
+
* @group Filter Utilities
|
|
116
|
+
* @param filters - An array of filters or filter relations to search.
|
|
117
|
+
* @param searchFn - A function that takes a filter and returns a boolean indicating whether the filter satisfies the search criteria.
|
|
118
|
+
* @returns The first filter that satisfies the search function, or `undefined` if no filter is found.
|
|
119
|
+
*
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
export declare function findFilter(filters: Filter[] | FilterRelations | undefined, searchFn: (filter: Filter) => boolean): Filter | undefined;
|
|
@@ -4,4 +4,5 @@ export * from './components/criteria-filter-tile';
|
|
|
4
4
|
export * from './components/cascading-filter-tile';
|
|
5
5
|
export * from './components/filters-panel';
|
|
6
6
|
export * from './components/custom-filter-tile';
|
|
7
|
+
export * from './helpers';
|
|
7
8
|
export { type FilterVariant } from './components/common/filter-utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataSource, Filter } from '@sisense/sdk-data';
|
|
1
|
+
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
2
2
|
import { DashboardStyleOptions, WidgetModel } from '../../models';
|
|
3
3
|
import { type WidgetsOptions } from './types';
|
|
4
4
|
import { DashboardLayoutOptions } from '../../dashboard';
|
|
@@ -42,7 +42,7 @@ export interface DashboardModel {
|
|
|
42
42
|
*
|
|
43
43
|
* @internal
|
|
44
44
|
*/
|
|
45
|
-
filters: Filter[];
|
|
45
|
+
filters: Filter[] | FilterRelations;
|
|
46
46
|
/**
|
|
47
47
|
* Dashboard options for each of the widgets.
|
|
48
48
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
|
+
import { DashboardModel } from '../../models/dashboard';
|
|
2
3
|
import { CompleteThemeSettings } from '../../types';
|
|
3
4
|
import { AppSettings } from '../../app/settings/settings';
|
|
4
5
|
export interface GetDashboardModelOptions {
|
|
@@ -26,4 +27,4 @@ export interface GetDashboardModelOptions {
|
|
|
26
27
|
* @returns The dashboard model
|
|
27
28
|
* @internal
|
|
28
29
|
*/
|
|
29
|
-
export declare function getDashboardModel(http: HttpClient, dashboardOid: string, options?: GetDashboardModelOptions, themeSettings?: CompleteThemeSettings, appSettings?: AppSettings): Promise<
|
|
30
|
+
export declare function getDashboardModel(http: HttpClient, dashboardOid: string, options?: GetDashboardModelOptions, themeSettings?: CompleteThemeSettings, appSettings?: AppSettings): Promise<DashboardModel>;
|
|
@@ -2,8 +2,8 @@ import { Filter } from '@sisense/sdk-data';
|
|
|
2
2
|
import { CascadingFilterDto, FilterDto } from '../../api/types/dashboard-dto';
|
|
3
3
|
/**
|
|
4
4
|
* Translates a {@link Filter} to a {@link FilterDto}.
|
|
5
|
-
* @param filter
|
|
6
5
|
*
|
|
6
|
+
* @param filter - The filter to translate.
|
|
7
7
|
* @returns FilterDto
|
|
8
8
|
*
|
|
9
9
|
* @internal
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { type LayoutDto, type FilterDto, type CascadingFilterDto } from '../../api/types/dashboard-dto';
|
|
1
|
+
import { type LayoutDto, type FilterDto, type CascadingFilterDto, DashboardDto } from '../../api/types/dashboard-dto';
|
|
2
2
|
import type { WidgetsPanelColumnLayout, WidgetsOptions } from './types';
|
|
3
|
-
import { Filter } from '@sisense/sdk-data';
|
|
3
|
+
import { Filter, FilterRelations, FilterRelationsModel, FilterRelationsModelNode } from '@sisense/sdk-data';
|
|
4
4
|
import { WidgetDto } from '../../widget-by-id/types';
|
|
5
|
+
import { RestApi } from '../../api/rest-api';
|
|
5
6
|
export declare const translateLayout: (layout: LayoutDto) => WidgetsPanelColumnLayout;
|
|
6
|
-
export declare function extractDashboardFilters(dashboardFilters: Array<FilterDto | CascadingFilterDto
|
|
7
|
+
export declare function extractDashboardFilters(dashboardFilters: Array<FilterDto | CascadingFilterDto>, filterRelationsModel?: FilterRelationsModel | FilterRelationsModelNode): Filter[] | FilterRelations;
|
|
7
8
|
export declare function translateWidgetsOptions(widgets?: WidgetDto[]): WidgetsOptions;
|
|
9
|
+
/**
|
|
10
|
+
* Replace all shared formulas, which defined by id references, in the dashboard with their actual values.
|
|
11
|
+
* @param dashboard - The dashboard DTO to replace shared formulas in
|
|
12
|
+
* @param api - The REST API instance
|
|
13
|
+
* @returns The dashboard DTO with shared formulas, defined by id references, replaced
|
|
14
|
+
*/
|
|
15
|
+
export declare function withSharedFormulas(dashboard: DashboardDto, api: RestApi): Promise<DashboardDto>;
|
|
@@ -26,6 +26,9 @@ export interface WidgetsPanelColumnLayout {
|
|
|
26
26
|
* Layout of dashboard widgets panel, which is a union of different layout algorithms
|
|
27
27
|
*/
|
|
28
28
|
export type WidgetsPanelLayout = WidgetsPanelColumnLayout;
|
|
29
|
+
/**
|
|
30
|
+
* Widget ID
|
|
31
|
+
*/
|
|
29
32
|
export type WidgetId = string;
|
|
30
33
|
/**
|
|
31
34
|
* Options for widgets in a dashboard
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DashboardModel, WidgetModel } from '../../../models';
|
|
2
|
-
import { Filter } from '@sisense/sdk-data';
|
|
2
|
+
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
3
3
|
import { RestApi } from '../../../api/rest-api';
|
|
4
4
|
export type UseDashboardModelState = DashboardModel | null;
|
|
5
5
|
/**
|
|
@@ -42,7 +42,7 @@ export type UseDashboardModelAction = UseDashboardModelFilterUpdateAction | UseD
|
|
|
42
42
|
*/
|
|
43
43
|
export type UseDashboardModelFilterUpdateAction = {
|
|
44
44
|
type: UseDashboardModelActionType.FILTERS_UPDATE;
|
|
45
|
-
payload: Filter[];
|
|
45
|
+
payload: Filter[] | FilterRelations;
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
48
|
* Add widget action for the dashboard model state used in {@link useDashboardModel}.
|
package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare const useDashboardModel: (args_0: UseDashboardModelParams) => {
|
|
|
24
24
|
dashboard: import('../../../models').UseDashboardModelState;
|
|
25
25
|
isLoading: boolean;
|
|
26
26
|
isError: boolean;
|
|
27
|
+
error: Error | undefined;
|
|
27
28
|
dispatchChanges: Dispatch<UseDashboardModelAction>;
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
@@ -35,5 +36,6 @@ export declare function useDashboardModelInternal({ dashboardOid, includeWidgets
|
|
|
35
36
|
dashboard: import('../../../models').UseDashboardModelState;
|
|
36
37
|
isLoading: boolean;
|
|
37
38
|
isError: boolean;
|
|
39
|
+
error: Error | undefined;
|
|
38
40
|
dispatchChanges: Dispatch<UseDashboardModelAction>;
|
|
39
41
|
};
|
|
@@ -61,4 +61,5 @@ export declare const defaultDateConfig: DateConfig;
|
|
|
61
61
|
* @param cfg -
|
|
62
62
|
*/
|
|
63
63
|
export declare function applyDateFormat(date: Date, format: DateFormat, locale?: Locale, cfg?: DateConfig): string;
|
|
64
|
+
export declare function getDefaultDateMask(granularity?: string): "HH:mm:ss" | "yyyy" | "MM/yyyy" | "ww yyyy" | "HH:mm" | "shortDate" | "fullDate" | "Q yyyy";
|
|
64
65
|
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PivotQueryDescription, QueryDescription } from '../query/execute-query';
|
|
2
|
+
import { ExecutePivotQueryParams, ExecuteQueryParams } from './types';
|
|
3
|
+
export declare function convertToQueryDescription<T extends ExecuteQueryParams | ExecutePivotQueryParams>(params: T): T extends ExecutePivotQueryParams ? PivotQueryDescription : QueryDescription;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Filter, FilterRelations, FilterRelationsModel, FilterRelationsModelNode } from '@sisense/sdk-data';
|
|
2
|
+
/**
|
|
3
|
+
* Rules of filter relations - logical operators of how filters are related to each other.
|
|
4
|
+
*/
|
|
5
|
+
export type FilterRelationsRules = FilterRelationsRule | FilterRelationsRuleNode | null;
|
|
6
|
+
type FilterRelationsRule = {
|
|
7
|
+
left: FilterRelationsRuleNode;
|
|
8
|
+
right: FilterRelationsRuleNode;
|
|
9
|
+
operator: 'AND' | 'OR';
|
|
10
|
+
};
|
|
11
|
+
type FilterRelationsRuleIdNode = {
|
|
12
|
+
instanceid: string;
|
|
13
|
+
};
|
|
14
|
+
type FilterRelationsRuleNode = FilterRelationsRule | FilterRelationsRuleIdNode;
|
|
15
|
+
/**
|
|
16
|
+
* Merges source filters with target filters and recalculates relations.
|
|
17
|
+
*
|
|
18
|
+
* @param sourceFilters - The source filters or filter relations to merge.
|
|
19
|
+
* @param targetFilters - The target filters or filter relations to merge with.
|
|
20
|
+
* @returns Updated source filters merged with target filters. If the source filters are FilterRelations, the relations are recalculated.
|
|
21
|
+
*/
|
|
22
|
+
export declare function mergeFiltersOrFilterRelations(sourceFilters: Filter[] | FilterRelations | undefined, targetFilters: Filter[] | FilterRelations | undefined): Filter[] | FilterRelations;
|
|
23
|
+
/**
|
|
24
|
+
* Splits filters or filter relations into filters and relations rules.
|
|
25
|
+
*/
|
|
26
|
+
export declare function splitFiltersAndRelations(filtersOrFilterRelations: Filter[] | FilterRelations | undefined): {
|
|
27
|
+
filters: Filter[];
|
|
28
|
+
relations: FilterRelationsRules;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Returns pure filters array from the given filters or filter relations.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getFiltersArray(filtersOrFilterRelations: Filter[] | FilterRelations | undefined): Filter[];
|
|
34
|
+
/**
|
|
35
|
+
* Combines filters and relations into a single FilterRelations object.
|
|
36
|
+
* If the relations are empty or relations are trivial (single node), the filters are returned as is.
|
|
37
|
+
*/
|
|
38
|
+
export declare function combineFiltersAndRelations(filters: Filter[], relations: FilterRelationsRules): Filter[] | FilterRelations;
|
|
39
|
+
/** Type guard for checking if a node is a single relations node (trivial case when relations are needless). */
|
|
40
|
+
export declare function isTrivialSingleNodeRelations(relations: FilterRelationsRules): relations is FilterRelationsRuleIdNode;
|
|
41
|
+
/**
|
|
42
|
+
* Calculates new relations based on the changes in filters.
|
|
43
|
+
*/
|
|
44
|
+
export declare function calculateNewRelations(prevFilters: Filter[], prevRelations: FilterRelationsRules, newFilters: Filter[]): FilterRelationsRules;
|
|
45
|
+
/**
|
|
46
|
+
* Replaces a filter in the relations tree with a new filter.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getRelationsWithReplacedFilter(relations: FilterRelationsRules, filterToReplace: Filter, newFilter: Filter): FilterRelationsRules;
|
|
49
|
+
/**
|
|
50
|
+
* Converts filter relations model from Fusion to internal CSDK filter relations rules.
|
|
51
|
+
*/
|
|
52
|
+
export declare function convertFilterRelationsModelToRelationRules(filterRelationsModel: FilterRelationsModel | FilterRelationsModelNode | undefined, filters: Filter[]): FilterRelationsRules;
|
|
53
|
+
/**
|
|
54
|
+
* Converts internal CSDK filter relations rules to filter relations model for Fusion.
|
|
55
|
+
*/
|
|
56
|
+
export declare function filterRelationRulesToFilterRelationsModel(filterRelationRules: FilterRelationsRules, filters: Filter[]): FilterRelationsModel | FilterRelationsModelNode | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Textual representation of filter relations for debugging purposes.
|
|
59
|
+
* Returns string like "(([Gender] AND [Country]) OR [Condition])".
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export declare function getRelationsAsText(relations: FilterRelationsRules, filters: Filter[]): string | null;
|
|
64
|
+
export {};
|
|
@@ -9,6 +9,11 @@ import { Filter, FilterRelations, FilterRelationsJaql } from '@sisense/sdk-data'
|
|
|
9
9
|
* The function ignores randomly generated names of the filters.
|
|
10
10
|
*/
|
|
11
11
|
export declare function isFiltersChanged(prevFilters: Filter[] | undefined, newFilters: Filter[] | undefined): boolean;
|
|
12
|
+
export declare function haveSameAttribute(filterA: Filter, filterB: Filter): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Compare filters with ignoring randomly generated names
|
|
15
|
+
*/
|
|
16
|
+
export declare function areFiltersEqual(filterA: Filter, filterB: Filter): boolean;
|
|
12
17
|
/**
|
|
13
18
|
* Checks if filter relations have changed by deep comparison.
|
|
14
19
|
*
|
|
@@ -8,6 +8,5 @@ export declare const cloneFilterAndToggleDisabled: <TFilter extends Filter>(filt
|
|
|
8
8
|
export declare const cloneFilter: <TFilter extends Filter>(filter: TFilter) => TFilter;
|
|
9
9
|
export declare function clearMembersFilter(filter: Filter): Filter;
|
|
10
10
|
export declare function isIncludeAllFilter(filter: Filter): boolean;
|
|
11
|
-
export declare function haveSameAttribute(filterA: Filter, filterB: Filter): boolean;
|
|
12
11
|
/** @internal */
|
|
13
12
|
export declare function isSameAttribute(attributeA: Attribute, attributeB: Attribute): boolean;
|