@sisense/sdk-ui 1.21.0 → 1.22.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 (66) hide show
  1. package/dist/ai.cjs +48 -48
  2. package/dist/ai.js +793 -764
  3. package/dist/analytics-composer.cjs +18 -18
  4. package/dist/analytics-composer.js +595 -595
  5. package/dist/{get-widget-options-NhNoIBS9.js → get-widget-options-DTIulxC2.js} +5993 -5761
  6. package/dist/{get-widget-options-BmZF5Ztf.cjs → get-widget-options-DixoCEhn.cjs} +76 -76
  7. package/dist/index.cjs +71 -71
  8. package/dist/index.js +8097 -7730
  9. package/dist/packages/sdk-ui/src/ai/chat-config.d.ts +1 -1
  10. package/dist/packages/sdk-ui/src/api/rest-api.d.ts +4 -0
  11. package/dist/packages/sdk-ui/src/app/client-application.d.ts +57 -13
  12. package/dist/packages/sdk-ui/src/app/settings/settings.d.ts +5 -0
  13. package/dist/packages/sdk-ui/src/boxplot-utils.d.ts +5 -4
  14. package/dist/packages/sdk-ui/src/chart/chart.d.ts +1 -0
  15. package/dist/packages/sdk-ui/src/chart-options-processor/translations/translations-to-highcharts.d.ts +1 -1
  16. package/dist/packages/sdk-ui/src/common/hooks/use-fetch.d.ts +1 -1
  17. package/dist/packages/sdk-ui/src/common/hooks/use-synced-state.d.ts +19 -0
  18. package/dist/packages/sdk-ui/src/common-filters/selection-utils.d.ts +9 -1
  19. package/dist/packages/sdk-ui/src/common-filters/use-common-filters.d.ts +4 -2
  20. package/dist/packages/sdk-ui/src/dashboard/dashboard-by-id.d.ts +1 -2
  21. package/dist/packages/sdk-ui/src/dashboard/dashboard-helpers.d.ts +86 -9
  22. package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +9 -1
  23. package/dist/packages/sdk-ui/src/dashboard/index.d.ts +2 -1
  24. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +18 -0
  25. package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +30 -0
  26. package/dist/packages/sdk-ui/src/dashboard/use-dashboard-theme.d.ts +40 -0
  27. package/dist/packages/sdk-ui/src/dashboard-widget/dashboard-widget.d.ts +2 -2
  28. package/dist/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.d.ts +12 -2
  29. package/dist/packages/sdk-ui/src/dashboard-widget/utils.d.ts +1 -0
  30. package/dist/packages/sdk-ui/src/decorators/hook-decorators/with-tracking.d.ts +1 -0
  31. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-display.d.ts +2 -1
  32. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +2 -2
  33. package/dist/packages/sdk-ui/src/filters/components/filters-panel/index.d.ts +1 -1
  34. package/dist/packages/sdk-ui/src/formulas/use-get-shared-formula.d.ts +2 -2
  35. package/dist/packages/sdk-ui/src/index.d.ts +16 -6
  36. package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model-translator.d.ts +2 -2
  37. package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +1 -1
  38. package/dist/packages/sdk-ui/src/models/dashboard/index.d.ts +2 -0
  39. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +11 -0
  40. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dasboard-model-utils.d.ts +22 -0
  41. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +63 -0
  42. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +38 -0
  43. package/dist/packages/sdk-ui/src/models/dashboard/use-get-dashboard-model.d.ts +1 -2
  44. package/dist/packages/sdk-ui/src/models/dashboard/use-get-dashboard-models.d.ts +1 -1
  45. package/dist/packages/sdk-ui/src/models/hierarchy/use-get-hierarchy-models.d.ts +2 -2
  46. package/dist/packages/sdk-ui/src/models/widget/use-get-widget-model.d.ts +2 -2
  47. package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +18 -0
  48. package/dist/packages/sdk-ui/src/models/widget/widget-model.d.ts +1 -1
  49. package/dist/packages/sdk-ui/src/props.d.ts +39 -20
  50. package/dist/packages/sdk-ui/src/query-execution/execute-query-by-widget-id.d.ts +1 -1
  51. package/dist/packages/sdk-ui/src/query-execution/use-execute-query-by-widget-id.d.ts +1 -1
  52. package/dist/packages/sdk-ui/src/translation/custom-translations-loader.d.ts +10 -0
  53. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +97 -0
  54. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +194 -0
  55. package/dist/packages/sdk-ui/src/types.d.ts +24 -3
  56. package/dist/packages/sdk-ui/src/widgets/common/drilldown-utils.d.ts +7 -0
  57. package/dist/packages/sdk-ui/src/widgets/common/{use-drilldown.d.ts → use-drilldown-core.d.ts} +7 -8
  58. package/dist/packages/sdk-ui/src/widgets/common-widget.d.ts +1 -0
  59. package/dist/packages/sdk-ui/src/widgets/hooks/use-drilldown.d.ts +25 -0
  60. package/dist/packages/sdk-ui/src/widgets/hooks/use-with-drilldown.d.ts +12 -0
  61. package/dist/packages/sdk-ui/src/widgets/widget.d.ts +9 -0
  62. package/dist/{table-widget-BPmucihM.js → table-widget-CLL1iN3H.js} +14606 -14487
  63. package/dist/{table-widget-BikAZUJv.cjs → table-widget-CYCcYqzZ.cjs} +173 -173
  64. package/package.json +9 -9
  65. package/dist/packages/sdk-ui/src/ai/api/errors.d.ts +0 -4
  66. package/dist/packages/sdk-ui/src/widgets/common/drilldown-connector.d.ts +0 -19
