@sisense/sdk-ui 2.2.0 → 2.3.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 (83) hide show
  1. package/dist/ai.cjs +39 -27
  2. package/dist/ai.js +1650 -1155
  3. package/dist/analytics-composer.cjs +24 -24
  4. package/dist/analytics-composer.js +131 -127
  5. package/dist/derive-chart-family-BtTi3OxL.js +90465 -0
  6. package/dist/derive-chart-family-DeTlU_Wm.cjs +669 -0
  7. package/dist/{dimensions-mYUylB-h.cjs → dimensions-DpBTdNJ_.cjs} +1 -1
  8. package/dist/{dimensions-HgrcPa-Q.js → dimensions-Xxab6o5s.js} +13 -13
  9. package/dist/index.cjs +22 -22
  10. package/dist/index.js +12403 -12525
  11. package/dist/index.umd.js +1578 -0
  12. package/dist/packages/sdk-ui/src/ai/api/types.d.ts +2 -0
  13. package/dist/packages/sdk-ui/src/ai/common/icon-button.d.ts +1 -1
  14. package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +1 -0
  15. package/dist/packages/sdk-ui/src/analytics-composer/widget/chart-options/get-widget-options.d.ts +23 -7
  16. package/dist/packages/sdk-ui/src/app/client-application.d.ts +16 -0
  17. package/dist/packages/sdk-ui/src/chart/restructured-charts/chart-builder-factory.d.ts +3 -1
  18. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/alerts.d.ts +3 -0
  19. package/dist/packages/sdk-ui/src/chart/restructured-charts/{helpers/cartesians → highchart-based-charts/cartesians/helpers}/data-options.d.ts +2 -2
  20. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/data.d.ts +4 -0
  21. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/get-legacy-cartesian-chart-options.d.ts +3 -0
  22. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/bar-chart/bar-chart-builder.d.ts +2 -0
  23. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/bar-chart/highcharts-options-builder.d.ts +2 -0
  24. package/dist/packages/sdk-ui/src/chart/restructured-charts/{column-chart → highchart-based-charts/cartesians/stackable/column-chart}/column-chart-builder.d.ts +1 -1
  25. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/column-chart/highcharts-options-builder.d.ts +2 -0
  26. package/dist/packages/sdk-ui/src/chart/restructured-charts/{helpers/cartesians/stackable → highchart-based-charts/cartesians/stackable/helpers}/design-options.d.ts +3 -3
  27. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/types.d.ts +1 -0
  28. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/build-highchart-options.d.ts +20 -0
  29. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/highcharts-based-chart-renderer.d.ts +39 -0
  30. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/utils.d.ts +2 -0
  31. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/types.d.ts +28 -0
  32. package/dist/packages/sdk-ui/src/chart/restructured-charts/types.d.ts +2 -2
  33. package/dist/packages/sdk-ui/src/chart/types.d.ts +0 -1
  34. package/dist/packages/sdk-ui/src/chart-options-processor/apply-event-handlers.d.ts +15 -0
  35. package/dist/packages/sdk-ui/src/chart-options-processor/common-highcharts-option-service.d.ts +9 -0
  36. package/dist/packages/sdk-ui/src/chart-options-processor/subtype-to-design-options.d.ts +2 -1
  37. package/dist/packages/sdk-ui/src/chart-options-processor/theme-option-service.d.ts +8 -0
  38. package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +4 -1
  39. package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/group.d.ts +1 -0
  40. package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/types.d.ts +3 -0
  41. package/dist/packages/sdk-ui/src/common/components/loading-overlay.d.ts +1 -3
  42. package/dist/packages/sdk-ui/src/common/components/menu/menu-ids.d.ts +10 -1
  43. package/dist/packages/sdk-ui/src/common/components/menu/types.d.ts +2 -0
  44. package/dist/packages/sdk-ui/src/common/components/modal/index.d.ts +2 -0
  45. package/dist/packages/sdk-ui/src/common/components/modal/modal-context.d.ts +39 -0
  46. package/dist/packages/sdk-ui/src/common/components/modal/modal-provider.d.ts +19 -0
  47. package/dist/packages/sdk-ui/src/common/components/popover.d.ts +10 -0
  48. package/dist/packages/sdk-ui/src/common/hooks/use-combined-menu.d.ts +4 -8
  49. package/dist/packages/sdk-ui/src/dashboard/components/jtd-dashboard.d.ts +15 -0
  50. package/dist/packages/sdk-ui/src/dashboard/hooks/use-jtd.d.ts +113 -0
  51. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +9 -2
  52. package/dist/packages/sdk-ui/src/data-browser/data-schema-browser/data-schema-browser.d.ts +14 -0
  53. package/dist/packages/sdk-ui/src/data-browser/data-schema-browser/data-schema-browser.styles.d.ts +6 -0
  54. package/dist/packages/sdk-ui/src/data-browser/dimensions-browser/types.d.ts +5 -0
  55. package/dist/packages/sdk-ui/src/decorators/component-decorators/as-sisense-component.d.ts +2 -0
  56. package/dist/packages/sdk-ui/src/decorators/component-decorators/with-modal.d.ts +6 -0
  57. package/dist/packages/sdk-ui/src/index.d.ts +2 -1
  58. package/dist/packages/sdk-ui/src/models/dashboard/index.d.ts +1 -0
  59. package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +6 -0
  60. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +18 -17
  61. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-persistence.d.ts +34 -0
  62. package/dist/packages/sdk-ui/src/pivot-table/hooks/use-render-pivot.d.ts +4 -4
  63. package/dist/packages/sdk-ui/src/plugins-provider/types.d.ts +2 -2
  64. package/dist/packages/sdk-ui/src/props.d.ts +3 -3
  65. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +7 -0
  66. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +14 -0
  67. package/dist/packages/sdk-ui/src/types.d.ts +26 -3
  68. package/dist/packages/sdk-ui/src/utils/filter-relations.d.ts +4 -4
  69. package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +72 -0
  70. package/dist/packages/sdk-ui/src/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
  71. package/dist/packages/sdk-ui/src/widgets/tabber-widget.d.ts +2 -1
  72. package/dist/use-common-filters-B2N7j9H-.cjs +350 -0
  73. package/dist/use-common-filters-BC4Vg9wu.js +32068 -0
  74. package/dist/{widget-composer-CACtfvw6.js → widget-composer-Bj5DrCSm.js} +83 -73
  75. package/dist/{widget-composer-JVl8mNCt.cjs → widget-composer-DjREvygd.cjs} +7 -7
  76. package/package.json +23 -19
  77. package/dist/derive-chart-family-BsbFdcgd.cjs +0 -758
  78. package/dist/derive-chart-family-C9IDI6UV.js +0 -102051
  79. package/dist/packages/sdk-ui/src/chart/restructured-charts/bar-chart/bar-chart-builder.d.ts +0 -2
  80. package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/cartesians/data.d.ts +0 -4
  81. package/dist/packages/sdk-ui/src/widget-by-id/use-get-dashboard-model-and-widget-model.d.ts +0 -14
  82. package/dist/use-common-filters-BKYG6WGA.cjs +0 -271
  83. package/dist/use-common-filters-DkwU7HJ3.js +0 -28928
