@sisense/sdk-ui 1.32.0 → 1.34.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 (143) hide show
  1. package/dist/ai.cjs +10 -10
  2. package/dist/ai.js +565 -560
  3. package/dist/analytics-composer.cjs +1 -1
  4. package/dist/analytics-composer.js +38 -38
  5. package/dist/{derive-chart-family-CVwj-7u5.js → derive-chart-family-5CbFzbpu.js} +23428 -23324
  6. package/dist/{derive-chart-family-7Fxxf6Sy.cjs → derive-chart-family-C3FH49ux.cjs} +186 -186
  7. package/dist/index.cjs +29 -17
  8. package/dist/index.js +10583 -8088
  9. package/dist/packages/sdk-ui/src/ai/ai-context-provider.d.ts +3 -2
  10. package/dist/packages/sdk-ui/src/ai/api/types.d.ts +11 -3
  11. package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +2 -2
  12. package/dist/packages/sdk-ui/src/ai/custom-ai-context-provider.d.ts +5 -7
  13. package/dist/packages/sdk-ui/src/ai/get-nlg-insights.d.ts +1 -0
  14. package/dist/packages/sdk-ui/src/ai/index.d.ts +2 -1
  15. package/dist/packages/sdk-ui/src/ai/use-final-nlq-response.d.ts +20 -0
  16. package/dist/packages/sdk-ui/src/ai/use-get-nlq-result.d.ts +1 -0
  17. package/dist/packages/sdk-ui/src/ai/use-get-query-recommendations.d.ts +1 -0
  18. package/dist/packages/sdk-ui/src/ai/use-last-nlq-response-from-history.d.ts +8 -0
  19. package/dist/packages/sdk-ui/src/ai/use-last-nlq-response.d.ts +1 -2
  20. package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +3 -0
  21. package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +17 -1
  22. package/dist/packages/sdk-ui/src/api/rest-api.d.ts +6 -2
  23. package/dist/packages/sdk-ui/src/area-chart.d.ts +2 -2
  24. package/dist/packages/sdk-ui/src/bar-chart.d.ts +2 -2
  25. package/dist/packages/sdk-ui/src/chart-data/table-data.d.ts +10 -0
  26. package/dist/packages/sdk-ui/src/column-chart.d.ts +2 -2
  27. package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/group-header.d.ts +10 -0
  28. package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/group.d.ts +10 -0
  29. package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/grouped-items-browser.d.ts +6 -0
  30. package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/item-row.d.ts +15 -0
  31. package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/types.d.ts +42 -0
  32. package/dist/packages/sdk-ui/src/common/components/loading-dots.d.ts +1 -1
  33. package/dist/packages/sdk-ui/src/common/components/popover.d.ts +1 -0
  34. package/dist/packages/sdk-ui/src/common/components/radio.d.ts +1 -0
  35. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/index.d.ts +5 -0
  36. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/use-data-accumulation.d.ts +8 -0
  37. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/use-get-hook-state-result.d.ts +10 -0
  38. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/use-get-load-more-function.d.ts +4 -0
  39. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/use-load-data-from-internal-hook.d.ts +16 -0
  40. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/use-manage-slice-to-load.d.ts +10 -0
  41. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/utils/calculate-if-all-items-loaded.d.ts +2 -0
  42. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/utils/index.d.ts +1 -0
  43. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/index.d.ts +1 -0
  44. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/types.d.ts +27 -0
  45. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/with-lazy-loading.d.ts +7 -0
  46. package/dist/packages/sdk-ui/src/common/hooks/fusion-endpoints/use-get-data-source-fields.d.ts +3 -0
  47. package/dist/packages/sdk-ui/src/common/hooks/use-defaults.d.ts +10 -0
  48. package/dist/packages/sdk-ui/src/common/hooks/use-last-defined.d.ts +6 -0
  49. package/dist/packages/sdk-ui/src/common/icons/approval-icon.d.ts +1 -0
  50. package/dist/packages/sdk-ui/src/common/icons/arrow-icon.d.ts +3 -0
  51. package/dist/packages/sdk-ui/src/common/icons/breadcrumbs-arrows-arrow-icon.d.ts +3 -0
  52. package/dist/packages/sdk-ui/src/common/icons/close-icon.d.ts +1 -0
  53. package/dist/packages/sdk-ui/src/common/icons/date-attribute-icon.d.ts +1 -0
  54. package/dist/packages/sdk-ui/src/common/icons/elasticube-icon.d.ts +1 -0
  55. package/dist/packages/sdk-ui/src/common/icons/numeric-attribute-icon.d.ts +1 -0
  56. package/dist/packages/sdk-ui/src/common/icons/plus-icon.d.ts +1 -0
  57. package/dist/packages/sdk-ui/src/common/icons/table-icon.d.ts +1 -0
  58. package/dist/packages/sdk-ui/src/common/icons/text-attribute-icon.d.ts +1 -0
  59. package/dist/packages/sdk-ui/src/dashboard/components/content-panel.d.ts +9 -1
  60. package/dist/packages/sdk-ui/src/dashboard/components/dashboard-container.d.ts +1 -1
  61. package/dist/packages/sdk-ui/src/dashboard/constants.d.ts +4 -0
  62. package/dist/packages/sdk-ui/src/dashboard/dashboard-helpers.d.ts +6 -7
  63. package/dist/packages/sdk-ui/src/dashboard/index.d.ts +1 -1
  64. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +64 -31
  65. package/dist/packages/sdk-ui/src/data-browser/add-filter-popover/add-filter-data-browser.d.ts +16 -0
  66. package/dist/packages/sdk-ui/src/data-browser/add-filter-popover/add-filter-popover.d.ts +19 -0
  67. package/dist/packages/sdk-ui/src/data-browser/add-filter-popover/index.d.ts +1 -0
  68. package/dist/packages/sdk-ui/src/data-browser/add-filter-popover/popover-header.d.ts +12 -0
  69. package/dist/packages/sdk-ui/src/data-browser/data-source-selector/data-source-selector.d.ts +7 -0
  70. package/dist/packages/sdk-ui/src/data-browser/data-source-selector/use-data-source-selection.d.ts +5 -0
  71. package/dist/packages/sdk-ui/src/data-browser/dimensions-browser/dimensions-browser.d.ts +6 -0
  72. package/dist/packages/sdk-ui/src/data-browser/dimensions-browser/types.d.ts +82 -0
  73. package/dist/packages/sdk-ui/src/data-browser/search-input/search-input.d.ts +5 -0
  74. package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -0
  75. package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +3 -1
  76. package/dist/packages/sdk-ui/src/filters/components/common/checkbox.d.ts +1 -0
  77. package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/types.d.ts +1 -0
  78. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +5 -1
  79. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/input.d.ts +2 -1
  80. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/base.d.ts +10 -6
  81. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/calendar-select.d.ts +1 -4
  82. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-multi-select.d.ts +1 -4
  83. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-single-select.d.ts +4 -8
  84. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/selectable-section.d.ts +2 -1
  85. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-container.d.ts +2 -1
  86. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-context.d.ts +15 -0
  87. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-datetime.d.ts +2 -1
  88. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-numerical.d.ts +2 -1
  89. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-popover.d.ts +7 -2
  90. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-textual.d.ts +2 -1
  91. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor.d.ts +7 -2
  92. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/hooks/use-get-attribute-stats.d.ts +4 -1
  93. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/common/granularities.d.ts +36 -6
  94. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/not-supported-section.d.ts +6 -0
  95. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/utils.d.ts +5 -2
  96. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/types.d.ts +7 -0
  97. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/utils.d.ts +1 -0
  98. package/dist/packages/sdk-ui/src/filters/components/filter-tile-container.d.ts +8 -0
  99. package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +5 -3
  100. package/dist/packages/sdk-ui/src/filters/components/filters-panel/constants.d.ts +6 -0
  101. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel-header.d.ts +6 -0
  102. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +5 -2
  103. package/dist/packages/sdk-ui/src/filters/components/filters-panel/hooks/use-existing-filter-editing.d.ts +19 -0
  104. package/dist/packages/sdk-ui/src/filters/components/filters-panel/hooks/use-new-filter-adding.d.ts +21 -0
  105. package/dist/packages/sdk-ui/src/filters/components/filters-panel/index.d.ts +1 -0
  106. package/dist/packages/sdk-ui/src/filters/components/filters-panel/types.d.ts +60 -0
  107. package/dist/packages/sdk-ui/src/filters/components/icons/index.d.ts +0 -1
  108. package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +3 -3
  109. package/dist/packages/sdk-ui/src/index.d.ts +1 -1
  110. package/dist/packages/sdk-ui/src/line-chart.d.ts +2 -2
  111. package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model-translator.d.ts +0 -2
  112. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +0 -1
  113. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -0
  114. package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +1 -0
  115. package/dist/packages/sdk-ui/src/models/hierarchy/types.d.ts +0 -1
  116. package/dist/packages/sdk-ui/src/models/widget/use-get-widget-model.d.ts +1 -1
  117. package/dist/packages/sdk-ui/src/pie-chart.d.ts +2 -2
  118. package/dist/packages/sdk-ui/src/plugins-provider/custom-plugins-provider.d.ts +4 -9
  119. package/dist/packages/sdk-ui/src/polar-chart.d.ts +2 -2
  120. package/dist/packages/sdk-ui/src/props.d.ts +2 -0
  121. package/dist/packages/sdk-ui/src/query-execution/index.d.ts +1 -1
  122. package/dist/packages/sdk-ui/src/query-execution/types.d.ts +1 -1
  123. package/dist/packages/sdk-ui/src/query-execution/use-execute-query.d.ts +1 -1
  124. package/dist/packages/sdk-ui/src/scatter-chart.d.ts +1 -1
  125. package/dist/packages/sdk-ui/src/sisense-context/custom-sisense-context-provider.d.ts +2 -4
  126. package/dist/packages/sdk-ui/src/theme-provider/custom-theme-provider.d.ts +5 -8
  127. package/dist/packages/sdk-ui/src/theme-provider/use-theme-settings.d.ts +1 -1
  128. package/dist/packages/sdk-ui/src/theme-provider/utils.d.ts +5 -0
  129. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +10 -0
  130. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +20 -0
  131. package/dist/packages/sdk-ui/src/types.d.ts +167 -3
  132. package/dist/packages/sdk-ui/src/utils/data-sources-utils.d.ts +8 -0
  133. package/dist/packages/sdk-ui/src/utils/utility-types.d.ts +6 -2
  134. package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +7 -0
  135. package/dist/packages/sdk-ui/src/widget-by-id/use-get-dashboard-model-and-widget-model.d.ts +1 -0
  136. package/dist/packages/sdk-ui/src/widgets/drilldown-widget.d.ts +1 -1
  137. package/dist/packages/sdk-ui/src/widgets/tabber-widget.d.ts +5 -0
  138. package/dist/{use-common-filters-BanIIIUW.js → use-common-filters-Bw15BNGn.js} +5013 -4956
  139. package/dist/{use-common-filters-BeKQ1bKU.cjs → use-common-filters-CqGo6jp3.cjs} +55 -55
  140. package/dist/{widget-composer-4bEKHitq.js → widget-composer-C5_iIuZN.js} +26 -26
  141. package/dist/{widget-composer-NDI4zssI.cjs → widget-composer-D5_iKTui.cjs} +1 -1
  142. package/package.json +9 -8
  143. /package/dist/packages/sdk-ui/src/{filters/components → common}/icons/search-icon.d.ts +0 -0
