@sisense/sdk-ui 1.27.1 → 1.29.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 (99) hide show
  1. package/dist/ai.cjs +50 -50
  2. package/dist/ai.js +968 -904
  3. package/dist/analytics-composer.cjs +49 -49
  4. package/dist/analytics-composer.js +374 -374
  5. package/dist/{derive-chart-family-H_RlUbXY.js → derive-chart-family-Cy3hlluo.js} +15339 -15478
  6. package/dist/{derive-chart-family-DDkQybGb.cjs → derive-chart-family-DWCXp57c.cjs} +103 -103
  7. package/dist/index.cjs +253 -120
  8. package/dist/index.js +11042 -8996
  9. package/dist/packages/sdk-ui/src/ai/api/chat-rest-api.d.ts +5 -3
  10. package/dist/packages/sdk-ui/src/ai/api/hooks.d.ts +3 -2
  11. package/dist/packages/sdk-ui/src/ai/api/types.d.ts +12 -2
  12. package/dist/packages/sdk-ui/src/ai/chart/chart-insights.d.ts +2 -2
  13. package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +9 -1
  14. package/dist/packages/sdk-ui/src/ai/{get-nlg-query-result.d.ts → get-nlg-insights.d.ts} +21 -6
  15. package/dist/packages/sdk-ui/src/ai/index.d.ts +4 -3
  16. package/dist/packages/sdk-ui/src/ai/messages/insights-message.d.ts +2 -2
  17. package/dist/packages/sdk-ui/src/ai/{use-get-nlg-query-result.d.ts → use-get-nlg-insights.d.ts} +17 -10
  18. package/dist/packages/sdk-ui/src/ai/use-get-nlq-result.d.ts +74 -0
  19. package/dist/packages/sdk-ui/src/ai/use-get-query-recommendations.d.ts +11 -3
  20. package/dist/packages/sdk-ui/src/analytics-composer/common/stringify-props.d.ts +1 -1
  21. package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +17 -1
  22. package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +30 -1
  23. package/dist/packages/sdk-ui/src/area-chart.d.ts +1 -1
  24. package/dist/packages/sdk-ui/src/areamap-chart.d.ts +1 -1
  25. package/dist/packages/sdk-ui/src/boxplot-utils.d.ts +3 -2
  26. package/dist/packages/sdk-ui/src/chart-data-options/types.d.ts +1 -1
  27. package/dist/packages/sdk-ui/src/chart-options-processor/subtype-to-design-options.d.ts +1 -1
  28. package/dist/packages/sdk-ui/src/chart-options-processor/translations/axis-section.d.ts +5 -2
  29. package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +1 -0
  30. package/dist/packages/sdk-ui/src/chart-options-processor/translations/value-label-section.d.ts +3 -1
  31. package/dist/packages/sdk-ui/src/common/components/button.d.ts +10 -0
  32. package/dist/packages/sdk-ui/src/common/components/popover.d.ts +23 -0
  33. package/dist/packages/sdk-ui/src/common/components/radio.d.ts +8 -0
  34. package/dist/packages/sdk-ui/src/common/hooks/use-combined-menu.d.ts +3 -4
  35. package/dist/packages/sdk-ui/src/const.d.ts +1 -0
  36. package/dist/packages/sdk-ui/src/dashboard/components/dashboard-container.d.ts +1 -1
  37. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +6 -0
  38. package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -2
  39. package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +1 -1
  40. package/dist/packages/sdk-ui/src/filters/components/custom-filter-tile.d.ts +1 -1
  41. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +1 -1
  42. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +1 -1
  43. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/index.d.ts +4 -0
  44. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/input.d.ts +5 -0
  45. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/search-input.d.ts +8 -0
  46. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/base.d.ts +14 -0
  47. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/index.d.ts +3 -0
  48. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/multi-select-item.d.ts +7 -0
  49. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-multi-select.d.ts +12 -0
  50. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-single-select.d.ts +12 -0
  51. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/single-select-item.d.ts +7 -0
  52. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/single-select.d.ts +12 -0
  53. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/types.d.ts +7 -0
  54. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/utils.d.ts +4 -0
  55. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/selectable-section.d.ts +11 -0
  56. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-popover.d.ts +12 -0
  57. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor.d.ts +8 -0
  58. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/multi-select-control.d.ts +7 -0
  59. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/include-all-section.d.ts +9 -0
  60. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/members-section.d.ts +11 -0
  61. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/text-condition-section.d.ts +11 -0
  62. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/utils.d.ts +5 -0
  63. package/dist/packages/sdk-ui/src/filters/components/filter-tile-container.d.ts +42 -0
  64. package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +19 -35
  65. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +2 -0
  66. package/dist/packages/sdk-ui/src/filters/components/filters-panel/index.d.ts +0 -1
  67. package/dist/packages/sdk-ui/src/filters/components/icons/arrow-down-icon.d.ts +1 -1
  68. package/dist/packages/sdk-ui/src/filters/components/icons/check-icon.d.ts +2 -0
  69. package/dist/packages/sdk-ui/src/filters/components/icons/index.d.ts +1 -0
  70. package/dist/packages/sdk-ui/src/filters/components/icons/search-icon.d.ts +1 -1
  71. package/dist/packages/sdk-ui/src/filters/components/index.d.ts +7 -0
  72. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/index.d.ts +1 -1
  73. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +3 -3
  74. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/members-reducer.d.ts +7 -0
  75. package/dist/packages/sdk-ui/src/filters/components/unsupported-filter-tile.d.ts +1 -1
  76. package/dist/packages/sdk-ui/src/filters/helpers.d.ts +1 -122
  77. package/dist/packages/sdk-ui/src/filters/hooks/index.d.ts +1 -0
  78. package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +77 -0
  79. package/dist/packages/sdk-ui/src/filters/index.d.ts +2 -7
  80. package/dist/packages/sdk-ui/src/index.d.ts +1 -1
  81. package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +9 -1
  82. package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-totals-formatter.d.ts +4 -0
  83. package/dist/packages/sdk-ui/src/props.d.ts +15 -15
  84. package/dist/packages/sdk-ui/src/query/date-formats/apply-date-format.d.ts +1 -1
  85. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +29 -0
  86. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +58 -0
  87. package/dist/packages/sdk-ui/src/types.d.ts +27 -2
  88. package/dist/packages/sdk-ui/src/utils/filter-relations.d.ts +30 -72
  89. package/dist/packages/sdk-ui/src/widget-by-id/dashboard-widget.d.ts +1 -1
  90. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +1 -2
  91. package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +14 -0
  92. package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +2 -57
  93. package/dist/useQuery-CRu7WcYd.cjs +916 -0
  94. package/dist/{useQuery-DOgANgSI.js → useQuery-CdtycPOg.js} +17043 -16999
  95. package/dist/{widget-composer-ldmqMCC4.cjs → widget-composer-DyY3yi_b.cjs} +10 -8
  96. package/dist/{widget-composer-NNyD6tF2.js → widget-composer-G4mPX-JO.js} +168 -143
  97. package/package.json +7 -7
  98. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel-tile.d.ts +0 -24
  99. package/dist/useQuery-KI9icU5_.cjs +0 -915