@@ -0,0 +1,113 @@
1
+ import { type Filter } from '@sisense/sdk-data';
2
+ import { WidgetProps } from '../../props.js';
3
+ import { OpenMenuFn } from '../../common/components/menu/types.js';
4
+ import { DataPoint } from '../../types';
5
+ import { WidgetsOptions } from '../../index-typedoc';
6
+ import { JTDConfig, JTDDrillTarget } from '../../widget-by-id/types';
7
+ import React from 'react';
8
+ import { SizeMeasurement } from '../../types';
9
+ /**
10
+ * Jump to Dashboard (JTD) Filter Merging Logic:
11
+ *
12
+ * When a user clicks on a datapoint to open a JTD modal, multiple types of filters are merged:
13
+ *
14
+ * 1. **Generated Filters**: Created from the clicked datapoint's category and breakBy entries
15
+ * 2. **Dashboard Filters**: Current dashboard filters (filtered by includeDashFilterDims)
16
+ * 3. **Widget Filters**: Original widget-specific filters (filtered by includeWidgetFilterDims)
17
+ * 4. **Formula Context Filters**: NEW - Embedded filters from the clicked widget's datapoint calculations
18
+ *
19
+ * ## Formula Context Filters (New Feature)
20
+ *
21
+ * Formula context filters are embedded within datapoint calculations and represent intrinsic
22
+ * filters that are part of the measure/column computation itself. They are extracted only from
23
+ * the specific widget that was clicked, not from all widgets. For example:
24
+ *
25
+ * ```
26
+ * clickedWidget.dataOptions.value[0].column.context = {
27
+ * "13FC1-655": {
28
+ * "type": "filter",
29
+ * "filterType": "numeric",
30
+ * "attribute": { ... },
31
+ * "valueA": 10,
32
+ * "valueB": 27249.89453125
33
+ * }
34
+ * }
35
+ * ```
36
+ *
37
+ * These filters:
38
+ * - Represent calculation constraints that are intrinsic to the clicked widget's datapoint
39
+ * - Are extracted from all dataOption fields of the clicked widget (value, category, breakBy, x, y, etc.)
40
+ * - Support both object format and string reference format
41
+ *
42
+ * ## Duplicate Filter Handling
43
+ *
44
+ * Complex formulas like `AVG(cost) - AVG(PREVMONTH(cost))` can contain multiple filters on the same dimension.
45
+ * The `sendFormulaFiltersDuplicate` parameter controls how duplicates are handled:
46
+ *
47
+ * - **"none"**: Exclude all duplicate filters (only include filters that appear once)
48
+ * - **Number (1+)**: Include only the filter at that position (1-indexed). Invalid numbers treated as "none"
49
+ * - **Other values**: Include only the first duplicate filter
50
+ *
51
+ * Examples:
52
+ * - Formula has 2 filters on Commerce.Cost dimension
53
+ * - `sendFormulaFiltersDuplicate = "none"` → No Cost filters included
54
+ * - `sendFormulaFiltersDuplicate = 1` → Include first Cost filter
55
+ * - `sendFormulaFiltersDuplicate = 2` → Include second Cost filter
56
+ * - `sendFormulaFiltersDuplicate = 3` → Invalid (out of range), treat as "none"
57
+ */
58
+ export declare const getFormulaContextFilters: (point: DataPoint, clickedWidget: WidgetProps, jtdConfig: JTDConfig) => Filter[];
59
+ /**
60
+ * @internal
61
+ * Handle duplicate formula filters based on sendFormulaFiltersDuplicate parameter
62
+ * @param filters - The filters to handle
63
+ * @param sendFormulaFiltersDuplicate - The send formula filters duplicate parameter
64
+ * @returns The filtered filters
65
+ */
66
+ export declare const handleFormulaDuplicateFilters: (filters: Filter[], sendFormulaFiltersDuplicate?: number | 'none') => Filter[];
67
+ export declare const getFiltersFromDataPoint: (point: DataPoint) => Filter[];
68
+ /**
69
+ * Filter filters based on allowed dimension names, supporting cascading filters
70
+ *
71
+ * @param filters - The filters to filter
72
+ * @param allowedDims - The allowed dimensions
73
+ * @returns The filtered filters
74
+ */
75
+ export declare const filterByAllowedDimensions: (filters: Filter[], allowedDims?: string[]) => Filter[];
76
+ /**
77
+ * @internal
78
+ * Get the JTD click handler for a specific data point of the specific widget
79
+ * @param jtdConfig - The JTD config
80
+ * @param drillTarget - The drill target
81
+ * @param widgetProps - The widget props
82
+ * @param point - The data point
83
+ * @param dashboardFilters - The dashboard filters
84
+ * @param originalWidgetFilters - The original widget filters
85
+ * @param openModal - The open modal function
86
+ * @returns The JTD click handler
87
+ */
88
+ export declare const getJtdClickHandler: (jtdConfig: JTDConfig, drillTarget: JTDDrillTarget, widgetProps: WidgetProps, point: DataPoint, dashboardFilters: Filter[], originalWidgetFilters: Filter[], openModal: (options: {
89
+ title: string;
90
+ width?: number;
91
+ height?: number;
92
+ measurement?: SizeMeasurement;
93
+ allowResize?: boolean;
94
+ content: React.ReactNode;
95
+ }) => Promise<string>) => () => Promise<void>;
96
+ /**
97
+ * @internal
98
+ * Jump to Dashboard (JTD) hook.
99
+ * Implements the JTD functionality for each widget with JTD config.
100
+ * @param widgetOptions - The widget options of the dashboard
101
+ * @param dashboardFilters - The dashboard filters to use
102
+ * @param widgetFilters - The widget filters to use
103
+ * @param openMenu - The open menu function to use
104
+ * @returns The connect to widget props function
105
+ */
106
+ export declare const useJtd: ({ widgetOptions, dashboardFilters, widgetFilters, openMenu, }: {
107
+ widgetOptions: WidgetsOptions;
108
+ dashboardFilters?: Filter[] | undefined;
109
+ widgetFilters?: Map<string, Filter[]> | undefined;
110
+ openMenu: OpenMenuFn;
111
+ }) => {
112
+ connectToWidgetProps: (widgetProps: WidgetProps) => WidgetProps;
113
+ };
@@ -89,9 +89,16 @@ export interface DashboardConfig {
89
89
  */
90
90
  responsive?: boolean;
91
91
  /**
92
- * If true will .
92
+ * If true, an 'Edit Layout' action is visible to users on the dashboard toolbar.
93
+ * Clicking 'Edit Layout' opens the dashboard in editing mode, where the user can resize or reposition widgets using drag and drop.
94
+ * Layout changes are temporarily stored during editing, with undo/redo buttons available on the toolbar.
95
+ * Finally, changes are confirmed or discarded with 'Apply' or 'Cancel' buttons.
93
96
  *
94
- * @internal
97
+ * If persistence is enabled for the dashboard, changes to the layout will be saved to Fusion on clicking the 'Apply' button.
98
+ *
99
+ * This feature is in alpha.
100
+ *
101
+ * @alpha
95
102
  */
96
103
  editMode?: boolean;
97
104
  };
