@sisense/sdk-ui 2.4.1 → 2.6.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 (54) hide show
  1. package/dist/ai.cjs +1 -1
  2. package/dist/ai.js +4 -4
  3. package/dist/analytics-composer.cjs +82 -82
  4. package/dist/analytics-composer.js +1911 -1911
  5. package/dist/{derive-chart-family-woVAnbRi.js → derive-chart-family-BPYK8evJ.js} +11015 -10951
  6. package/dist/{derive-chart-family-Cqw-HJq1.cjs → derive-chart-family-yUBZXP4x.cjs} +146 -146
  7. package/dist/dimensions-BgPl9ZS9.cjs +1 -0
  8. package/dist/dimensions-DuHaCozA.js +203 -0
  9. package/dist/index.cjs +17 -17
  10. package/dist/index.js +7207 -6831
  11. package/dist/index.umd.js +296 -296
  12. package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +18 -0
  13. package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +4 -0
  14. package/dist/packages/sdk-ui/src/app/client-application.d.ts +27 -8
  15. package/dist/packages/sdk-ui/src/chart/advanced-chart.d.ts +1 -1
  16. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/highcharts-based-chart-renderer.d.ts +4 -0
  17. package/dist/packages/sdk-ui/src/chart-data-options/types.d.ts +8 -0
  18. package/dist/packages/sdk-ui/src/chart-data-options/utils.d.ts +8 -1
  19. package/dist/packages/sdk-ui/src/common/components/modal/index.d.ts +1 -1
  20. package/dist/packages/sdk-ui/src/common/components/modal/modal-context.d.ts +0 -6
  21. package/dist/packages/sdk-ui/src/common/hooks/use-modal.d.ts +14 -0
  22. package/dist/packages/sdk-ui/src/common/icons/jtd-jumpable-icon.d.ts +1 -0
  23. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/resizable-columns.d.ts +7 -3
  24. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/const.d.ts +2 -2
  25. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/helpers.d.ts +6 -0
  26. package/dist/packages/sdk-ui/src/dashboard/components/jtd-dashboard.d.ts +3 -2
  27. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/index.d.ts +5 -0
  28. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-filters.d.ts +129 -0
  29. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-handlers.d.ts +46 -0
  30. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-menu.d.ts +47 -0
  31. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-types.d.ts +93 -0
  32. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-widget-transforms.d.ts +48 -0
  33. package/dist/packages/sdk-ui/src/dashboard/hooks/use-jtd.d.ts +1 -92
  34. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +26 -19
  35. package/dist/packages/sdk-ui/src/dynamic-size-container/dynamic-size-container.d.ts +2 -1
  36. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/utils.d.ts +8 -0
  37. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -0
  38. package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +18 -2
  39. package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +2 -2
  40. package/dist/packages/sdk-ui/src/props.d.ts +10 -0
  41. package/dist/packages/sdk-ui/src/sisense-chart/sisense-chart.d.ts +1 -1
  42. package/dist/packages/sdk-ui/src/sisense-chart/types.d.ts +4 -0
  43. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +1 -0
  44. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +2 -0
  45. package/dist/packages/sdk-ui/src/utils/parseISOWithTimezoneCheck.d.ts +9 -0
  46. package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +9 -9
  47. package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +26 -0
  48. package/dist/{use-common-filters-Br-CoziA.js → use-common-filters-B1RKY2KD.js} +4512 -4440
  49. package/dist/{use-common-filters-CCXbao1t.cjs → use-common-filters-CRgYdKcV.cjs} +78 -78
  50. package/dist/{widget-composer-DheWJukc.cjs → widget-composer-B2r2a9Oh.cjs} +7 -7
  51. package/dist/{widget-composer-BCNu5BzM.js → widget-composer-I9gUFBZt.js} +121 -102
  52. package/package.json +7 -7
  53. package/dist/dimensions-BHdLQaOB.js +0 -200
  54. package/dist/dimensions-oGJ_aWd5.cjs +0 -1
@@ -29,3 +29,21 @@ export declare function isNonEmptyArray<T>(array: T[]): boolean;
29
29
  * @returns The modified string with the first empty line removed if the next line contains "import *" or "import {". If no such condition is met, the input remains unchanged.
30
30
  */
31
31
  export declare function removeEmptyLineBeforeImport(input: string): string;
