@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
|
@@ -4,6 +4,11 @@ export interface ChatContext {
|
|
|
4
4
|
title: string;
|
|
5
5
|
live: boolean;
|
|
6
6
|
}
|
|
7
|
+
export interface TextMessage {
|
|
8
|
+
role: 'assistant';
|
|
9
|
+
content: string;
|
|
10
|
+
type: 'text';
|
|
11
|
+
}
|
|
7
12
|
export interface NlqMessage {
|
|
8
13
|
role: 'assistant';
|
|
9
14
|
content: string;
|
|
@@ -13,7 +18,7 @@ interface RegularMessage {
|
|
|
13
18
|
role: 'user' | 'assistant';
|
|
14
19
|
content: string;
|
|
15
20
|
}
|
|
16
|
-
export type ChatMessage = RegularMessage | NlqMessage;
|
|
21
|
+
export type ChatMessage = RegularMessage | NlqMessage | TextMessage;
|
|
17
22
|
export interface Chat {
|
|
18
23
|
chatId: string;
|
|
19
24
|
contextId: string;
|
|
@@ -8,9 +8,11 @@ export interface ChatConfig {
|
|
|
8
8
|
*/
|
|
9
9
|
enableFollowupQuestions: boolean;
|
|
10
10
|
/**
|
|
11
|
-
* Number of recommended queries that should be shown in a chat session
|
|
11
|
+
* Number of recommended queries that should initially be shown in a chat session
|
|
12
12
|
*
|
|
13
|
-
* If not specified, the default value is `4
|
|
13
|
+
* If not specified, the default value is `4`.
|
|
14
|
+
*
|
|
15
|
+
* Set to `0` to disable initial recommendations.
|
|
14
16
|
*/
|
|
15
17
|
numOfRecommendations: number;
|
|
16
18
|
/**
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
colorSchema: ColorSchema;
|
|
1
|
+
export default function SisenseLogo({ isDarkBackground }: {
|
|
2
|
+
isDarkBackground: boolean;
|
|
4
3
|
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ChatMessage, NlqMessage, NlqResponseData, TextMessage } from './api/types';
|
|
2
2
|
/**
|
|
3
3
|
* Result of the useChatSession hook.
|
|
4
4
|
*
|
|
@@ -14,6 +14,7 @@ export interface UseChatSessionResult {
|
|
|
14
14
|
lastError: Error | null;
|
|
15
15
|
}
|
|
16
16
|
export declare const isNlqMessage: (message: ChatMessage | null | undefined) => message is NlqMessage;
|
|
17
|
+
export declare const isTextMessage: (message: ChatMessage | null | undefined) => message is TextMessage;
|
|
17
18
|
/**
|
|
18
19
|
* React hook that returns a chat session object for the given data model or
|
|
19
20
|
* perspective.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
2
|
+
import { ChartDataOptions } from '../../types';
|
|
3
|
+
export declare function stringifyDataOptions(dataOptions: ChartDataOptions): string;
|
|
4
|
+
export declare function stringifyDataSource(dataSource: DataSource | undefined): string;
|
|
5
|
+
export declare function stringifyExtraImports(filters: Filter[] | FilterRelations): string;
|
|
@@ -12,4 +12,4 @@ export declare function sanitizeDimensionId(str: string): string;
|
|
|
12
12
|
export declare function validateQueryModel(model: any): SimpleQueryModel;
|
|
13
13
|
export declare function isEmptyQueryModel(queryModel: ExpandedQueryModel | undefined | null): boolean;
|
|
14
14
|
export declare function escapeSingleQuotes(str?: string): string | undefined;
|
|
15
|
-
export declare function validateChartType(chartType: DynamicChartType): void;
|
|
15
|
+
export declare function validateChartType(chartType: DynamicChartType | 'pivot' | 'pivot2'): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExecuteQueryCodeParams, ExecutePivotQueryCodeParams } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Converts query params to CSDK code.
|
|
4
|
+
*
|
|
5
|
+
* @param queryParams - queryParams params
|
|
6
|
+
* @returns CSDK code string
|
|
7
|
+
*/
|
|
8
|
+
export declare const toExecuteQueryCode: (executeQueryCodeParams: ExecuteQueryCodeParams) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Converts pivot query params to CSDK code.
|
|
11
|
+
*
|
|
12
|
+
* @param executePivotQueryCodeParams - pivotQuery params
|
|
13
|
+
* @returns CSDK code string
|
|
14
|
+
*/
|
|
15
|
+
export declare const toExecutePivotQueryCode: (executePivotQueryCodeParams: ExecutePivotQueryCodeParams) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ExecuteQueryCodeParams, ExecutePivotQueryCodeParams } from '../types.js';
|
|
2
|
+
export declare const toExecuteQueryCode: ({ queryParams, uiFramework, }: ExecuteQueryCodeParams) => string;
|
|
3
|
+
export declare const toExecutePivotQueryCode: ({ pivotQueryParams, uiFramework, }: ExecutePivotQueryCodeParams) => string;
|
|
@@ -10,3 +10,8 @@ export * as widgetComposer from './widget/widget-composer';
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export * as dashboardComposer from './dashboard/dashboard-composer';
|
|
13
|
+
/**
|
|
14
|
+
* Utility functions to compose props and code for executing queries.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export * as executeQueryComposer from './execute-query/execute-query-composer';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WidgetProps } from '../props';
|
|
2
2
|
import { ChartDataOptions } from '../types';
|
|
3
|
+
import { ExecuteQueryParams, ExecutePivotQueryParams } from '../query-execution';
|
|
3
4
|
import { MetadataItem } from '@sisense/sdk-data';
|
|
4
5
|
import { DynamicChartType } from '../chart-options-processor/translations/types.js';
|
|
5
6
|
export type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
@@ -85,7 +86,7 @@ export type UiFramework = 'react' | 'vue' | 'angular';
|
|
|
85
86
|
* Code Template Key
|
|
86
87
|
* @internal
|
|
87
88
|
*/
|
|
88
|
-
export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'widgetByIdTmpl' | 'executeQueryByWidgetIdTmpl' | '
|
|
89
|
+
export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'widgetByIdTmpl' | 'executeQueryByWidgetIdTmpl' | 'executeQueryTmpl' | 'executePivotQueryTmpl' | 'pivotTableWidgetTmpl';
|
|
89
90
|
/**
|
|
90
91
|
* Code Templates
|
|
91
92
|
* @internal
|
|
@@ -118,7 +119,7 @@ export type WidgetCodeConfig = BaseCodeConfig & {
|
|
|
118
119
|
* Client-side Widget Code Params
|
|
119
120
|
* @internal
|
|
120
121
|
*/
|
|
121
|
-
export type ClientSideWidgetCodeParams =
|
|
122
|
+
export type ClientSideWidgetCodeParams = BaseCodeConfig & {
|
|
122
123
|
widgetProps: WidgetProps;
|
|
123
124
|
};
|
|
124
125
|
/**
|
|
@@ -151,3 +152,15 @@ export declare const isByIdWidgetCodeParams: (params: WidgetCodeParams) => param
|
|
|
151
152
|
export type WidgetPropsConfig = {
|
|
152
153
|
useCustomizedStyleOptions?: boolean;
|
|
153
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
export type ExecuteQueryCodeParams = BaseCodeConfig & {
|
|
159
|
+
queryParams: ExecuteQueryParams;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* @internal
|
|
163
|
+
*/
|
|
164
|
+
export type ExecutePivotQueryCodeParams = BaseCodeConfig & {
|
|
165
|
+
pivotQueryParams: ExecutePivotQueryParams;
|
|
166
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ByIdWidgetCodeParams, ClientSideWidgetCodeParams } from '../types.js';
|
|
2
2
|
export declare const toWidgetCodeById: ({ dashboardOid, widgetOid, uiFramework, chartType, includeChart, }: ByIdWidgetCodeParams) => string;
|
|
3
|
-
export declare const toWidgetCodeClientSide: ({ widgetProps, uiFramework,
|
|
3
|
+
export declare const toWidgetCodeClientSide: ({ widgetProps, uiFramework, }: ClientSideWidgetCodeParams) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
2
|
import { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
|
|
3
3
|
import { type DataSource } from '@sisense/sdk-data';
|
|
4
|
-
import { HierarchyDto, WidgetDto } from '../widget-by-id/types';
|
|
4
|
+
import { HierarchyDto, SharedFormulaDto, WidgetDto } from '../widget-by-id/types';
|
|
5
5
|
import type { DashboardDto } from './types/dashboard-dto';
|
|
6
6
|
import { TranslatableError } from '../translation/translatable-error';
|
|
7
7
|
import { PaletteDto } from '../api/types/palette-dto';
|
|
@@ -21,7 +21,19 @@ export declare class RestApi {
|
|
|
21
21
|
/**
|
|
22
22
|
* Get all dashboards
|
|
23
23
|
*/
|
|
24
|
-
getDashboards: (options?: GetDashboardsOptions) => Promise<
|
|
24
|
+
getDashboards: (options?: GetDashboardsOptions) => Promise<({
|
|
25
|
+
oid: string;
|
|
26
|
+
title: string;
|
|
27
|
+
datasource: import("@sisense/sdk-data").JaqlDataSource;
|
|
28
|
+
widgets?: WidgetDto[] | undefined;
|
|
29
|
+
filters?: (import("./types/dashboard-dto").FilterDto | import("./types/dashboard-dto").CascadingFilterDto)[] | undefined;
|
|
30
|
+
filterRelations?: {
|
|
31
|
+
datasource: string;
|
|
32
|
+
filterRelations: import("@sisense/sdk-data").FilterRelationsModelNode;
|
|
33
|
+
}[] | undefined;
|
|
34
|
+
layout?: import("./types/dashboard-dto").LayoutDto | undefined;
|
|
35
|
+
style?: import("./types/dashboard-dto").DashboardStyleDto | undefined;
|
|
36
|
+
} & import("../utils/utility-types").AnyObject)[]>;
|
|
25
37
|
/**
|
|
26
38
|
* Get a specific dashboard
|
|
27
39
|
*/
|
|
@@ -58,6 +70,18 @@ export declare class RestApi {
|
|
|
58
70
|
* Add widget to a dashboard
|
|
59
71
|
*/
|
|
60
72
|
addWidgetToDashboard: (dashboardOid: string, widgetDto: WidgetDto) => Promise<WidgetDto | undefined>;
|
|
73
|
+
/**
|
|
74
|
+
* Get shared formulas by ids
|
|
75
|
+
* @param sharedFormulasIds - An array of shared formulas ids
|
|
76
|
+
* @returns A dictionary of shared formulas
|
|
77
|
+
*/
|
|
78
|
+
getSharedFormulas: (sharedFormulasIds: string[]) => Promise<Record<string, SharedFormulaDto>>;
|
|
79
|
+
/**
|
|
80
|
+
* Get a shared formula by id
|
|
81
|
+
* @param sharedFormulaId - A shared formula id
|
|
82
|
+
* @returns A shared formula
|
|
83
|
+
*/
|
|
84
|
+
getSharedFormula: (sharedFormulaId: string) => Promise<SharedFormulaDto | undefined>;
|
|
61
85
|
}
|
|
62
86
|
export declare const useRestApi: () => {
|
|
63
87
|
restApi: RestApi | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WidgetDto } from '../../widget-by-id/types';
|
|
2
|
-
import { FilterJaql, FilterRelationsModel, JaqlDataSource } from '@sisense/sdk-data';
|
|
2
|
+
import { FilterJaql, FilterRelationsModel, FilterRelationsModelNode, JaqlDataSource } from '@sisense/sdk-data';
|
|
3
3
|
import { AnyObject } from '../../utils/utility-types';
|
|
4
4
|
/** @internal */
|
|
5
5
|
export type LayoutDto = {
|
|
6
|
-
columns
|
|
6
|
+
columns?: {
|
|
7
7
|
width: number;
|
|
8
8
|
cells?: {
|
|
9
9
|
subcells: {
|
|
@@ -23,9 +23,12 @@ export type FilterDto = {
|
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
locked?: boolean;
|
|
25
25
|
};
|
|
26
|
+
type CascadeLevel = FilterJaql & {
|
|
27
|
+
instanceid?: string;
|
|
28
|
+
};
|
|
26
29
|
export type CascadingFilterDto = {
|
|
27
30
|
isCascading: true;
|
|
28
|
-
levels:
|
|
31
|
+
levels: CascadeLevel[];
|
|
29
32
|
instanceid?: string;
|
|
30
33
|
disabled?: boolean;
|
|
31
34
|
locked?: boolean;
|
|
@@ -48,8 +51,10 @@ export type DashboardDto = {
|
|
|
48
51
|
widgets?: WidgetDto[];
|
|
49
52
|
filters?: Array<FilterDto | CascadingFilterDto>;
|
|
50
53
|
filterRelations?: {
|
|
51
|
-
|
|
54
|
+
datasource: string;
|
|
55
|
+
filterRelations: FilterRelationsModel | FilterRelationsModelNode;
|
|
52
56
|
}[];
|
|
53
57
|
layout?: LayoutDto;
|
|
54
58
|
style?: DashboardStyleDto;
|
|
55
59
|
} & AnyObject;
|
|
60
|
+
export {};
|
|
@@ -4,5 +4,18 @@ import { ChartDataOptionsInternal } from '../../chart-data-options/types';
|
|
|
4
4
|
import { ChartType } from '../../types';
|
|
5
5
|
import { DataColumnNamesMapping } from '../../chart-data-options/validate-data-options';
|
|
6
6
|
type DataSet = DataSource | Data | undefined;
|
|
7
|
-
|
|
7
|
+
type UseSyncedDataProps = {
|
|
8
|
+
dataSet: DataSet;
|
|
9
|
+
chartDataOptions: ChartDataOptionsInternal;
|
|
10
|
+
chartType: ChartType;
|
|
11
|
+
attributes: Attribute[];
|
|
12
|
+
measures: Measure[];
|
|
13
|
+
dataColumnNamesMapping: DataColumnNamesMapping;
|
|
14
|
+
filters?: Filter[] | FilterRelations;
|
|
15
|
+
highlights?: Filter[];
|
|
16
|
+
refreshCounter?: number;
|
|
17
|
+
setIsLoading?: Dispatch<SetStateAction<boolean>>;
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare const useSyncedData: ({ dataSet, chartDataOptions, chartType, attributes, measures, dataColumnNamesMapping, filters, highlights, refreshCounter, setIsLoading, enabled, }: UseSyncedDataProps) => [Data, ChartDataOptionsInternal];
|
|
8
21
|
export {};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
language: string;
|
|
3
|
-
};
|
|
4
|
-
export declare const getBaseDateFnsLocale: (systemSettings?: SystemSettings) => Locale;
|
|
1
|
+
export declare const getBaseDateFnsLocale: (language?: string) => Locale;
|
|
5
2
|
export declare enum DatePeriod {
|
|
6
3
|
YEAR = "years",
|
|
7
4
|
QUARTER = "quarters",
|
|
@@ -14,7 +14,9 @@ export declare function flattenCascadingFilters(filters: Filter[]): {
|
|
|
14
14
|
* @param originalFilters - Original filters with maybe cascading filters.
|
|
15
15
|
* @returns reassembled filters.
|
|
16
16
|
*/
|
|
17
|
-
export declare function reassembleCascadingFilters(updatedFilters: PureFilter[], originalFilters: (PureFilter | CascadingFilter)[]
|
|
17
|
+
export declare function reassembleCascadingFilters(updatedFilters: PureFilter[], originalFilters: (PureFilter | CascadingFilter)[], config?: {
|
|
18
|
+
shouldResetFiltersDeeperThanModified?: boolean;
|
|
19
|
+
}): (PureFilter | CascadingFilter)[];
|
|
18
20
|
/**
|
|
19
21
|
* Converts cascading filters to pure filters and vice versa.
|
|
20
22
|
*
|
|
@@ -4,14 +4,15 @@ import { CommonFiltersOptions } from './types.js';
|
|
|
4
4
|
import { WidgetTypeInternal } from '../models/widget/types';
|
|
5
5
|
import { OpenMenuFn } from '../common/components/menu/types';
|
|
6
6
|
import { TFunction } from '@sisense/sdk-common';
|
|
7
|
-
type
|
|
7
|
+
type CommonFiltersConnectionProps = Pick<ChartWidgetProps, 'highlights' | 'onDataPointClick' | 'onDataPointsSelected' | 'onDataPointContextMenu'> & {
|
|
8
|
+
filters: Filter[];
|
|
8
9
|
renderToolbar: RenderToolbarHandler;
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
|
-
* Prepares common filters
|
|
12
|
+
* Prepares common filters for connection to widget props
|
|
12
13
|
*
|
|
13
14
|
* @param filters - Pure filters (non-cascading)
|
|
14
15
|
* @param setFilters - Function to set updated pure filters (non-cascading)
|
|
15
16
|
*/
|
|
16
|
-
export declare function
|
|
17
|
+
export declare function prepareCommonFiltersConnectionProps(commonFilters: Filter[], updateCommonFilters: (filters: Filter[]) => void, widgetType: WidgetTypeInternal, dataOptions: ChartDataOptions | PivotTableDataOptions, options: CommonFiltersOptions, translate: TFunction, openMenu?: OpenMenuFn): CommonFiltersConnectionProps;
|
|
17
18
|
export {};
|
|
@@ -11,16 +11,41 @@ export declare enum CommonFiltersApplyMode {
|
|
|
11
11
|
* Options for common filters defined at the dashboard level to be applied to certain widgets.
|
|
12
12
|
*/
|
|
13
13
|
export type CommonFiltersOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* Apply mode for common filters: 'highlight' or 'filter'.
|
|
16
|
+
*/
|
|
14
17
|
applyMode?: `${CommonFiltersApplyMode}`;
|
|
18
|
+
/**
|
|
19
|
+
* Boolean flag whether widget interactions – for example, selection of bars on a bar chart –
|
|
20
|
+
* should affect common filters.
|
|
21
|
+
*
|
|
22
|
+
* If not specified, the default value is `true`.
|
|
23
|
+
*/
|
|
15
24
|
shouldAffectFilters?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Filters to ignore when applying common filters.
|
|
27
|
+
*/
|
|
16
28
|
ignoreFilters?: FiltersIgnoringRules;
|
|
29
|
+
/**
|
|
30
|
+
* Boolean flag whether to apply all background filters as slice filters ignoring "disabled" state and "ignoreFilters" rules
|
|
31
|
+
*
|
|
32
|
+
* If not specified, the default value is `true`.
|
|
33
|
+
*/
|
|
17
34
|
forceApplyBackgroundFilters?: boolean;
|
|
18
35
|
};
|
|
19
36
|
/**
|
|
20
37
|
* Filters ignoring rules.
|
|
21
38
|
*/
|
|
22
39
|
export type FiltersIgnoringRules = {
|
|
40
|
+
/**
|
|
41
|
+
* Boolean flag whether to ignore all filters.
|
|
42
|
+
*
|
|
43
|
+
* If not specified, the default value is `false`.
|
|
44
|
+
*/
|
|
23
45
|
all?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Filter GUIDs to ignore.
|
|
48
|
+
*/
|
|
24
49
|
ids?: string[];
|
|
25
50
|
};
|
|
26
51
|
/** @internal */
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import { type Filter } from '@sisense/sdk-data';
|
|
1
|
+
import { FilterRelations, type Filter } from '@sisense/sdk-data';
|
|
3
2
|
import { CommonFiltersOptions } from './types.js';
|
|
4
3
|
import { WidgetProps } from '../props.js';
|
|
5
4
|
import { BeforeMenuOpenHandler, OpenMenuFn } from '../common/components/menu/types.js';
|
|
6
5
|
/** @internal */
|
|
7
|
-
export declare const useCommonFilters: ({ initialFilters, openMenu, onBeforeMenuOpen, onFiltersChange, }?: {
|
|
8
|
-
initialFilters?: Filter[] | undefined;
|
|
6
|
+
export declare const useCommonFilters: ({ initialFilters: initialCommonFiltersOrFilterRelations, openMenu, onBeforeMenuOpen, onFiltersChange, }?: {
|
|
7
|
+
initialFilters?: Filter[] | FilterRelations | undefined;
|
|
9
8
|
openMenu?: OpenMenuFn | undefined;
|
|
10
9
|
onBeforeMenuOpen?: BeforeMenuOpenHandler | undefined;
|
|
11
|
-
onFiltersChange?: ((filters: Filter[]) => void) | undefined;
|
|
10
|
+
onFiltersChange?: ((filters: Filter[] | FilterRelations) => void) | undefined;
|
|
12
11
|
}) => {
|
|
13
|
-
filters: Filter[];
|
|
14
|
-
setFilters:
|
|
15
|
-
addFilter: (
|
|
16
|
-
connectToWidgetProps: (
|
|
12
|
+
filters: Filter[] | FilterRelations;
|
|
13
|
+
setFilters: (filtersOrFilterRelations: Filter[] | FilterRelations) => void;
|
|
14
|
+
addFilter: (filter: Filter) => void;
|
|
15
|
+
connectToWidgetProps: (widgetProps: WidgetProps, options?: CommonFiltersOptions) => WidgetProps;
|
|
17
16
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
2
|
+
/**
|
|
3
|
+
* Result of the FilterRelations conversion.
|
|
4
|
+
*/
|
|
5
|
+
type UseFilterRelationsConversionResult = {
|
|
6
|
+
/** The current filters or filter relations. */
|
|
7
|
+
filtersOrFilterRelations: Filter[] | FilterRelations;
|
|
8
|
+
/** The current regular filters without relations. */
|
|
9
|
+
regularFilters: Filter[];
|
|
10
|
+
/** Adds a new filter to the current filters (recalculates relations if needed). */
|
|
11
|
+
addFilter: (filter: Filter) => void;
|
|
12
|
+
/** Completely replaces the current filters and relations with new ones. */
|
|
13
|
+
setFiltersOrFilterRelations: (filtersOrFilterRelations: Filter[] | FilterRelations) => void;
|
|
14
|
+
/** Completely replaces the current filters with new ones (recalculates relations if needed). */
|
|
15
|
+
setFilters: (filters: Filter[]) => void;
|
|
16
|
+
/** Calculates relations for some other filters based on current relations and applies them */
|
|
17
|
+
applyRelationsToOtherFilters: (otherFilters: Filter[]) => Filter[] | FilterRelations;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Hook for handling conversion between regular filters and filter relations.
|
|
21
|
+
*
|
|
22
|
+
* @param initialFiltersOrFilterRelations - Initial filters or filter relations.
|
|
23
|
+
* @returns The result of the conversion. See {@link UseFilterRelationsConversionResult}.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useConvertFilterRelations(initialFiltersOrFilterRelations: Filter[] | FilterRelations, onFiltersChange?: (filters: Filter[] | FilterRelations) => void): UseFilterRelationsConversionResult;
|
|
26
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Filter } from '@sisense/sdk-data';
|
|
2
1
|
import { DashboardProps } from './types';
|
|
2
|
+
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a new dashboard instance with its filters replaced by a new set of filters.
|
|
5
5
|
*
|
|
@@ -13,10 +13,10 @@ import { DashboardProps } from './types';
|
|
|
13
13
|
* const updatedDashboard = replaceFilters(existingDashboard, newFilters);
|
|
14
14
|
* ```
|
|
15
15
|
* @param dashboard - The original dashboard (`DashboardProps`) whose filters are to be replaced.
|
|
16
|
-
* @param newFilters - An array of new filters to set on the dashboard.
|
|
16
|
+
* @param newFilters - An array of new filters or filter relations to set on the dashboard.
|
|
17
17
|
* @returns A new dashboard instance with the updated filters.
|
|
18
18
|
*/
|
|
19
|
-
export declare const replaceFilters: (dashboard: DashboardProps, newFilters: Filter[]) => DashboardProps;
|
|
19
|
+
export declare const replaceFilters: (dashboard: DashboardProps, newFilters: Filter[] | FilterRelations) => DashboardProps;
|
|
20
20
|
/**
|
|
21
21
|
* Creates a new dashboard instance with an additional filter added to its existing filters.
|
|
22
22
|
*
|
|
@@ -52,19 +52,31 @@ export declare const addFilter: (dashboard: DashboardProps, newFilter: Filter) =
|
|
|
52
52
|
*/
|
|
53
53
|
export declare const addFilters: (dashboard: DashboardProps, newFilters: Filter[]) => DashboardProps;
|
|
54
54
|
/**
|
|
55
|
-
* Creates a new dashboard instance with a specific filter
|
|
55
|
+
* Creates a new dashboard instance with a specific filter replaced.
|
|
56
56
|
*
|
|
57
|
-
* This function searches for a filter with the same GUID as the provided `
|
|
57
|
+
* This function searches for a filter with the same GUID as the provided `filterToReplace` and replaces it with `newFilter`.
|
|
58
58
|
* This function does not modify the original dashboard; instead, it returns a new dashboard with the updated filters.
|
|
59
59
|
*
|
|
60
60
|
* @example
|
|
61
|
-
*
|
|
61
|
+
* Replace a filter in a dashboard.
|
|
62
62
|
* ```ts
|
|
63
63
|
* const existingDashboard: DashboardProps = {...};
|
|
64
|
-
* const
|
|
64
|
+
* const filterToReplace: Filter = {...};
|
|
65
65
|
* const newFilter: Filter = {...};
|
|
66
|
-
* const updatedDashboard =
|
|
66
|
+
* const updatedDashboard = replaceFilter(existingDashboard, filterToReplace, newFilter);
|
|
67
67
|
* ```
|
|
68
|
+
* @param dashboard - The original dashboard (`DashboardProps`) containing the filter to be replaced.
|
|
69
|
+
* @param filterToReplace - The existing filter to be replaced.
|
|
70
|
+
* @param newFilter - The new filter to replace the existing one.
|
|
71
|
+
* @returns A new dashboard instance with the specified filter replaced.
|
|
72
|
+
*/
|
|
73
|
+
export declare const replaceFilter: (dashboard: DashboardProps, filterToReplace: Filter, newFilter: Filter) => DashboardProps;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a new dashboard instance with a specific filter modified.
|
|
76
|
+
* Alias for `replaceFilter`.
|
|
77
|
+
*
|
|
78
|
+
* @deprecated Use {@link replaceFilter} instead
|
|
79
|
+
*
|
|
68
80
|
* @param dashboard - The original dashboard (`DashboardProps`) containing the filter to modify.
|
|
69
81
|
* @param filterToModify - The existing filter to be modified.
|
|
70
82
|
* @param newFilter - The new filter to replace the existing one.
|
|
@@ -85,7 +97,25 @@ export declare const modifyFilter: (dashboard: DashboardProps, filterToModify: F
|
|
|
85
97
|
* const updatedDashboard = removeFilter(existingDashboard, filterToRemove);
|
|
86
98
|
* ```
|
|
87
99
|
* @param dashboard - The original dashboard (`DashboardProps`) from which to remove the filter.
|
|
88
|
-
* @param
|
|
100
|
+
* @param filterToRemove - The filter to be removed.
|
|
89
101
|
* @returns A new dashboard instance with the specified filter removed.
|
|
90
102
|
*/
|
|
91
|
-
export declare const removeFilter: (dashboard: DashboardProps,
|
|
103
|
+
export declare const removeFilter: (dashboard: DashboardProps, filterToRemove: Filter) => DashboardProps;
|
|
104
|
+
/**
|
|
105
|
+
* Creates a new dashboard instance with multiple filters removed.
|
|
106
|
+
*
|
|
107
|
+
* This function removes all filters with the same GUID as the provided filters from the dashboard's filters.
|
|
108
|
+
* This function does not modify the original dashboard; instead, it returns a new dashboard with the updated filters.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* Remove multiple filters from a dashboard.
|
|
112
|
+
* ```ts
|
|
113
|
+
* const existingDashboard: DashboardProps = {...};
|
|
114
|
+
* const filtersToRemove: Filter[] = [{...}, {...}, ...];
|
|
115
|
+
* const updatedDashboard = removeFilters(existingDashboard, filtersToRemove);
|
|
116
|
+
* ```
|
|
117
|
+
* @param dashboard - The original dashboard (`DashboardProps`) from which the specified filters are removed.
|
|
118
|
+
* @param filtersToRemove - An array of filters to remove.
|
|
119
|
+
* @returns A new dashboard instance with the specified filters removed.
|
|
120
|
+
*/
|
|
121
|
+
export declare const removeFilters: (dashboard: DashboardProps, filtersToRemove: Filter[]) => DashboardProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DashboardProps } from '../dashboard/types';
|
|
3
|
-
import { Filter } from '@sisense/sdk-data';
|
|
3
|
+
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
4
4
|
export declare enum DashboardChangeType {
|
|
5
5
|
/** Dashboard filters have been updated */
|
|
6
6
|
FILTERS_UPDATE = "FILTERS.UPDATE",
|
|
@@ -9,7 +9,7 @@ export declare enum DashboardChangeType {
|
|
|
9
9
|
}
|
|
10
10
|
export type DashboardChangeAction = {
|
|
11
11
|
type: DashboardChangeType.FILTERS_UPDATE;
|
|
12
|
-
payload: Filter[];
|
|
12
|
+
payload: Filter[] | FilterRelations;
|
|
13
13
|
} | {
|
|
14
14
|
type: DashboardChangeType.UI_FILTERS_PANEL_COLLAPSE;
|
|
15
15
|
payload: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DashboardStyleOptions, WidgetsOptions, WidgetsPanelLayout } from '../models';
|
|
2
2
|
import { WidgetProps } from '../props';
|
|
3
|
-
import { DataSource, Filter } from '@sisense/sdk-data';
|
|
4
3
|
import { DashboardChangeAction } from '../dashboard/dashboard';
|
|
4
|
+
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
5
5
|
export type { DashboardStyleOptions, WidgetsPanelColumnLayout } from '../models';
|
|
6
6
|
/**
|
|
7
7
|
* Props for the DashboardById component
|
|
@@ -19,7 +19,7 @@ export interface DashboardByIdProps {
|
|
|
19
19
|
* Limitations:
|
|
20
20
|
* - WAT authentication does not support persistence.
|
|
21
21
|
* - As an alpha feature, currently only changes to dashboard filters are persisted.
|
|
22
|
-
* @
|
|
22
|
+
* @alpha
|
|
23
23
|
*/
|
|
24
24
|
persist?: boolean;
|
|
25
25
|
}
|
|
@@ -31,8 +31,8 @@ export interface DashboardContainerProps {
|
|
|
31
31
|
layoutOptions?: DashboardLayoutOptions;
|
|
32
32
|
config?: DashboardConfig;
|
|
33
33
|
widgets: WidgetProps[];
|
|
34
|
-
filters: Filter[];
|
|
35
|
-
onFiltersChange: (filters: Filter[]) => void;
|
|
34
|
+
filters: Filter[] | FilterRelations;
|
|
35
|
+
onFiltersChange: (filters: Filter[] | FilterRelations) => void;
|
|
36
36
|
defaultDataSource?: DataSource;
|
|
37
37
|
/**
|
|
38
38
|
* Callback to receive changes
|
|
@@ -95,7 +95,7 @@ export interface DashboardProps {
|
|
|
95
95
|
/** The widgets to render in the dashboard */
|
|
96
96
|
widgets: WidgetProps[];
|
|
97
97
|
/** The dashboard filters to be applied to each of the widgets based on the widget filter options */
|
|
98
|
-
filters?: Filter[];
|
|
98
|
+
filters?: Filter[] | FilterRelations;
|
|
99
99
|
/** The default data source to use for the dashboard */
|
|
100
100
|
defaultDataSource?: DataSource;
|
|
101
101
|
/** The options for each of the widgets */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DashboardProps } from './types.js';
|
|
2
|
-
import { Filter } from '@sisense/sdk-data';
|
|
2
|
+
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
3
3
|
export type ComposableDashboardProps = Pick<DashboardProps, 'filters' | 'widgets' | 'widgetsOptions'>;
|
|
4
4
|
export type UseComposedDashboardOptions = {
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
onFiltersChange?: (filters: Filter[]) => void;
|
|
8
|
+
onFiltersChange?: (filters: Filter[] | FilterRelations) => void;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* {@link useComposedDashboard} without tracking to be used inside other hooks or components in Compose SDK.
|
|
@@ -15,7 +15,7 @@ export type UseComposedDashboardOptions = {
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function useComposedDashboardInternal<D extends ComposableDashboardProps | DashboardProps>(initialDashboard: D, { onFiltersChange }?: UseComposedDashboardOptions): {
|
|
17
17
|
dashboard: D;
|
|
18
|
-
setFilters: (filters: Filter[]) => void;
|
|
18
|
+
setFilters: (filters: Filter[] | FilterRelations) => void;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* React hook that takes in separate dashboard elements and
|
|
@@ -26,5 +26,5 @@ export declare function useComposedDashboardInternal<D extends ComposableDashboa
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const useComposedDashboard: <D extends DashboardProps | ComposableDashboardProps>(args_0: D, args_1?: UseComposedDashboardOptions | undefined) => {
|
|
28
28
|
dashboard: D;
|
|
29
|
-
setFilters: (filters: Filter[]) => void;
|
|
29
|
+
setFilters: (filters: Filter[] | FilterRelations) => void;
|
|
30
30
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DataSource, Filter } from '@sisense/sdk-data';
|
|
2
|
+
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
3
3
|
/**
|
|
4
4
|
* Props of the {@link FiltersPanel} component
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
export type FiltersPanelProps = {
|
|
8
8
|
/** Array of filters to display */
|
|
9
|
-
filters: Filter[];
|
|
9
|
+
filters: Filter[] | FilterRelations;
|
|
10
10
|
/** Callback to handle changes in filters */
|
|
11
|
-
onFiltersChange: (filters: Filter[]) => void;
|
|
11
|
+
onFiltersChange: (filters: Filter[] | FilterRelations) => void;
|
|
12
12
|
/** Default data source used for filter tiles */
|
|
13
13
|
defaultDataSource?: DataSource;
|
|
14
14
|
};
|
|
@@ -7,7 +7,7 @@ export interface MemberListProps {
|
|
|
7
7
|
checkAllMembers: () => void;
|
|
8
8
|
uncheckAllMembers: () => void;
|
|
9
9
|
excludeMembers: boolean;
|
|
10
|
-
|
|
10
|
+
enableMultiSelection: boolean;
|
|
11
11
|
disabled: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare const MemberList: FunctionComponent<MemberListProps>;
|