@@ -0,0 +1,14 @@
1
+ import { Dimension } from '@sisense/sdk-data';
2
+ type DataSchemaBrowserProps = {
3
+ dimensions: Dimension[];
4
+ collapseAll?: boolean;
5
+ };
6
+ /**
7
+ * A component that displays a list of dimensions and attributes for a given data source.
8
+ *
9
+ * @param params DataSchemaBrowserProps
10
+ * @returns ReactElement
11
+ * @internal
12
+ */
13
+ export declare const DataSchemaBrowser: ({ dimensions, collapseAll }: DataSchemaBrowserProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { Themable } from '../../theme-provider/types.js';
3
+ export declare const DimensionsBrowserContainer: import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
6
+ } & Themable, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -37,6 +37,11 @@ export type DimensionsBrowserProps = {
37
37
  disabledAttributes: AttributiveElement[];
38
38
  getTooltip: (attribute: AttributiveElement) => string;
39
39
  };
40
+ /**
41
+ * Whether to collapse all dimensions by default.
42
+ * @internal
43
+ */
44
+ collapseAll?: boolean;
40
45
  };
41
46
  /**
42
47
  * Attribute-like element.
@@ -17,6 +17,8 @@ export type SisenseComponentConfig = {
17
17
  customContextErrorMessageKey?: string;
18
18
  /** If set, the component will have a standalone menu root, allowing the menu to be opened even when the component is used outside of the SisenseContextProvider */
