@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
@@ -2,6 +2,7 @@ import { MenuPosition, MenuItemSection } from '../../../types';
2
2
  export type MenuOptions = {
3
3
  position: MenuPosition;
4
4
  itemSections: MenuItemSection[];
5
+ onClose?: () => void;
5
6
  };
6
7
  export type BeforeMenuOpenHandler = (options: MenuOptions) => MenuOptions | null;
7
8
  export type OpenMenuFn = (options: MenuOptions) => void;
@@ -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
+ };
@@ -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
@@ -0,0 +1,8 @@
1
+ import { type FunctionComponent, type InputHTMLAttributes } from 'react';
2
+ type MemberRadioProps = {
3
+ label?: string;
4
+ isLabelInactive?: boolean;
5
+ wrapperClassName?: string;
6
+ } & InputHTMLAttributes<HTMLInputElement>;
7
+ export declare const MemberRadio: FunctionComponent<MemberRadioProps>;
8
+ export {};
@@ -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';
@@ -7,6 +7,7 @@ export interface MemberListProps {
7
7
  checkAllMembers: () => void;
8
8
  uncheckAllMembers: () => void;
9
9
  excludeMembers: boolean;
10
+ multiSelection: boolean;
10
11
  disabled: boolean;
11
12
  }
12
13
  export declare const MemberList: FunctionComponent<MemberListProps>;
@@ -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;
@@ -1,20 +1,21 @@
1
- export { ClientApplication, createClientApplication } from './app/client-application';
1
+ export { type ClientApplication, createClientApplication } from './app/client-application';
2
2
  export * from './chart-data-options/types';
3
3
  export { Chart } from './chart';
4
4
  export { ThemeProvider } from './theme-provider';
5
5
  export * from './dashboard';
6
- export { DashboardWidget } from './dashboard-widget/dashboard-widget';
7
- export { getSortType } from './dashboard-widget/utils';
8
- export { type WidgetType, type CartesianWidgetType, type CategoricalWidgetType, type TabularWidgetType, type TextWidgetType, } from './dashboard-widget/types';
6
+ export { DashboardWidget } from './widget-by-id/dashboard-widget';
7
+ export { WidgetById } from './widget-by-id/widget-by-id';
8
+ export { type WidgetType, type CartesianWidgetType, type CategoricalWidgetType, type TabularWidgetType, type TextWidgetType, } from './widget-by-id/types';
9
9
  export * from './query-execution';
10
10
  export { executeQuery } from './query/execute-query';
11
11
  export { SisenseContextProvider } from './sisense-context/sisense-context-provider';
12
12
  export { DrilldownWidget } from './widgets/drilldown-widget';
13
- export { processDrilldownSelections } from './widgets/common/use-drilldown';
13
+ export { processDrilldownSelections } from './widgets/common/use-drilldown-core';
14
14
  export { ChartWidget } from './widgets/chart-widget';
15
15
  export { TableWidget } from './widgets/table-widget';
16
16
  export { PivotTableWidget } from './widgets/pivot-table-widget';
17
17
  export { TextWidget } from './widgets/text-widget';
18
+ export { Widget } from './widgets/widget';
18
19
  export { ContextMenu } from './common/components/menu/context-menu/context-menu';
19
20
  export { DrilldownBreadcrumbs } from './widgets/common/drilldown-breadcrumbs';
20
21
  export * from './line-chart';
@@ -44,20 +45,29 @@ export { getThemeSettingsByOid } from './themes/theme-loader';
44
45
  export { getDefaultThemeSettings } from './theme-provider/default-theme-settings';
45
46
  export { useGetDashboardModel, useGetDashboardModels, getDashboardModel, getDashboardModels, useGetWidgetModel, getWidgetModel, translateToDashboardResponse, translateToDashboardsResponse, useGetHierarchyModels, getHierarchyModels, type DashboardModel, type GetDashboardModelParams, type GetDashboardModelsParams, type DashboardModelState, type DashboardModelLoadingState, type DashboardModelSuccessState, type DashboardModelErrorState, type DashboardModelsState, type DashboardModelsLoadingState, type DashboardModelsSuccessState, type DashboardModelsErrorState, type WidgetModel, type WidgetDataOptions, type WidgetModelState, type WidgetModelLoadingState, type WidgetModelErrorState, type WidgetModelSuccessState, type GetWidgetModelParams, type GetDashboardModelOptions, type GetDashboardModelsOptions, type WidgetsPanelColumnLayout as WidgetsPanelColumnLayout, type WidgetsPanelLayout as WidgetsPanelLayout, type WidgetId, type WidgetsOptions, type CommonFiltersOptions, type CommonFiltersApplyMode, type FiltersIgnoringRules, type HierarchyModel, type Hierarchy, type HierarchyId, type GetHierarchiesParams, type HierarchyModelsState, type HierarchyModelsLoadingState, type HierarchyModelsErrorState, type HierarchyModelsSuccessState, } from './models';