@@ -1,8 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
- export type AiContextProviderProps = {
2
+ export interface AiContextProviderProps {
3
3
  children: ReactNode;
4
+ /** AI context volatile mode */
4
5
  volatile?: boolean;
5
- };
6
+ }
6
7
  /**
7
8
  * React component that wraps all generative AI components and hooks.
8
9
  *
@@ -65,13 +65,19 @@ interface ErrorResponse {
65
65
  responseType: 'error';
66
66
  }
67
67
  /**
68
- * Response data to NLQ request
68
+ * Response data for NLQ request
69
69
  */
70
70
  export interface NlqResponseData extends ExpandedQueryModel {
71
+ /** Detailed description of the response */
71
72
  detailedDescription: string;
72
- followupQuestions: string[];
73
+ /** An array of suggested followup questions */
74
+ followupQuestions?: string[];
75
+ /** NLQ prompt used in the request */
73
76
  nlqPrompt: string;
77
+ /** Suggested widget props*/
74
78
  widgetProps?: WidgetProps | undefined;
79
+ /** The response message for the chat */
80
+ userMsg: string;
75
81
  }
76
82
  export interface NlqResponse {
77
83
  data: NlqResponseData;
@@ -83,7 +89,9 @@ export interface QueryRecommendationConfig {
83
89
  numOfRecommendations: number;
84
90
  }
85
91
  export type NlqResult = Omit<NlqResponseData, 'followupQuestions'>;
86
- export type QueryRecommendation = Omit<NlqResponseData, 'followupQuestions'>;
92
+ /** AI-generated recommended query you can run on your data model */
93
+ export interface QueryRecommendation extends Omit<NlqResponseData, 'followupQuestions'> {
94
+ }
87
95
  export type QueryRecommendationResponse = QueryRecommendation[];
88
96
  export interface GetNlgInsightsRequest {
89
97
  jaql: Pick<JaqlQueryPayload, 'datasource' | 'metadata' | 'filterRelations'>;
@@ -1,4 +1,4 @@
1
- import { Filter, Data } from '@sisense/sdk-data';
1
+ import { Filter, Data, FilterRelations } from '@sisense/sdk-data';
2
2
  import type { NlqResponseData } from '../../ai';
3
3
  import { NlqChartWidgetStyleOptions } from '../../types';
4
4
  /**
@@ -15,7 +15,7 @@ export interface NlqChartWidgetProps {
15
15
  /**
16
16
  * The dashboard filters to be applied to the chart
17
17
  */
18
- filters?: Filter[];
18
+ filters?: Filter[] | FilterRelations;
19
19
  /**
20
20
  * A callback that allows to modify data immediately after it has been retrieved.
21
21
  * Can be used to inject modification of queried data.
@@ -1,13 +1,11 @@
1
- import { ReactNode } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  import { type ChatRestApi } from './api/chat-rest-api';
3
+ import { CustomContextProviderProps } from '../types';
3
4
  /** @internal */
4
5
  export type CustomAiContext = {
5
- api: ChatRestApi;
6
+ api?: ChatRestApi;
6
7
  };
7
8
  /** @internal */
8
- export type CustomAiContextProviderProps = {
9
- context?: CustomAiContext;
10
- children: ReactNode;
11
- };
9
+ export type CustomAiContextProviderProps = CustomContextProviderProps<CustomAiContext>;
12
10
  /** @internal */
13
- export declare function CustomAiContextProvider({ children, context }: CustomAiContextProviderProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function CustomAiContextProvider({ children, context, }: PropsWithChildren<CustomAiContextProviderProps>): import("react/jsx-runtime").JSX.Element;
@@ -30,6 +30,7 @@ declare const _default: import("react").FunctionComponent<GetNlgInsightsProps>;
30
30
  export default _default;
31
31
  /**
32
32
  * Props for {@link GetNlgQueryResult} component.
33
+ *
33
34
  * @deprecated Use {@link GetNlgInsightsProps} instead
34
35
  * @internal
35
36
  */
@@ -5,11 +5,12 @@ export { useGetNlqResult, prepareGetNlqResultPayload, type UseGetNlqResultParams
5
5
  export { useGetQueryRecommendations, type UseGetQueryRecommendationsParams, type GetQueryRecommendationsParams, type UseGetQueryRecommendationsState, DEFAULT_RECOMMENDATIONS_COUNT, } from './use-get-query-recommendations';
6
6
  export { useChatSession, type UseChatSessionResult } from './use-chat-session';
7
7
  export { useLastNlqResponse } from './use-last-nlq-response';
8
+ export { useFinalNlqResponse } from './use-final-nlq-response';
8
9
  export type { GetNlgInsightsRequest, GetNlgInsightsResponse, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, NlqResult, NLQ_RESULT_CHART_TYPES, NlqResultChartType, } from './api/types';
9
10
  export { Chatbot, type ChatbotProps } from './chatbot';
10
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';
12
13
  export { ChatRestApi } from './api/chat-rest-api';
13
- export { CustomAiContextProvider, type CustomAiContext } from './custom-ai-context-provider';
14
+ export { CustomAiContextProvider, type CustomAiContext, type CustomAiContextProviderProps, } from './custom-ai-context-provider';
14
15
  export { prepareGetNlgInsightsPayload } from './use-get-nlg-insights';
15
16
  export { widgetComposer } from '../analytics-composer';
@@ -0,0 +1,20 @@
1
+ import type { NlqResponseData, ChatContextDetails } from './api/types';
2
+ /**
3
+ * Parameters for the useFinalNlqResponse hook.
4
+ *
5
+ * @internal
6
+ */
7
+ export interface UseFinalNlqResponseParams {
8
+ /** The title of the data model or perspective */
9
+ contextTitle: string;
10
+ /** optional chat context details */
11
+ contextDetails?: ChatContextDetails;
12
+ }
13
+ /**
14
+ * React hook that returns the final NLQ response for the chat that corresponds
15
+ * to the given data model or perspective.
16
+ *
17
+ * @param params - Parameters for the hook
18
+ * @internal
19
+ */
20
+ export declare const useFinalNlqResponse: ({ contextTitle, contextDetails, }: UseFinalNlqResponseParams) => NlqResponseData | null;
@@ -13,6 +13,7 @@ export interface GetNlqResultParams {
13
13
  * Enable suggested axis titles in generated widget
14
14
  *
15
15
  * If not specified, the default value is `false`
16
+ *
16
17
  * @internal
17
18
  */
18
19
  enableAxisTitlesInWidgetProps?: boolean;
@@ -15,6 +15,7 @@ export interface GetQueryRecommendationsParams {
15
15
  * Enable suggested axis titles in generated widget
16
16
  *
17
17
  * If not specified, the default value is `false`
18
+ *
18
19
  * @internal
19
20
  */
20
21
  enableAxisTitlesInWidgetProps?: boolean;
@@ -0,0 +1,8 @@
1
+ import type { NlqResponseData, ChatMessage } from './api/types';
2
+ /**
3
+ * React hook that returns the last NLQ response from chat history
4
+ *
5
+ * @chatHistory [ChatMessage[]] - Parameters for the hook
6
+ * @internal
7
+ */
8
+ export declare const useLastNlqResponseFromHistory: (chatHistory?: ChatMessage[]) => NlqResponseData | null;
@@ -4,7 +4,7 @@ import type { NlqResponseData, ChatContextDetails } from './api/types';
4
4
  *
5
5
  * @internal
6
6
  */
7
- interface UseLastNlqResponseParams {
7
+ export interface UseLastNlqResponseParams {
8
8
  /** The title of the data model or perspective */
9
9
  contextTitle: string;
10
10
  /** optional chat context details */
@@ -18,4 +18,3 @@ interface UseLastNlqResponseParams {
18
18
  * @internal
19
19
  */
20
20
  export declare const useLastNlqResponse: ({ contextTitle, contextDetails, }: UseLastNlqResponseParams) => NlqResponseData | null;
21
- export {};
@@ -2,16 +2,19 @@ export * from './types';
2
2
  export * from './query';
3
3
  /**
4
4
  * Utility functions to compose props and code for widgets.
5
+ *
5
6
  * @internal
6
7
  */
7
8
  export * as widgetComposer from './widget/widget-composer';
8
9
  /**
9
10
  * Utility functions to compose props and code for dashboards.
11
+ *
10
12
  * @internal
11
13
  */
12
14
  export * as dashboardComposer from './dashboard/dashboard-composer';
13
15
  /**
14
16
  * Utility functions to compose props and code for executing queries.
17
+ *
15
18
  * @internal
16
19
  */
17
20
  export * as executeQueryComposer from './execute-query/execute-query-composer';
@@ -29,6 +29,7 @@ export interface ChartRecommendations {
29
29
  /**
30
30
  * Expanded Query Model that is based on NlqResponseData.
31
31
  * It contains expanded JAQL and chart recommendations returned from the chat response.
32
+ *
32
33
  * @internal
33
34
  */
34
35
  export interface ExpandedQueryModel {
@@ -50,11 +51,13 @@ export interface ExpandedQueryModel {
50
51
  * Empty Expanded Query Model
51
52
  *
52
53
  * Used as a default value for ExpandedQueryModel
54
+ *
53
55
  * @internal
54
56
  */
55
57
  export declare const EMPTY_EXPANDED_QUERY_MODEL: ExpandedQueryModel;
56
58
  /**
57
59
  * Simple Chart Recommendations
60
+ *
58
61
  * @internal
59
62
  */
60
63
  export interface SimpleChartRecommendations {
@@ -71,6 +74,7 @@ export interface SimpleChartRecommendations {
71
74
  * Users manipulates this model via the query in YAML format.
72
75
  *
73
76
  * QueryTranslator is responsible for translating this query model to ExpandedWidgetModel.
77
+ *
74
78
  * @internal
75
79
  */
76
80
  export interface SimpleQueryModel {
@@ -89,21 +93,25 @@ export interface SimpleQueryModel {
89
93
  * Empty Simple Query Model
90
94
  *
91
95
  * Used as a default value for SimpleQueryModel
96
+ *
92
97
  * @internal
93
98
  */
94
99
  export declare const EMPTY_SIMPLE_QUERY_MODEL: SimpleQueryModel;
95
100
  /**
96
101
  * UI Framework
102
+ *
97
103
  * @internal
98
104
  */
99
105
  export type UiFramework = 'react' | 'vue' | 'angular';
100
106
  /**
101
107
  * Code Template Key
108
+ *
102
109
  * @internal
103
110
  */
104
111
  export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'widgetByIdTmpl' | 'executeQueryByWidgetIdTmpl' | 'executeQueryTmpl' | 'executePivotQueryTmpl' | 'pivotTableWidgetTmpl';
105
112
  /**
106
113
  * Code Templates
114
+ *
107
115
  * @internal
108
116
  */
109
117
  export type CodeTemplates = {
@@ -113,11 +121,13 @@ export type CodeTemplates = {
113
121
  };
114
122
  /**
115
123
  * Code Placeholder Map
124
+ *
116
125
  * @internal
117
126
  */
118
127
  export type CodePlaceholderMap = Record<string, string>;
119
128
  /**
120
129
  * Base Code Config
130
+ *
121
131
  * @internal
122
132
  */
123
133
  export type BaseCodeConfig = {
@@ -125,6 +135,7 @@ export type BaseCodeConfig = {
125
135
  };
126
136
  /**
127
137
  * Widget Code Config
138
+ *
128
139
  * @internal
129
140
  */
130
141
  export type WidgetCodeConfig = BaseCodeConfig & {
@@ -132,6 +143,7 @@ export type WidgetCodeConfig = BaseCodeConfig & {
132
143
  };
133
144
  /**
134
145
  * Client-side Widget Code Params
146
+ *
135
147
  * @internal
136
148
  */
137
149
  export type ClientSideWidgetCodeParams = BaseCodeConfig & {
@@ -139,6 +151,7 @@ export type ClientSideWidgetCodeParams = BaseCodeConfig & {
139
151
  };
140
152
  /**
141
153
  * By ID Widget Code Params
154
+ *
142
155
  * @internal
143
156
  */
144
157
  export type ByIdWidgetCodeParams = WidgetCodeConfig & {
@@ -148,22 +161,25 @@ export type ByIdWidgetCodeParams = WidgetCodeConfig & {
148
161
  };
149
162
  /**
150
163
  * Widget Code Params
164
+ *
151
165
  * @internal
152
166
  */
153
167
  export type WidgetCodeParams = ClientSideWidgetCodeParams | ByIdWidgetCodeParams;
154
168
  /**
155
169
  * Check if widget code params is for client-side code
170
+ *
156
171
  * @internal
157
172
  */
158
173
  export declare const isClientSideWidgetCodeParams: (params: WidgetCodeParams) => params is ClientSideWidgetCodeParams;
159
174
  /**
160
175
  * Check if widget code params is for by ID code
176
+ *
161
177
  * @internal
162
178
  */
163
179
  export declare const isByIdWidgetCodeParams: (params: WidgetCodeParams) => params is ByIdWidgetCodeParams;
164
180
  /**
165
181
  * @internal
166
- **/
182
+ */
167
183
  export type WidgetPropsConfig = {
168
184
  useCustomizedStyleOptions?: boolean;
169
185
  };
@@ -72,25 +72,29 @@ export declare class RestApi {
72
72
  addWidgetToDashboard: (dashboardOid: string, widgetDto: WidgetDto) => Promise<WidgetDto | undefined>;
73
73
  /**
74
74
  * Get shared formulas by ids
75
+ *
75
76
  * @param sharedFormulasIds - An array of shared formulas ids
76
77
  * @returns A dictionary of shared formulas
77
78
  */
78
79
  getSharedFormulas: (sharedFormulasIds: string[]) => Promise<Record<string, SharedFormulaDto>>;
79
80
  /**
80
81
  * Get a shared formula by id
82
+ *
81
83
  * @param sharedFormulaId - A shared formula id
82
84
  * @returns A shared formula
83
85
  */
84
86
  getSharedFormula: (sharedFormulaId: string) => Promise<SharedFormulaDto | undefined>;
85
87
  /**
86
88
  * Get datasource fields
89
+ *
87
90
  * @param dataSource - A datasource name
88
91
  * @param options - An object with offset and count
89
92
  * @returns A list of datasource fields
90
93
  */
91
94
  getDataSourceFields: (dataSource: string, options?: {
92
- offset: number;
93
- count: number;
95
+ offset?: number;
96
+ count?: number;
97
+ searchValue?: string;
94
98
  }) => Promise<DataSourceField[] | undefined>;
95
99
  }
96
100
  export declare const useRestApi: () => {
@@ -17,8 +17,8 @@ import { AreaChartProps } from './props';
17
17
  *
18
18
  * Additional Area Chart examples:
19
19
  *
20
- * - [Stacked Area Chart](https://www.sisense.com/platform/compose-sdk/playground/?example=charts%2Farea-chart-stacked)
21
- * - [Stacked Percentage Area Chart](https://www.sisense.com/platform/compose-sdk/playground/?example=charts%2Farea-chart-stacked100)
20
+ * - [Stacked Area Chart](https://www.sisense.com/developers/playground/?example=charts%2Farea-chart-stacked)
21
+ * - [Stacked Percentage Area Chart](https://www.sisense.com/developers/playground/?example=charts%2Farea-chart-stacked100)
22
22
  *
23
23
  * @param props - Area chart properties
24
24
  * @returns Area Chart component
@@ -17,8 +17,8 @@ import { BarChartProps } from './props';
17
17
  *
18
18
  * Additional Bar Chart examples:
19
19
  *
20
- * - [Stacked Bar Chart](https://www.sisense.com/platform/compose-sdk/playground/?example=charts%2Fbar-chart-stacked)
21
- * - [Stacked Percentage Bar Chart](https://www.sisense.com/platform/compose-sdk/playground/?example=charts%2Fbar-chart-stacked100)
20
+ * - [Stacked Bar Chart](https://www.sisense.com/developers/playground/?example=charts%2Fbar-chart-stacked)
21
+ * - [Stacked Percentage Bar Chart](https://www.sisense.com/developers/playground/?example=charts%2Fbar-chart-stacked100)
22
22
  *
23
23
  * @param props - Bar chart properties
24
24
  * @returns Bar Chart component
@@ -2,5 +2,15 @@ import { Column as DataTableColumn, DataTable } from '../chart-data-processor/ta
2
2
  import { StyledColumn, StyledMeasureColumn, TableDataOptionsInternal } from '../chart-data-options/types';
3
3
  export declare const unifySortToDirection: ({ column, sortType, }: StyledColumn | StyledMeasureColumn) => number;
4
4
  export declare const syncDataTableWithDataOptionsSort: (chartDataOptions: TableDataOptionsInternal, dataTable: DataTable) => DataTable;
5
+ /**
6
+ * Updates the sort type of a styled column for table
7
+ * This is needed because sorting for Table is done at the JAQL level (backend)
8
+ * while sorting for other charts is done on the client side in CSDK. I am working on a fix for this
9
+ *
10
+ * @param styledColumn - The styled column to update
11
+ * @returns The updated styled column
12
+ * @internal
13
+ */
14
+ export declare const updateStyledColumnSortForTable: (styledColumn: StyledColumn | StyledMeasureColumn) => StyledColumn | StyledMeasureColumn;
5
15
  export declare const updateInnerDataOptionsSort: (dataOptions: TableDataOptionsInternal, sortColumn: DataTableColumn) => TableDataOptionsInternal;
6
16
  export declare const tableData: (chartDataOptions: TableDataOptionsInternal, dataTable: DataTable) => DataTable;
@@ -20,8 +20,8 @@ import { ColumnChartProps } from './props';
20
20
  *
21
21
  * Additional Column Chart examples:
22
22
  *
23
- * - [Stacked Column Chart](https://www.sisense.com/platform/compose-sdk/playground/?example=charts%2Fcolumn-chart-stacked)
24
- * - [Stacked Percentage Column Chart](https://www.sisense.com/platform/compose-sdk/playground/?example=charts%2Fcolumn-chart-stacked100)
23
+ * - [Stacked Column Chart](https://www.sisense.com/developers/playground/?example=charts%2Fcolumn-chart-stacked)
24
+ * - [Stacked Percentage Column Chart](https://www.sisense.com/developers/playground/?example=charts%2Fcolumn-chart-stacked100)
25
25
  *
26
26
  * @param props - Column chart properties
27
27
  * @returns Column Chart component
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { ItemsGroup, GroupSecondaryActionConfig } from './types';
3
+ type GroupHeaderProps = {
4
+ isOpen: boolean;
5
+ group: ItemsGroup;
6
+ secondaryAction?: GroupSecondaryActionConfig;
7
+ onOpenStateChange?: (open: boolean) => void;
8
+ };
9
+ export declare const GroupHeader: React.FC<GroupHeaderProps>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { ItemsGroup, GroupSecondaryActionConfig, ItemActionConfig, ItemSecondaryActionConfig } from './types';
3
+ type GroupProps = {
4
+ group: ItemsGroup;
5
+ groupSecondaryActionConfig?: GroupSecondaryActionConfig;
6
+ itemActionConfig?: ItemActionConfig;
7
+ itemSecondaryActionConfig?: ItemSecondaryActionConfig;
8
+ };
9
+ export declare const Group: React.FC<GroupProps>;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { GroupedItemsBrowserProps } from './types';
3
+ /**
4
+ * A generic component that displays a list of grouped items.
5
+ */
6
+ export declare const GroupedItemsBrowser: React.FC<GroupedItemsBrowserProps>;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Item, ItemActionConfig, ItemSecondaryActionConfig } from './types';
3
+ /**
4
+ * Props for the item row component.
5
+ */
6
+ type ItemRowProps = {
7
+ /** The item to display. */
8
+ item: Item;
9
+ /** The action to perform when the item is clicked. */
10
+ itemActionConfig?: ItemActionConfig;
11
+ /** The secondary action of the item. */
12
+ itemSecondaryActionConfig?: ItemSecondaryActionConfig;
13
+ };
14
+ export declare const ItemRow: React.FC<ItemRowProps>;
15
+ export {};
@@ -0,0 +1,42 @@
1
+ /// <reference types="react" />
2
+ export type GroupedItemsBrowserProps = {
3
+ groupedItems: ItemsGroup[];
4
+ groupSecondaryActionConfig?: GroupSecondaryActionConfig;
5
+ itemActionConfig?: ItemActionConfig;
6
+ itemSecondaryActionConfig?: ItemSecondaryActionConfig;
7
+ onScrolledToBottom?: () => void;
8
+ };
9
+ /**
10
+ * A group of items.
11
+ */
12
+ export type ItemsGroup = {
13
+ title: string;
14
+ id: string;
15
+ items: Item[];
16
+ Icon?: React.ComponentType;
17
+ };
18
+ /**
19
+ * An item in the list of grouped items.
20
+ */
21
+ export type Item = {
22
+ id: string;
23
+ title: string;
24
+ Icon?: React.ComponentType;
25
+ isDisabled?: boolean;
26
+ hoverTooltip?: string;
27
+ };
28
+ export type GroupSecondaryActionConfig = {
29
+ SecondaryActionButtonIcon: React.ComponentType<{
30
+ group: ItemsGroup;
31
+ }>;
32
+ onClick(this: void, group: ItemsGroup): void;
33
+ };
34
+ export type ItemActionConfig = {
35
+ onClick(this: void, item: Item): void;
36
+ };
37
+ export type ItemSecondaryActionConfig = {
38
+ SecondaryActionButtonIcon: React.ComponentType<{
39
+ item: Item;
40
+ }>;
41
+ onClick(this: void, item: Item): void;
42
+ };
@@ -1,3 +1,3 @@
1
1
  export declare const LoadingDots: ({ color }: {
2
- color: string | undefined;
2
+ color?: string | undefined;
3
3
  }) => import("react/jsx-runtime").JSX.Element;
@@ -15,6 +15,7 @@ type PopoverPosition = PopoverAnchorPosition;
15
15
  type PopoverProps = {
16
16
  children: ReactNode;
17
17
  open: boolean;
18
+ id?: string;
18
19
  position?: PopoverPosition;
19
20
  onClose?: () => void;
20
21
  };
@@ -2,6 +2,7 @@ type ButtonProps = {
2
2
  checked?: boolean;
3
3
  value?: string;
4
4
  onChange?: (checked: boolean) => void;
5
+ disabled?: boolean;
5
6
  };
6
7
  /** @internal */
7
8
  export declare const Radio: (props: ButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export * from './use-data-accumulation';
2
+ export * from './use-get-load-more-function';
3
+ export * from './use-load-data-from-internal-hook';
4
+ export * from './use-manage-slice-to-load';
5
+ export * from './use-get-hook-state-result';
@@ -0,0 +1,8 @@
1
+ import { DataChunk } from '../../types';
2
+ export declare function useDataAccumulation({ shouldBeReset }: {
3
+ shouldBeReset: boolean;
4
+ }): {
5
+ accumulatedData: DataChunk[];
6
+ addData: (dataChunk: DataChunk | null) => void;
7
+ isDataReset: boolean;
8
+ };
@@ -0,0 +1,10 @@
1
+ import { AnyArray, RestApiHookState } from '../../../../../../utils/utility-types';
2
+ import { HookExecutionStatus, WithLoadMore } from '../../types.js';
3
+ export declare function useGetHookStateResult<DataKey extends string, SuccessDataType extends AnyArray>(options: {
4
+ status: HookExecutionStatus;
5
+ dataKey: DataKey;
6
+ data: SuccessDataType;
7
+ loadMore: () => void;
8
+ isDataReset: boolean;
9
+ error?: Error;
10
+ }): WithLoadMore<RestApiHookState<DataKey, SuccessDataType>>;
@@ -0,0 +1,4 @@
1
+ export declare function useGetLoadMoreFunction({ increaseSliceToLoad, isLoadMoreRequestsForbidden, }: {
2
+ increaseSliceToLoad: () => void;
3
+ isLoadMoreRequestsForbidden: boolean;
4
+ }): () => void;
@@ -0,0 +1,16 @@
1
+ import { AnyArray, RestApiHookState } from '../../../../../../utils/utility-types';
2
+ import { RestApiHookParams, SliceableRestApiHook, UnsliceableParams, Slice, DataChunk, HookExecutionStatus } from '../../types';
3
+ type UseLoadDataFromInternalHookOptions<HookParams extends RestApiHookParams, DataKey extends string, SuccessDataType extends AnyArray, Hook extends SliceableRestApiHook<HookParams, DataKey, SuccessDataType>> = {
4
+ hook: Hook;
5
+ params: UnsliceableParams<HookParams>;
6
+ sliceToLoad: Slice;
7
+ dataKey: DataKey;
8
+ };
9
+ type UseLoadDataFromInternalHookResult<DataKey extends string, SuccessDataType extends AnyArray> = {
10
+ dataChunk: DataChunk | null;
11
+ hookExecutionStatus: HookExecutionStatus;
12
+ dataLoadingError: Error | undefined;
13
+ hookResultState: RestApiHookState<DataKey, SuccessDataType>;
14
+ };
15
+ export declare function useLoadDataFromInternalHook<HookParams extends RestApiHookParams, DataKey extends string, SuccessDataType extends AnyArray, Hook extends SliceableRestApiHook<HookParams, DataKey, SuccessDataType>>(options: UseLoadDataFromInternalHookOptions<HookParams, DataKey, SuccessDataType, Hook>): UseLoadDataFromInternalHookResult<DataKey, SuccessDataType>;
16
+ export {};
@@ -0,0 +1,10 @@
1
+ import { DataChunk, Slice } from '../../types';
2
+ export declare function useManageSliceToLoad({ initialCount, chunkSize, accumulatedData, shouldBeReset, }: {
3
+ initialCount: number;
4
+ chunkSize: number;
5
+ accumulatedData: DataChunk[];
6
+ shouldBeReset: boolean;
7
+ }): {
8
+ sliceToLoad: Slice;
9
+ increaseSliceToLoad: () => void;
10
+ };
@@ -0,0 +1,2 @@
1
+ import { DataChunk } from '../../types';
2
+ export declare const calculateIfAllItemsLoaded: (dataChunk: DataChunk | null) => boolean;
@@ -0,0 +1 @@
1
+ export * from './calculate-if-all-items-loaded';
@@ -0,0 +1 @@
1
+ export { withLazyLoading } from './with-lazy-loading';
@@ -0,0 +1,27 @@
1
+ import { AnyArray, AnyObject, RestApiHookState } from '../../../../utils/utility-types';
2
+ export type Slice = {
3
+ count: number;
4
+ offset: number;
5
+ };
6
+ type Sliceable = Partial<Slice>;
7
+ type Enableable = {
8
+ enabled?: boolean;
9
+ };
10
+ export type RestApiHookParams = Sliceable & Enableable & AnyObject;
11
+ export type UnsliceableParams<Params extends RestApiHookParams> = Omit<Params, keyof Slice>;
12
+ export type LazyLoadingConfig = {
13
+ initialCount: number;
14
+ chunkSize: number;
15
+ dataKey: string;
16
+ };
17
+ export type SliceableRestApiHook<Params extends RestApiHookParams, DataKey extends string, SuccessDataType extends AnyArray> = (params: Params) => RestApiHookState<DataKey, SuccessDataType>;
18
+ export type WithLoadMore<ReturnObject> = ReturnObject & {
19
+ loadMore: () => void;
20
+ };
21
+ export type HookWithLazyLoading<HookParams extends RestApiHookParams, DataKey extends string, SuccessDataType extends AnyArray, Hook extends SliceableRestApiHook<HookParams, DataKey, SuccessDataType>> = (params: UnsliceableParams<HookParams>) => WithLoadMore<ReturnType<Hook>>;
22
+ export type DataChunk = {
23
+ slice: Slice;
24
+ data: AnyArray;
25
+ };
26
+ export type HookExecutionStatus = 'success' | 'error' | 'loading';
27
+ export {};
@@ -0,0 +1,7 @@
1
+ import { AnyArray } from '../../../../utils/utility-types';
2
+ import { LazyLoadingConfig, SliceableRestApiHook, HookWithLazyLoading, RestApiHookParams } from './types';
3
+ /**
4
+ * A decorator that adds lazy loading functionality to a hook.
5
+ *
6
+ */
7
+ export declare const withLazyLoading: (config: LazyLoadingConfig) => <HookParams extends RestApiHookParams, DataKey extends string, SuccessDataType extends AnyArray>(hook: SliceableRestApiHook<HookParams, DataKey, SuccessDataType>) => HookWithLazyLoading<HookParams, DataKey, SuccessDataType, SliceableRestApiHook<HookParams, DataKey, SuccessDataType>>;
@@ -9,6 +9,9 @@ import { DataSource, DataSourceField } from '@sisense/sdk-data';
9
9
  export declare const useGetDataSourceFields: (params: {
10
10
  dataSource: DataSource | undefined;
11
11
  enabled?: boolean;
12
+ count?: number;
13
+ offset?: number;
14
+ searchValue?: string;
12
15
  }) => DataSourceFieldsState;
13
16
  type DataSourceFieldsState = RestApiHookState<'dataSourceFields', DataSourceField[]>;
14
17
  export {};