19
19
  shouldHaveOwnMenuRoot?: boolean;
20
+ /** If set, the component will have a standalone modal root, allowing modals to be opened even when the component is used outside of a ModalProvider */
21
+ shouldHaveOwnModalRoot?: boolean;
20
22
  };
21
23
  export type ComponentDecorator<DecoratorConfig> = (decoratorConfig: DecoratorConfig) => <ComponentProps extends Record<string, any>>(Component: FunctionComponent<ComponentProps>) => FunctionComponent<ComponentProps>;
22
24
  /**
@@ -0,0 +1,6 @@
1
+ import { ComponentDecorator } from './as-sisense-component';
2
+ type ModalConfig = {
3
+ shouldHaveOwnModalRoot?: boolean;
4
+ };
5
+ export declare const withModal: ComponentDecorator<ModalConfig>;
6
+ export {};
@@ -44,7 +44,7 @@ export { usePlugins } from './plugins-provider/plugins-provider';
44
44
  export { extractDimensionsAndMeasures, useExecutePluginQuery, } from './plugins-provider/use-execute-plugin-query';
45
45
  export { getThemeSettingsByOid } from './themes/theme-loader';
46
46
  export { getDefaultThemeSettings } from './theme-provider/default-theme-settings';
47
- export { useGetDashboardModel, useGetDashboardModels, useDashboardModel, getDashboardModel, getDashboardModels, useGetWidgetModel, getWidgetModel, translateToDashboardResponse, translateToDashboardsResponse, useGetHierarchyModels, getHierarchyModels, translateFiltersAndRelationsToDto, 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, type WidgetsPanelLayout, type WidgetsPanelColumn, type WidgetsPanelRow, type WidgetsPanelCell, type WidgetId, type WidgetsOptions, type CommonFiltersOptions, type CommonFiltersApplyMode, type FiltersIgnoringRules, type HierarchyModel, type Hierarchy, type HierarchyId, type GetHierarchyModelsParams, type HierarchyModelsState, type HierarchyModelsLoadingState, type HierarchyModelsErrorState, type HierarchyModelsSuccessState, UseDashboardModelActionType, } from './models';
47
+ export { useGetDashboardModel, useGetDashboardModels, useDashboardModel, useDashboardPersistence, getDashboardModel, getDashboardModels, useGetWidgetModel, getWidgetModel, translateToDashboardResponse, translateToDashboardsResponse, useGetHierarchyModels, getHierarchyModels, translateFiltersAndRelationsToDto, 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, type WidgetsPanelLayout, type WidgetsPanelColumn, type WidgetsPanelRow, type WidgetsPanelCell, type WidgetId, type WidgetsOptions, type CommonFiltersOptions, type CommonFiltersApplyMode, type FiltersIgnoringRules, type HierarchyModel, type Hierarchy, type HierarchyId, type GetHierarchyModelsParams, type HierarchyModelsState, type HierarchyModelsLoadingState, type HierarchyModelsErrorState, type HierarchyModelsSuccessState, UseDashboardModelActionType, } from './models';
48
48
  /**
49
49
  * Utility functions to translate a Fusion widget model from and to other widget data structures
50
50
  *
@@ -93,4 +93,5 @@ export { translateColumnToAttribute } from './chart-data-options/utils';
93
93
  export { isSameAttribute } from './utils/filters';
94
94
  export { updateDrilldownSelections } from './widgets/common/use-drilldown-core';
95
95
  export { getSelectionTitleMenuItem, getDrilldownMenuItems } from './widgets/hooks/use-drilldown';
96
+ export { DataSchemaBrowser } from './data-browser/data-schema-browser/data-schema-browser';
96
97
  export { type TranslationDictionary, PACKAGE_NAMESPACE as translationNamespace, } from './translation/resources';
@@ -7,3 +7,4 @@ export * from './dashboard-model';
7
7
  export * as dashboardModelTranslator from './dashboard-model-translator';
8
8
  export * from './use-dashboard-model/use-dashboard-model';
9
9
  export * from './use-dashboard-model/use-dashboard-model-reducer';
10
+ export * from './use-dashboard-model/use-dashboard-persistence';
@@ -1,5 +1,6 @@
1
1
  import { CommonFiltersOptions } from '../../common-filters/types';
2
2
  import { ColorPaletteTheme, TabberConfig } from '../../types';
3
+ import { JTDConfig } from '../../widget-by-id/types';
3
4
  export type { CommonFiltersOptions, CommonFiltersApplyMode, FiltersIgnoringRules, } from '../../common-filters/types';
4
5
  /**
5
6
  * Part of Dashboard layout, which describes how widgets are arranged in a cell
@@ -49,6 +50,11 @@ export type WidgetId = string;
49
50
  */