46
47
  /**
47
- * Utility functions to translate between widget abstractions of models and UI props.
48
+ * Utility functions to translate a Fusion widget model from and to other widget data structures
48
49
  *
49
- * @group Fusion Embed
50
+ * @group Fusion Assets
50
51
  * @fusionEmbed
52
+ * @shortDescription Utility functions to translate a Fusion widget model from and to other widget data structures
51
53
  */
52
54
  export * as widgetModelTranslator from './models/widget/widget-model-translator';
53
55
  /**
54
- * Utility functions to translate between dashboard abstractions of models and UI props.
56
+ * Utility functions to translate a Fusion dashboard model from and to other dashboard data structures
55
57
  *
56
- * @group Fusion Embed
58
+ * @group Fusion Assets
57
59
  * @fusionEmbed
60
+ * @shortDescription Utility functions to translate a Fusion dashboard model from and to other dashboard data structures
58
61
  */
59
62
  export * as dashboardModelTranslator from './models/dashboard/dashboard-model-translator';
60
- export type { AutoZoomNavigatorScrollerLocation } from './dashboard-widget/types';
63
+ /**
64
+ * Utility functions to manipulate `DashboardProps`
65
+ *
66
+ * @group Dashboards
67
+ * @shortDescription Utility functions to manipulate dashboard elements
68
+ */
69
+ export * as dashboardHelpers from './dashboard/dashboard-helpers';
70
+ export type { AutoZoomNavigatorScrollerLocation } from './widget-by-id/types';
61
71
  export { boxWhiskerProcessResult } from './boxplot-utils';
62
72
  export { queryStateReducer } from './query-execution/query-state-reducer';
63
73
  export * from './props';
@@ -66,12 +76,17 @@ export * from './filters';
66
76
  export * from './formulas';
67
77
  export { trackHook } from './decorators/hook-decorators';
68
78
  export * from './common/hooks/data-load-state-reducer';
69
- export { createDataOptionsFromPanels } from './dashboard-widget/translate-widget-data-options';
79
+ export { createDataOptionsFromPanels } from './widget-by-id/translate-widget-data-options';
70
80
  export { type DashboardDto } from './api/types/dashboard-dto';
71
- export { type WidgetDto } from './dashboard-widget/types';
72
- export { extractCombinedFilters } from './dashboard-widget/translate-dashboard-filters';
81
+ export { type WidgetDto } from './widget-by-id/types';
82
+ export { extractCombinedFilters } from './widget-by-id/translate-dashboard-filters';
73
83
  export { useThemeContext } from './theme-provider';
74
84
  export { LoadingIndicator } from './common/components/loading-indicator';
75
85
  export { LoadingOverlay } from './common/components/loading-overlay';
76
86
  export { useFetch, type RequestConfig, type UseQueryResult } from './common/hooks/use-fetch';
77
87
  export type { EmptyObject } from './utils/utility-types';
88
+ export { translateColumnToAttribute } from './chart-data-options/utils';
89
+ export { isSameAttribute } from './utils/filters';
90
+ export { updateDrilldownSelections } from './widgets/common/use-drilldown-core';
91
+ export { getSelectionTitleMenuItem, getDrilldownMenuItems } from './widgets/hooks/use-drilldown';
92
+ export { type TranslationDictionary, PACKAGE_NAMESPACE as translationNamespace, } from './translation/resources';
@@ -10,10 +10,10 @@ import { AppSettings } from '../../app/settings/settings.js';
10
10
  * ```tsx
11
11
  * <Dashboard {...dashboardModelTranslator.toDashboardProps(dashboardModel)} />
12
12
  * ```
13
- * @group Fusion Embed
13
+ * @group Fusion Assets
14
14
  * @fusionEmbed
15
15
  */
16
- export declare function toDashboardProps(dashboardModel: DashboardModel): Required<DashboardProps>;
16
+ export declare function toDashboardProps(dashboardModel: DashboardModel): DashboardProps;
17
17
  /**
18
18
  * Creates a new dashboard model from a dashboard DTO.
19
19
  *
@@ -5,7 +5,7 @@ import { DashboardLayoutOptions } from '../../dashboard';
5
5
  /**
6
6
  * Model of Sisense Fusion dashboard defined in the abstractions of Compose SDK.
7
7
  *
8
- * @group Fusion Embed
8
+ * @group Fusion Assets
9
9
  * @fusionEmbed
10
10
  */