32
+ /**
33
+ * Returns a new object where any "unsafe" keys (i.e., keys that contain
34
+ * characters not allowed in JavaScript dot notation — such as spaces, slashes, dashes, etc.)
35
+ * are wrapped in double quotes.
36
+ *
37
+ * If the object contains a `composeCode` field, it is returned as-is without modification.
38
+ *
39
+ * Safe keys (valid JS identifiers) are left unchanged.
40
+ *
41
+ * @param obj - The input object with arbitrary string keys
42
+ * @returns A new object with the same values, but with unsafe keys wrapped in quotes,
43
+ * unless the object has a `composeCode` field
44
+ *
45
+ * @example
46
+ * quoteUnsafeKeys({ "user-id": true, normalKey: 42 })
47
+ * // => { '"user-id"': true, normalKey: 42 }
48
+ */
49
+ export declare function quoteUnsafeKeys<T extends Record<string, any>>(obj: T): Record<string, any>;
@@ -11,6 +11,10 @@ export type LayoutDto = {
11
11
  elements: {
12
12
  height: number | string;
13
13
  widgetid: string;
14
+ minWidth: number;
15
+ maxWidth: number;
16
+ minHeight: number;
17
+ maxHeight: number;
14
18
  }[];
15
19
  }[];
16
20
  }[];
@@ -110,18 +110,37 @@ export type AppConfig = {
110
110
  onTrackingEvent?: (payload: TrackingEventDetails) => void;
111
111
  };
112
112
  /**
113
- * Configuration of the jump to dashboard feature
114
- * Only the widgets with pre-configured JTD config will support this feature.
115
- * You can configure the JTD config in the widget settings in Fusion UI having jump to dashboard plugin enabled.
113
+ * Configuration of the Jump to Dashboard feature
114
+ *
115
+ * This feature is currently in Beta.
116
+ *
117
+ * **Note:** Only widgets that are configured using the Fusion UI as documented
118
+ * [here](https://docs.sisense.com/main/SisenseLinux/jump-to-dashboard.htm?tocpath=Add-ons%7C_____2#ConfiguringJTDPerWidget)
119
+ * are supported in Compose SDK.
120
+ *
121
+ * Widgets that are configured using an older version of Jump To Dashboard, or via scripts, are not supported.
122
+ *
123
+ * Known limitations:
124
+ * - Jump To Dashboard is not currently supported for Pivot widgets.
125
+ * - Target dashboards are always opened in a popup window, options to open in new tab and new window are not supported.
126
+ * - Show 'Header' and 'Dashboards panel' options are not supported (only relevant to Fusion).
127
+ * - 'Reset filters after JTD' is not supported, since changes are never saved to the target dashboard using Compose SDK.
128
+ *
129
+ * The following Jump To Dashboard configuration is supported:
130
+ * - Target dashboard set by Id, with configurable display title
131
+ * - 'Popup window' display type ('Allow Resize' not supported)
132
+ * - Display filter panel on the target dashboard (true/false)
133
+ * - Navigation setting (Click / Right click)
134
+ * - Note: 'Keep changes made by user' is not supported, since changes are never saved to the target dashboard using Compose SDK.
135
+ * - Apply filters to the target dashboard (select)
136
+ * - Merge target dashboard filters (true/false)
116
137
  *
117
- * This feature is currently in alpha.
118
- * To learn more about the jump to dashboard feature, see the [Jump to Dashboard documentation](https://docs.sisense.com/main/SisenseLinux/jump-to-dashboard.htm?tocpath=Add-ons%7C_____2#ConfiguringJTDPerWidget).
119
138
  */
120
139
  jumpToDashboardConfig?: {
121
140
  /**
122
141
  * Whether to enable or disable the jump to dashboard feature
123
142
  *
124
- * If not specified, the default value is `false`
143
+ * If not specified, the default value is `true`
125
144
  */
126
145
  enabled?: boolean;
127
146
  };
@@ -162,7 +181,7 @@ export interface ClientApplication {
162
181
  clear: () => void;
163
182
  };
164
183
  }
165
- type ClientApplicationParams = Pick<SisenseContextProviderProps, 'appConfig' | 'defaultDataSource' | 'url' | 'token' | 'wat' | 'ssoEnabled' | 'enableSilentPreAuth' | 'useFusionAuth'>;
184
+ type ClientApplicationParams = Pick<SisenseContextProviderProps, 'appConfig' | 'defaultDataSource' | 'url' | 'token' | 'wat' | 'ssoEnabled' | 'enableSilentPreAuth' | 'useFusionAuth' | 'alternativeSsoHost'>;
166
185
  /** @internal */