50
51
  export type WidgetsOptions = Record<WidgetId, {
51
52
  filtersOptions?: CommonFiltersOptions;
53
+ /**
54
+ * Jump to dashboard config for widgets
55
+ @internal
56
+ */
57
+ jtdConfig?: JTDConfig;
52
58
  }>;
53
59
  /**
54
60
  * Options for TabberWidets in a dashboard
@@ -1,6 +1,5 @@
1
- import { GetDashboardModelParams } from '../../../models';
2
- import { Dispatch } from 'react';
3
- import { UseDashboardModelAction } from './use-dashboard-model-reducer';
1
+ import { GetDashboardModelParams } from '../use-get-dashboard-model';
2
+ import { UseDashboardPersistenceResult } from './use-dashboard-persistence';
4
3
  export interface UseDashboardModelParams extends GetDashboardModelParams {
5
4
  /**
6
5
  * Boolean flag indicating whether changes to the dashboard state should be saved to the dashboard in Fusion
@@ -10,6 +9,20 @@ export interface UseDashboardModelParams extends GetDashboardModelParams {
10
9
  */
11
10
  persist?: boolean;
12
11
  }
12
+ export interface UseDashboardModelResult extends UseDashboardPersistenceResult {
13
+ /**
14
+ * Whether the dashboard model is loading
15
+ */
16
+ isLoading: boolean;
17
+ /**
18
+ * Whether the dashboard model load has failed
19
+ */
20
+ isError: boolean;
21
+ /**
22
+ * The error if any occurred during loading
23
+ */
24
+ error: Error | undefined;
25
+ }
13
26
  /**
14
27
  * This hook allows you to retrieve and manage a dashboard model from a Sisense instance.
15
28
  * It handles fetching the existing dashboard, managing its local state, and saving any changes back to the Sisense server.
@@ -20,22 +33,10 @@ export interface UseDashboardModelParams extends GetDashboardModelParams {
20
33
  * @fusionEmbed
21
34
  * @internal
22
35
  */
23
- export declare const useDashboardModel: (args_0: UseDashboardModelParams) => {
24
- dashboard: import('../../../models').UseDashboardModelState;
25
- isLoading: boolean;
26
- isError: boolean;
27
- error: Error | undefined;
28
- dispatchChanges: Dispatch<UseDashboardModelAction>;
29
- };
36
+ export declare const useDashboardModel: (args_0: UseDashboardModelParams) => UseDashboardModelResult;
30
37
  /**
31
38
  * {@link useDashboardModel} without tracking to be used inside other hooks or components in Compose SDK.
32
39
  *
33
40
  * @internal
34
41
  */
35
- export declare function useDashboardModelInternal({ dashboardOid, includeWidgets, includeFilters, persist, }: UseDashboardModelParams): {
36
- dashboard: import('../../../models').UseDashboardModelState;
37
- isLoading: boolean;
38
- isError: boolean;
39
- error: Error | undefined;
40
- dispatchChanges: Dispatch<UseDashboardModelAction>;
41
- };
42
+ export declare function useDashboardModelInternal({ dashboardOid, includeWidgets, includeFilters, persist, }: UseDashboardModelParams): UseDashboardModelResult;
@@ -0,0 +1,34 @@
1
+ import { UseDashboardModelAction } from './use-dashboard-model-reducer';
2
+ import { DashboardModel } from '../../../models';
3
+ export interface UseDashboardPersistenceParams {
4
+ /**
5
+ * The dashboard model to manage persistence for
6
+ */
7
+ dashboard: DashboardModel | null;
8
+ /**
9
+ * Boolean flag indicating whether changes to the dashboard state should be saved to the dashboard in Fusion
10
+ *
11
+ * @default true
12
+ */
13
+ persist?: boolean;
14
+ }
15
+ export interface UseDashboardPersistenceResult {
16
+ /**
17
+ * The current dashboard model with local state
18
+ */
19
+ dashboard: DashboardModel | null;
20
+ /**
21
+ * Function to dispatch changes to the dashboard model with optional persistence
22
+ * Returns a promise when persistence is enabled to allow error handling
23
+ */
24
+ dispatchChanges: (action: UseDashboardModelAction) => Promise<void> | void;
25
+ }
26
+ /**
27
+ * Hook that provides persistence capabilities for an already loaded dashboard model.
28
+ * This hook manages local state changes and optionally persists them to the server.
29
+ *
30
+ * @param params - Parameters for dashboard persistence
31
+ * @returns Dashboard persistence state and dispatch function
32
+ * @internal
33
+ */
34
+ export declare function useDashboardPersistence({ dashboard, persist, }: UseDashboardPersistenceParams): UseDashboardPersistenceResult;
@@ -1,11 +1,9 @@
1
1
  /// <reference types="react" />