@@ -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
  *
@@ -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,10 +1,10 @@
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
4
  import { DateConfig } from '../query/date-formats';
5
5
  import { AppSettings } from './settings/settings';
6
6
  import { PivotClient } from '@sisense/sdk-pivot-client';
7
- import { LoadingIndicatorConfig } from '../types';
7
+ import { CustomTranslationObject, LoadingIndicatorConfig } from '../types';
8
8
  import { TrackingEventDetails } from '@sisense/sdk-tracking';
9
9
  import { SisenseContextProviderProps } from '../props';
10
10
  /**
@@ -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 packageName property using camelCase.
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
+ * packageName: '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,14 +181,6 @@ 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 */
@@ -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
@@ -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>;
@@ -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;
@@ -31,7 +31,7 @@ export type UseQueryResult<TData, TError> = TanstackUseQueryResult<TData, TError
31
31
  });
32
32
  ```
33
33
  * @returns Query state that contains the status of the query execution, the result data, or the error if any occurred
34
- * @group Fusion Embed
34
+ * @group Fusion Assets
35
35
  */
36
36
  export declare const useFetch: <TData = unknown, TError = unknown>(path: string, init?: RequestInit | undefined, options?: {
37
37
  requestConfig?: RequestConfig | undefined;
@@ -0,0 +1,19 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ type UseSyncedStateOptions<T> = {
3
+ /**
4
+ * A callback function that is triggered when the state is updated via the local setter,
5
+ * but not through synchronization with `syncValue`.
6
+ */
7
+ onLocalStateChange?: (state: T) => void;
8
+ /**
9
+ * A custom comparison function to determine if the external `syncValue` is different
10
+ * from the current state. The default function performs a deep equality check using `isEqual`.
11
+ */
12
+ syncCompareFn?: (currentState: T, syncValue: T) => boolean;
13
+ };
14
+ /**
15
+ * A custom React hook that behaves like the regular `useState`, but also synchronizes the state
16
+ * with an external `syncValue`.
17
+ */
18
+ export declare function useSyncedState<T>(syncValue: T, { onLocalStateChange, syncCompareFn }?: UseSyncedStateOptions<T>): [T, Dispatch<SetStateAction<T>>];
19
+ export {};
@@ -9,7 +9,15 @@ type DataSelection = {
9
9
  };
10
10
  export declare function getWidgetSelections(widgetType: WidgetTypeInternal, dataOptions: ChartDataOptions | PivotTableDataOptions, points: Array<ChartDataPoint>): DataSelection[];
11
11
  export declare function getSelectableWidgetAttributes(widgetType: WidgetTypeInternal, dataOptions: ChartDataOptions | PivotTableDataOptions): Attribute[];
12
- export declare function createCommonFiltersOverSelections(selections: DataSelection[], existingCommonFilters: Filter[]): Filter[];
12
+ type FiltersWithSelectionFlag = {
13
+ filters: Filter[];
14
+ isSelection: boolean;
15
+ };
16
+ /**
17
+ * Creates a set of common filters based on the current selections, considering existing filters and
18
+ * the common filters unselection rules.
19
+ */
20
+ export declare function createCommonFiltersOverSelections(selections: DataSelection[], existingCommonFilters: Filter[], allowPartialUnselection?: boolean): FiltersWithSelectionFlag;
13
21
  export declare function getWidgetSelectionsTitleMenuItem(widgetType: WidgetTypeInternal, dataOptions: ChartDataOptions | PivotTableDataOptions, points: Array<ChartDataPoint>): MenuItemSection | null;
14
22
  export declare function getSelectMenuItem(title: string, selectHandler: () => void): MenuItemSection;
15
23
  export {};
@@ -2,11 +2,13 @@
2
2
  import { type Filter } from '@sisense/sdk-data';
3
3
  import { CommonFiltersOptions } from './types.js';
4
4
  import { WidgetProps } from '../props.js';
5
- import { OpenMenuFn } from '../common/components/menu/types.js';
5
+ import { BeforeMenuOpenHandler, OpenMenuFn } from '../common/components/menu/types.js';
6
6
  /** @internal */
7
- export declare const useCommonFilters: ({ initialFilters, openMenu, }?: {
7
+ export declare const useCommonFilters: ({ initialFilters, openMenu, onBeforeMenuOpen, onFiltersChange, }?: {
8
8
  initialFilters?: Filter[] | undefined;
9
9
  openMenu?: OpenMenuFn | undefined;
10
+ onBeforeMenuOpen?: BeforeMenuOpenHandler | undefined;
11
+ onFiltersChange?: ((filters: Filter[]) => void) | undefined;
10
12
  }) => {
11
13
  filters: Filter[];
12
14
  setFilters: import("react").Dispatch<import("react").SetStateAction<Filter[]>>;
@@ -25,8 +25,7 @@ import { DashboardByIdProps } from './types';
25
25
  *
26
26
  * To learn more about this and related dashboard components,
27
27
  * see [Embedded Dashboards](/guides/sdk/guides/dashboards/index.html).
28
- *
29
- * @group Fusion Embed
28
+ * @group Fusion Assets
30
29
  * @fusionEmbed
31
30
  * @beta
32
31
  */
@@ -1,14 +1,91 @@
1
1
  import { Filter } from '@sisense/sdk-data';
2
2
  import { DashboardProps } from './types';
3
3
  /**
4
- * Utility functions to manipulate DashboardProps.
4
+ * Creates a new dashboard instance with its filters replaced by a new set of filters.
5
5
  *
6
- * @group Dashboards
6
+ * This function does not modify the original dashboard; instead, it returns a new dashboard with the updated filters.
7
+ *
8
+ * @example
9
+ * Replace all filters on a dashboard with a new set of filters.
10
+ * ```ts
11
+ * const existingDashboard: DashboardProps = {...}
12
+ * const newFilters: Filter[] = [{...}, {...}, ...];
13
+ * const updatedDashboard = replaceFilters(existingDashboard, newFilters);
14
+ * ```
15
+ * @param dashboard - The original dashboard (`DashboardProps`) whose filters are to be replaced.
16
+ * @param newFilters - An array of new filters to set on the dashboard.
17
+ * @returns A new dashboard instance with the updated filters.
18
+ */
19
+ export declare const replaceFilters: (dashboard: DashboardProps, newFilters: Filter[]) => DashboardProps;
20
+ /**
21
+ * Creates a new dashboard instance with an additional filter added to its existing filters.
22
+ *
23
+ * This function does not modify the original dashboard; instead, it returns a new dashboard with the added filter.
24
+ *
25
+ * @example
26
+ * Add a new filter to a dashboard.
27
+ * ```ts
28
+ * const existingDashboard: DashboardProps = {...};
29
+ * const newFilter: Filter = {...};
30
+ * const updatedDashboard = addFilter(existingDashboard, newFilter);
31
+ * ```
32
+ * @param dashboard - The original dashboard (`DashboardProps`) to which the filter will be added.
33
+ * @param newFilter - The filter to add to the dashboard.
34
+ * @returns A new dashboard instance with the new filter added.
35
+ */
36
+ export declare const addFilter: (dashboard: DashboardProps, newFilter: Filter) => DashboardProps;
37
+ /**
38
+ * Creates a new dashboard instance with additional filters added to its existing filters.
39
+ *
40
+ * This function does not modify the original dashboard; instead, it returns a new dashboard with the added filters.
41
+ *
42
+ * @example
43
+ * Add multiple new filters to a dashboard.
44
+ * ```ts
45
+ * const existingDashboard: DashboardProps = {...};
46
+ * const newFilters: Filter[] = [{...}, {...}, ...];
47
+ * const updatedDashboard = addFilters(existingDashboard, newFilters);
48
+ * ```
49
+ * @param dashboard - The original dashboard (`DashboardProps`) to which the filters will be added.
50
+ * @param newFilters - An array of filters to add to the dashboard.
51
+ * @returns A new dashboard instance with the new filters added.
52
+ */
53
+ export declare const addFilters: (dashboard: DashboardProps, newFilters: Filter[]) => DashboardProps;
54
+ /**
55
+ * Creates a new dashboard instance with a specific filter modified.
56
+ *
57
+ * This function searches for a filter with the same GUID as the provided `filterToModify` and replaces it with `newFilter`.
58
+ * This function does not modify the original dashboard; instead, it returns a new dashboard with the updated filters.
59
+ *
60
+ * @example
61
+ * Modify a filter in a dashboard.
62
+ * ```ts
63
+ * const existingDashboard: DashboardProps = {...};
64
+ * const filterToModify: Filter = {...};
65
+ * const newFilter: Filter = {...};
66
+ * const updatedDashboard = modifyFilter(existingDashboard, filterToModify, newFilter);
67
+ * ```
68
+ * @param dashboard - The original dashboard (`DashboardProps`) containing the filter to modify.
69
+ * @param filterToModify - The existing filter to be modified.
70
+ * @param newFilter - The new filter to replace the existing one.
71
+ * @returns A new dashboard instance with the specified filter modified.
72
+ */
73
+ export declare const modifyFilter: (dashboard: DashboardProps, filterToModify: Filter, newFilter: Filter) => DashboardProps;
74
+ /**
75
+ * Creates a new dashboard instance with a specific filter removed.
76
+ *
77
+ * This function removes the filter with the same GUID as the provided filter from the dashboard's filters.
78
+ * This function does not modify the original dashboard; instead, it returns a new dashboard with the updated filters.
79
+ *
80
+ * @example
81
+ * Remove a filter from a dashboard.
82
+ * ```ts
83
+ * const existingDashboard: DashboardProps = {...};
84
+ * const filterToRemove: Filter = {...};
85
+ * const updatedDashboard = removeFilter(existingDashboard, filterToRemove);
86
+ * ```
87
+ * @param dashboard - The original dashboard (`DashboardProps`) from which to remove the filter.
88
+ * @param filter - The filter to be removed.
89
+ * @returns A new dashboard instance with the specified filter removed.
7
90
  */
8
- export declare const DashboardHelpers: {
9
- replaceFilters: (dashboard: DashboardProps, newFilters: Filter[]) => DashboardProps;
10
- modifyFilter: (dashboard: DashboardProps, filterToModify: Filter, newFilter: Filter) => DashboardProps;
11
- removeFilter: (dashboard: DashboardProps, filter: Filter) => DashboardProps;
12
- addFilter: (dashboard: DashboardProps, newFilter: Filter) => DashboardProps;
13
- addFilters: (dashboard: DashboardProps, newFilters: Filter[]) => DashboardProps;
14
- };
91
+ export declare const removeFilter: (dashboard: DashboardProps, filter: Filter) => DashboardProps;
@@ -1,5 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  import { DashboardProps } from '../dashboard/types';
3
+ import { Filter } from '@sisense/sdk-data';
4
+ export declare enum DashboardChangeType {
5
+ /** Dashboard filters have been updated */
6
+ FILTERS_UPDATE = "FILTERS.UPDATE"
7
+ }
8
+ export type DashboardChangeAction = {
9
+ type: DashboardChangeType.FILTERS_UPDATE;
10
+ payload: Filter[];
11
+ };
3
12
  /**
4
13
  * React component that renders a dashboard whose elements are customizable. It includes internal logic of applying common filters to widgets.
5
14
  *
@@ -33,7 +42,6 @@ export default CodeExample;
33
42
  *
34
43
  * To learn more about this and related dashboard components,
35
44
  * see [Embedded Dashboards](/guides/sdk/guides/dashboards/index.html).
36
- *
37
45
  * @group Dashboards
38
46
  * @beta
39
47
  */
@@ -1,4 +1,5 @@
1
1
  export { DashboardById } from './dashboard-by-id';
2
2
  export { Dashboard } from './dashboard';
3
+ export { useComposedDashboard, type ComposableDashboardProps, type UseComposedDashboardOptions, } from './use-composed-dashboard';
4
+ export { useDashboardTheme, type DashboardThemeParams } from './use-dashboard-theme';
3
5
  export type { DashboardByIdProps, DashboardProps, DashboardLayoutOptions, DashboardStyleOptions, DashboardConfig, } from './types';
4
- export { DashboardHelpers } from './dashboard-helpers';
@@ -1,6 +1,7 @@
1
1
  import { DashboardStyleOptions, WidgetsOptions, WidgetsPanelLayout } from '../models';
2
2
  import { WidgetProps } from '../props';
3
3
  import { DataSource, Filter } from '@sisense/sdk-data';
4
+ import { DashboardChangeAction } from '../dashboard/dashboard';
4
5
  export type { DashboardStyleOptions, WidgetsPanelColumnLayout } from '../models';
5
6
  /**
6
7
  * Props for the DashboardById component
@@ -10,6 +11,17 @@ export interface DashboardByIdProps {
10
11
  * The OID of the dashboard to render.
11
12
  */
12
13
  dashboardOid: string;
14
+ /**
15
+ * Boolean flag indicating whether changes to the embedded dashboard should be saved to the dashboard in Fusion.
16
+ *
17
+ * If not specified, the default value is `false`.
18
+ *
19
+ * Limitations:
20
+ * - WAT authentication does not support persistence.
21
+ * - As an alpha feature, currently only changes to dashboard filters are persisted.
22
+ * @internal
23
+ */
24
+ persist?: boolean;
13
25
  }
14
26
  /**
15
27
  * Props for the DashboardContainer component
@@ -72,6 +84,12 @@ export interface DashboardProps {
72
84
  widgetsOptions?: WidgetsOptions;
73
85
  /** The style options for the dashboard */
74
86
  styleOptions?: DashboardStyleOptions;
87
+ /**
88
+ * Callback to receive changes
89
+ *
90
+ * @internal
91
+ */
92
+ onChange?: (action: DashboardChangeAction) => void;
75
93
  }
76
94
  /**
77
95
  * Props for the Dashboard Header component
@@ -0,0 +1,30 @@
1
+ import { DashboardProps } from './types.js';
2
+ import { Filter } from '@sisense/sdk-data';
3
+ export type ComposableDashboardProps = Pick<DashboardProps, 'filters' | 'widgets' | 'widgetsOptions'>;
4
+ export type UseComposedDashboardOptions = {
5
+ /**
6
+ * @internal
7
+ */
8
+ onFiltersChange?: (filters: Filter[]) => void;
9
+ };
10
+ /**
11
+ * {@link useComposedDashboard} without tracking to be used inside other hooks or components in Compose SDK.
12
+ *
13
+ * @param params - Parameters of the composable dashboard props
14
+ * @internal
15
+ */
16
+ export declare function useComposedDashboardInternal<D extends ComposableDashboardProps | DashboardProps>(initialDashboard: D, { onFiltersChange }?: UseComposedDashboardOptions): {
17
+ dashboard: D;
18
+ setFilters: (filters: Filter[]) => void;
19
+ };
20
+ /**
21
+ * React hook that takes in separate dashboard elements and
22
+ * composes them into a coordinated dashboard with change detection, cross filtering, and drill down.
23
+ *
24
+ * @group Dashboards
25
+ * @alpha
26
+ */
27
+ export declare const useComposedDashboard: <D extends DashboardProps | ComposableDashboardProps>(args_0: D, args_1?: UseComposedDashboardOptions | undefined) => {
28
+ dashboard: D;
29
+ setFilters: (filters: Filter[]) => void;
30
+ };
@@ -0,0 +1,40 @@
1
+ import { DashboardStyleOptions } from '../models';
2
+ /**
3
+ * @internal
4
+ */
5
+ export interface DashboardThemeParams {
6
+ styleOptions?: DashboardStyleOptions;
7
+ }
8
+ /**
9
+ * {@link useDashboardTheme} without tracking to be used inside other hooks or components in Compose SDK.
10
+ *
11
+ * @param params - Parameters of the dashboard to be retrieved
12
+ * @internal
13
+ */
14
+ export declare const useDashboardThemeInternal: ({ styleOptions }: DashboardThemeParams) => {
15
+ themeSettings: {
16
+ dashboard: {
17
+ backgroundColor: string;
18
+ dividerLineWidth: number;
19
+ dividerLineColor: string;
20
+ };
21
+ palette?: import("..").ColorPaletteTheme | undefined;
22
+ };
23
+ };
24
+ /**
25
+ * React hook that returns dashboard theme settings
26
+ *
27
+ * @group Dashboards
28
+ * @alpha
29
+ * @internal
30
+ */
31
+ export declare const useDashboardTheme: (args_0: DashboardThemeParams) => {
32
+ themeSettings: {
33
+ dashboard: {
34
+ backgroundColor: string;
35
+ dividerLineWidth: number;
36
+ dividerLineColor: string;
37
+ };
38
+ palette?: import("..").ColorPaletteTheme | undefined;
39
+ };
40
+ };
@@ -11,7 +11,7 @@ import { DashboardWidgetProps } from '../props';
11
11
  *
12
12
  * ## Example
13
13
  *
14
- * Display two dashboard widgets from a Fusion Embed instance.
14
+ * Display two dashboard widgets from a Fusion instance.
15
15
  *
16
16
  * <iframe
17
17
  * src='https://csdk-playground.sisense.com/?example=fusion-assets%2Ffusion-widgets&mode=docs'
@@ -20,7 +20,7 @@ import { DashboardWidgetProps } from '../props';
20
20
  * style='border:none;'
21
21
  * />
22
22
  *
23
- * @group Fusion Embed
23
+ * @group Fusion Assets
24
24
  * @fusionEmbed
25
25
  */
26
26
  export declare const DashboardWidget: FunctionComponent<DashboardWidgetProps>;
@@ -1,8 +1,8 @@
1
- import { DimensionalBaseMeasure, DimensionalAttribute, DimensionalCalculatedMeasure, Jaql, JaqlDataSource } from '@sisense/sdk-data';
1
+ import { DimensionalBaseMeasure, DimensionalAttribute, DimensionalCalculatedMeasure, Jaql, JaqlDataSource, Filter } from '@sisense/sdk-data';
2
2
  import { StyledMeasureColumn, StyledColumn, Color } from '../types';
3
3
  import { Panel, PanelItem, WidgetType, WidgetStyle, BoxplotWidgetStyle } from './types';
4
4
  import { WidgetDataOptions } from '../models';
5
- export declare function createDimensionalElementFromJaql(jaql: Jaql, format?: PanelItem['format']): import("@sisense/sdk-data").Filter | DimensionalAttribute | DimensionalCalculatedMeasure | DimensionalBaseMeasure;
5
+ export declare function createDimensionalElementFromJaql(jaql: Jaql, format?: PanelItem['format']): Filter | DimensionalAttribute | DimensionalCalculatedMeasure | DimensionalBaseMeasure;
6
6
  /** @internal */
7
7
  export declare function applyStatisticalModels(dataOption: StyledMeasureColumn, statisticalModels?: {
8
8
  forecast?: {
@@ -19,9 +19,19 @@ export declare function applyStatisticalModels(dataOption: StyledMeasureColumn,
19
19
  }): StyledMeasureColumn;
20
20
  export declare function createDataColumn(item: PanelItem, customPaletteColors?: Color[]): StyledColumn | StyledMeasureColumn;
21
21
  /** @internal */
22
+ export declare function createPanelItem(column: StyledColumn | StyledMeasureColumn): PanelItem;
23
+ /** @internal */
22
24
  export declare const createDataOptionsFromPanels: (panels: Panel[], variantColors: Color[]) => {
23
25
  [key: string]: any[];
24
26
  };
27
+ export declare const createPanelsFromDataOptions: (dataOptions: {
28
+ [key: string]: any[];
29
+ }) => {
30
+ name: string;
31
+ items: {
32
+ jaql: any;
33
+ }[];
34
+ }[];
25
35
  export declare function createColumnsFromPanelItems<ColumnType = StyledColumn | StyledMeasureColumn>(panels: Panel[], panelName: string, customPaletteColors?: Color[]): ColumnType[];
26
36
  export declare function extractBoxplotBoxType(style: BoxplotWidgetStyle): "iqr" | "extremums" | "standardDeviation";
27
37
  /**
@@ -5,6 +5,7 @@ import { FiltersMergeStrategy, Panel, PanelItem, TextWidgetDtoStyle, WidgetStyle
5
5
  import { ChartProps, ChartWidgetProps, PivotTableWidgetProps, PluginWidgetProps, RenderToolbarHandler, TextWidgetProps, CommonWidgetProps, WithWidgetType, WidgetProps } from '..';
6
6
  import { WidgetTypeInternal } from '../models/widget/types';
7
7
  export declare function getChartType(widgetType: WidgetType): ChartType;
8
+ export declare function getWidgetTypeFromChartType(chartType: ChartType): WidgetType;
8
9
  export declare function getChartSubtype(widgetSubtype: WidgetSubtype): ChartSubtype | undefined;
9
10
  type WidgetTypeOrString = string | WidgetType;
10
11
  export declare function isSupportedWidgetType(widgetType: WidgetTypeOrString): widgetType is WidgetType;
@@ -2,6 +2,7 @@ import { ClientApplication } from '../../app/client-application';
2
2
  export type HookDecorator<DecoratorConfig> = (decoratorConfig: DecoratorConfig) => <HookArgs extends any[], HookResult>(hook: (...args: HookArgs) => HookResult) => (...args: HookArgs) => HookResult;
3
3
  /**
4
4
  * Tracks the hook event and sends it to the server.
5
+ *
5
6
  * @param hookName - The name of the hook
6
7
  * @param packageName - The name of the package
7
8
  * @param app - The client application
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  import { DateRangeFilter } from '@sisense/sdk-data';
2
3
  type DateRangeFilterDisplayProps = {
3
4
  filter: DateRangeFilter;
4
5
  };
5
- export declare const DateRangeFilterDisplay: (props: DateRangeFilterDisplayProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const DateRangeFilterDisplay: React.FC<DateRangeFilterDisplayProps>;
6
7
  export {};
@@ -3,7 +3,6 @@ import { DataSource, Filter } from '@sisense/sdk-data';
3
3
  /**
4
4
  * Props of the {@link FiltersPanel} component
5
5
  *
6
- * @internal
7
6
  */
8
7
  export type FiltersPanelProps = {
9
8
  /** Array of filters to display */
@@ -16,6 +15,7 @@ export type FiltersPanelProps = {
16
15
  /**
17
16
  * Filters panel component that renders a list of filter tiles
18
17
  *
19
- * @internal
18
+ * @group Filter Tiles
19
+ * @alpha
20
20
  */
21
21
  export declare const FiltersPanel: import("react").FunctionComponent<FiltersPanelProps>;
@@ -1,2 +1,2 @@
1
- export { FiltersPanel } from './filters-panel';
1
+ export { FiltersPanel, type FiltersPanelProps } from './filters-panel';
2
2
  export { FiltersPanelTile } from './filters-panel-tile';
@@ -67,7 +67,7 @@ export type SharedFormulaSuccessState = {
67
67
  status: 'success';
68
68
  };
69
69
  /**
70
- * Fetch a [shared formula](https://docs.sisense.com/main/SisenseLinux/shared-formulas.htm) from the a Fusion Embed instance.
70
+ * Fetch a [shared formula](https://docs.sisense.com/main/SisenseLinux/shared-formulas.htm) from the a Fusion instance.
71
71
  *
72
72
  * The formula can be identified either by `oid` or by name and data source pair.
73
73
  *
@@ -84,7 +84,7 @@ export type SharedFormulaSuccessState = {
84
84
  const { formula, isLoading, isError } = useGetSharedFormula({ name: 'My Shared Formula', datasource: DM.DataSource })
85
85
  ```
86
86
  * @returns Formula load state that contains the status of the execution, the result formula, or the error if any
87
- * @group Fusion Embed
87
+ * @group Fusion Assets
88
88
  * @fusionEmbed
89
89
  */
90
90
  export declare const useGetSharedFormula: (params: UseGetSharedFormulaParams) => SharedFormulaState;