@sisense/sdk-ui 1.21.0 → 1.23.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 (118) hide show
  1. package/dist/ai.cjs +57 -49
  2. package/dist/ai.js +844 -744
  3. package/dist/analytics-composer.cjs +89 -148
  4. package/dist/analytics-composer.js +1198 -1481
  5. package/dist/{get-widget-options-NhNoIBS9.js → derive-chart-family-CTpRObm1.js} +11138 -11042
  6. package/dist/{get-widget-options-BmZF5Ztf.cjs → derive-chart-family-DcALKnKU.cjs} +100 -100
  7. package/dist/index.cjs +116 -116
  8. package/dist/index.js +9303 -8779
  9. package/dist/packages/sdk-ui/src/ai/api/chat-rest-api.d.ts +1 -1
  10. package/dist/packages/sdk-ui/src/ai/api/types.d.ts +3 -23
  11. package/dist/packages/sdk-ui/src/ai/chart/chart-insights.d.ts +5 -0
  12. package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +41 -0
  13. package/dist/packages/sdk-ui/src/ai/chat-config.d.ts +1 -1
  14. package/dist/packages/sdk-ui/src/ai/icons/ai-icon.d.ts +2 -0
  15. package/dist/packages/sdk-ui/src/ai/index.d.ts +2 -3
  16. package/dist/packages/sdk-ui/src/ai/messages/chart-message.d.ts +1 -2
  17. package/dist/packages/sdk-ui/src/ai/use-get-data-source-fields.d.ts +1 -1
  18. package/dist/packages/sdk-ui/src/analytics-composer/{translators → code}/code-templates.d.ts +1 -1
  19. package/dist/packages/sdk-ui/src/analytics-composer/{translators → code}/generate-code.d.ts +3 -3
  20. package/dist/packages/sdk-ui/src/analytics-composer/{translators → common}/utils.d.ts +1 -1
  21. package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +12 -1
  22. package/dist/packages/sdk-ui/src/analytics-composer/query/index.d.ts +1 -0
  23. package/dist/packages/sdk-ui/src/analytics-composer/{translators → query}/query-translator.d.ts +2 -3
  24. package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +149 -0
  25. package/dist/packages/sdk-ui/src/{ai/messages → analytics-composer/widget/chart-options}/get-widget-options.d.ts +5 -14
  26. package/dist/packages/sdk-ui/src/analytics-composer/widget/stringify-filters.d.ts +2 -0
  27. package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +3 -0
  28. package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-props.d.ts +3 -0
  29. package/dist/packages/sdk-ui/src/analytics-composer/widget/widget-composer.d.ts +15 -0
  30. package/dist/packages/sdk-ui/src/api/rest-api.d.ts +5 -1
  31. package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +1 -1
  32. package/dist/packages/sdk-ui/src/app/client-application.d.ts +60 -16
  33. package/dist/packages/sdk-ui/src/app/settings/settings.d.ts +5 -0
  34. package/dist/packages/sdk-ui/src/app/settings/types/user.d.ts +0 -1
  35. package/dist/packages/sdk-ui/src/boxplot-utils.d.ts +5 -4
  36. package/dist/packages/sdk-ui/src/chart/chart.d.ts +1 -0
  37. package/dist/packages/sdk-ui/src/chart/helpers/derive-chart-family.d.ts +8 -0
  38. package/dist/packages/sdk-ui/src/chart-data-options/utils.d.ts +1 -0
  39. package/dist/packages/sdk-ui/src/chart-options-processor/translations/translations-to-highcharts.d.ts +1 -1
  40. package/dist/packages/sdk-ui/src/common/components/menu/types.d.ts +1 -0
  41. package/dist/packages/sdk-ui/src/common/hooks/use-fetch.d.ts +1 -1
  42. package/dist/packages/sdk-ui/src/common/hooks/use-synced-state.d.ts +19 -0
  43. package/dist/packages/sdk-ui/src/common-filters/selection-utils.d.ts +9 -1
  44. package/dist/packages/sdk-ui/src/common-filters/use-common-filters.d.ts +4 -2
  45. package/dist/packages/sdk-ui/src/dashboard/dashboard-by-id.d.ts +1 -2
  46. package/dist/packages/sdk-ui/src/dashboard/dashboard-helpers.d.ts +86 -9
  47. package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +9 -1
  48. package/dist/packages/sdk-ui/src/dashboard/index.d.ts +2 -1
  49. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +18 -0
  50. package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +30 -0
  51. package/dist/packages/sdk-ui/src/dashboard/use-dashboard-theme.d.ts +40 -0
  52. package/dist/packages/sdk-ui/src/decorators/hook-decorators/with-tracking.d.ts +1 -0
  53. package/dist/packages/sdk-ui/src/filters/components/common/member-radio.d.ts +8 -0
  54. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-display.d.ts +2 -1
  55. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +2 -2
  56. package/dist/packages/sdk-ui/src/filters/components/filters-panel/index.d.ts +1 -1
  57. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.d.ts +1 -0
  58. package/dist/packages/sdk-ui/src/formulas/use-get-shared-formula.d.ts +2 -2
  59. package/dist/packages/sdk-ui/src/index.d.ts +28 -13
  60. package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model-translator.d.ts +2 -2
  61. package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +1 -1
  62. package/dist/packages/sdk-ui/src/models/dashboard/index.d.ts +2 -0
  63. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +11 -0
  64. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -1
  65. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dasboard-model-utils.d.ts +22 -0
  66. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +63 -0
  67. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +38 -0
  68. package/dist/packages/sdk-ui/src/models/dashboard/use-get-dashboard-model.d.ts +3 -4
  69. package/dist/packages/sdk-ui/src/models/dashboard/use-get-dashboard-models.d.ts +1 -1
  70. package/dist/packages/sdk-ui/src/models/hierarchy/hierarchy-model-translator.d.ts +1 -1
  71. package/dist/packages/sdk-ui/src/models/hierarchy/use-get-hierarchy-models.d.ts +2 -2
  72. package/dist/packages/sdk-ui/src/models/widget/use-get-widget-model.d.ts +2 -2
  73. package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +19 -1
  74. package/dist/packages/sdk-ui/src/models/widget/widget-model.d.ts +2 -2
  75. package/dist/packages/sdk-ui/src/props.d.ts +47 -24
  76. package/dist/packages/sdk-ui/src/query-execution/execute-query-by-widget-id.d.ts +1 -1
  77. package/dist/packages/sdk-ui/src/query-execution/types.d.ts +1 -1
  78. package/dist/packages/sdk-ui/src/query-execution/use-execute-query-by-widget-id.d.ts +1 -1
  79. package/dist/packages/sdk-ui/src/sisense-context/custom-sisense-context-provider.d.ts +1 -3
  80. package/dist/packages/sdk-ui/src/sisense-context/sisense-context.d.ts +3 -0
  81. package/dist/packages/sdk-ui/src/translation/i18n-provider.d.ts +3 -1
  82. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +114 -2
  83. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +206 -4
  84. package/dist/packages/sdk-ui/src/types.d.ts +33 -5
  85. package/dist/packages/sdk-ui/src/utils/filters.d.ts +1 -0
  86. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/dashboard-widget.d.ts +4 -3
  87. package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +4800 -0
  88. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-panel-color-format.d.ts +3 -3
  89. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-data-options.d.ts +15 -5
  90. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-drilldown-options.d.ts +2 -2
  91. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-filters.d.ts +85 -83
  92. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/types.d.ts +1 -1
  93. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/use-fetch-widget-dto-model.d.ts +3 -3
  94. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/utils.d.ts +6 -13
  95. package/dist/packages/sdk-ui/src/widget-by-id/widget-by-id.d.ts +26 -0
  96. package/dist/packages/sdk-ui/src/widgets/common/drilldown-utils.d.ts +7 -0
  97. package/dist/packages/sdk-ui/src/widgets/common/{use-drilldown.d.ts → use-drilldown-core.d.ts} +14 -8
  98. package/dist/packages/sdk-ui/src/widgets/common-widget.d.ts +1 -0
  99. package/dist/packages/sdk-ui/src/widgets/hooks/use-drilldown.d.ts +27 -0
  100. package/dist/packages/sdk-ui/src/widgets/hooks/use-with-drilldown.d.ts +12 -0
  101. package/dist/packages/sdk-ui/src/widgets/widget.d.ts +9 -0
  102. package/dist/{table-widget-BPmucihM.js → useQuery-1xZMqnAI.js} +40059 -39949
  103. package/dist/useQuery-D9rZ58KS.cjs +821 -0
  104. package/dist/widget-composer-B17DVa2A.cjs +101 -0
  105. package/dist/widget-composer-DqjH_6dw.js +448 -0
  106. package/package.json +9 -9
  107. package/dist/packages/sdk-ui/src/ai/api/errors.d.ts +0 -4
  108. package/dist/packages/sdk-ui/src/ai/messages/jaql-element.d.ts +0 -28
  109. package/dist/packages/sdk-ui/src/analytics-composer/translators/index.d.ts +0 -3
  110. package/dist/packages/sdk-ui/src/analytics-composer/translators/model-translator.d.ts +0 -48
  111. package/dist/packages/sdk-ui/src/analytics-composer/translators/translate-filters-to-code.d.ts +0 -2
  112. package/dist/packages/sdk-ui/src/analytics-composer/translators/types.d.ts +0 -95
  113. package/dist/packages/sdk-ui/src/dashboard-widget/translate-dashboard-filters.d.ts +0 -4798
  114. package/dist/packages/sdk-ui/src/widgets/common/drilldown-connector.d.ts +0 -19
  115. package/dist/table-widget-BikAZUJv.cjs +0 -821
  116. /package/dist/packages/sdk-ui/src/analytics-composer/{translators → query}/query-templates.d.ts +0 -0
  117. /package/dist/packages/sdk-ui/src/analytics-composer/{translators/translate-props-to-code.d.ts → widget/stringify-props.d.ts} +0 -0
  118. /package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-style-options.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
