@sisense/sdk-ui 1.6.0 → 1.7.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 (52) hide show
  1. package/dist/ai/api/chat-api-provider.d.ts +1 -1
  2. package/dist/ai/api/chat-history.d.ts +18 -0
  3. package/dist/ai/api/errors.d.ts +2 -0
  4. package/dist/ai/api/hooks.d.ts +2 -13
  5. package/dist/ai/api/types.d.ts +11 -9
  6. package/dist/ai/chat-style-provider.d.ts +15 -0
  7. package/dist/ai/chatbot.d.ts +7 -0
  8. package/dist/ai/{error-page.d.ts → common/error-container.d.ts} +1 -1
  9. package/dist/ai/suggestions/suggestion-item.d.ts +1 -2
  10. package/dist/ai/use-chat-session.d.ts +1 -0
  11. package/dist/ai.js +2064 -3702
  12. package/dist/alert-box/alert-box.d.ts +1 -1
  13. package/dist/app/client-application.d.ts +27 -0
  14. package/dist/app/settings/settings.d.ts +1 -1
  15. package/dist/boxplot-utils.d.ts +2 -1
  16. package/dist/chart-options-processor/translations/base-design-options.d.ts +1 -0
  17. package/dist/charts/indicator/indicator-legacy-chart-options/legacy-chart-options-to-theme-settings-dictionary.d.ts +2 -0
  18. package/dist/charts/indicator/indicator-legacy-chart-options/override-with-value-color.d.ts +1 -2
  19. package/dist/common/hooks/use-fetch.d.ts +42 -0
  20. package/dist/const.d.ts +1 -0
  21. package/dist/dashboard-widget/dashboard-widget.d.ts +2 -1
  22. package/dist/dynamic-size-container/dynamic-size-container.d.ts +4 -3
  23. package/dist/formulas/use-get-shared-formula.d.ts +2 -1
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +4704 -4459
  26. package/dist/models/dashboard/use-get-dashboard-model.d.ts +2 -1
  27. package/dist/models/dashboard/use-get-dashboard-models.d.ts +2 -1
  28. package/dist/models/widget/use-get-widget-model.d.ts +2 -1
  29. package/dist/models/widget/widget-model.d.ts +2 -1
  30. package/dist/pivot-table/formatters/data-cell-formatters/data-cell-value-formatter.d.ts +3 -0
  31. package/dist/pivot-table/formatters/data-cell-formatters/index.d.ts +1 -0
  32. package/dist/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +3 -0
  33. package/dist/pivot-table/formatters/header-cell-formatters/index.d.ts +1 -0
  34. package/dist/pivot-table/formatters/index.d.ts +2 -0
  35. package/dist/pivot-table/formatters/types.d.ts +4 -0
  36. package/dist/pivot-table/formatters/utils.d.ts +5 -0
  37. package/dist/pivot-table/sorting-utils.d.ts +56 -0
  38. package/dist/pivot-table/use-apply-pivot-table-formatting.d.ts +11 -0
  39. package/dist/pivot-table/use-get-pivot-table-query.d.ts +1 -1
  40. package/dist/props.d.ts +3 -2
  41. package/dist/query/execute-query.d.ts +5 -5
  42. package/dist/query-execution/execute-query-by-widget-id.d.ts +2 -1
  43. package/dist/query-execution/index.d.ts +2 -1
  44. package/dist/query-execution/query-params-comparator.d.ts +8 -0
  45. package/dist/query-execution/types.d.ts +7 -0
  46. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +2 -1
  47. package/dist/query-execution/use-execute-query.d.ts +3 -10
  48. package/dist/query-execution/use-query-cache.d.ts +10 -0
  49. package/dist/sisense-context/sisense-query-client-provider.d.ts +2 -0
  50. package/dist/{with-tracking-e2a077f9.js → useQuery-aa258c0d.js} +70359 -58170
  51. package/dist/utils/create-cache.d.ts +33 -0
  52. package/package.json +8 -8
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  interface Props {
3
- alerts: string[];
3
+ alerts?: string[];
4
4
  }
5
5
  export declare const AlertBox: ({ alerts }: Props) => JSX.Element;
6
6
  export default AlertBox;
@@ -28,6 +28,24 @@ export type AppConfig = {
28
28
  * Loading Indicator Configurations
29
29
  */
30
30
  loadingIndicatorConfig?: LoadingIndicatorConfig;
31
+ /**
32
+ * Query Cache Configurations
33
+ *
34
+ * This feature is in alpha.
35
+ */
36
+ queryCacheConfig?: {
37
+ /**
38
+ * Whether to enable query caching
39
+ *
40
+ * If not specified, the default value is `false`
41
+ */
42
+ enabled?: boolean;
43
+ };
44
+ /**
45
+ * Query limit (max rows count that will be fetched in query)
46
+ * @default 20000
47
+ */
48
+ queryLimit?: number;
31
49
  };