167
- export declare const createClientApplication: ({ defaultDataSource, url: rawUrl, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, useFusionAuth, }: ClientApplicationParams) => Promise<ClientApplication>;
186
+ export declare const createClientApplication: ({ defaultDataSource, url: rawUrl, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, useFusionAuth, alternativeSsoHost, }: ClientApplicationParams) => Promise<ClientApplication>;
168
187
  export {};
@@ -4,4 +4,4 @@ import { RegularChartProps } from '../props.js';
4
4
  * @param props
5
5
  * @returns
6
6
  */
7
- export declare const AdvancedChart: (props: RegularChartProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export declare const AdvancedChart: (props: RegularChartProps) => import("react/jsx-runtime").JSX.Element;
@@ -12,6 +12,10 @@ export type HighchartsBasedChartRendererProps<CT extends HighchartBasedChartType
12
12
  onDataPointContextMenu?: SisenseChartDataPointEventHandler;
13
13
  onDataPointsSelected?: SisenseChartDataPointsEventHandler;
14
14
  onBeforeRender?: BeforeRenderHandler;
15
+ size?: {
16
+ width?: number;
17
+ height?: number;
18
+ };
15
19
  };
16
20
  /**
17
21
  * Creates a specific highcharts based chart renderer component
@@ -58,6 +58,10 @@ export interface CategoryStyle {
58
58
  width?: number;
59
59
  /** {@inheritDoc DataColorOptions} */
60
60
  color?: DataColorOptions;
61
+ /**
62
+ * Name of the column.
63
+ */
64
+ name?: string;
61
65
  }
62
66
  /**
63
67
  * Wrapped {@link @sisense/sdk-data!Column | Column} with styles controlling how the column is visualized in a chart.
@@ -157,6 +161,10 @@ export type ValueStyle = {
157
161
  * @internal
158
162
  */
159
163
  width?: number;
164
+ /**
165
+ * Name of the measure.
166
+ */
167
+ name?: string;
160
168
  };
161
169
  /**
162
170
  * Specific style options to be applied to specific series in Chart.
@@ -34,7 +34,14 @@ export declare const splitColumn: <C extends AnyColumn>(targetColumn: C) => {
34
34
  * @internal
35
35
  */
36
36
  export declare function isMeasureColumn(arg: AnyColumn): arg is MeasureColumn | CalculatedMeasureColumn | StyledMeasureColumn;
37
- export declare const getDataOptionTitle: ({ column }: StyledColumn | StyledMeasureColumn) => string;
37
+ /**
38
+ * Returns the title of a column (data option).
39
+ *
40
+ * @param column - The column to get the title of.
41
+ * @param name - The name of the column.
42
+ * @returns The title of the column.
43
+ */
44
+ export declare const getDataOptionTitle: ({ column, name }: StyledColumn | StyledMeasureColumn) => string;
38
45
  export declare const getDataOptionGranularity: ({ column, granularity }: StyledColumn) => string;
39
46
  /** @internal */
40
47
  export declare const translateColumnToAttribute: (c: Column | StyledColumn) => Attribute;
@@ -1,2 +1,2 @@
1
- export { useModal, ModalContext, useModalContext, type ModalOptions, type ModalInstance, } from './modal-context';
1
+ export { ModalContext, useModalContext, type ModalOptions, type ModalInstance, } from './modal-context';
2
2
  export { ModalProvider, ModalTreeRootProvider, ModalTreeNodeProvider } from './modal-provider';
@@ -30,10 +30,4 @@ export declare const ModalContext: import("react").Context<ModalSettings | null>
30
30
  * @internal
31
31
  */
32
32
  export declare const useModalContext: () => ModalSettings | null;
33
- /**
34
- * Hook to use modal functionality
35
- *
36
- * @returns Modal API functions
37
- */
38
- export declare const useModal: () => ModalSettings;
39
33
  export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Hook to access modal API.