2
- import type { PivotBuilder } from '@sisense/sdk-pivot-client';
2
+ import { type PivotBuilder } from '@sisense/sdk-pivot-client';
3
3
  import type { CompleteThemeSettings, PivotTableStyleOptions } from '../../types';
4
4
  import type { PivotTableDataOptions } from '../../chart-data-options/types';
5
5
  import type { ContainerSize } from '../../dynamic-size-container/dynamic-size-container';
6
6
  type PivotRenderOptions = {
7
- /** Reference to the pivot table container. */
8
- nodeRef: React.RefObject<HTMLDivElement>;
9
7
  /** The pivot builder instance. */
10
8
  pivotBuilder: PivotBuilder;
11
9
  /** The pivot table data options. */
@@ -22,5 +20,7 @@ type PivotRenderOptions = {
22
20
  /**
23
21
  * A hook that renders the pivot table.
24
22
  */
25
- export declare function useRenderPivot({ nodeRef, pivotBuilder, dataOptions, styleOptions, themeSettings, size, onTotalHeightChange, }: PivotRenderOptions): void;
23
+ export declare function useRenderPivot({ pivotBuilder, dataOptions, styleOptions, themeSettings, size, onTotalHeightChange, }: PivotRenderOptions): {
24
+ pivotElement: JSX.Element | null;
25
+ };
26
26
  export {};
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { DataSource, Filter } from '@sisense/sdk-data';
2
+ import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
3
3
  import { GenericDataOptions } from '../types';
4
4
  /**
5
5
  * Props passed to a user-defined widget component.
@@ -10,7 +10,7 @@ export interface PluginComponentProps<DataOptions = GenericDataOptions, StyleOpt
10
10
  dataSource?: DataSource;
11
11
  dataOptions: DataOptions;
12
12
  styleOptions: StyleOptions;
13
- filters?: Filter[];
13
+ filters?: Filter[] | FilterRelations;
14
14
  highlights?: Filter[];
15
15
  description?: string;
16
16
  }
@@ -1,5 +1,5 @@
1
1
  import { Attribute, Filter, Measure, DataSource, Data, QueryResultData, FilterRelations } from '@sisense/sdk-data';
2
- import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, ChartStyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, ThemeOid, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection, SunburstStyleOptions, ChartWidgetStyleOptions, TableWidgetStyleOptions, WidgetByIdStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions, AreamapStyleOptions, DataPoint, ScatterDataPoint, AreamapDataPoint, BoxplotDataPoint, ChartDataPoints, ScattermapDataPoint, PivotTableStyleOptions, PivotTableWidgetStyleOptions, RegularChartType, RegularChartStyleOptions, TabularChartStyleOptions, TableStyleOptions, AreaRangeStyleOptions, DrilldownSelection, TextWidgetStyleOptions, GenericDataOptions, IndicatorRenderOptions, TabberStyleProps } from './types';
2
+ import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, ChartStyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, ThemeOid, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection, SunburstStyleOptions, ChartWidgetStyleOptions, TableWidgetStyleOptions, WidgetByIdStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions, AreamapStyleOptions, DataPoint, ScatterDataPoint, AreamapDataPoint, BoxplotDataPoint, ChartDataPoints, ScattermapDataPoint, PivotTableStyleOptions, PivotTableWidgetStyleOptions, RegularChartType, RegularChartStyleOptions, TabularChartStyleOptions, TableStyleOptions, AreaRangeStyleOptions, DrilldownSelection, TextWidgetStyleOptions, GenericDataOptions, IndicatorRenderOptions, TabberStyleProps, PluginWidgetStyleOptions } from './types';
3
3
  import { HighchartsOptions } from './chart-options-processor/chart-options-service';
4
4
  import { ComponentType, PropsWithChildren, ReactNode } from 'react';
5
5
  import { IndicatorChartDataOptions, BoxplotChartCustomDataOptions, BoxplotChartDataOptions, ScatterChartDataOptions, TableDataOptions, ScattermapChartDataOptions, AreamapChartDataOptions, PivotTableDataOptions, RegularChartDataOptions, TabularChartDataOptions, RangeChartDataOptions } from './chart-data-options/types';
@@ -1182,7 +1182,7 @@ export interface PluginWidgetProps {
1182
1182
  *
1183
1183
  * @category Data
1184
1184
  */
1185
- filters?: Filter[];
1185
+ filters?: Filter[] | FilterRelations;
1186
1186
  /**
1187
1187
  * Filters that will highlight query results
1188
1188
  *
@@ -1200,7 +1200,7 @@ export interface PluginWidgetProps {
1200
1200
  *
1201
1201
  * @category Widget
1202
1202
  */
1203
- styleOptions?: unknown;
1203
+ styleOptions?: PluginWidgetStyleOptions;
1204
1204
  /**
1205
1205
  * Title of the widget
1206
1206
  *
@@ -49,6 +49,7 @@ export declare const translation: {
49
49
  invalidFilterType: string;
50
50
  secondsDateTimeLevelSupportedOnlyForLive: string;
51
51
  missingMenuRoot: string;
52
+ missingModalRoot: string;
52
53
  missingDataSource: string;
53
54
  incorrectOnDataReadyHandler: string;
54
55
  undefinedDataSource: string;
@@ -68,9 +69,11 @@ export declare const translation: {
68
69
  mapLoadingFailed: string;
69
70
  cascadingFilterOriginalNotFound: string;
70
71
  dashboardLoadFailed: string;
72
+ widgetLoadFailed: string;
71
73
  dashboardWithOidNotFound: string;
72
74
  failedToAddWidget: string;
73
75
  widgetWithOidNotFound: string;
76
+ widgetWithOidNotFoundInDashboard: string;
74
77
  widgetEmptyResponse: string;
75
78
  dateFilterIncorrectOperator: string;
76
79
  synchronizedFilterInvalidProps: string;
@@ -87,6 +90,7 @@ export declare const translation: {
87
90
  addFilterPopover: {
88
91
  noDataSources: string;
89
92
  };
93
+ tabberInvalidConfiguration: string;
90
94
  };
91
95
  errorBoxText: string;
92
96
  chartNoData: string;
@@ -361,6 +365,9 @@ export declare const translation: {
361
365
  editLayout: string;
362
366
  };
363
367
  };
368
+ jumpToDashboard: {
369
+ defaultCaption: string;
370
+ };
364
371
  };
365
372
  /**
366
373
  * A reference type containing all currently used translation keys.
@@ -59,6 +59,7 @@ export declare const resources: {
59
59
  invalidFilterType: string;
60
60
  secondsDateTimeLevelSupportedOnlyForLive: string;
61
61
  missingMenuRoot: string;
62
+ missingModalRoot: string;
62
63
  missingDataSource: string;
63
64
  incorrectOnDataReadyHandler: string;
64
65
  undefinedDataSource: string;
@@ -78,9 +79,11 @@ export declare const resources: {
78
79
  mapLoadingFailed: string;
79
80
  cascadingFilterOriginalNotFound: string;
80
81
  dashboardLoadFailed: string;
82
+ widgetLoadFailed: string;
81
83
  dashboardWithOidNotFound: string;
82
84
  failedToAddWidget: string;
83
85
  widgetWithOidNotFound: string;
86
+ widgetWithOidNotFoundInDashboard: string;
84
87
  widgetEmptyResponse: string;
85
88
  dateFilterIncorrectOperator: string;
86
89
  synchronizedFilterInvalidProps: string;
@@ -97,6 +100,7 @@ export declare const resources: {
97
100
  addFilterPopover: {
98
101
  noDataSources: string;
99
102
  };
103
+ tabberInvalidConfiguration: string;
100
104
  };
101
105
  errorBoxText: string;
102
106
  chartNoData: string;
@@ -371,6 +375,9 @@ export declare const resources: {
371
375
  editLayout: string;
372
376
  };
373
377
  };
378
+ jumpToDashboard: {
379
+ defaultCaption: string;
380
+ };
374
381
  };
375
382
  uk: {
376
383
  errors: {
@@ -423,6 +430,7 @@ export declare const resources: {
423
430
  invalidFilterType: string;
424
431
  secondsDateTimeLevelSupportedOnlyForLive: string;
425
432
  missingMenuRoot: string;
433
+ missingModalRoot: string;
426
434
  missingDataSource: string;
427
435
  incorrectOnDataReadyHandler: string;
428
436
  undefinedDataSource: string;
@@ -442,9 +450,11 @@ export declare const resources: {
442
450
  mapLoadingFailed: string;
443
451
  cascadingFilterOriginalNotFound: string;
444
452
  dashboardLoadFailed: string;
453
+ widgetLoadFailed: string;
445
454
  dashboardWithOidNotFound: string;
446
455
  failedToAddWidget: string;
447
456
  widgetWithOidNotFound: string;
457
+ widgetWithOidNotFoundInDashboard: string;
448
458
  widgetEmptyResponse: string;
449
459
  dateFilterIncorrectOperator: string;
450
460
  synchronizedFilterInvalidProps: string;
@@ -461,6 +471,7 @@ export declare const resources: {
461
471
  addFilterPopover: {
462
472
  noDataSources: string;
463
473
  };
474
+ tabberInvalidConfiguration: string;
464
475
  };
465
476
  errorBoxText: string;
466
477
  chartNoData: string;
@@ -735,5 +746,8 @@ export declare const resources: {
735
746
  editLayout: string;
736
747
  };
737
748
  };
749
+ jumpToDashboard: {
750
+ defaultCaption: string;
751
+ };
738
752
  };
739
753
  };
@@ -17,6 +17,14 @@ import { SoftUnion } from './utils/utility-types';
17
17
  export type { SortDirection, PivotRowsSort } from '@sisense/sdk-data';
18
18
  export type { AppConfig } from './app/client-application';
19
19
  export type { DateConfig } from './query/date-formats';
20
+ /**
21
+ * @internal
22
+ * Enum for size measurement units
23
+ */
24
+ export declare enum SizeMeasurement {
25
+ PERCENT = "%",
26
+ PIXEL = "px"
27
+ }
20
28
  export type { CartesianChartDataOptions, CategoricalChartDataOptions, ChartDataOptions, ScatterChartDataOptions, IndicatorChartDataOptions, StyledColumn, StyledMeasureColumn, } from './chart-data-options/types';
21
29
  export type { DataColorCondition, ConditionalDataColorOptions, DataColorOptions, RangeDataColorOptions, UniformDataColorOptions, } from './chart-data/data-coloring/types';
22
30
  export type { CartesianChartType, CategoricalChartType, ScatterChartType, IndicatorChartType, BoxplotChartType, ScattermapChartType, AreamapChartType, TableType, TableChartType, AreaSubtype, AreaRangeSubtype, LineSubtype, PieSubtype, PolarSubtype, StackableSubtype, BoxplotSubtype, IndicatorComponents, ScatterMarkerSize, LegendPosition, GeoDataElement, RawGeoDataElement, Coordinates, RangeChartType, TableColorOptions, };
@@ -249,6 +257,17 @@ export interface LineStyleOptions extends BaseStyleOptions, BaseAxisStyleOptions
249
257
  lineWidth?: LineWidth;
250
258
  /** Subtype of LineChart */
251
259
  subtype?: LineSubtype;
260
+ /**
261
+ * For step charts: defines where the step occurs (before, between, or after points)
262
+ * Only used when subtype is 'line/step'
263
+ *
264
+ * **Values**
265
+ *
266
+ * - `left` - step occurs before the point (default)
267
+ * - `center` - step occurs between points
268
+ * - `right` - step occurs after the point
269
+ */
270
+ stepPosition?: 'left' | 'center' | 'right';
252
271
  }
253
272
  /** Configuration options that define functional style of the various elements of AreaRangeChart */
254
273
  export interface AreaRangeStyleOptions extends BaseStyleOptions, BaseAxisStyleOptions {
@@ -1145,7 +1164,7 @@ export type CompleteThemeSettings = DeepRequired<Omit<ThemeSettings, 'typography
1145
1164
  };
1146
1165
  };