32
50
  /**
33
51
  * Stands for a Sisense Client Application which connects to a Sisense Environment
@@ -55,6 +73,15 @@ export declare class ClientApplication {
55
73
  * Gets the application settings
56
74
  */
57
75
  settings: AppSettings;
76
+ /**
77
+ * Gets the module to control query cache
78
+ */
79
+ queryCache: {
80
+ /**
81
+ * Clears the query cache
82
+ */
83
+ clear: () => void;
84
+ };
58
85
  /**
59
86
  * Construct new Sisense Client Application
60
87
  *
@@ -21,5 +21,5 @@ type ServerSettings = {
21
21
  * @param isWat - Whether the application is running with WAT authentication
22
22
  * @returns - Application settings
23
23
  */
24
- export declare function getSettings(customConfig: ConfigurableAppSettings, httpClient: Pick<HttpClient, 'get'>, useDefaultPalette: boolean): Promise<AppSettings>;
24
+ export declare function getSettings(customConfig: ConfigurableAppSettings, httpClient: Pick<HttpClient, 'get'>, useDefaultPalette?: boolean): Promise<AppSettings>;
25
25
  export {};
@@ -1,5 +1,6 @@
1
1
  import { Attribute, Measure, Filter, QueryResultData, DataSource } from '@sisense/sdk-data';
2
2
  import { ClientApplication } from './app/client-application.js';
3
+ import { executeQuery as executeQueryFunction } from './query/execute-query.js';
3
4
  import { BoxplotChartCustomDataOptions, BoxplotChartDataOptionsInternal } from './chart-data-options/types.js';
4
5
  /**
5
6
  * Processes box whisker data and outliers data to combine them into a single data set.
@@ -28,4 +29,4 @@ export declare const executeBoxplotQuery: ({ app, chartDataOptions, dataSource,
28
29
  measures: Measure[];
29
30
  filters?: Filter[] | undefined;
30
31
  highlights?: Filter[] | undefined;
31
- }) => Promise<QueryResultData>;
32
+ }, executeQuery: typeof executeQueryFunction) => Promise<QueryResultData>;
@@ -1,6 +1,7 @@
1
1
  import { DesignOptions } from './types';
2
2
  import { Merge } from '../../utils/utility-types';
3
3
  export declare const SERIES_CAPACITY = 50;
4
+ export declare const PIE_SERIES_CAPACITY = 1000;
4
5
  export declare const SCATTER_CATEGORIES_CAPACITY = 500;
5
6
  export declare const CATEGORIES_CAPACITY = 100000;
6
7
  export declare const BaseDesignOptions: Merge<DesignOptions>;
@@ -9,4 +9,6 @@ export declare const legacyOptionsToThemeSettingsDictionary: {
9
9
  backgroundColor: string;
10
10
  'label.color': string;
11
11
  'secondaryTitle.color': string;
12
+ 'secondaryValue.color': string;
13
+ 'value.color': string;
12
14
  };
@@ -1,6 +1,5 @@
1
1
  import { IndicatorChartDataOptions, ConditionalDataColorOptions, DataColorOptions, UniformDataColorOptions } from '../../../types';
2
2
  import { LegacyIndicatorChartOptions } from '../types';
3
- import { IndicatorTypeOptions } from './indicator-legacy-chart-options';
4
3
  /**
5
4
  * Type that represents allowed color options for an indicator.
6
5
  */