3
+ *
4
+ * Throws an error if used outside the modal context.
5
+ *
6
+ * @internal
7
+ */
8
+ export declare const useModal: () => {
9
+ openModal: import("../components/modal/modal-context").OpenModalFn;
10
+ closeModal: import("../components/modal/modal-context").CloseModalFn;
11
+ closeAllModals: () => void;
12
+ getModalStack: () => import('../../common/components/modal').ModalInstance[];
13
+ isModalOpen: (modalId: string) => boolean;
14
+ };
@@ -0,0 +1 @@
1
+ export declare const JtdJumpableIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -14,9 +14,13 @@ interface ResizableColumnsProps {
14
14
  */
15
15
  widths: number[];
16
16
  /**
17
- * The minimum width of the columns (in percentage)
17
+ * The minimum width of the columns (in pixels)
18
18
  */
19
- minColWidth: number;
19
+ minColWidths?: number[];
20
+ /**
21
+ * The maximum width of the columns (in pixels)
22
+ */
23
+ maxColWidths?: number[];
20
24
  /**
21
25
  * The callback function to call when the widths change
22
26
  */
@@ -27,5 +31,5 @@ interface ResizableColumnsProps {
27
31
  *
28
32
  * @internal
29
33
  */
30
- export declare const ResizableColumns: ({ children, widths, minColWidth, onWidthsChange, }: ResizableColumnsProps) => import("react/jsx-runtime").JSX.Element;
34
+ export declare const ResizableColumns: ({ children, widths, minColWidths, maxColWidths, onWidthsChange, }: ResizableColumnsProps) => import("react/jsx-runtime").JSX.Element;
31
35
  export {};
@@ -1,9 +1,9 @@
1
1
  export declare const RESIZE_LINE_SIZE = 4;
2
- export declare const MIN_COL_WIDTH_PERCENTAGE = 10;
3
- export declare const MIN_CELL_WIDTH_PERCENTAGE = 5;
4
2
  export declare const MIN_ROW_HEIGHT = 60;
5
3
  export declare const MAX_ROW_HEIGHT = 1500;
6
4
  export declare const WIDGET_HEADER_HEIGHT = 32;
5
+ export declare const MIN_COLUMN_WIDTH = 128;
6
+ export declare const MAX_COLUMN_WIDTH = 2048;
7
7
  export declare const Z_INDEX_RESIZE_OVERLAY = 100;
8
8
  export declare const Z_INDEX_RESIZE_LINE = 101;
9
9
  export declare const Z_INDEX_CELL_DROPZONE = 102;
@@ -1,5 +1,6 @@
1
1
  import { WidgetsPanelColumn, WidgetsPanelColumnLayout, WidgetsPanelLayout, WidgetsPanelRow } from '../../../models';
2
2
  import { EditableLayoutDropData, EditableLayoutDragData } from './types';
3
+ import { WidgetProps } from '../../../index-typedoc';
3
4
  /**
4
5
  * Updates the height of all cells in a specific row within a column layout.
5
6
  *
@@ -96,3 +97,8 @@ export declare const distributeEqualWidthInRow: (layout: WidgetsPanelLayout, col
96
97
  * @internal
97
98
  */
98
99
  export declare function updateLayoutAfterDragAndDrop(layout: WidgetsPanelLayout, dragData: EditableLayoutDragData, dropData: EditableLayoutDropData): WidgetsPanelColumnLayout;
100
+ export declare function getRowHeight(row: WidgetsPanelRow, widgets: WidgetProps[]): number;
101
+ export declare function getRowMaxHeight(row: WidgetsPanelRow): number;
102
+ export declare function getRowMinHeight(row: WidgetsPanelRow): number;
103
+ export declare function getColumnMinWidths(row: WidgetsPanelRow): number[];
104
+ export declare function getColumnMaxWidths(row: WidgetsPanelRow): number[];
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { type Filter } from '@sisense/sdk-data';
2
- interface JTDDashboardProps {
3
+ interface JtdDashboardProps {
3
4
  dashboardOid: string;
4
5
  filters: Filter[];
5
6
  mergeTargetDashboardFilters: boolean;
@@ -11,5 +12,5 @@ interface JTDDashboardProps {
11
12
  * This component reuses DashboardById logic but is specifically designed for JTD use cases
12
13
  * @internal
13
14
  */
14
- export declare const JTDDashboard: ({ dashboardOid, filters: runtimeFilters, mergeTargetDashboardFilters, displayToolbarRow, displayFilterPane, }: JTDDashboardProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const JtdDashboard: import("react").FunctionComponent<JtdDashboardProps>;
15
16
  export {};
@@ -0,0 +1,5 @@
1
+ export { getFiltersFromDataPoint, getFormulaContextFilters, filterByAllowedDimensions, handleFormulaDuplicateFilters, mergeJtdFilters, } from './jtd-filters';
2
+ export { getJtdClickHandler, getJtdClickHandlerForMultiplePoints, handleDataPointClick, handleTextWidgetClick, } from './jtd-handlers';
3
+ export { getJumpToDashboardMenuItem, getJumpToDashboardMenuItemForMultiplePoints, } from './jtd-menu';
4
+ export { addPointerCursorToChart, applyClickNavigationForChart, applyClickNavigationForText, applyRightClickNavigation, addJtdIconToHeader, } from './jtd-widget-transforms';
5
+ export { type JtdCoreData, type JtdContext, type JtdActions, type JtdClickHandlerData, type JtdWidgetTransformConfig, type JtdDataPointClickEvent, type JtdMenuItem, } from './jtd-types';
@@ -0,0 +1,129 @@
1
+ import { type Filter } from '@sisense/sdk-data';
2
+ import { WidgetProps } from '../../../props.js';
3
+ import { DataPoint, ScatterDataPoint } from '../../../types';
4
+ import { JtdConfig } from '../../../widget-by-id/types';
5
+ /**
6
+ * Jump to Dashboard (JTD) Filter Merging Logic:
7
+ *
8
+ * When a user clicks on a datapoint to open a JTD modal, multiple types of filters are merged:
9
+ *
10
+ * 1. **Generated Filters**: Created from the clicked datapoint's category and breakBy entries
11
+ * 2. **Dashboard Filters**: Current dashboard filters (filtered by includeDashFilterDims)
12
+ * 3. **Widget Filters**: Original widget-specific filters (filtered by includeWidgetFilterDims)
13
+ * 4. **Formula Context Filters**: NEW - Embedded filters from the clicked widget's datapoint calculations
14
+ *
15
+ * ## Formula Context Filters (New Feature)
16
+ *
17
+ * Formula context filters are embedded within datapoint calculations and represent intrinsic
18
+ * filters that are part of the measure/column computation itself. They are extracted only from
19
+ * the specific widget that was clicked, not from all widgets. For example:
20
+ *
21
+ * ```
22
+ * clickedWidget.dataOptions.value[0].column.context = {
23
+ * "13FC1-655": {
24
+ * "type": "filter",
25
+ * "filterType": "numeric",
26
+ * "attribute": { ... },
27
+ * "valueA": 10,
28
+ * "valueB": 27249.89453125
29
+ * }
30
+ * }
31
+ * ```
32
+ *
33
+ * These filters:
34
+ * - Represent calculation constraints that are intrinsic to the clicked widget's datapoint
35
+ * - Are extracted from all dataOption fields of the clicked widget (value, category, breakBy, x, y, etc.)
36
+ * - Support both object format and string reference format
37
+ *
38
+ * ## Duplicate Filter Handling
39
+ *
40
+ * Complex formulas like `AVG(cost) - AVG(PREVMONTH(cost))` can contain multiple filters on the same dimension.
41
+ * The `sendFormulaFiltersDuplicate` parameter controls how duplicates are handled:
42
+ *
43
+ * - **"none"**: Exclude all duplicate filters (only include filters that appear once)
44
+ * - **Number (1+)**: Include only the filter at that position (1-indexed). Invalid numbers treated as "none"
45
+ * - **Other values**: Include only the first duplicate filter
46
+ *
47
+ * Examples:
48
+ * - Formula has 2 filters on Commerce.Cost dimension
49
+ * - `sendFormulaFiltersDuplicate = "none"` → No Cost filters included
50
+ * - `sendFormulaFiltersDuplicate = 1` → Include first Cost filter
51
+ * - `sendFormulaFiltersDuplicate = 2` → Include second Cost filter
52
+ * - `sendFormulaFiltersDuplicate = 3` → Invalid (out of range), treat as "none"
53
+ */
54
+ /**
55
+ * Extract formula context filters from data point
56
+ *
57
+ * @param clickedWidget - The clicked widget
58
+ * @param jtdConfig - The JTD configuration
59
+ * @returns Array of formula context filters
60
+ */
61
+ export declare const getFormulaContextFilters: (clickedWidget: WidgetProps, jtdConfig: JtdConfig) => Filter[];
62
+ /**
63
+ * Handle duplicate formula filters based on sendFormulaFiltersDuplicate parameter
64
+ *
65
+ * @param filters - The filters to handle
66
+ * @param sendFormulaFiltersDuplicate - The send formula filters duplicate parameter
67
+ * @returns The filtered filters
68
+ * @internal
69
+ */
70
+ export declare const handleFormulaDuplicateFilters: (filters: Filter[], sendFormulaFiltersDuplicate?: number | 'none') => Filter[];
71
+ /**
72
+ * Type guard to check if a data point is a ScatterDataPoint.
73
+ * Checks for actual scatter chart structure (x/y coordinates) and scatter-only properties.
74
+ *
75
+ * @param point - The data point to check
76
+ * @returns True if the point is a ScatterDataPoint, false otherwise
77
+ * @internal
78
+ */
79
+ export declare const isScatterDataPoint: (point: DataPoint | ScatterDataPoint) => point is ScatterDataPoint;
80
+ /**
81
+ * Extracts filters from scatter chart data point (breakByColor and breakByPoint).
82
+ *
83
+ * @param point - The scatter data point
84
+ * @returns Array of filters generated from scatter chart breakBy properties
85
+ * @internal
86
+ */
87
+ export declare const getFiltersFromScatterDataPoint: (point: ScatterDataPoint) => Filter[];
88
+ /**
89
+ * Extracts filters from regular chart data point (category and breakBy array).
90
+ * Also processes any scatter properties (breakByColor/breakByPoint) if present.
91
+ *
92
+ * @param point - The regular data point (may have mixed properties)
93
+ * @returns Array of filters generated from all available entries
94
+ * @internal
95
+ */
96
+ export declare const getFiltersFromRegularDataPoint: (point: DataPoint) => Filter[];
97
+ /**
98
+ * Extracts filters from a data point for Jump To Dashboard functionality.
99
+ *
100
+ * This function handles both regular DataPoint and ScatterDataPoint types:
101
+ * - If data point has scatter properties (breakByColor/breakByPoint), process as scatter chart
102
+ * - Otherwise, process as regular chart (category/breakBy entries)
103
+ * - Scatter properties take priority over regular properties when both exist
104
+ *
105
+ * @param point - The data point from chart interaction
106
+ * @returns Array of filters generated from the data point
107
+ * @internal
108
+ */
109
+ export declare const getFiltersFromDataPoint: (point: DataPoint | ScatterDataPoint) => Filter[];
110
+ /**
111
+ * Filter filters based on allowed dimension names, supporting cascading filters
112
+ *
113
+ * @param filters - The filters to filter
114
+ * @param allowedDims - The allowed dimensions
115
+ * @returns The filtered filters
116
+ * @internal
117
+ */
118
+ export declare const filterByAllowedDimensions: (filters: Filter[], allowedDims?: string[]) => Filter[];
119
+ /**
120
+ * Merge all types of filters for JTD functionality
121
+ *
122
+ * @param generatedFilters - Filters generated from data point
123
+ * @param dashboardFilters - Current dashboard filters
124
+ * @param widgetFilters - Widget-specific filters
125
+ * @param formulaContextFilters - Formula context filters
126
+ * @returns Merged filters array
127
+ * @internal
128
+ */
129
+ export declare const mergeJtdFilters: (generatedFilters: Filter[], dashboardFilters: Filter[], widgetFilters: Filter[], formulaContextFilters: Filter[]) => Filter[];
@@ -0,0 +1,46 @@
1
+ import { type Filter } from '@sisense/sdk-data';
2
+ import { WidgetProps } from '../../../props.js';
3
+ import { JtdConfig } from '../../../widget-by-id/types';
4
+ import { OpenModalFn } from '../../../common/components/modal/modal-context';
5
+ import { JtdCoreData, JtdContext, JtdActions, JtdClickHandlerData, JtdDataPointClickEvent } from './jtd-types';
6
+ /**
7
+ * Get the JTD click handler for a specific data point of the specific widget
8
+ *
9
+ * @param data - Core data with drill target (config, drill target, widget props, point)
10
+ * @param context - Context data (filters)
11
+ * @param actions - Action functions
12
+ * @returns The JTD click handler
13
+ * @internal
14
+ */
15
+ export declare const getJtdClickHandler: (data: JtdClickHandlerData, context: JtdContext, actions: Pick<JtdActions, 'openModal'>) => () => Promise<string>;
16
+ /**
17
+ * Get the JTD click handler for multiple data points
18
+ *
19
+ * @param data - Core data with drill target (config, drill target, widget props, points)
20
+ * @param context - Context data (filters)
21
+ * @param actions - Action functions
22
+ * @returns The JTD click handler
23
+ * @internal
24
+ */
25
+ export declare const getJtdClickHandlerForMultiplePoints: (data: JtdClickHandlerData, context: JtdContext, actions: Pick<JtdActions, 'openModal'>) => () => void;
26
+ /**
27
+ * Handle data point click for chart widgets
28
+ *
29
+ * @param coreData - Core data (config, widget props, point)
30
+ * @param context - Context data (filters)
31
+ * @param actions - Action functions
32
+ * @param event - Event-related data
33
+ * @internal
34
+ */
35
+ export declare const handleDataPointClick: (coreData: JtdCoreData, context: JtdContext, actions: Pick<JtdActions, 'openModal' | 'openMenu' | 'translate'>, event: JtdDataPointClickEvent) => void | Promise<string>;
36
+ /**
37
+ * Handle text widget click (placeholder for future implementation)
38
+ *
39
+ * @param jtdConfig - The JTD config
40
+ * @param widgetProps - The widget props
41
+ * @param dashboardFilters - The dashboard filters
42
+ * @param originalWidgetFilters - The original widget filters
43
+ * @param openModal - The open modal function
44
+ * @internal
45
+ */
46
+ export declare const handleTextWidgetClick: (jtdConfig: JtdConfig, widgetProps: WidgetProps, dashboardFilters: Filter[], originalWidgetFilters: Filter[], openModal: OpenModalFn) => Promise<string>;
@@ -0,0 +1,47 @@
1
+ import { JtdCoreData, JtdContext, JtdActions } from './jtd-types';
2
+ /**
3
+ * Get the JTD menu item for a specific data point of the specific widget
4
+ *
5
+ * @param coreData - Core data (config, widget props, point)
6
+ * @param context - Context data (filters)
7
+ * @param actions - Action functions
8
+ * @returns The JTD menu item
9
+ * @internal
10
+ */
11
+ export declare const getJumpToDashboardMenuItem: (coreData: JtdCoreData, context: JtdContext, actions: Pick<JtdActions, 'openModal' | 'translate'>) => {
12
+ caption: string;
13
+ subItems: {
14
+ items: {
15
+ caption: string;
16
+ onClick: () => Promise<string>;
17
+ }[];
18
+ }[];
19
+ onClick?: undefined;
20
+ } | {
21
+ caption: string;
22
+ onClick: () => Promise<string>;
23
+ subItems?: undefined;
24
+ } | null;
25
+ /**
26
+ * Get the JTD menu item for multiple data points of the specific widget
27
+ *
28
+ * @param coreData - Core data (config, widget props, points)
29
+ * @param context - Context data (filters)
30
+ * @param actions - Action functions
31
+ * @returns The JTD menu item
32
+ * @internal
33
+ */
34
+ export declare const getJumpToDashboardMenuItemForMultiplePoints: (coreData: JtdCoreData, context: JtdContext, actions: Pick<JtdActions, 'openModal' | 'translate'>) => {
35
+ caption: string;
36
+ subItems: {
37
+ items: {
38
+ caption: string;
39
+ onClick: () => void;
40
+ }[];
41
+ }[];
42
+ onClick?: undefined;
43
+ } | {
44
+ caption: string;
45
+ onClick: () => void;
46
+ subItems?: undefined;
47
+ } | null;
@@ -0,0 +1,93 @@
1
+ import { type Filter } from '@sisense/sdk-data';
2
+ import { WidgetProps } from '../../../props.js';
3
+ import { DataPoint } from '../../../types';
4
+ import { JtdConfig, JtdDrillTarget } from '../../../widget-by-id/types';
5
+ import { OpenModalFn } from '../../../common/components/modal/modal-context';
6
+ import { OpenMenuFn } from '../../../common/components/menu/types.js';
7
+ /**
8
+ * Menu item structure for JTD navigation
9
+ *
10
+ * @internal
11
+ */
12
+ export type JtdMenuItem = {
13
+ caption: string;
14
+ onClick?: () => void;
15
+ subItems?: Array<{
16
+ items: Array<{
17
+ caption: string;
18
+ onClick: () => void;
19
+ }>;
20
+ }>;
21
+ } | null;
22
+ /**
23
+ * Base interface for core JTD data used across all JTD functions
24
+ *
25
+ * @internal
26
+ */
27
+ export interface JtdCoreData {
28
+ /** The JTD config */
29
+ jtdConfig: JtdConfig;
30
+ /** The widget props */
31
+ widgetProps: WidgetProps;
32
+ /** The data point (single point) */
33
+ point?: DataPoint;
34
+ /** The data points (multiple points) */
35
+ points?: DataPoint[];
36
+ }
37
+ /**
38
+ * Base interface for JTD context data (filters) used across all JTD functions
39
+ *
40
+ * @internal
41
+ */
42
+ export interface JtdContext {
43
+ /** The dashboard filters */
44
+ dashboardFilters: Filter[];
45
+ /** The original widget filters */
46
+ originalWidgetFilters: Filter[];
47
+ }
48
+ /**
49
+ * Base interface for JTD action functions
50
+ *
51
+ * @internal
52
+ */
53
+ export interface JtdActions {
54
+ /** The open modal function */
55
+ openModal: OpenModalFn;
56
+ /** The open menu function (optional) */
57
+ openMenu?: OpenMenuFn;
58
+ /** The translation function (optional) */
59
+ translate?: (key: string) => string;
60
+ }
61
+ /**
62
+ * Extended core data for JTD click handlers that includes drill target
63
+ *
64
+ * @internal
65
+ */
66
+ export interface JtdClickHandlerData extends JtdCoreData {
67
+ /** The drill target */
68
+ drillTarget: JtdDrillTarget;
69
+ }
70
+ /**
71
+ * Configuration for widget transforms, combining config and context
72
+ *
73
+ * @internal
74
+ */
75
+ export interface JtdWidgetTransformConfig {
76
+ /** The JTD config */
77
+ jtdConfig: JtdConfig;
78
+ /** The dashboard filters */
79
+ dashboardFilters: Filter[];
80
+ /** The original widget filters */
81
+ originalWidgetFilters: Filter[];
82
+ }
83
+ /**
84
+ * Event-related data for handling data point clicks
85
+ *
86
+ * @internal
87
+ */
88
+ export interface JtdDataPointClickEvent {
89
+ /** The native event */
90
+ nativeEvent: PointerEvent;
91
+ /** Function to get menu item */
92
+ getJumpToDashboardMenuItem: (coreData: JtdCoreData, context: JtdContext, actions: Pick<JtdActions, 'openModal' | 'translate'>) => JtdMenuItem;
93
+ }
@@ -0,0 +1,48 @@
1
+ import { WidgetProps } from '../../../props.js';
2
+ import { JtdActions, JtdWidgetTransformConfig } from './jtd-types';
3
+ /**
4
+ * Add pointer cursor to chart widgets that support it
5
+ *
6
+ * @param widgetProps - The widget props
7
+ * @returns Updated widget props with pointer cursor
8
+ * @internal
9
+ */
10
+ export declare const addPointerCursorToChart: (widgetProps: WidgetProps) => WidgetProps;
11
+ /**
12
+ * Apply JTD click navigation for chart widgets
13
+ *
14
+ * @param widgetProps - The widget props
15
+ * @param config - The JTD configuration and context
16
+ * @param actions - The action functions
17
+ * @returns Updated widget props with click navigation
18
+ * @internal
19
+ */
20
+ export declare const applyClickNavigationForChart: (widgetProps: WidgetProps, config: JtdWidgetTransformConfig, actions: Pick<JtdActions, 'openModal' | 'openMenu' | 'translate'>) => WidgetProps;
21
+ /**
22
+ * Apply JTD click navigation for text widgets
23
+ *
24
+ * @param widgetProps - The widget props
25
+ * @param config - The JTD configuration and context
26
+ * @param actions - The action functions for modal operations
27
+ * @returns Updated widget props with click navigation
28
+ * @internal
29
+ */
30
+ export declare const applyClickNavigationForText: (widgetProps: WidgetProps, config: JtdWidgetTransformConfig, actions: Pick<JtdActions, 'openModal'>) => WidgetProps;
31
+ /**
32
+ * Apply JTD right-click navigation for chart widgets
33
+ *
34
+ * @param widgetProps - The widget props
35
+ * @param config - The JTD configuration and context
36
+ * @param actions - The action functions
37
+ * @returns Updated widget props with right-click navigation
38
+ * @internal
39
+ */
40
+ export declare const applyRightClickNavigation: (widgetProps: WidgetProps, config: JtdWidgetTransformConfig, actions: Pick<JtdActions, 'openModal' | 'openMenu' | 'translate'>) => WidgetProps;
41
+ /**
42
+ * Add JTD icon to widget header if configured
43
+ *
44
+ * @param widgetProps - The widget props
45
+ * @returns Updated widget props with JTD icon in header
46
+ * @internal
47
+ */
48
+ export declare const addJtdIconToHeader: (widgetProps: WidgetProps) => WidgetProps;