1147
1166
  /** Complete set of configuration options that define functional style of the various elements of the charts as well as the look and feel of widget itself and widget header. */
1148
- export type WidgetStyleOptions = (ChartStyleOptions | TableStyleOptions | TextWidgetStyleOptions) & WidgetContainerStyleOptions;
1167
+ export type WidgetStyleOptions = (ChartStyleOptions | TableStyleOptions | TextWidgetStyleOptions | PluginWidgetStyleOptions) & WidgetContainerStyleOptions;
1149
1168
  /** Style settings defining the look and feel of widget itself and widget header */
1150
1169
  export interface WidgetContainerStyleOptions {
1151
1170
  /** Space between widget container edge and the chart */
@@ -1243,6 +1262,10 @@ export type TextWidgetStyleOptions = {
1243
1262
  vAlign: `valign-${'middle' | 'top' | 'bottom'}`;
1244
1263
  bgColor: string;
1245
1264
  };
1265
+ /**
1266
+ * Style settings defining the look and feel of PluginWidget
1267
+ */
1268
+ export type PluginWidgetStyleOptions = Record<string, unknown> & WidgetContainerStyleOptions;
1246
1269
  /**
1247
1270
  * Runs type guard check for ThemeOid.
1248
1271
  *
@@ -1692,8 +1715,8 @@ export type TabberTab = {
1692
1715
  *
1693
1716
  * @internal
1694
1717
  */
1695
- export type TabberDtoStyle = TabberStyleProps & {
1696
- activeTab: string;
1718
+ export type TabberDtoStyle = Partial<TabberStyleProps> & {
1719
+ activeTab?: string;
1697
1720
  };
1698
1721
  /**
1699
1722
  * Configuration options that define style of the various elements of the Tabber component.
@@ -23,10 +23,10 @@ export declare function getFilterRelationsDescription(relations: FilterRelations
23
23
  /**
24
24
  * Merge two arrays of filters using the specified merge strategy.
25
25
  *
26
- * @param {Filter[]} widgetFilters - The filters from the widget.
27
- * @param {Filter[]} codeFilters - The filters from the code.
28
- * @param {FiltersMergeStrategy} [mergeStrategy] - The strategy to use for merging filters.
29
- * @returns {Filter[]} The merged filters based on the selected strategy.
26
+ * @param widgetFilters - The filters from the widget.
27
+ * @param codeFilters - The filters from the code.
28
+ * @param mergeStrategy - The strategy to use for merging filters.
29
+ * @returns The merged filters based on the selected strategy.
30
30
  * @internal
31
31
  */
32
32
  export declare function mergeFiltersByStrategy(widgetFilters?: Filter[] | FilterRelations, codeFilters?: Filter[] | FilterRelations, mergeStrategy?: FiltersMergeStrategy): Filter[] | FilterRelations;