@@ -25,7 +24,7 @@ export declare function getValueColorOptions(dataOptions: IndicatorChartDataOpti
25
24
  * @param typeOptions - Describe indicator type and subtype.
26
25
  * @returns The modified legacy indicator chart options.
27
26
  */
28
- export declare function overrideWithValueColor(colorOptions: DataColorOptions, value: number, legacyChartOptions: LegacyIndicatorChartOptions, typeOptions: IndicatorTypeOptions): LegacyIndicatorChartOptions;
27
+ export declare function overrideWithValueColor(colorOptions: DataColorOptions, value: number, legacyChartOptions: LegacyIndicatorChartOptions): LegacyIndicatorChartOptions;
29
28
  /**
30
29
  * Checks if the color options are allowed for an indicator.
31
30
  *
@@ -0,0 +1,42 @@
1
+ import { type UseQueryResult as TanstackUseQueryResult } from '@tanstack/react-query';
2
+ /**
3
+ * Additional request configuration options for the `useFetch` hook.
4
+ */
5
+ export type RequestConfig = {
6
+ /**
7
+ * Indicates that the request body is not a JSON object.
8
+ */
9
+ nonJSONBody?: boolean;
10
+ /**
11
+ * Indicates that the response should be treated as a Blob.
12
+ */
13
+ returnBlob?: boolean;
14
+ };
15
+ /**
16
+ * The result of the `useFetch` hook.
17
+ * Return value of the `useQuery` hook from `@tanstack/react-query`.
18
+ * @link https://tanstack.com/query/v4/docs/framework/react/reference/useQuery
19
+ *
20
+ * @template TData - The type of the data returned by the fetch request
21
+ * @template TError - The type of the error returned by the fetch request
22
+ */
23
+ export type UseQueryResult<TData, TError> = TanstackUseQueryResult<TData, TError>;
24
+ /**
25
+ * React hook that allows to make authorized fetch request to any Sisense API.
26
+ *
27
+ * @example
28
+ ```tsx
29
+ const { data, isLoading, error } = useFetch<unknown, Error>('api/v1/elasticubes/getElasticubes', {
30
+ method: 'POST',
31
+ });
32
+ ```
33
+ * @param path - The endpoint path to fetch data from. This should be a relative path like '/api/v1/endpoint'.
34
+ * @param init - The request init object
35
+ * @param options - The additional request options
36
+ * @returns Query state that contains the status of the query execution, the result data, or the error if any occurred
37
+ * @group Fusion Embed
38
+ */
39
+ export declare const useFetch: <TData = unknown, TError = unknown>(path: string, init?: RequestInit | undefined, options?: {
40
+ requestConfig?: RequestConfig | undefined;
41
+ enabled?: boolean | undefined;
42
+ } | undefined) => UseQueryResult<TData, TError>;
@@ -0,0 +1 @@
1
+ export declare const QUERY_DEFAULT_LIMIT = 20000;
@@ -15,6 +15,7 @@ import { DashboardWidgetProps } from '../props';
15
15
  * dashboardOid={'6441e728dac1920034bce737'}
16
16
  * />
17
17
  * ```
18
- * @group Fusion Assets
18
+ * @group Fusion Embed
19
+ * @fusionEmbed
19
20
  */
20
21
  export declare const DashboardWidget: FunctionComponent<DashboardWidgetProps>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- type ContainerSize = {
2
+ export type ContainerSize = {
3
3
  width: number;
4
4
  height: number;
5
5
  };
@@ -7,6 +7,8 @@ export type DynamicSizeContainerProps = {
7
7
  children: React.ReactNode | ((size: ContainerSize) => React.ReactNode);
8
8
  defaultSize: ContainerSize;
9
9
  size?: Partial<ContainerSize>;
10
+ rerenderOnResize?: boolean;
11
+ onSizeChange?: (size: ContainerSize) => void;
10
12
  };
11
13
  /**
12
14
  * A container component that adjusts its content size according to provided sizes
@@ -18,5 +20,4 @@ export type DynamicSizeContainerProps = {
18
20
  * @param {DynamicSizeContainerProps} props - DynamicSizeContainer properties.
19
21
  * @returns {JSX.Element} The DynamicSizeContainer component.
20
22
  */
21
- export declare const DynamicSizeContainer: ({ children, defaultSize, size, }: DynamicSizeContainerProps) => JSX.Element;
22
- export {};
23
+ export declare const DynamicSizeContainer: ({ children, defaultSize, size, rerenderOnResize, onSizeChange, }: DynamicSizeContainerProps) => JSX.Element;
@@ -86,7 +86,8 @@ export type SharedFormulaSuccessState = {
86
86
  * @param params - {@link UseGetSharedFormulaParams}
87
87
  * @param dataSource - Data source in Sisense instance
88
88
  * @returns Formula load state that contains the status of the execution, the result formula, or the error if any
89
- * @group Fusion Assets
89
+ * @group Fusion Embed
90
+ * @fusionEmbed
90
91
  */
91
92
  export declare const useGetSharedFormula: (params: UseGetSharedFormulaParams) => SharedFormulaState;
92
93
  /**
package/dist/index.d.ts CHANGED
@@ -46,3 +46,4 @@ export { createDataOptionsFromPanels } from './dashboard-widget/translate-widget
46
46
  export { createFilterFromJaql } from './dashboard-widget/translate-widget-filters';
47
47
  export { useThemeContext } from './theme-provider/theme-provider';
48
48
  export { LoadingIndicator } from './common/components/loading-indicator';
49
+ export { useFetch, type RequestConfig, type UseQueryResult } from './common/hooks/use-fetch';