@sisense/sdk-ui 1.23.0 → 1.25.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.
Files changed (103) hide show
  1. package/dist/ai.cjs +30 -29
  2. package/dist/ai.js +571 -558
  3. package/dist/analytics-composer.cjs +35 -35
  4. package/dist/analytics-composer.js +281 -261
  5. package/dist/{derive-chart-family-CTpRObm1.js → derive-chart-family-BlFbAr2V.js} +18111 -17793
  6. package/dist/{derive-chart-family-DcALKnKU.cjs → derive-chart-family-C_c2ZQQd.cjs} +108 -108
  7. package/dist/index.cjs +56 -75
  8. package/dist/index.js +5374 -5298
  9. package/dist/packages/sdk-ui/src/ai/chart/chart-insights.d.ts +2 -1
  10. package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +7 -2
  11. package/dist/packages/sdk-ui/src/ai/chat-config.d.ts +4 -2
  12. package/dist/packages/sdk-ui/src/ai/icons/exclamation-mark-brand-icon.d.ts +3 -0
  13. package/dist/packages/sdk-ui/src/analytics-composer/common/stringify-props.d.ts +5 -0
  14. package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +2 -0
  15. package/dist/packages/sdk-ui/src/analytics-composer/execute-query/execute-query-composer.d.ts +8 -0
  16. package/dist/packages/sdk-ui/src/analytics-composer/execute-query/to-execute-query-code.d.ts +2 -0
  17. package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +5 -0
  18. package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +13 -2
  19. package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +1 -1
  20. package/dist/packages/sdk-ui/src/analytics-composer/widget/widget-composer.d.ts +1 -0
  21. package/dist/packages/sdk-ui/src/api/rest-api.d.ts +25 -2
  22. package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +9 -4
  23. package/dist/packages/sdk-ui/src/chart/advanced-chart.d.ts +1 -1
  24. package/dist/packages/sdk-ui/src/chart/regular-chart.d.ts +3 -0
  25. package/dist/packages/sdk-ui/src/chart-data-processor/data-table-date-period.d.ts +1 -4
  26. package/dist/packages/sdk-ui/src/chart-options-processor/category-chart-options.d.ts +2 -1
  27. package/dist/packages/sdk-ui/src/chart-options-processor/translations/sunburst/sunburst-options.d.ts +2 -1
  28. package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-options.d.ts +2 -1
  29. package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +3 -2
  30. package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +2 -0
  31. package/dist/packages/sdk-ui/src/common-filters/cascading-utils.d.ts +3 -1
  32. package/dist/packages/sdk-ui/src/common-filters/common-filters-connector.d.ts +4 -3
  33. package/dist/packages/sdk-ui/src/common-filters/types.d.ts +25 -0
  34. package/dist/packages/sdk-ui/src/common-filters/use-common-filters.d.ts +8 -9
  35. package/dist/packages/sdk-ui/src/common-filters/use-convert-filter-relations.d.ts +26 -0
  36. package/dist/packages/sdk-ui/src/dashboard/components/dashboard-container.d.ts +1 -1
  37. package/dist/packages/sdk-ui/src/dashboard/components/horizontal-collapse.d.ts +6 -0
  38. package/dist/packages/sdk-ui/src/dashboard/dashboard-helpers.d.ts +40 -10
  39. package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +8 -3
  40. package/dist/packages/sdk-ui/src/dashboard/hooks/use-filters-panel-collapsed-state.d.ts +8 -0
  41. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +24 -6
  42. package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +4 -4
  43. package/dist/packages/sdk-ui/src/decorators/component-decorators/with-error-boundary.d.ts +3 -1
  44. package/dist/packages/sdk-ui/src/error-boundary/error-boundary.d.ts +4 -2
  45. package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -0
  46. package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +2 -0
  47. package/dist/packages/sdk-ui/src/filters/components/custom-filter-tile.d.ts +2 -0
  48. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +2 -0
  49. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/helpers.d.ts +6 -0
  50. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +2 -0
  51. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +2 -1
  52. package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +1 -0
  53. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel-tile.d.ts +3 -1
  54. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +3 -3
  55. package/dist/packages/sdk-ui/src/filters/components/icons/trash-icon.d.ts +1 -1
  56. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +2 -0
  57. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.d.ts +1 -1
  58. package/dist/packages/sdk-ui/src/filters/components/unsupported-filter-tile.d.ts +3 -1
  59. package/dist/packages/sdk-ui/src/filters/helpers.d.ts +122 -0
  60. package/dist/packages/sdk-ui/src/filters/index.d.ts +1 -0
  61. package/dist/packages/sdk-ui/src/index.d.ts +3 -1
  62. package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +2 -2
  63. package/dist/packages/sdk-ui/src/models/dashboard/get-dashboard-model.d.ts +2 -1
  64. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +1 -1
  65. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +2 -2
  66. package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +3 -0
  67. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dasboard-model-utils.d.ts +2 -4
  68. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +26 -18
  69. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +3 -0
  70. package/dist/packages/sdk-ui/src/models/hierarchy/get-hierarchy-models.d.ts +6 -1
  71. package/dist/packages/sdk-ui/src/models/hierarchy/types.d.ts +3 -0
  72. package/dist/packages/sdk-ui/src/models/hierarchy/use-get-hierarchy-models.d.ts +4 -4
  73. package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +11 -1
  74. package/dist/packages/sdk-ui/src/pivot-table/hooks/use-render-pivot.d.ts +3 -1
  75. package/dist/packages/sdk-ui/src/props.d.ts +11 -3
  76. package/dist/packages/sdk-ui/src/query/date-formats/apply-date-format.d.ts +1 -0
  77. package/dist/packages/sdk-ui/src/query-execution/utils.d.ts +3 -0
  78. package/dist/packages/sdk-ui/src/sisense-context/sisense-context.d.ts +2 -0
  79. package/dist/packages/sdk-ui/src/table/table-component.d.ts +1 -1
  80. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +10 -0
  81. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +20 -0
  82. package/dist/packages/sdk-ui/src/utils/extract-widget-ids.d.ts +2 -0
  83. package/dist/packages/sdk-ui/src/utils/filter-relations.d.ts +64 -0
  84. package/dist/packages/sdk-ui/src/utils/filters-comparator.d.ts +5 -0
  85. package/dist/packages/sdk-ui/src/utils/filters.d.ts +0 -1
  86. package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +178 -178
  87. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +2 -2
  88. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-filters.d.ts +17 -17
  89. package/dist/packages/sdk-ui/src/widget-by-id/use-get-dashboard-model-and-widget-model.d.ts +13 -0
  90. package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +13 -4
  91. package/dist/packages/sdk-ui/src/widgets/common/widget-container.d.ts +2 -0
  92. package/dist/packages/sdk-ui/src/widgets/common/widget-errors-and-warnings-context.d.ts +14 -0
  93. package/dist/packages/sdk-ui/src/widgets/common/widget-header-info-button.d.ts +3 -1
  94. package/dist/packages/sdk-ui/src/widgets/common/widget-header.d.ts +2 -0
  95. package/dist/useQuery-BYxzPyc5.cjs +870 -0
  96. package/dist/{useQuery-1xZMqnAI.js → useQuery-P9b5LtGq.js} +18768 -17547
  97. package/dist/widget-composer-DPsDPrFM.cjs +237 -0
  98. package/dist/widget-composer-DXM5t9rq.js +614 -0
  99. package/package.json +8 -8
  100. package/dist/packages/sdk-ui/src/dashboard/components/HorizontalCollapse.d.ts +0 -5
  101. package/dist/useQuery-D9rZ58KS.cjs +0 -821
  102. package/dist/widget-composer-B17DVa2A.cjs +0 -101
  103. package/dist/widget-composer-DqjH_6dw.js +0 -448
