@sisense/sdk-ui 1.27.1 → 1.28.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 +50 -50
- package/dist/ai.js +909 -858
- package/dist/analytics-composer.cjs +49 -49
- package/dist/analytics-composer.js +374 -374
- package/dist/{derive-chart-family-DDkQybGb.cjs → derive-chart-family-BNu7PP-p.cjs} +42 -42
- package/dist/{derive-chart-family-H_RlUbXY.js → derive-chart-family-BYdyoe8O.js} +952 -950
- package/dist/index.cjs +55 -55
- package/dist/index.js +3676 -3620
- package/dist/packages/sdk-ui/src/ai/api/chat-rest-api.d.ts +5 -3
- package/dist/packages/sdk-ui/src/ai/api/hooks.d.ts +1 -1
- package/dist/packages/sdk-ui/src/ai/api/types.d.ts +12 -2
- package/dist/packages/sdk-ui/src/ai/chart/chart-insights.d.ts +2 -2
- package/dist/packages/sdk-ui/src/ai/{get-nlg-query-result.d.ts → get-nlg-insights.d.ts} +21 -6
- package/dist/packages/sdk-ui/src/ai/index.d.ts +4 -3
- package/dist/packages/sdk-ui/src/ai/messages/insights-message.d.ts +2 -2
- package/dist/packages/sdk-ui/src/ai/{use-get-nlg-query-result.d.ts → use-get-nlg-insights.d.ts} +17 -10
- package/dist/packages/sdk-ui/src/ai/use-get-nlq-result.d.ts +74 -0
- package/dist/packages/sdk-ui/src/ai/use-get-query-recommendations.d.ts +8 -1
- package/dist/packages/sdk-ui/src/analytics-composer/common/stringify-props.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +17 -0
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +30 -1
- package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -2
- package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/custom-filter-tile.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-tile-container.d.ts +42 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +19 -35
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/index.d.ts +0 -1
- package/dist/packages/sdk-ui/src/filters/components/index.d.ts +7 -0
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +2 -2
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/members-reducer.d.ts +7 -0
- package/dist/packages/sdk-ui/src/filters/components/unsupported-filter-tile.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/hooks/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +77 -0
- package/dist/packages/sdk-ui/src/filters/index.d.ts +2 -6
- package/dist/packages/sdk-ui/src/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +9 -1
- package/dist/packages/sdk-ui/src/query/date-formats/apply-date-format.d.ts +1 -1
- package/dist/{useQuery-KI9icU5_.cjs → useQuery-7UcSPq8U.cjs} +125 -125
- package/dist/{useQuery-DOgANgSI.js → useQuery-CwqhrvKr.js} +101 -91
- package/dist/{widget-composer-ldmqMCC4.cjs → widget-composer-BvJFwTM1.cjs} +10 -8
- package/dist/{widget-composer-NNyD6tF2.js → widget-composer-CAmaQCTo.js} +155 -132
- package/package.json +7 -7
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel-tile.d.ts +0 -24
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
|
-
import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, ChatContext,
|
|
2
|
+
import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, ChatContext, GetNlgInsightsRequest, GetNlgInsightsResponse, LlmConfig, QueryRecommendationConfig, QueryRecommendationResponse, SendFeedbackRequest, GetNlqResultRequest, NlqResult } from './types';
|
|
3
3
|
import { DataSourceField } from '@sisense/sdk-data';
|
|
4
4
|
export declare class ChatRestApi {
|
|
5
5
|
private httpClient;
|
|
6
6
|
constructor(httpClient: HttpClient);
|
|
7
7
|
getChatContexts: () => Promise<ChatContext[]>;
|
|
8
|
-
private
|
|
8
|
+
private getNlgInsights;
|
|
9
9
|
private getQueryRecommendations;
|
|
10
|
+
private getNlqResult;
|
|
10
11
|
private setLlmConfig;
|
|
11
12
|
private getAllChats;
|
|
12
13
|
private getChatById;
|
|
@@ -16,7 +17,8 @@ export declare class ChatRestApi {
|
|
|
16
17
|
private sendFeedback;
|
|
17
18
|
private getDataSourceFields;
|
|
18
19
|
ai: {
|
|
19
|
-
|
|
20
|
+
getNlgInsights: (request: GetNlgInsightsRequest) => Promise<GetNlgInsightsResponse | undefined>;
|
|
21
|
+
getNlqResult: (contextTitle: string, request: GetNlqResultRequest) => Promise<NlqResult | undefined>;
|
|
20
22
|
getQueryRecommendations: (contextTitle: string, config: QueryRecommendationConfig) => Promise<QueryRecommendationResponse | undefined>;
|
|
21
23
|
setLlmConfig: (config: LlmConfig) => Promise<unknown>;
|
|
22
24
|
sendFeedback: (request: SendFeedbackRequest) => Promise<unknown>;
|
|
@@ -18,7 +18,7 @@ export declare const useGetAllChats: () => {
|
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
20
|
export declare const useMaybeCreateChat: (contextId: string | undefined, shouldCreate: boolean) => import("@tanstack/react-query").UseMutationResult<import("./types").Chat | undefined, unknown, void, unknown>;
|
|
21
|
-
export declare const useSendChatMessage: (chatId: string | undefined) => {
|
|
21
|
+
export declare const useSendChatMessage: (chatId: string | undefined, enableFollowupQuestions?: boolean) => {
|
|
22
22
|
mutate: import("@tanstack/react-query").UseMutateFunction<ChatResponse | undefined, unknown, string, void>;
|
|
23
23
|
isLoading: boolean;
|
|
24
24
|
};
|
|
@@ -73,17 +73,27 @@ export type ChatResponse = NlqResponse | TextResponse | ErrorResponse;
|
|
|
73
73
|
export interface QueryRecommendationConfig {
|
|
74
74
|
numOfRecommendations: number;
|
|
75
75
|
}
|
|
76
|
+
export type NlqResult = Omit<NlqResponseData, 'followupQuestions'>;
|
|
76
77
|
export type QueryRecommendation = Omit<NlqResponseData, 'followupQuestions'>;
|
|
77
78
|
export type QueryRecommendationResponse = QueryRecommendation[];
|
|
78
|
-
export interface
|
|
79
|
+
export interface GetNlgInsightsRequest {
|
|
79
80
|
jaql: Pick<JaqlQueryPayload, 'datasource' | 'metadata' | 'filterRelations'>;
|
|
80
81
|
}
|
|
81
|
-
export interface
|
|
82
|
+
export interface GetNlgInsightsResponse {
|
|
82
83
|
data?: {
|
|
83
84
|
answer: string;
|
|
84
85
|
};
|
|
85
86
|
responseType: 'Text';
|
|
86
87
|
}
|
|
88
|
+
/** @internal */
|
|
89
|
+
export declare const NLQ_RESULT_CHART_TYPES: readonly ["indicator", "column", "line", "table", "pie", "bar"];
|
|
90
|
+
/** NLQ result chart types @expandType */
|
|
91
|
+
export type NlqResultChartType = (typeof NLQ_RESULT_CHART_TYPES)[number];
|
|
92
|
+
export interface GetNlqResultRequest {
|
|
93
|
+
text: string;
|
|
94
|
+
timezone?: string;
|
|
95
|
+
chartTypes: NlqResultChartType[];
|
|
96
|
+
}
|
|
87
97
|
export interface SendFeedbackRequest {
|
|
88
98
|
type: string;
|
|
89
99
|
data: object;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetNlgInsightsRequest } from '../../ai';
|
|
2
2
|
export interface ChartInsightsProps {
|
|
3
3
|
summary: string;
|
|
4
|
-
nlgRequest:
|
|
4
|
+
nlgRequest: GetNlgInsightsRequest;
|
|
5
5
|
}
|
|
6
6
|
export declare const ChartInsights: ({ summary, nlgRequest }: ChartInsightsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { UseGetNlgInsightsParams } from './use-get-nlg-insights';
|
|
3
3
|
/**
|
|
4
|
-
* Props for {@link
|
|
4
|
+
* Props for {@link GetNlgInsights} component.
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface GetNlgInsightsProps extends Omit<UseGetNlgInsightsParams, 'enabled'> {
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* React component that fetches and displays a collapsible analysis of the provided query using natural language generation (NLG).
|
|
@@ -15,16 +15,31 @@ export interface GetNlgQueryResultProps extends Omit<UseGetNlgQueryResultParams,
|
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```tsx
|
|
18
|
-
* <
|
|
18
|
+
* <GetNlgInsights
|
|
19
19
|
* dataSource="Sample ECommerce"
|
|
20
20
|
* dimensions={[DM.Commerce.Date.Years]}
|
|
21
21
|
* measures={[measureFactory.sum(DM.Commerce.Revenue)]}
|
|
22
22
|
* />
|
|
23
23
|
* ```
|
|
24
|
-
* @param props - {@link
|
|
24
|
+
* @param props - {@link GetNlgInsightsProps}
|
|
25
25
|
* @returns Collapsible container wrapping a text summary
|
|
26
26
|
* @group Generative AI
|
|
27
27
|
* @beta
|
|
28
28
|
*/
|
|
29
|
-
declare const _default: import("react").FunctionComponent<
|
|
29
|
+
declare const _default: import("react").FunctionComponent<GetNlgInsightsProps>;
|
|
30
30
|
export default _default;
|
|
31
|
+
/**
|
|
32
|
+
* Props for {@link GetNlgQueryResult} component.
|
|
33
|
+
* @deprecated Use {@link GetNlgInsightsProps} instead
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export interface GetNlgQueryResultProps extends GetNlgInsightsProps {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @param props - {@link GetNlgQueryResultProps}
|
|
40
|
+
* @returns Collapsible container wrapping a text summary
|
|
41
|
+
* @group Generative AI
|
|
42
|
+
* @deprecated Use {@link GetNlgInsights} instead
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare const GetNlgQueryResult: import("react").FunctionComponent<GetNlgQueryResultProps>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { default as AiContextProvider, type AiContextProviderProps } from './ai-context-provider';
|
|
2
2
|
export { type ChatConfig } from './chat-config';
|
|
3
|
-
export {
|
|
3
|
+
export { useGetNlgInsights, type UseGetNlgInsightsParams, type UseGetNlgInsightsState, useGetNlgQueryResult, } from './use-get-nlg-insights';
|
|
4
|
+
export { useGetNlqResult, type UseGetNlqResultParams, type UseGetNlqResultState, } from './use-get-nlq-result';
|
|
4
5
|
export { useGetQueryRecommendations, type UseGetQueryRecommendationsParams, type UseGetQueryRecommendationsState, } from './use-get-query-recommendations';
|
|
5
6
|
export { useChatSession, type UseChatSessionResult } from './use-chat-session';
|
|
6
7
|
export { useLastNlqResponse } from './use-last-nlq-response';
|
|
7
8
|
export { useGetDataSourceFields } from './use-get-data-source-fields';
|
|
8
|
-
export type {
|
|
9
|
+
export type { GetNlgInsightsRequest, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, NlqResult, NLQ_RESULT_CHART_TYPES, NlqResultChartType, } from './api/types';
|
|
9
10
|
export { Chatbot, type ChatbotProps } from './chatbot';
|
|
10
|
-
export { default as GetNlgQueryResult, type GetNlgQueryResultProps } from './get-nlg-
|
|
11
|
+
export { default as GetNlgInsights, type GetNlgInsightsProps, GetNlgQueryResult, type GetNlgQueryResultProps, } from './get-nlg-insights';
|
|
11
12
|
export { NlqChartWidget, type NlqChartWidgetProps } from './chart/nlq-chart-widget';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetNlgInsightsRequest } from '../api/types';
|
|
2
2
|
type InsightsMessageProps = {
|
|
3
|
-
nlgRequest:
|
|
3
|
+
nlgRequest: GetNlgInsightsRequest;
|
|
4
4
|
};
|
|
5
5
|
export default function InsightsMessage({ nlgRequest }: InsightsMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
package/dist/packages/sdk-ui/src/ai/{use-get-nlg-query-result.d.ts → use-get-nlg-insights.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Attribute, DataSource, Filter, FilterRelations, Measure } from '@sisense/sdk-data';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { GetNlgInsightsRequest } from './api/types';
|
|
3
|
+
import { GetNlgInsightsProps } from './get-nlg-insights';
|
|
4
4
|
/**
|
|
5
|
-
* Parameters for {@link
|
|
5
|
+
* Parameters for {@link useGetNlgInsights} hook.
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface UseGetNlgInsightsParams {
|
|
8
8
|
/** The data source that the query targets - e.g. `Sample ECommerce` */
|
|
9
9
|
dataSource: DataSource;
|
|
10
10
|
/** Dimensions of the query */
|
|
@@ -21,9 +21,9 @@ export interface UseGetNlgQueryResultParams {
|
|
|
21
21
|
enabled?: boolean;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* State for {@link
|
|
24
|
+
* State for {@link useGetNlgInsights} hook.
|
|
25
25
|
*/
|
|
26
|
-
export interface
|
|
26
|
+
export interface UseGetNlgInsightsState {
|
|
27
27
|
/** Whether the data fetching is loading */
|
|
28
28
|
isLoading: boolean;
|
|
29
29
|
/** Whether the data fetching has failed */
|
|
@@ -39,11 +39,11 @@ export interface UseGetNlgQueryResultState {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
|
-
* @param params - {@link
|
|
42
|
+
* @param params - {@link UseGetNlgInsightsParams}
|
|
43
43
|
* @param enabled - boolean flag to enable/disable this hook
|
|
44
44
|
* @internal
|
|
45
45
|
*/
|
|
46
|
-
export declare const
|
|
46
|
+
export declare const useGetNlgInsightsInternal: (params: GetNlgInsightsProps | GetNlgInsightsRequest, enabled?: boolean) => UseGetNlgInsightsState;
|
|
47
47
|
/**
|
|
48
48
|
* React hook that fetches an analysis of the provided query using natural language generation (NLG).
|
|
49
49
|
* Specifying a query is similar to providing parameters to a {@link useExecuteQuery} hook, using dimensions, measures, and filters.
|
|
@@ -54,7 +54,7 @@ export declare const useGetNlgQueryResultInternal: (params: GetNlgQueryResultPro
|
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```tsx
|
|
57
|
-
* const { data, isLoading } =
|
|
57
|
+
* const { data, isLoading } = useGetNlgInsights({
|
|
58
58
|
* dataSource: 'Sample ECommerce',
|
|
59
59
|
* dimensions: [DM.Commerce.Date.Years],
|
|
60
60
|
* measures: [measureFactory.sum(DM.Commerce.Revenue)],
|
|
@@ -70,4 +70,11 @@ export declare const useGetNlgQueryResultInternal: (params: GetNlgQueryResultPro
|
|
|
70
70
|
* @group Generative AI
|
|
71
71
|
* @beta
|
|
72
72
|
*/
|
|
73
|
-
export declare const
|
|
73
|
+
export declare const useGetNlgInsights: (params: UseGetNlgInsightsParams) => UseGetNlgInsightsState;
|
|
74
|
+
/**
|
|
75
|
+
* @returns Response object containing a text summary
|
|
76
|
+
* @group Generative AI
|
|
77
|
+
* @deprecated Use {@link useGetNlgInsights} instead
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
export declare const useGetNlgQueryResult: (params: UseGetNlgInsightsParams) => UseGetNlgInsightsState;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { WidgetProps } from '../props';
|
|
2
|
+
import { DataSource } from '@sisense/sdk-data';
|
|
3
|
+
import { HookEnableParam } from '../common/hooks/types';
|
|
4
|
+
import { NlqResultChartType } from './api/types';
|
|
5
|
+
/**
|
|
6
|
+
* Parameters for {@link useGetNlqResult} hook.
|
|
7
|
+
*/
|
|
8
|
+
export interface UseGetNlqResultParams extends HookEnableParam {
|
|
9
|
+
/** Data source for queries to run against */
|
|
10
|
+
dataSource: DataSource;
|
|
11
|
+
/** Text containing the natural language query */
|
|
12
|
+
query: string;
|
|
13
|
+
/** Possible chart types to be used in NLQ results */
|
|
14
|
+
chartTypes?: NlqResultChartType[];
|
|
15
|
+
/**
|
|
16
|
+
* Enable suggested axis titles in generated widget
|
|
17
|
+
*
|
|
18
|
+
* If not specified, the default value is `false`
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
enableAxisTitlesInWidgetProps?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* State for {@link useGetNlqResult} hook.
|
|
25
|
+
*/
|
|
26
|
+
export interface UseGetNlqResultState {
|
|
27
|
+
/** Whether the data fetching is loading */
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
/** Whether the data fetching has failed */
|
|
30
|
+
isError: boolean;
|
|
31
|
+
/** Whether the data fetching has succeeded */
|
|
32
|
+
isSuccess: boolean;
|
|
33
|
+
/** The result data */
|
|
34
|
+
data: WidgetProps | undefined;
|
|
35
|
+
/** The error if any occurred */
|
|
36
|
+
error: unknown;
|
|
37
|
+
/** Callback to trigger a refetch of the data */
|
|
38
|
+
refetch: () => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @param params - {@link UseGetNlqResultParams}
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare const useGetNlqResultInternal: (params: UseGetNlqResultParams) => UseGetNlqResultState;
|
|
45
|
+
/**
|
|
46
|
+
* React hook that enables natural language query (NLQ) against a data model or perspective.
|
|
47
|
+
*
|
|
48
|
+
* ::: warning Note
|
|
49
|
+
* This hook is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
|
|
50
|
+
* :::
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* const { data, isLoading } = useGetNlqResult({
|
|
55
|
+
* dataSource: 'Sample ECommerce',
|
|
56
|
+
* query: 'Show me total revenue by age range'
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* if (isLoading) {
|
|
60
|
+
* return <div>Loading...</div>;
|
|
61
|
+
* }
|
|
62
|
+
*
|
|
63
|
+
* return (
|
|
64
|
+
* {
|
|
65
|
+
* data &&
|
|
66
|
+
* <Widget {...data} />
|
|
67
|
+
* }
|
|
68
|
+
* );
|
|
69
|
+
* ```
|
|
70
|
+
* @returns NLQ load state that contains the status of the execution, the result (data) as WidgetProps
|
|
71
|
+
* @group Generative AI
|
|
72
|
+
* @beta
|
|
73
|
+
*/
|
|
74
|
+
export declare const useGetNlqResult: (params: UseGetNlqResultParams) => UseGetNlqResultState;
|
|
@@ -11,6 +11,13 @@ export interface UseGetQueryRecommendationsParams {
|
|
|
11
11
|
* If not specified, the default value is `4`
|
|
12
12
|
*/
|
|
13
13
|
count?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Enable suggested axis titles in generated widget
|
|
16
|
+
*
|
|
17
|
+
* If not specified, the default value is `false`
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
enableAxisTitlesInWidgetProps?: boolean;
|
|
14
21
|
}
|
|
15
22
|
/**
|
|
16
23
|
* State for {@link useGetQueryRecommendations} hook.
|
|
@@ -61,7 +68,7 @@ export declare const useGetQueryRecommendationsInternal: (params: UseGetQueryRec
|
|
|
61
68
|
* </ul>
|
|
62
69
|
* );
|
|
63
70
|
* ```
|
|
64
|
-
* @returns An array of objects, each containing recommended question text and its corresponding JAQL
|
|
71
|
+
* @returns An array of objects, each containing recommended question text and its corresponding `widgetProps`, as well as other variants of this information such as JAQL + chartMappings
|
|
65
72
|
* @group Generative AI
|
|
66
73
|
* @beta
|
|
67
74
|
*/
|
|
@@ -2,4 +2,4 @@ import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
|
2
2
|
import { ChartDataOptions } from '../../types';
|
|
3
3
|
export declare function stringifyDataOptions(dataOptions: ChartDataOptions): string;
|
|
4
4
|
export declare function stringifyDataSource(dataSource: DataSource | undefined): string;
|
|
5
|
-
export declare function stringifyExtraImports(filters: Filter[] | FilterRelations): string;
|
|
5
|
+
export declare function stringifyExtraImports(filters: Filter[] | FilterRelations, importMeasureFactory?: boolean): string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ExpandedQueryModel, SimpleQueryModel } from '../types.js';
|
|
2
|
+
import { ChartWidgetProps, PivotTableWidgetProps } from '../../props';
|
|
3
|
+
import { ExecuteQueryParams, ExecutePivotQueryParams } from '../../query-execution';
|
|
2
4
|
import { DynamicChartType } from '../../chart-options-processor/translations/types.js';
|
|
3
5
|
export declare function toKebabCase(str: string): string;
|
|
4
6
|
export declare function capitalizeFirstLetter(str: string): string;
|
|
@@ -13,3 +15,18 @@ export declare function validateQueryModel(model: any): SimpleQueryModel;
|
|
|
13
15
|
export declare function isEmptyQueryModel(queryModel: ExpandedQueryModel | undefined | null): boolean;
|
|
14
16
|
export declare function escapeSingleQuotes(str?: string): string | undefined;
|
|
15
17
|
export declare function validateChartType(chartType: DynamicChartType | 'pivot' | 'pivot2'): void;
|
|
18
|
+
export declare function checkIfMeasuresExist(props: ChartWidgetProps | PivotTableWidgetProps | ExecuteQueryParams | ExecutePivotQueryParams): boolean;
|
|
19
|
+
export declare function isNonEmptyArray<T>(array: T[]): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Removes the first empty line or string if the next line contains "import *" or "import {".
|
|
22
|
+
*
|
|
23
|
+
* The `stringifyExtraImports` function can return an empty string if there are no measures or filters, then
|
|
24
|
+
* `filterFactory` or `measureFactory` are not required for import.
|
|
25
|
+
* In our code templates, we use the `{{extraImportsString}}` placeholder, and
|
|
26
|
+
* if it is replaced with an empty string, our tests may break.
|
|
27
|
+
* This function ensures that such invalid empty lines before imports are removed to maintain proper formatting.
|
|
28
|
+
*
|
|
29
|
+
* @param input - the populated template
|
|
30
|
+
* @returns The modified string with the first empty line removed if the next line contains "import *" or "import {". If no such condition is met, the input remains unchanged.
|
|
31
|
+
*/
|
|
32
|
+
export declare function removeEmptyLineBeforeImport(input: string): string;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { WidgetProps } from '../props';
|
|
1
|
+
import { WidgetProps, ChartWidgetProps, PivotTableWidgetProps } from '../props';
|
|
2
2
|
import { ChartDataOptions } from '../types';
|
|
3
3
|
import { ExecuteQueryParams, ExecutePivotQueryParams } from '../query-execution';
|
|
4
4
|
import { MetadataItem } from '@sisense/sdk-data';
|
|
5
5
|
import { DynamicChartType } from '../chart-options-processor/translations/types.js';
|
|
6
|
+
type Stringify<T> = {
|
|
7
|
+
[K in keyof T as `${K & string}String`]: string;
|
|
8
|
+
};
|
|
9
|
+
type ExtraCodeProps = {
|
|
10
|
+
componentString: string;
|
|
11
|
+
extraImportsString: string;
|
|
12
|
+
};
|
|
6
13
|
export type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
7
14
|
export type AllPossibleChartOptionKeys = KeysOfUnion<ChartDataOptions>;
|
|
8
15
|
export type AxesMappingKey = Exclude<AllPossibleChartOptionKeys, 'seriesToColorMap'>;
|
|
@@ -30,6 +37,7 @@ export interface ExpandedQueryModel {
|
|
|
30
37
|
};
|
|
31
38
|
metadata: MetadataItem[];
|
|
32
39
|
};
|
|
40
|
+
widgetProps?: WidgetProps | undefined;
|
|
33
41
|
queryTitle: string;
|
|
34
42
|
}
|
|
35
43
|
/**
|
|
@@ -164,3 +172,24 @@ export type ExecuteQueryCodeParams = BaseCodeConfig & {
|
|
|
164
172
|
export type ExecutePivotQueryCodeParams = BaseCodeConfig & {
|
|
165
173
|
pivotQueryParams: ExecutePivotQueryParams;
|
|
166
174
|
};
|
|
175
|
+
/**
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
export type ExecuteQueryCodeProps = Stringify<ExecuteQueryParams> & {
|
|
179
|
+
extraImportsString: string;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* @internal
|
|
183
|
+
*/
|
|
184
|
+
export type ExecutePivotQueryCodeProps = Stringify<ExecutePivotQueryParams> & {
|
|
185
|
+
extraImportsString: string;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
export type ChartWidgetCodeProps = Stringify<ChartWidgetProps> & ExtraCodeProps;
|
|
191
|
+
/**
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
export type PivotTableWidgetCodeProps = Stringify<PivotTableWidgetProps> & ExtraCodeProps;
|
|
195
|
+
export {};
|
package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { DataSource, Filter } from '@sisense/sdk-data';
|
|
3
3
|
import { FilterVariant } from '../common/filter-utils.js';
|
|
4
4
|
/**
|
|
5
5
|
* Props for {@link CascadingFilterTile}
|
|
@@ -8,7 +8,7 @@ import { FilterVariant } from '../common/filter-utils.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export interface CascadingFilterTileProps {
|
|
10
10
|
/** Cascading filter object to initialize filter type and default values */
|
|
11
|
-
filter:
|
|
11
|
+
filter: Filter;
|
|
12
12
|
/**
|
|
13
13
|
* Data source the query is run against - e.g. `Sample ECommerce`
|
|
14
14
|
*
|
package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FilterTileDesignOptions } from '../filter-tile.js';
|
|
2
|
+
import { FilterTileDesignOptions } from '../filter-tile-container.js';
|
|
3
3
|
import { ExcludeFilter, Filter, Measure, NumericFilter, RankingFilter, TextFilter } from '@sisense/sdk-data';
|
|
4
4
|
import { FilterVariant } from '../common/filter-utils.js';
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LevelAttribute, DataSource, Filter } from '@sisense/sdk-data';
|
|
3
|
-
import { FilterTileDesignOptions } from '../../filter-tile';
|
|
3
|
+
import { FilterTileDesignOptions } from '../../filter-tile-container';
|
|
4
4
|
export interface DateRangeFilterTileProps {
|
|
5
5
|
/**
|
|
6
6
|
* Filter tile title
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Filter } from '@sisense/sdk-data';
|
|
3
3
|
import { FilterVariant } from '../../common/index.js';
|
|
4
|
-
import { FilterTileDesignOptions } from '../../filter-tile.js';
|
|
4
|
+
import { FilterTileDesignOptions } from '../../filter-tile-container.js';
|
|
5
5
|
/**
|
|
6
6
|
* Props for {@link RelativeDateFilterTile}
|
|
7
7
|
*/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { FilterVariant } from './common/filter-utils';
|
|
3
|
+
import { DeepRequired } from 'ts-essentials';
|
|
4
|
+
/**
|
|
5
|
+
* Design options for the filter tile component.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface FilterTileDesignOptions {
|
|
10
|
+
header?: {
|
|
11
|
+
shouldBeShown?: boolean;
|
|
12
|
+
isCollapsible?: boolean;
|
|
13
|
+
hasBorder?: boolean;
|
|
14
|
+
hasBackgroundFilterIcon?: boolean;
|
|
15
|
+
};
|
|
16
|
+
border?: {
|
|
17
|
+
shouldBeShown?: boolean;
|
|
18
|
+
};
|
|
19
|
+
footer?: {
|
|
20
|
+
shouldBeShown?: boolean;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export type CompleteFilterTileDesignOptions = DeepRequired<FilterTileDesignOptions>;
|
|
24
|
+
interface FilterTileContainerProps {
|
|
25
|
+
title?: string;
|
|
26
|
+
renderContent: (collapsed: boolean, tileDisabled: boolean) => ReactNode;
|
|
27
|
+
arrangement?: FilterVariant;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
isDependent?: boolean;
|
|
30
|
+
design?: FilterTileDesignOptions;
|
|
31
|
+
onToggleDisabled?: () => void;
|
|
32
|
+
onDelete?: () => void;
|
|
33
|
+
onEdit?: () => void;
|
|
34
|
+
locked?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generic component that owns common functionality of a filter "tile" like
|
|
38
|
+
* collapsible content and an enable/disable toggle. This is intended to match
|
|
39
|
+
* the style of filter tiles in the right sidebar on a Sisense dashboard.
|
|
40
|
+
*/
|
|
41
|
+
export declare const FilterTileContainer: FunctionComponent<FilterTileContainerProps>;
|
|
42
|
+
export {};
|
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { DeepRequired } from 'ts-essentials';
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DataSource, Filter } from '@sisense/sdk-data';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Props of the {@link FilterTile} component
|
|
6
5
|
*
|
|
7
|
-
* @internal
|
|
8
6
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
border?: {
|
|
17
|
-
shouldBeShown?: boolean;
|
|
18
|
-
};
|
|
19
|
-
footer?: {
|
|
20
|
-
shouldBeShown?: boolean;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export type CompleteFilterTileDesignOptions = DeepRequired<FilterTileDesignOptions>;
|
|
24
|
-
interface Props {
|
|
25
|
-
title?: string;
|
|
26
|
-
renderContent: (collapsed: boolean, tileDisabled: boolean) => ReactNode;
|
|
27
|
-
arrangement?: FilterVariant;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
isDependent?: boolean;
|
|
30
|
-
design?: FilterTileDesignOptions;
|
|
31
|
-
onToggleDisabled?: () => void;
|
|
7
|
+
export type FilterTileProps = {
|
|
8
|
+
/** Filter to display */
|
|
9
|
+
filter: Filter;
|
|
10
|
+
/** Callback to handle filter change */
|
|
11
|
+
onChange: (filter: Filter | null) => void;
|
|
12
|
+
/** Filter delete callback */
|
|
32
13
|
onDelete?: () => void;
|
|
14
|
+
/** Filter edit callback */
|
|
33
15
|
onEdit?: () => void;
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
/** Default data source used for filter tiles */
|
|
17
|
+
defaultDataSource?: DataSource;
|
|
18
|
+
};
|
|
36
19
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
20
|
+
* Facade component that renders a filter tile based on filter type
|
|
21
|
+
*
|
|
22
|
+
* @group Filter Tiles
|
|
23
|
+
* @shortDescription Facade component rendering a filter tile based on filter type
|
|
24
|
+
* @beta
|
|
40
25
|
*/
|
|
41
|
-
export declare const FilterTile:
|
|
42
|
-
export {};
|
|
26
|
+
export declare const FilterTile: React.FC<FilterTileProps>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { MemberFilterTile, type MemberFilterTileProps } from './member-filter-tile';
|
|
2
2
|
export { BasicMemberFilterTile, type BasicMemberFilterTileProps } from './basic-member-filter-tile';
|
|
3
|
-
export type { Member } from './members-reducer';
|
|
3
|
+
export type { Member, SelectedMember } from './members-reducer';
|
package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Attribute, DataSource, Filter } from '@sisense/sdk-data';
|
|
2
2
|
import { FunctionComponent } from 'react';
|
|
3
|
-
import { FilterTileDesignOptions } from '../filter-tile';
|
|
3
|
+
import { FilterTileDesignOptions } from '../filter-tile-container';
|
|
4
4
|
/**
|
|
5
5
|
* Props for {@link MemberFilterTile}
|
|
6
6
|
*/
|
|
@@ -17,7 +17,7 @@ export interface MemberFilterTileProps {
|
|
|
17
17
|
attribute: Attribute;
|
|
18
18
|
/** Source filter object. Caller is responsible for keeping track of filter state */
|
|
19
19
|
filter: Filter | null;
|
|
20
|
-
/** Callback indicating when the source
|
|
20
|
+
/** Callback indicating when the source members filter should be updated */
|
|
21
21
|
onChange: (filter: Filter | null) => void;
|
|
22
22
|
/** Filter delete callback */
|
|
23
23
|
onDelete?: () => void;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
export interface Member {
|
|
2
|
+
/** Key of the member */
|
|
2
3
|
key: string;
|
|
4
|
+
/** Title of the member */
|
|
3
5
|
title: string;
|
|
4
6
|
}
|
|
5
7
|
export interface SelectedMember extends Member {
|
|
8
|
+
/**
|
|
9
|
+
* Boolean flag whether the member is inactive
|
|
10
|
+
*
|
|
11
|
+
* If not specified, the default value is `false`
|
|
12
|
+
*/
|
|
6
13
|
inactive?: boolean;
|
|
7
14
|
}
|
|
8
15
|
type MembersState = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FilterTileDesignOptions } from '../../filters/components/filter-tile';
|
|
1
|
+
import { FilterTileDesignOptions } from '../../filters/components/filter-tile-container';
|
|
2
2
|
import { Filter } from '@sisense/sdk-data';
|
|
3
3
|
export type UnsupportedFilterTileProps = {
|
|
4
4
|
filter: Filter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useGetFilterMembers, type GetFilterMembersParams, type GetFilterMembersResult, type GetFilterMembersSuccess, type GetFilterMembersError, } from './use-get-filter-members';
|