11
11
  export interface DashboardModel {
@@ -5,3 +5,5 @@ export * from './use-get-dashboard-model';
5
5
  export * from './use-get-dashboard-models';
6
6
  export * from './dashboard-model';
7
7
  export * as dashboardModelTranslator from './dashboard-model-translator';
8
+ export * from './use-dashboard-model/use-dashboard-model';
9
+ export * from './use-dashboard-model/use-dashboard-model-reducer';
@@ -0,0 +1,11 @@
1
+ import { Filter } from '@sisense/sdk-data';
2
+ import { CascadingFilterDto, FilterDto } from '../../api/types/dashboard-dto';
3
+ /**
4
+ * Translates a {@link Filter} to a {@link FilterDto}.
5
+ * @param filter
6
+ *
7
+ * @returns FilterDto
8
+ *
9
+ * @internal
10
+ */
11
+ export declare function filterToFilterDto(filter: Filter): FilterDto | CascadingFilterDto;
@@ -1,7 +1,7 @@
1
1
  import { type LayoutDto, type FilterDto, type CascadingFilterDto } from '../../api/types/dashboard-dto';
2
2
  import type { WidgetsPanelColumnLayout, WidgetsOptions } from './types';
3
3
  import { Filter } from '@sisense/sdk-data';
4
- import { WidgetDto } from '../../dashboard-widget/types';
4
+ import { WidgetDto } from '../../widget-by-id/types';
5
5
  export declare const translateLayout: (layout: LayoutDto) => WidgetsPanelColumnLayout;
6
6
  export declare function extractDashboardFilters(dashboardFilters: Array<FilterDto | CascadingFilterDto>): Filter[];
7
7
  export declare function translateWidgetsOptions(widgets?: WidgetDto[]): WidgetsOptions;
@@ -0,0 +1,22 @@
1
+ import { UseDashboardModelAction } from '../../../models';
2
+ import { DashboardChangeAction } from '../../../dashboard/dashboard';
3
+ import { Authenticator } from '@sisense/sdk-rest-client';
4
+ /**
5
+ * Convert a dashboard change action to a use dashboard model action.
6
+ * @param action - The dashboard change action to convert
7
+ *
8
+ * @returns The useDashboardModel action or null if the action is not supported
9
+ *
10
+ * @internal
11
+ */
12
+ export declare function dashboardChangeActionToUseDashboardModelAction(action: DashboardChangeAction): UseDashboardModelAction | null;
13
+ /**
14
+ * Check if the persistence is supported and log a warning if it is not.
15
+ * @param authType - The authentication type
16
+ * @param shouldWarn - Whether to log a warning
17
+ *
18
+ * @returns True if the persistence is supported, false otherwise
19
+ *
20
+ * @internal
21
+ */
22
+ export declare function checkPersistenceSupport(authType: Authenticator['type'], shouldWarn: boolean): boolean;
@@ -0,0 +1,63 @@
1
+ import { DashboardModel } from '../../../models';
2
+ import { Filter } from '@sisense/sdk-data';
3
+ import { RestApi } from '../../../api/rest-api';
4
+ export type UseDashboardModelState = DashboardModel | null;
5
+ /**
6
+ * Internal action types for the dashboard model state used in {@link useDashboardModel}.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare enum UseDashboardModelActionTypeInternal {
11
+ DASHBOARD_INIT = "DASHBOARD.INIT"
12
+ }
13
+ /**
14
+ * Action types for the dashboard model state used in {@link useDashboardModel}.
15
+ *
16
+ * @internal
17
+ */
18
+ export declare enum UseDashboardModelActionType {
19
+ FILTERS_UPDATE = "FILTERS.UPDATE"
20
+ }
21
+ /**
22
+ * Internal actions for the dashboard model state used in {@link useDashboardModel}.
23
+ *
24
+ * @internal
25
+ */
26
+ type UseDashboardModelInternalAction = UseDashboardModelAction | {
27
+ type: UseDashboardModelActionTypeInternal.DASHBOARD_INIT;
28
+ payload: DashboardModel;
29
+ };
30
+ /**
31
+ * Actions for the dashboard model state used in {@link useDashboardModel}.
32
+ *
33
+ * @internal
34
+ */
35
+ export type UseDashboardModelAction = {
36
+ type: UseDashboardModelActionType.FILTERS_UPDATE;
37
+ payload: Filter[];
38
+ };
39
+ /**
40
+ * Reducer for the dashboard model state used in {@link useDashboardModel}.
41
+ * @param state
42
+ * @param action
43
+ *
44
+ * @internal
45
+ */
46
+ export declare function dashboardReducer(state: UseDashboardModelState, action: UseDashboardModelInternalAction): UseDashboardModelState;
47
+ /**
48
+ * Middleware connector for {@link persistDashboardModelMiddleware}.
49
+ * @param restApi - The Sisense REST API instance
50
+ * @param reducer - The dashboard model reducer
51
+ *
52
+ * @internal
53
+ */
54
+ export declare function withPersistDashboardModelMiddleware(restApi: RestApi, reducer: (state: UseDashboardModelState, action: UseDashboardModelInternalAction) => UseDashboardModelState): (state: UseDashboardModelState, action: UseDashboardModelInternalAction) => UseDashboardModelState;
55
+ /**
56
+ * Middleware that persists the dashboard model changes to the Sisense server.
57
+ * @param restApi - The Sisense REST API instance
58
+ * @param reducer - The dashboard model reducer
59
+ *
60
+ * @internal
61
+ */
62
+ export declare function persistDashboardModelMiddleware(state: DashboardModel, action: UseDashboardModelAction, restApi: RestApi): Promise<import("../../..").DashboardDto | undefined> | Promise<null>;
63
+ export {};