@@ -1,5 +1,10 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
+ import { HierarchyModel } from '../../models';
2
3
  import { DataSource } from '@sisense/sdk-data';
3
4
  import { GetHierarchiesOptions } from './types.js';
5
+ /**
6
+ * Options for retrieving hierarchy models.
7
+ */
8
+ export type GetHierarchyModelsOptions = GetHierarchiesOptions;
4
9
  /** @internal */
5
- export declare function getHierarchyModels(http: HttpClient, options: GetHierarchiesOptions, defaultDataSource?: DataSource): Promise<import('../../models').HierarchyModel[]>;
10
+ export declare function getHierarchyModels(http: HttpClient, options: GetHierarchyModelsOptions, defaultDataSource?: DataSource): Promise<HierarchyModel[]>;
@@ -1,6 +1,9 @@
1
1
  import type { Attribute, DataSource } from '@sisense/sdk-data';
2
2
  /**
3
3
  * Options for retrieving hierarchies.
4
+ *
5
+ * @internal
6
+ *
4
7
  */
5
8
  export type GetHierarchiesOptions = {
6
9
  /**
@@ -1,10 +1,10 @@
1
1
  import { HookEnableParam } from '../../common/hooks/types.js';
2
2
  import { HierarchyModel } from '../../models/hierarchy/hierarchy-model';
3
- import { GetHierarchiesOptions } from './types.js';
3
+ import { GetHierarchyModelsOptions } from './get-hierarchy-models.js';
4
4
  /**
5
5
  * Parameters for {@link useGetHierarchyModels} hook.
6
6
  */
7
- export interface GetHierarchiesParams extends GetHierarchiesOptions, HookEnableParam {
7
+ export interface GetHierarchyModelsParams extends GetHierarchyModelsOptions, HookEnableParam {
8
8
  }
9
9
  /**
10
10
  * States of hierarchy models load.
@@ -87,11 +87,11 @@ export type HierarchyModelsSuccessState = {
87
87
  * @group Fusion Assets
88
88
  * @fusionEmbed
89
89
  */
90
- export declare const useGetHierarchyModels: (params: GetHierarchiesParams) => HierarchyModelsState;
90
+ export declare const useGetHierarchyModels: (params: GetHierarchyModelsParams) => HierarchyModelsState;
91
91
  /**
92
92
  * {@link useGetHierarchyModels} without tracking to be used inside other hooks or components in Compose SDK.
93
93
  *
94
94
  * @param params - Parameters of the hierarchies to be retrieved
95
95
  * @internal
96
96
  */
97
- export declare function useGetHierarchyModelsInternal(params: GetHierarchiesParams): HierarchyModelsState;
97
+ export declare function useGetHierarchyModelsInternal(params: GetHierarchyModelsParams): HierarchyModelsState;
@@ -152,6 +152,16 @@ export declare function fromWidgetDto(widgetDto: WidgetDto, themeSettings?: Comp
152
152
  * @internal
153
153
  */
154
154
  export declare function fromChartWidgetProps(chartWidgetProps: ChartWidgetProps): WidgetModel;
155
+ /**
156
+ * Data source as specified in the jaql
157
+ * but with required filelds
158
+ *
159
+ * @internal
160
+ */
161
+ export type JaqlDataSourceForWidgetDto = JaqlDataSource & {
162
+ id: string;
163
+ address: string;
164
+ };
155
165
  /**
156
166
  * Translates a {@link WidgetModel} to {@link WidgetDto}.
157
167
  *
@@ -160,4 +170,4 @@ export declare function fromChartWidgetProps(chartWidgetProps: ChartWidgetProps)
160
170
  * @returns WidgetDto
161
171
  * @internal
162
172
  */
163
- export declare function toWidgetDto(widgetModel: WidgetModel, dataSource: JaqlDataSource): WidgetDto;
173
+ export declare function toWidgetDto(widgetModel: WidgetModel, dataSource?: JaqlDataSourceForWidgetDto): WidgetDto;
@@ -16,9 +16,11 @@ type PivotRenderOptions = {
16
16
  themeSettings: CompleteThemeSettings;
17
17
  /** The size of the pivot table container. */
18
18
  size: ContainerSize | null;
19
+ /** Callback to handle total height change. */
20
+ onTotalHeightChange?: (totalHeight: number) => void;
19
21
  };
20
22
  /**
21
23
  * A hook that renders the pivot table.
22
24
  */
23
- export declare function useRenderPivot({ nodeRef, pivotBuilder, dataOptions, styleOptions, themeSettings, size, }: PivotRenderOptions): void;
25
+ export declare function useRenderPivot({ nodeRef, pivotBuilder, dataOptions, styleOptions, themeSettings, size, onTotalHeightChange, }: PivotRenderOptions): void;
24
26
  export {};
@@ -88,10 +88,18 @@ export interface SisenseContextProviderProps {
88
88
  * This callback is useful for handling errors that happen during the initialization or runtime of the Sisense context,
89
89
  * such as incorrect configuration, invalid authentication, or network-related issues.
90
90
  *
91
- * @param error - The error object containing details about the issue.
92
91
  * @category Sisense App Error Handling
93
92
  */
94
- onError?: (error: Error) => void;
93
+ onError?: (
94
+ /** The error object containing details about the issue. */
95
+ error: Error,
96
+ /** Additional details about the error, such as the component name and props that caused this error. */
97
+ errorDetails?: {
98
+ /** The name of the component that caused the error. */
99
+ componentName: string;
100
+ /** The props of the component that caused the error. */
101
+ componentProps: unknown;
102
+ }) => void;
95
103
  /**
96
104
  * Boolean flag to enable sending silent pre-authentication requests to the Sisense instance.
97
105
  * Used to check if user is already authenticated, check is performed in an ivisible iframe.
@@ -701,7 +709,7 @@ export interface IndicatorChartProps extends BaseChartProps {
701
709
  /**
702
710
  * Props of the {@link Table} component.
703
711
  */
704
- export interface TableProps {
712
+ export interface TableProps extends BaseChartEventProps {
705
713
  /**
706
714
  * {@inheritDoc ChartProps.dataSet}
707
715
  *
@@ -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;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ClientApplication } from '../app/client-application';
3
3
  import { TrackingEventDetails } from '@sisense/sdk-tracking';
4
+ import { SisenseContextProviderProps } from '..';
4
5
  export type SisenseContextPayload = {
5
6
  isInitialized: boolean;
6
7
  app?: ClientApplication;
@@ -11,6 +12,7 @@ export type SisenseContextPayload = {
11
12
  };
12
13
  errorBoundary: {
13
14
  showErrorBox: boolean;
15
+ onError?: SisenseContextProviderProps['onError'];
14
16
  };
15
17
  };
16
18
  export declare const SisenseContext: import("react").Context<SisenseContextPayload>;
@@ -5,4 +5,4 @@ export declare const PAGES_BATCH_SIZE = 10;
5
5
  /**
6
6
  * Component that renders a table with aggregation and pagination.
7
7
  */
8
- export declare const TableComponent: ({ dataSet, dataOptions, styleOptions, filters, }: TableProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const TableComponent: ({ dataSet, dataOptions, styleOptions, filters, onDataReady, }: TableProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,7 @@
1
1
  export declare const translation: {
2
2
  errors: {
3
3
  noSisenseContext: string;
4
+ restApiNotReady: string;
4
5
  componentRenderError: string;
5
6
  sisenseContextNoAuthentication: string;
6
7
  chartNoSisenseContext: string;
@@ -28,6 +29,8 @@ export declare const translation: {
28
29
  failedToFetch: string;
29
30
  };
30
31
  widgetModel: {
32
+ incomleteWidget: string;
33
+ unsupportedWidgetTypeDto: string;
31
34
  pivotWidgetNotSupported: string;
32
35
  textWidgetNotSupported: string;
33
36
  onlyTableWidgetSupported: string;
@@ -60,6 +63,7 @@ export declare const translation: {
60
63
  cascadingFilterOriginalNotFound: string;
61
64
  dashboardLoadFailed: string;
62
65
  dashboardWithOidNotFound: string;
66
+ failedToAddWidget: string;
63
67
  widgetWithOidNotFound: string;
64
68
  widgetEmptyResponse: string;
65
69
  dateFilterIncorrectOperator: string;
@@ -132,6 +136,12 @@ export declare const translation: {
132
136
  max: string;
133
137
  };
134
138
  };
139
+ treemap: {
140
+ tooltip: {
141
+ ofTotal: string;
142
+ of: string;
143
+ };
144
+ };
135
145
  advanced: {
136
146
  tooltip: {
137
147
  min: string;
@@ -11,6 +11,7 @@ export declare const resources: {
11
11
  en: {
12
12
  errors: {
13
13
  noSisenseContext: string;
14
+ restApiNotReady: string;
14
15
  componentRenderError: string;
15
16
  sisenseContextNoAuthentication: string;
16
17
  chartNoSisenseContext: string;
@@ -38,6 +39,8 @@ export declare const resources: {
38
39
  failedToFetch: string;
39
40
  };
40
41
  widgetModel: {
42
+ incomleteWidget: string;
43
+ unsupportedWidgetTypeDto: string;
41
44
  pivotWidgetNotSupported: string;
42
45
  textWidgetNotSupported: string;
43
46
  onlyTableWidgetSupported: string;
@@ -70,6 +73,7 @@ export declare const resources: {
70
73
  cascadingFilterOriginalNotFound: string;
71
74
  dashboardLoadFailed: string;
72
75
  dashboardWithOidNotFound: string;
76
+ failedToAddWidget: string;
73
77
  widgetWithOidNotFound: string;
74
78
  widgetEmptyResponse: string;
75
79
  dateFilterIncorrectOperator: string;
@@ -142,6 +146,12 @@ export declare const resources: {
142
146
  max: string;
143
147
  };
144
148
  };
149
+ treemap: {
150
+ tooltip: {
151
+ ofTotal: string;
152
+ of: string;
153
+ };
154
+ };
145
155
  advanced: {
146
156
  tooltip: {
147
157
  min: string;
@@ -240,6 +250,7 @@ export declare const resources: {
240
250
  uk: {
241
251
  errors: {
242
252
  noSisenseContext: string;
253
+ restApiNotReady: string;
243
254
  componentRenderError: string;
244
255
  sisenseContextNoAuthentication: string;
245
256
  chartNoSisenseContext: string;
@@ -267,6 +278,8 @@ export declare const resources: {
267
278
  failedToFetch: string;
268
279
  };
269
280
  widgetModel: {
281
+ incomleteWidget: string;
282
+ unsupportedWidgetTypeDto: string;
270
283
  pivotWidgetNotSupported: string;
271
284
  textWidgetNotSupported: string;
272
285
  onlyTableWidgetSupported: string;
@@ -299,6 +312,7 @@ export declare const resources: {
299
312
  cascadingFilterOriginalNotFound: string;
300
313
  dashboardLoadFailed: string;
301
314
  dashboardWithOidNotFound: string;
315
+ failedToAddWidget: string;
302
316
  widgetWithOidNotFound: string;
303
317
  widgetEmptyResponse: string;
304
318
  dateFilterIncorrectOperator: string;
@@ -371,6 +385,12 @@ export declare const resources: {
371
385
  max: string;
372
386
  };
373
387
  };
388
+ treemap: {
389
+ tooltip: {
390
+ ofTotal: string;
391
+ of: string;
392
+ };
393
+ };
374
394
  advanced: {
375
395
  tooltip: {
376
396
  min: string;
@@ -0,0 +1,2 @@
1
+ import type { DashboardDto } from '../api/types/dashboard-dto';
2
+ export declare const getWidgetIdsFromDashboard: (dashboard: DashboardDto) => string[];
@@ -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;