@@ -1,12 +1,13 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
- import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, ChatContext, GetNlgQueryResultRequest, GetNlgQueryResultResponse, LlmConfig, QueryRecommendationConfig, QueryRecommendationResponse, SendFeedbackRequest } from './types';
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 getNlgQueryResult;
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
- getNlgQueryResult: (request: GetNlgQueryResultRequest) => Promise<GetNlgQueryResultResponse | undefined>;
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>;
@@ -1,4 +1,5 @@
1
1
  import type { ChatResponse } from './types';
2
+ import { TranslatableError } from '../../translation/translatable-error';
2
3
  /**
3
4
  * @internal
4
5
  */
@@ -18,7 +19,7 @@ export declare const useGetAllChats: () => {
18
19
  * @internal
19
20
  */
20
21
  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) => {
22
- mutate: import("@tanstack/react-query").UseMutateFunction<ChatResponse | undefined, unknown, string, void>;
22
+ export declare const useSendChatMessage: (chatId: string | undefined, enableFollowupQuestions?: boolean) => {
23
+ mutate: import("@tanstack/react-query").UseMutateFunction<ChatResponse | undefined, TranslatableError, string, void>;
23
24
  isLoading: boolean;
24
25
  };
@@ -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 GetNlgQueryResultRequest {
79
+ export interface GetNlgInsightsRequest {
79
80
  jaql: Pick<JaqlQueryPayload, 'datasource' | 'metadata' | 'filterRelations'>;
80
81
  }
81
- export interface GetNlgQueryResultResponse {
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 { GetNlgQueryResultRequest } from '../../ai';
1
+ import { GetNlgInsightsRequest } from '../../ai';
2
2
  export interface ChartInsightsProps {
3
3
  summary: string;
4
- nlgRequest: GetNlgQueryResultRequest;
4
+ nlgRequest: GetNlgInsightsRequest;
5
5
  }
6
6
  export declare const ChartInsights: ({ summary, nlgRequest }: ChartInsightsProps) => import("react/jsx-runtime").JSX.Element;
@@ -20,6 +20,14 @@ export interface NlqChartWidgetProps {
20
20
  * Can be used to inject modification of queried data.
21
21
  */
22
22
  onDataReady?: (data: Data) => Data;
23
+ /**
24
+ * Boolean flag to show or hide the widget header
25
+ *
26
+ * Note: set to 'false' to hide the widget header
27
+ *
28
+ * @default true
29
+ */
30
+ enableHeader?: boolean;
23
31
  }
24
32
  /**
25
33
  * React component that renders a chart widget based on NLQ response data.
@@ -43,4 +51,4 @@ export interface NlqChartWidgetProps {
43
51
  * @group Generative AI
44
52
  * @internal
45
53
  */
46
- export declare const NlqChartWidget: ({ nlqResponse, onDataReady, filters }: NlqChartWidgetProps) => import("react/jsx-runtime").JSX.Element;
54
+ export declare const NlqChartWidget: ({ nlqResponse, onDataReady, filters, enableHeader, }: NlqChartWidgetProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { UseGetNlgQueryResultParams } from './use-get-nlg-query-result';
2
+ import { UseGetNlgInsightsParams } from './use-get-nlg-insights';
3
3
  /**
4
- * Props for {@link GetNlgQueryResult} component.
4
+ * Props for {@link GetNlgInsights} component.
5
5
  */
6
- export interface GetNlgQueryResultProps extends Omit<UseGetNlgQueryResultParams, 'enabled'> {
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
- * <GetNlgQueryResult
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 GetNlgQueryResultProps}
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<GetNlgQueryResultProps>;
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 { useGetNlgQueryResult, type UseGetNlgQueryResultParams, type UseGetNlgQueryResultState, } from './use-get-nlg-query-result';
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 { GetNlgQueryResultRequest, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, } from './api/types';
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-query-result';
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 { GetNlgQueryResultRequest } from '../api/types';
1
+ import { GetNlgInsightsRequest } from '../api/types';
2
2
  type InsightsMessageProps = {
3
- nlgRequest: GetNlgQueryResultRequest;
3
+ nlgRequest: GetNlgInsightsRequest;
4
4
  };
5
5
  export default function InsightsMessage({ nlgRequest }: InsightsMessageProps): import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -1,10 +1,10 @@
1
1
  import { Attribute, DataSource, Filter, FilterRelations, Measure } from '@sisense/sdk-data';
2
- import { GetNlgQueryResultRequest } from './api/types';
3
- import { GetNlgQueryResultProps } from './get-nlg-query-result';
2
+ import { GetNlgInsightsRequest } from './api/types';
3
+ import { GetNlgInsightsProps } from './get-nlg-insights';
4
4
  /**
5
- * Parameters for {@link useGetNlgQueryResult} hook.
5
+ * Parameters for {@link useGetNlgInsights} hook.
6
6
  */
7
- export interface UseGetNlgQueryResultParams {
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 useGetNlgQueryResult} hook.
24
+ * State for {@link useGetNlgInsights} hook.
25
25
  */
26
- export interface UseGetNlgQueryResultState {
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 UseGetNlgQueryResultParams}
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 useGetNlgQueryResultInternal: (params: GetNlgQueryResultProps | GetNlgQueryResultRequest, enabled?: boolean) => UseGetNlgQueryResultState;
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 } = useGetNlgQueryResult({
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 useGetNlgQueryResult: (params: UseGetNlgQueryResultParams) => UseGetNlgQueryResultState;
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;
@@ -1,8 +1,9 @@
1
1
  import { QueryRecommendation } from './api/types';
2
+ import { HookEnableParam } from '../common/hooks/types';
2
3
  /**
3
4
  * Parameters for {@link useGetQueryRecommendations} hook.
4
5
  */
5
- export interface UseGetQueryRecommendationsParams {
6
+ export interface UseGetQueryRecommendationsParams extends HookEnableParam {
6
7
  /** Data model title or perspective title */
7
8
  contextTitle: string;
8
9
  /**
@@ -11,6 +12,13 @@ export interface UseGetQueryRecommendationsParams {
11
12
  * If not specified, the default value is `4`
12
13
  */
13
14
  count?: number;
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;
14
22
  }
15
23
  /**
16
24
  * State for {@link useGetQueryRecommendations} hook.
@@ -23,7 +31,7 @@ export interface UseGetQueryRecommendationsState {
23
31
  /** Whether the data fetching has succeeded */
24
32
  isSuccess: boolean;
25
33
  /** The result data */
26
- data: QueryRecommendation[];
34
+ data: QueryRecommendation[] | undefined;
27
35
  /** The error if any occurred */
28
36
  error: unknown;
29
37
  /** Callback to trigger a refetch of the data */
@@ -61,7 +69,7 @@ export declare const useGetQueryRecommendationsInternal: (params: UseGetQueryRec
61
69
  * </ul>
62
70
  * );
63
71
  * ```
64
- * @returns An array of objects, each containing recommended question text and its corresponding JAQL
72
+ * @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
73
  * @group Generative AI
66
74
  * @beta
67
75
  */
@@ -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;
@@ -11,5 +13,19 @@ export declare function capitalizeFirstLetter(str: string): string;
11
13
  export declare function sanitizeDimensionId(str: string): string;
12
14
  export declare function validateQueryModel(model: any): SimpleQueryModel;
13
15
  export declare function isEmptyQueryModel(queryModel: ExpandedQueryModel | undefined | null): boolean;
14
- export declare function escapeSingleQuotes(str?: string): string | undefined;
15
16
  export declare function validateChartType(chartType: DynamicChartType | 'pivot' | 'pivot2'): void;
17
+ export declare function checkIfMeasuresExist(props: ChartWidgetProps | PivotTableWidgetProps | ExecuteQueryParams | ExecutePivotQueryParams): boolean;
18
+ export declare function isNonEmptyArray<T>(array: T[]): boolean;
19
+ /**
20
+ * Removes the first empty line or string if the next line contains "import *" or "import {".
21
+ *
22
+ * The `stringifyExtraImports` function can return an empty string if there are no measures or filters, then
23
+ * `filterFactory` or `measureFactory` are not required for import.
24
+ * In our code templates, we use the `{{extraImportsString}}` placeholder, and
25
+ * if it is replaced with an empty string, our tests may break.
26
+ * This function ensures that such invalid empty lines before imports are removed to maintain proper formatting.
27
+ *
28
+ * @param input - the populated template
29
+ * @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.
30
+ */
31
+ 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 {};
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { AreaChartProps } from './props';
3
3
  /**
4
- * A React component similar to a {@link LineChart},
4
+ * A React component similar to a {@link @sisense/sdk-ui!LineChart | `LineChart`},
5
5
  * but with filled in areas under each line and an option to display them as stacked.
6
6
  *
7
7
  * ## Example
@@ -3,7 +3,7 @@ import { AreamapChartProps } from './props';
3
3
  /**
4
4
  * A React component for visualizing geographical data as colored polygons on a map.
5
5
  *
6
- * For another way do display data on a map, see {@link ScattermapChart}.
6
+ * For another way do display data on a map, see {@link @sisense/sdk-ui!ScattermapChart | `ScattermapChart`}.
7
7
  *
8
8
  * ## Example
9
9
  *
@@ -1,4 +1,4 @@
1
- import { Attribute, Measure, Filter, QueryResultData, DataSource } from '@sisense/sdk-data';
1
+ import { Attribute, Measure, Filter, QueryResultData, DataSource, FilterRelationsJaql } from '@sisense/sdk-data';
2
2
  import { ClientApplication } from './app/client-application.js';
3
3
  import { executeQuery as executeQueryFunction } from './query/execute-query.js';
4
4
  import { BoxplotChartCustomDataOptions, BoxplotChartDataOptionsInternal } from './chart-data-options/types.js';
@@ -22,12 +22,13 @@ export declare const boxWhiskerProcessResultInternal: (boxWhiskerData: QueryResu
22
22
  * @group Charts
23
23
  */
24
24
  export declare function boxWhiskerProcessResult(boxWhiskerData: QueryResultData, outliersData: QueryResultData, dataOptions?: BoxplotChartCustomDataOptions): QueryResultData;
25
- export declare const executeBoxplotQuery: ({ app, chartDataOptions, dataSource, attributes, measures, filters, highlights, }: {
25
+ export declare const executeBoxplotQuery: ({ app, chartDataOptions, dataSource, attributes, measures, filters, filterRelations, highlights, }: {
26
26
  app: ClientApplication;
27
27
  chartDataOptions: BoxplotChartDataOptionsInternal;
28
28
  dataSource?: DataSource | undefined;
29
29
  attributes: Attribute[];
30
30
  measures: Measure[];
31
31
  filters?: Filter[] | undefined;
32
+ filterRelations?: FilterRelationsJaql | undefined;
32
33
  highlights?: Filter[] | undefined;
33
34
  }, executeQuery: typeof executeQueryFunction) => Promise<QueryResultData>;
@@ -23,7 +23,7 @@ export interface CategoryStyle {
23
23
  /**
24
24
  * Date granularity that works with continuous timeline.
25
25
  *
26
- * Values from {@link @sisense/sdk-data!DateLevels}.
26
+ * Values from {@link @sisense/sdk-data!DateLevels | `DateLevels`}.
27
27
  *
28
28
  */
29
29
  granularity?: string;
@@ -93,7 +93,7 @@ export type PolarSubtype = 'polar/column' | 'polar/area' | 'polar/line';
93
93
  export type IndicatorSubtype = 'indicator/numeric' | 'indicator/gauge';
94
94
  /**
95
95
  *
96
- * Subtype of {@link TreemapChart}
96
+ * Subtype of {@link @sisense/sdk-ui!TreemapChart | `TreemapChart`}
97
97
  *
98
98
  * **Values**
99
99
  *
@@ -1,6 +1,6 @@
1
1
  import { Stacking, Style } from '../chart-options-service';
2
2
  import { ChartDataOptionsInternal, StyledColumn } from '../../chart-data-options/types';
3
- import { ChartType } from '../../types';
3
+ import { ChartType, CompleteThemeSettings } from '../../types';
4
4
  import { CategoricalXValues } from '../../chart-data/types';
5
5
  import { AxisClipped } from './translations-to-highcharts';
6
6
  export type Axis = {
@@ -78,6 +78,8 @@ export type StackLabel = {
78
78
  enabled: boolean;
79
79
  rotation: number;
80
80
  labelrank: number;
81
+ x?: number;
82
+ y?: number;
81
83
  };
82
84
  export type PlotBand = {
83
85
  text: string;
@@ -96,6 +98,7 @@ export type AxisPlotBand = {
96
98
  color?: string;
97
99
  label?: {
98
100
  text: string;
101
+ x: number;
99
102
  y: number;
100
103
  style?: Style;
101
104
  };
@@ -105,4 +108,4 @@ export declare const getDefaultDateFormat: (granularity?: string) => "HH:mm:ss"
105
108
  export declare const getDateFormatter: (category: StyledColumn, dateFormatter?: ((date: Date, format: string) => string) | undefined) => (time: number) => string;
106
109
  export declare const getXAxisDatetimeSettings: (axis: Axis, category: StyledColumn, values: number[], dateFormatter?: ((date: Date, format: string) => string) | undefined) => AxisSettings[];
107
110
  export declare const getXAxisSettings: (axis: Axis, axis2: Axis | undefined, categories: string[], plotBands: PlotBand[], xAxisOrientation: AxisOrientation, dataOptions: ChartDataOptionsInternal, chartType: ChartType) => AxisSettings[];
108
- export declare const getYAxisSettings: (axis: Axis, axis2: Axis | undefined, axisMinMax: AxisMinMax, axis2MinMax: AxisMinMax | undefined, showTotal: boolean, dataOptions: ChartDataOptionsInternal, stacking: Stacking | undefined) => [AxisSettings[], AxisClipped[]];
111
+ export declare const getYAxisSettings: (axis: Axis, axis2: Axis | undefined, axisMinMax: AxisMinMax, axis2MinMax: AxisMinMax | undefined, showTotal: boolean, totalLabelRotation: number, dataOptions: ChartDataOptionsInternal, stacking: Stacking | undefined, themeSettings?: CompleteThemeSettings) => [AxisSettings[], AxisClipped[]];
@@ -35,6 +35,7 @@ export type CartesianChartDesignOptions = BaseDesignOptionsType & DesignPerSerie
35
35
  export type StackableChartDesignOptions = CartesianChartDesignOptions & {
36
36
  stackType: StackType;
37
37
  showTotal?: boolean;
38
+ totalLabelRotation?: number;
38
39
  } & DesignPerSeries;
39
40
  export type LineChartDesignOptions = CartesianChartDesignOptions;
40
41
  export type AreaChartDesignOptions = StackableChartDesignOptions;
@@ -7,6 +7,8 @@ import { NumberFormatConfig } from '../../types';
7
7
  export type ValueLabelOptions = {
8
8
  enabled?: boolean;
9
9
  rotation?: number;
10
+ showValue?: boolean;
11
+ showPercentage?: boolean;
10
12
  };
11
13
  export type RotationType = 'horizontal' | 'diagonal' | 'vertical';
12
14
  export type ValueLabelSettings = {
@@ -28,7 +30,7 @@ export type ValueLabelSettings = {
28
30
  };
29
31
  formatter?: (this: InternalSeries, options?: DataLabelsOptions, valuePropName?: string) => string;
30
32
  };
31
- export declare const createValueLabelFormatter: (numberFormatConfig?: NumberFormatConfig) => (this: InternalSeries) => string;
33
+ export declare const createValueLabelFormatter: (numberFormatConfig?: NumberFormatConfig, options?: ValueLabelOptions) => (this: InternalSeries) => string;
32
34
  export declare const getRotationType: (rotation: number) => RotationType;
33
35
  export declare const getValueLabelSettings: (xAxisOrientation: AxisOrientation, valueLabel: ValueLabelOptions, inside?: boolean) => ValueLabelSettings;
34
36
  export declare const getPolarValueLabelSettings: (valueLabel: ValueLabelOptions, polarType: PolarType) => ValueLabelSettings;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ type ButtonProps = {
3
+ children: ReactNode;
4
+ type?: 'primary' | 'secondary';
5
+ disabled?: boolean;
6
+ onClick?: () => void;
7
+ };
8
+ /** @internal */
9
+ export declare const Button: (props: ButtonProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ /** @internal */
3
+ export type PopoverAnchorPosition = {
4
+ anchorEl: HTMLElement;
5
+ anchorOrigin: {
6
+ vertical: 'top' | 'center' | 'bottom';
7
+ horizontal: 'left' | 'center' | 'right';
8
+ };
9
+ contentOrigin: {
10
+ vertical: 'top' | 'center' | 'bottom';
11
+ horizontal: 'left' | 'center' | 'right';
12
+ };
13
+ };
14
+ type PopoverPosition = PopoverAnchorPosition;
15
+ type PopoverProps = {
16
+ children: ReactNode;
17
+ open: boolean;
18
+ position?: PopoverPosition;
19
+ onClose?: () => void;
20
+ };
21
+ /** @internal */
22
+ export declare const Popover: (props: PopoverProps) => import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,8 @@
1
+ type ButtonProps = {
2
+ checked?: boolean;
3
+ value?: string;
4
+ onChange?: (checked: boolean) => void;
5
+ };
6
+ /** @internal */
7
+ export declare const Radio: ({ checked, value, onChange }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { MenuOptions } from '../components/menu/types.js';
2
- type IsTargetMenuFn = (menuOptions: MenuOptions) => boolean;
3
- type CombineMenusFn = (currentMenuOptions: MenuOptions, capturedMenuOptions: MenuOptions) => MenuOptions;
4
- interface CombinedMenuParams {
2
+ export type IsTargetMenuFn = (menuOptions: MenuOptions) => boolean;
3
+ export type CombineMenusFn = (currentMenuOptions: MenuOptions, capturedMenuOptions: MenuOptions) => MenuOptions;
4
+ export interface CombinedMenuParams {
5
5
  /** Function to determine if the captured menu is the target menu */
6
6
  isTargetMenu: IsTargetMenuFn;
7
7
  /** Function to combine the current menu options with the captured menu options */
@@ -17,4 +17,3 @@ export declare const useCombinedMenu: ({ isTargetMenu, combineMenus }: CombinedM
17
17
  openMenu: (options: MenuOptions) => void;
18
18
  onBeforeMenuOpen: (options: MenuOptions) => MenuOptions | null;
19
19
  };
20
- export {};
@@ -1 +1,2 @@
1
1
  export declare const QUERY_DEFAULT_LIMIT = 20000;
2
+ export declare const SYSTEM_TENANT_NAME = "system";
@@ -1,2 +1,2 @@
1
1
  import { DashboardContainerProps } from '../../dashboard/types';
2
- export declare const DashboardContainer: ({ title, layoutOptions, config, widgets, filters, onFiltersChange, defaultDataSource, onChange, }: DashboardContainerProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const DashboardContainer: ({ title, layoutOptions, config, widgets, filters, onFiltersChange, defaultDataSource, onChange, enableFilterEditor, }: DashboardContainerProps) => import("react/jsx-runtime").JSX.Element;