2
  import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, ChatContext, GetNlgQueryResultRequest, GetNlgQueryResultResponse, LlmConfig, QueryRecommendationConfig, QueryRecommendationResponse, SendFeedbackRequest } from './types';
3
- import { DataSourceField } from '@sisense/sdk-query-client';
3
+ import { DataSourceField } from '@sisense/sdk-data';
4
4
  export declare class ChatRestApi {
5
5
  private httpClient;
6
6
  constructor(httpClient: HttpClient);
@@ -1,5 +1,5 @@
1
- import { JaqlQueryPayload, MetadataItem } from '@sisense/sdk-query-client';
2
- import { ChartDataOptions } from '../../types';
1
+ import { JaqlQueryPayload } from '@sisense/sdk-query-client';
2
+ import { ExpandedQueryModel } from '../../analytics-composer';
3
3
  export interface ChatContext {
4
4
  title: string;
5
5
  live: boolean;
@@ -54,30 +54,10 @@ interface ErrorResponse {
54
54
  };
55
55
  responseType: 'error';
56
56
  }
57
- export type KeysOfUnion<T> = T extends T ? keyof T : never;
58
- export type AllPossibleChartOptionKeys = KeysOfUnion<ChartDataOptions>;
59
- export type AxesMappingKey = Exclude<AllPossibleChartOptionKeys, 'seriesToColorMap'>;
60
- export type AxesMapping = Partial<Record<AxesMappingKey, Array<{
61
- name: string;
62
- type?: string;
63
- }>>>;
64
- export interface ChartRecommendations {
65
- chartFamily: string;
66
- chartType: string;
67
- axesMapping: AxesMapping;
68
- }
69
- export interface NlqResponseData {
57
+ export interface NlqResponseData extends ExpandedQueryModel {
70
58
  detailedDescription: string;
71
59
  followupQuestions: string[];
72
60
  nlqPrompt: string;
73
- chartRecommendations: ChartRecommendations | {};
74
- jaql: {
75
- datasource: {
76
- title: string;
77
- };
78
- metadata: MetadataItem[];
79
- };
80
- queryTitle: string;
81
61
  }
82
62
  export interface NlqResponse {
83
63
  data: NlqResponseData;
@@ -0,0 +1,5 @@
1
+ import { GetNlgQueryResultRequest } from '../../ai';
2
+ export interface ChartInsightsProps {
3
+ nlgRequest: GetNlgQueryResultRequest;
4
+ }
5
+ export declare const ChartInsights: ({ nlgRequest }: ChartInsightsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { Filter } from '@sisense/sdk-data';
2
+ import type { NlqResponseData } from '../../ai';
3
+ /**
4
+ * Props for {@link NlqChartWidget} component.
5
+ *
6
+ * @group Generative AI
7
+ * @internal
8
+ */
9
+ export interface NlqChartWidgetProps {
10
+ /**
11
+ * Chatbot NLQ Response
12
+ */
13
+ nlqResponse: NlqResponseData;
14
+ /**
15
+ * The dashboard filters to be applied to the chart
16
+ */
17
+ filters?: Filter[];
18
+ }
19
+ /**
20
+ * React component that renders a chart widget based on NLQ response data.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * import { NlqChartWidget, NlqResponseData } from '@sisense/sdk-ui/ai';
25
+ * import { Filter } from '@sisense/sdk-data';
26
+ *
27
+ * function ExampleComponent(nlqResponse: NlqResponseData, filters?: Filter[]) {
28
+ *
29
+ * return (
30
+ * <ChartWidgetWithInsights
31
+ * nlqResponse={nlqResponse}
32
+ * filters={filters}
33
+ * />
34
+ * );
35
+ * }
36
+ * ```
37
+ * @param props - {@link NlqChartWidgetProps}
38
+ * @group Generative AI
39
+ * @internal
40
+ */
41
+ export declare const NlqChartWidget: ({ nlqResponse, filters }: NlqChartWidgetProps) => import("react/jsx-runtime").JSX.Element;
@@ -33,7 +33,7 @@ export interface ChatConfig {
33
33
  */
34
34
  chatMode?: ChatMode;
35
35
  /** The input prompt text to show in the chat input box */
36
- inputPromptText: string;
36
+ inputPromptText?: string;
37
37
  /**
38
38
  * The welcome text to show at the top of a chat session.
39
39
  *
@@ -0,0 +1,2 @@
1
+ import { Themable } from '../../theme-provider/types';
2
+ export default function AiIcon({ theme }: Themable): import("react/jsx-runtime").JSX.Element;
@@ -5,8 +5,7 @@ export { useGetQueryRecommendations, type UseGetQueryRecommendationsParams, type
5
5
  export { useChatSession, type UseChatSessionResult } from './use-chat-session';
6
6
  export { useLastNlqResponse } from './use-last-nlq-response';
7
7
  export { useGetDataSourceFields } from './use-get-data-source-fields';
8
- export type { GetNlgQueryResultRequest, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, ChartRecommendations, AxesMapping, AxesMappingKey, AllPossibleChartOptionKeys, KeysOfUnion, } from './api/types';
8
+ export type { GetNlgQueryResultRequest, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, } from './api/types';
9
9
  export { Chatbot, type ChatbotProps } from './chatbot';
10
10
  export { default as GetNlgQueryResult, type GetNlgQueryResultProps } from './get-nlg-query-result';
11
- export { getChartOptions, getTableOptions, deriveChartFamily } from './messages/get-widget-options';
12
- export { JaqlElement } from './messages/jaql-element';
11
+ export { NlqChartWidget, type NlqChartWidgetProps } from './chart/nlq-chart-widget';
@@ -1,7 +1,6 @@
1
1
  import { NlqResponseData } from '../api/types';
2
2
  type ChartMessageProps = {
3
3
  content: NlqResponseData;
4
- dataSource: string;
5
4
  };
6
- export default function ChartMessage({ content, dataSource }: ChartMessageProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function ChartMessage({ content }: ChartMessageProps): import("react/jsx-runtime").JSX.Element;
7
6
  export {};
@@ -7,6 +7,6 @@
7
7
  * @internal
8
8
  */
9
9
  export declare const useGetDataSourceFields: (dataSource: string | undefined) => {
10
- data: import("@sisense/sdk-query-client").DataSourceField[] | undefined;
10
+ data: import("@sisense/sdk-data").DataSourceField[] | undefined;
11
11
  isLoading: boolean;
12
12
  };
@@ -1,4 +1,4 @@
1
- import { CodeTemplates } from './types';
1
+ import { CodeTemplates } from '../types.js';
2
2
  /**
3
3
  * Code templates for different UI frameworks.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { CodeTemplateKey, UiFramework } from './types';
1
+ import { CodePlaceholderMap, CodeTemplateKey, UiFramework } from '../types.js';
2
2
  /**
3
3
  * Populates placeholders in the given template with the given data.
4
4
  * If a placeholder is not found in the data, a warning is logged.
@@ -12,7 +12,7 @@ export declare const populatePlaceholders: (template: string, data: Record<strin
12
12
  * Generates code from a template with the given data and UI framework.
13
13
  *
14
14
  * @param templateKey - the key of the template to use
15
- * @param data - the data to populate the template with
15
+ * @param placeholderMap - the data to populate the template with
16
16
  * @param uiFramework - the UI framework for the generated code
17
17
  */
18
- export declare const generateCode: (templateKey: CodeTemplateKey, data: Record<string, string>, uiFramework?: UiFramework) => string;
18
+ export declare const generateCode: (templateKey: CodeTemplateKey, placeholderMap: CodePlaceholderMap, uiFramework?: UiFramework) => string;
@@ -1,4 +1,4 @@
1
- import { ExpandedQueryModel, SimpleQueryModel } from './types';
1
+ import { ExpandedQueryModel, SimpleQueryModel } from '../types.js';
2
2
  export declare function toKebabCase(str: string): string;
3
3
  export declare function capitalizeFirstLetter(str: string): string;
4
4
  /**
@@ -1 +1,12 @@
1
- export * from './translators';
1
+ export * from './types';
2
+ export * from './query';
3
+ /**
4
+ * Utility functions to compose props and code for widgets.
5
+ * @internal
6
+ */
7
+ export * as widgetComposer from './widget/widget-composer';
8
+ /**
9
+ * Utility functions to compose props and code for dashboards.
10
+ * @internal
11
+ */
12
+ export * as dashboardComposer from './dashboard/dashboard-composer';
@@ -0,0 +1 @@
1
+ export { QueryTranslator } from './query-translator.js';
@@ -1,6 +1,5 @@
1
- import { ExpandedQueryModel, SimpleQueryModel, SimpleChartRecommendations } from './types.js';
2
- import { DataSourceField, MetadataItem, MetadataItemJaql } from '@sisense/sdk-query-client';
3
- import { ChartRecommendations } from '../../ai';
1
+ import { ExpandedQueryModel, SimpleQueryModel, SimpleChartRecommendations, ChartRecommendations } from '../types.js';
2
+ import { MetadataItem, MetadataItemJaql, DataSourceField } from '@sisense/sdk-data';
4
3
  /**
5
4
  * A class that translates ExpandedQueryModel (Raw JAQL+Chart Recommendations)
6
5
  * to SimpleQueryModel (Simple JAQL+Simple Chart Options) and vice versa.
@@ -0,0 +1,149 @@
1
+ import { WidgetProps } from '../props';
2
+ import { ChartDataOptions } from '../types';
3
+ import { MetadataItem } from '@sisense/sdk-data';
4
+ export type KeysOfUnion<T> = T extends T ? keyof T : never;
5
+ export type AllPossibleChartOptionKeys = KeysOfUnion<ChartDataOptions>;
6
+ export type AxesMappingKey = Exclude<AllPossibleChartOptionKeys, 'seriesToColorMap'>;
7
+ export type AxesMapping = Partial<Record<AxesMappingKey, Array<{
8
+ name: string;
9
+ type?: string;
10
+ }>>>;
11
+ export interface ChartRecommendations {
12
+ chartFamily: string;
13
+ chartType: string;
14
+ axesMapping: AxesMapping;
15
+ }
16
+ /**
17
+ * Expanded Query Model that is based on NlqResponseData.
18
+ * It contains expanded JAQL and chart recommendations returned from the chat response.
19
+ * @internal
20
+ */
21
+ export interface ExpandedQueryModel {
22
+ chartRecommendations: ChartRecommendations | {};
23
+ jaql: {
24
+ datasource: {
25
+ title: string;
26
+ };
27
+ metadata: MetadataItem[];
28
+ };
29
+ queryTitle: string;
30
+ }
31
+ /**
32
+ * Empty Expanded Query Model
33
+ *
34
+ * Used as a default value for ExpandedQueryModel
35
+ * @internal
36
+ */
37
+ export declare const EMPTY_EXPANDED_QUERY_MODEL: ExpandedQueryModel;
38
+ /**
39
+ * Simple Chart Recommendations
40
+ * @internal
41
+ */
42
+ export interface SimpleChartRecommendations {
43
+ chartType: string;
44
+ dataOptions: AxesMapping;
45
+ }
46
+ /**
47
+ * Simple Query Model that is a simplified version of ExpandedQueryModel.
48
+ *
49
+ * It removes any JAQL syntax or information that already exists in the schema.
50
+ * Also, any parameters that have a default do not need to be specified.
51
+ *
52
+ * Users manipulates this model via the query in YAML format.
53
+ *
54
+ * QueryTranslator is responsible for translating this query model to ExpandedWidgetModel.
55
+ * @internal
56
+ */
57
+ export interface SimpleQueryModel {
58
+ /**
59
+ * The data model or perspective title.
60
+ */
61
+ model: string;
62
+ metadata: MetadataItem[];
63
+ chart: SimpleChartRecommendations | {};
64
+ /**
65
+ * Title of the query
66
+ */
67
+ queryTitle: string;
68
+ }
69
+ /**
70
+ * Empty Simple Query Model
71
+ *
72
+ * Used as a default value for SimpleQueryModel
73
+ * @internal
74
+ */
75
+ export declare const EMPTY_SIMPLE_QUERY_MODEL: SimpleQueryModel;
76
+ /**
77
+ * UI Framework
78
+ * @internal
79
+ */
80
+ export type UiFramework = 'react' | 'vue' | 'angular';
81
+ /**
82
+ * Code Template Key
83
+ * @internal
84
+ */
85
+ export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'widgetByIdTmpl';
86
+ /**
87
+ * Code Templates
88
+ * @internal
89
+ */
90
+ export type CodeTemplates = {
91
+ [key in UiFramework]: {
92
+ [key in CodeTemplateKey]: string;
93
+ };
94
+ };
95
+ /**
96
+ * Code Placeholder Map
97
+ * @internal
98
+ */
99
+ export type CodePlaceholderMap = Record<string, string>;
100
+ /**
101
+ * Base Code Config
102
+ * @internal
103
+ */
104
+ export type BaseCodeConfig = {
105
+ uiFramework?: UiFramework;
106
+ };
107
+ /**
108
+ * Widget Code Config
109
+ * @internal
110
+ */
111
+ export type WidgetCodeConfig = BaseCodeConfig & {
112
+ includeChart?: boolean;
113
+ };
114
+ /**
115
+ * Client-side Widget Code Params
116
+ * @internal
117
+ */
118
+ export type ClientSideWidgetCodeParams = WidgetCodeConfig & {
119
+ widgetProps: WidgetProps;
120
+ };
121
+ /**
122
+ * By ID Widget Code Params
123
+ * @internal
124
+ */
125
+ export type ByIdWidgetCodeParams = WidgetCodeConfig & {
126
+ dashboardOid: string;
127
+ widgetOid: string;
128
+ };
129
+ /**
130
+ * Widget Code Params
131
+ * @internal
132
+ */
133
+ export type WidgetCodeParams = ClientSideWidgetCodeParams | ByIdWidgetCodeParams;
134
+ /**
135
+ * Check if widget code params is for client-side code
136
+ * @internal
137
+ */
138
+ export declare const isClientSideWidgetCodeParams: (params: WidgetCodeParams) => params is ClientSideWidgetCodeParams;
139
+ /**
140
+ * Check if widget code params is for by ID code
141
+ * @internal
142
+ */
143
+ export declare const isByIdWidgetCodeParams: (params: WidgetCodeParams) => params is ByIdWidgetCodeParams;
144
+ /**
145
+ * @internal
146
+ **/
147
+ export type WidgetPropsConfig = {
148
+ useCustomizedStyleOptions?: boolean;
149
+ };
@@ -1,13 +1,13 @@
1
- import { MetadataItem } from '@sisense/sdk-query-client';
2
- import { ChartDataOptions, ChartStyleOptions } from '../../types';
3
- import { ChartRecommendations, NlqResponseData } from '../api/types';
4
- export declare const getChartRecommendationsOrDefault: (response: NlqResponseData) => ChartRecommendations;
1
+ import { ChartDataOptions, ChartStyleOptions } from '../../../types';
2
+ import { MetadataItem } from '@sisense/sdk-data';
3
+ import { ChartRecommendations, ExpandedQueryModel } from '../../../analytics-composer/types';
4
+ export declare const getChartRecommendationsOrDefault: (response: ExpandedQueryModel) => ChartRecommendations;
5
5
  /**
6
6
  * @internal
7
7
  */
8
8
  export declare const getTableOptions: (jaql: MetadataItem[]) => {
9
9
  dataOptions: {
10
- columns: import("./jaql-element").JaqlElement[];
10
+ columns: import("@sisense/sdk-data").JaqlElement[];
11
11
  };
12
12
  };
13
13
  /**
@@ -21,13 +21,4 @@ export declare const getTableOptions: (jaql: MetadataItem[]) => {
21
21
  export declare const getChartOptions: (jaql: MetadataItem[], chartRecommendations: ChartRecommendations, useCustomizedStyleOptions?: boolean) => {
22
22
  dataOptions: ChartDataOptions;
23
23
  chartStyleOptions: ChartStyleOptions;
24
- expandedChartStyleOptions: ChartStyleOptions;
25
24
  };
26
- /**
27
- * Derives chart family from chart type.
28
- *
29
- * @param chartType - chart type
30
- * @returns chart family
31
- * @internal
32
- */
33
- export declare const deriveChartFamily: (chartType: string) => string;
@@ -0,0 +1,2 @@
1
+ import { Filter, FilterRelations } from '@sisense/sdk-data';
2
+ export declare const stringifyFilters: (filters: Filter[] | FilterRelations | undefined) => string;
@@ -0,0 +1,3 @@
1
+ import { ByIdWidgetCodeParams, ClientSideWidgetCodeParams } from '../types.js';
2
+ export declare const toWidgetCodeById: ({ dashboardOid, widgetOid, uiFramework, }: ByIdWidgetCodeParams) => string;
3
+ export declare const toWidgetCodeClientSide: ({ widgetProps, uiFramework, }: ClientSideWidgetCodeParams) => string;
@@ -0,0 +1,3 @@
1
+ import { WidgetProps } from '../../index.js';
2
+ import { ExpandedQueryModel, WidgetPropsConfig } from '../types.js';
3
+ export declare const toWidgetPropsFromQuery: (queryModel: ExpandedQueryModel, config?: WidgetPropsConfig) => WidgetProps | undefined;
@@ -0,0 +1,15 @@
1
+ import { WidgetProps } from '../../props.js';
2
+ import { ExpandedQueryModel, WidgetCodeParams, WidgetPropsConfig } from '../types.js';
3
+ /**
4
+ * Converts query model to widget props.
5
+ * @param queryModel - Expanded query model
6
+ * @returns Widget props
7
+ */
8
+ export declare const toWidgetProps: (queryModel: ExpandedQueryModel, config?: WidgetPropsConfig) => WidgetProps | undefined;
9
+ /**
10
+ * Converts widget props to CSDK code.
11
+ *
12
+ * @param widgetCodeParams - Widget code params
13
+ * @returns CSDK code string
14
+ */
15
+ export declare const toWidgetCode: (widgetCodeParams: WidgetCodeParams) => 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 '../dashboard-widget/types';
4
+ import { HierarchyDto, WidgetDto } from '../widget-by-id/types';
5
5
  import type { DashboardDto } from './types/dashboard-dto';
6
6
  import { PaletteDto } from '../api/types/palette-dto';
7
7
  import { GetHierarchiesOptions } from '../models/hierarchy/types';
@@ -49,6 +49,10 @@ export declare class RestApi {
49
49
  * Get hierarchies
50
50
  */
51
51
  getHierarchies: ({ dataSource, dimension, ids, alwaysIncluded, }: GetHierarchiesOptions) => Promise<HierarchyDto[]>;
52
+ /**
53
+ * Partially update a dashboard
54
+ */
55
+ patchDashboard: (dashboardOid: string, dashboard: Partial<DashboardDto>) => Promise<DashboardDto | undefined>;
52
56
  }
53
57
  export declare const useGetApi: () => RestApi;
54
58
  export {};
@@ -1,4 +1,4 @@
1
- import { WidgetDto } from '../../dashboard-widget/types';
1
+ import { WidgetDto } from '../../widget-by-id/types';
2
2
  import { FilterJaql, FilterRelationsModel, JaqlDataSource } from '@sisense/sdk-data';
3
3
  import { AnyObject } from '../../utils/utility-types';
4
4
  /** @internal */
@@ -1,11 +1,11 @@
1
- import { HttpClient, Authenticator } from '@sisense/sdk-rest-client';
1
+ import { HttpClient } from '@sisense/sdk-rest-client';
2
2
  import { QueryClient } from '@sisense/sdk-query-client';
3
3
  import { DataSource } from '@sisense/sdk-data';
4
- import { DateConfig } from '../query/date-formats';
5
- import { AppSettings } from './settings/settings';
6
4
  import { PivotClient } from '@sisense/sdk-pivot-client';
7
- import { LoadingIndicatorConfig } from '../types';
8
5
  import { TrackingEventDetails } from '@sisense/sdk-tracking';
6
+ import { DateConfig } from '../query/date-formats';
7
+ import { AppSettings } from './settings/settings';
8
+ import { CustomTranslationObject, LoadingIndicatorConfig } from '../types';
9
9
  import { SisenseContextProviderProps } from '../props';
10
10
  /**
11
11
  * Application configuration
@@ -15,10 +15,60 @@ export type AppConfig = {
15
15
  * A [date-fns Locale](https://date-fns.org/v2.30.0/docs/Locale)
16
16
  */
17
17
  locale?: Locale;
18
+ /**
19
+ * Translation Configurations
20
+ *
21
+ * @internal
22
+ */
23
+ translationConfig?: {
24
+ /**
25
+ * Language code to be used for translations.
26
+ *
27
+ * @internal
28
+ */
29
+ language?: string;
30
+ /**
31
+ * Additional translation resources to be loaded.
32
+ *
33
+ * You can find the list of available translation keys in the translation folder of every package.
34
+ *
35
+ * Translation keys that are not provided will default to the English translation.
36
+ * If translation is provided for a package other than sdk-ui, please specify the namespace property.
37
+ *
38
+ * Important: Do not translate parts in {{}} - these are placeholders for dynamic values and will be matched using provided variable names.
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * customTranslations: [
43
+ * {
44
+ * language: 'fr',
45
+ * resources: {
46
+ * errors: {
47
+ * invalidFilterType: 'Type de filtre invalide',
48
+ * },
49
+ * },
50
+ * },
51
+ * {
52
+ * language: 'es',
53
+ * namespace: 'sdkData'
54
+ * resources: {
55
+ * errors: {
56
+ * measure: {
57
+ * unsupportedType: 'Tipo de medida no compatible',
58
+ * },
59
+ * },
60
+ * },
61
+ * },
62
+ * ]
63
+ * ```
64
+ */
65
+ customTranslations?: CustomTranslationObject[];
66
+ };
18
67
  /**
19
68
  * Language code to be used for translations
20
69
  *
21
70
  * @internal
71
+ * @deprecated Use `translationConfig.language` instead
22
72
  */
23
73
  language?: string;
24
74
  /**
@@ -81,10 +131,12 @@ export type AppConfig = {
81
131
  */
82
132
  trackingConfig?: {
83
133
  /**
84
- * Whether to enable tracking
134
+ * Whether to enable or disable tracking in development or test environment.
85
135
  *
86
136
  * If not specified, the default value is `true`
87
137
  *
138
+ * In production, tracking is always enabled.
139
+ *
88
140
  * @internal
89
141
  */
90
142
  enabled?: boolean;
@@ -99,7 +151,7 @@ export type AppConfig = {
99
151
  *
100
152
  * @internal
101
153
  */
102
- export declare class ClientApplication {
154
+ export interface ClientApplication {
103
155
  /**
104
156
  * Gets the underlying HTTP Client
105
157
  */
@@ -115,7 +167,7 @@ export declare class ClientApplication {
115
167
  /**
116
168
  * Gets the default data source being used as default for child components with no explicitly defined data source
117
169
  */
118
- readonly defaultDataSource: DataSource;
170
+ readonly defaultDataSource?: DataSource;
119
171
  /**
120
172
  * Gets the application settings
121
173
  */
@@ -129,16 +181,8 @@ export declare class ClientApplication {
129
181
  */
130
182
  clear: () => void;
131
183
  };
132
- /**
133
- * Construct new Sisense Client Application
134
- *
135
- * @param url - URL to the sisense environment
136
- * @param auth - Authentication to be used
137
- * @param defaultDataSource - Default data source to be used by child components by default
138
- */
139
- constructor(url: string, auth: Authenticator, defaultDataSource?: DataSource);
140
184
  }
141
185
  type ClientApplicationParams = Pick<SisenseContextProviderProps, 'appConfig' | 'defaultDataSource' | 'url' | 'token' | 'wat' | 'ssoEnabled' | 'enableSilentPreAuth' | 'useFusionAuth'>;
142
186
  /** @internal */
143
- export declare const createClientApplication: ({ defaultDataSource, url, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, useFusionAuth, }: ClientApplicationParams) => Promise<ClientApplication>;
187
+ export declare const createClientApplication: ({ defaultDataSource, url: rawUrl, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, useFusionAuth, }: ClientApplicationParams) => Promise<ClientApplication>;
144
188
  export {};
@@ -17,6 +17,11 @@ type ServerSettings = {
17
17
  serverLanguage: string;
18
18
  serverVersion: string;
19
19
  serverFeatures: FeatureMap;
20
+ user: {
21
+ tenant: {
22
+ name: string;
23
+ };
24
+ };
20
25
  };
21
26
  /**
22
27
  * Gets the application settings
@@ -15,7 +15,6 @@ export type User = {
15
15
  manifest: Record<string, unknown>;
16
16
  tenantId: string;
17
17
  groups: string[];
18
- internalGroups: string[];
19
18
  default: boolean;
20
19
  email: string;
21
20
  firstName: string;
@@ -14,10 +14,11 @@ export declare const boxWhiskerProcessResultInternal: (boxWhiskerData: QueryResu
14
14
  /**
15
15
  * Processes box whisker data and outliers data to combine them into a single data set.
16
16
  *
17
- * @param {QueryResultData} boxWhiskerData - The data for the box whisker.
18
- * @param {QueryResultData} outliersData - The data for the outliers.
19
- * @param {BoxplotChartCustomDataOptions} [dataOptions] - Optional data options for customizing data processing.
20
- * @returns {QueryResultData} The combined data with outliers included in the box whisker plot.
17
+ * @param boxWhiskerData - The data for the box whisker.
18
+ * @param outliersData - The data for the outliers.
19
+ * @param dataOptions - Optional data options for customizing data processing.
20
+ * @returns The combined data with outliers included in the box whisker plot.
21
+ * @shortDescription Utility function that combines box whisker data and outliers data
21
22
  * @group Charts
22
23
  */
23
24
  export declare function boxWhiskerProcessResult(boxWhiskerData: QueryResultData, outliersData: QueryResultData, dataOptions?: BoxplotChartCustomDataOptions): QueryResultData;
@@ -16,6 +16,7 @@ import { ChartProps } from '../props';
16
16
  *
17
17
  * @param props - Chart properties
18
18
  * @returns Chart component representing a chart type as specified in `ChartProps.`{@link ChartProps.chartType | chartType}
19
+ * @shortDescription Common component for rendering charts of different types including table
19
20
  * @group Charts
20
21
  */
21
22
  export declare const Chart: import("react").FunctionComponent<ChartProps>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Derives chart family from chart type.
3
+ *
4
+ * @param chartType - chart type
5
+ * @returns chart family
6
+ * @internal
7
+ */
8
+ export declare const deriveChartFamily: (chartType: string) => string;
@@ -36,6 +36,7 @@ export declare const splitColumn: <C extends AnyColumn>(targetColumn: C) => {
36
36
  export declare function isMeasureColumn(arg: AnyColumn): arg is MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
37
37
  export declare const getDataOptionTitle: ({ column }: StyledColumn | StyledMeasureColumn) => string;
38
38
  export declare const getDataOptionGranularity: ({ column, granularity }: StyledColumn) => string;
39
+ /** @internal */
39
40
  export declare const translateColumnToAttribute: (c: Column | StyledColumn) => Attribute;
40
41
  export declare const translateColumnToMeasure: (c: MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn) => Measure;
41
42
  /**
@@ -75,7 +75,7 @@ export declare const addStackingIfSpecified: (chartType: ChartType, designOption
75
75
  */
76
76
  export declare const indexMapWhenOnlyY: (categories: string[], index: number) => (-1 | 0)[];
77
77
  export declare const formatSeriesContinuousXAxis: (series: CategoricalSeriesValues, indexMap: number[], treatNullDataAsZeros: boolean, interval: number, maxCategories: number, dateFormatter: (time: number) => string, yAxisSettings: AxisSettings, axisClipped: AxisClipped) => HighchartsSeriesValues;
78
- export declare const formatSeries: (series: CategoricalSeriesValues, indexMap: number[], treatNullDataAsZeros: boolean, categories?: string[], categoryColors?: string[]) => HighchartsSeriesValues;
78
+ export declare const formatSeries: (series: CategoricalSeriesValues, indexMap: number[], treatNullDataAsZeros: boolean, categories?: string[], categoryColors?: string[], convertValuesToAbsolute?: boolean) => HighchartsSeriesValues;
79
79
  export declare const adjustMinMaxWhenInvalid: (explicitAxis: AxisMinMax, autoMinMax: AxisMinMax) => {
80
80
  min: number;
81
81
  max: number;