@sisense/sdk-ui 2.1.1 → 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.
- package/dist/ai.cjs +39 -27
- package/dist/ai.js +1650 -1266
- package/dist/analytics-composer.cjs +24 -24
- package/dist/analytics-composer.js +131 -127
- package/dist/derive-chart-family-BtTi3OxL.js +90465 -0
- package/dist/derive-chart-family-DeTlU_Wm.cjs +669 -0
- package/dist/{dimensions-BBfnA6e8.cjs → dimensions-DpBTdNJ_.cjs} +1 -1
- package/dist/{dimensions-DOWF8q44.js → dimensions-Xxab6o5s.js} +13 -13
- package/dist/index.cjs +22 -22
- package/dist/index.js +12682 -12517
- package/dist/index.umd.js +1578 -0
- package/dist/packages/sdk-ui/src/ai/api/types.d.ts +2 -0
- package/dist/packages/sdk-ui/src/ai/common/icon-button.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/analytics-composer/widget/chart-options/get-widget-options.d.ts +23 -7
- package/dist/packages/sdk-ui/src/api/rest-api.d.ts +1 -0
- package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +7 -0
- package/dist/packages/sdk-ui/src/app/client-application.d.ts +16 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/chart-builder-factory.d.ts +3 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/alerts.d.ts +3 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/{helpers/cartesians → highchart-based-charts/cartesians/helpers}/data-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/data.d.ts +4 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/get-legacy-cartesian-chart-options.d.ts +3 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/bar-chart/bar-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/bar-chart/highcharts-options-builder.d.ts +2 -0
- 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
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/column-chart/highcharts-options-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/{helpers/cartesians/stackable → highchart-based-charts/cartesians/stackable/helpers}/design-options.d.ts +3 -3
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/types.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/build-highchart-options.d.ts +20 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/highcharts-based-chart-renderer.d.ts +39 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/utils.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/types.d.ts +28 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/chart/types.d.ts +0 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/apply-event-handlers.d.ts +15 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/common-highcharts-option-service.d.ts +9 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/subtype-to-design-options.d.ts +2 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/theme-option-service.d.ts +8 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +4 -1
- package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/group.d.ts +1 -0
- package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/types.d.ts +3 -0
- package/dist/packages/sdk-ui/src/common/components/loading-overlay.d.ts +1 -3
- package/dist/packages/sdk-ui/src/common/components/menu/menu-ids.d.ts +10 -1
- package/dist/packages/sdk-ui/src/common/components/menu/types.d.ts +2 -0
- package/dist/packages/sdk-ui/src/common/components/modal/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/common/components/modal/modal-context.d.ts +39 -0
- package/dist/packages/sdk-ui/src/common/components/modal/modal-provider.d.ts +19 -0
- package/dist/packages/sdk-ui/src/common/components/popover.d.ts +10 -0
- package/dist/packages/sdk-ui/src/common/hooks/use-combined-menu.d.ts +4 -8
- package/dist/packages/sdk-ui/src/common/hooks/use-state-with-history.d.ts +64 -0
- package/dist/packages/sdk-ui/src/dashboard/components/dashboard-header.d.ts +1 -1
- package/dist/packages/sdk-ui/src/dashboard/components/jtd-dashboard.d.ts +15 -0
- package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +7 -1
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-dashboard-header-toolbar.d.ts +17 -0
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-edit-mode-toolbar.d.ts +52 -0
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-jtd.d.ts +113 -0
- package/dist/packages/sdk-ui/src/dashboard/types.d.ts +11 -2
- package/dist/packages/sdk-ui/src/data-browser/data-schema-browser/data-schema-browser.d.ts +14 -0
- package/dist/packages/sdk-ui/src/data-browser/data-schema-browser/data-schema-browser.styles.d.ts +6 -0
- package/dist/packages/sdk-ui/src/data-browser/dimensions-browser/types.d.ts +5 -0
- package/dist/packages/sdk-ui/src/decorators/component-decorators/as-sisense-component.d.ts +2 -0
- package/dist/packages/sdk-ui/src/decorators/component-decorators/with-modal.d.ts +6 -0
- package/dist/packages/sdk-ui/src/error-boundary/error-boundary.d.ts +6 -2
- package/dist/packages/sdk-ui/src/index.d.ts +2 -1
- package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +7 -0
- package/dist/packages/sdk-ui/src/models/dashboard/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +3 -1
- package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +7 -1
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +14 -5
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +18 -17
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-persistence.d.ts +34 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-render-pivot.d.ts +4 -4
- package/dist/packages/sdk-ui/src/plugins-provider/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/props.d.ts +7 -4
- package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +16 -0
- package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +32 -0
- package/dist/packages/sdk-ui/src/types.d.ts +26 -3
- package/dist/packages/sdk-ui/src/utils/filter-relations.d.ts +4 -4
- package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +72 -0
- package/dist/packages/sdk-ui/src/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widgets/tabber-widget.d.ts +2 -1
- package/dist/use-common-filters-B2N7j9H-.cjs +350 -0
- package/dist/use-common-filters-BC4Vg9wu.js +32068 -0
- package/dist/{widget-composer-BZwsi1mW.js → widget-composer-Bj5DrCSm.js} +111 -98
- package/dist/{widget-composer-Bv_aqjLX.cjs → widget-composer-DjREvygd.cjs} +7 -7
- package/package.json +23 -19
- package/dist/derive-chart-family-C8duLtwv.js +0 -102033
- package/dist/derive-chart-family-CQ1Myy0A.cjs +0 -758
- package/dist/packages/sdk-ui/src/chart/restructured-charts/bar-chart/bar-chart-builder.d.ts +0 -2
- package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/cartesians/data.d.ts +0 -4
- package/dist/packages/sdk-ui/src/widget-by-id/use-get-dashboard-model-and-widget-model.d.ts +0 -14
- package/dist/use-common-filters--6cyMg9O.js +0 -28797
- package/dist/use-common-filters-NTIrYvRs.cjs +0 -271
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
interface UseStateWithHistoryOptions<T> {
|
|
2
|
+
/**
|
|
3
|
+
* Maximum number of history entries to store
|
|
4
|
+
* @default 10
|
|
5
|
+
*/
|
|
6
|
+
capacity?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Initial history entries
|
|
9
|
+
* @default []
|
|
10
|
+
*/
|
|
11
|
+
initialHistory?: T[];
|
|
12
|
+
}
|
|
13
|
+
interface StateWithHistoryResult<T> {
|
|
14
|
+
/** Current state value */
|
|
15
|
+
state: T;
|
|
16
|
+
/** All history entries */
|
|
17
|
+
history: T[];
|
|
18
|
+
/** Index of the current state in history */
|
|
19
|
+
currentIndex: number;
|
|
20
|
+
/** Set state and add to history */
|
|
21
|
+
setState: (value: T | ((prev: T) => T)) => void;
|
|
22
|
+
/** Go back to the previous state in history */
|
|
23
|
+
undo: () => void;
|
|
24
|
+
/** Go forward to the next state in history */
|
|
25
|
+
redo: () => void;
|
|
26
|
+
/** Whether there's a previous state to go back to */
|
|
27
|
+
canUndo: boolean;
|
|
28
|
+
/** Whether there's a next state to go forward to */
|
|
29
|
+
canRedo: boolean;
|
|
30
|
+
/** Go to a specific point in history by index */
|
|
31
|
+
goTo: (index: number) => void;
|
|
32
|
+
/** Clear all history except current state */
|
|
33
|
+
clearHistory: () => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A hook that provides state management with history tracking for undo/redo functionality.
|
|
37
|
+
*
|
|
38
|
+
* @param initialState - The initial state value
|
|
39
|
+
* @param options - Configuration options for history management
|
|
40
|
+
* @returns An object containing the current state, history, and methods to navigate through history
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* const {
|
|
45
|
+
* state,
|
|
46
|
+
* setState,
|
|
47
|
+
* undo,
|
|
48
|
+
* redo,
|
|
49
|
+
* canUndo,
|
|
50
|
+
* canRedo
|
|
51
|
+
* } = useStateWithHistory({ count: 0 });
|
|
52
|
+
*
|
|
53
|
+
* // Update state
|
|
54
|
+
* setState({ count: state.count + 1 });
|
|
55
|
+
*
|
|
56
|
+
* // Undo last action if possible
|
|
57
|
+
* if (canUndo) undo();
|
|
58
|
+
*
|
|
59
|
+
* // Redo last undone action if possible
|
|
60
|
+
* if (canRedo) redo();
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function useStateWithHistory<T>(initialState: T, options?: UseStateWithHistoryOptions<T>): StateWithHistoryResult<T>;
|
|
64
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DashboardHeaderProps } from '../../dashboard/types';
|
|
2
2
|
export declare const DASHBOARD_HEADER_HEIGHT = 48;
|
|
3
|
-
export declare const DashboardHeader: ({ title }: DashboardHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const DashboardHeader: ({ title, toolbar }: DashboardHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Filter } from '@sisense/sdk-data';
|
|
2
|
+
interface JTDDashboardProps {
|
|
3
|
+
dashboardOid: string;
|
|
4
|
+
filters: Filter[];
|
|
5
|
+
mergeTargetDashboardFilters: boolean;
|
|
6
|
+
displayToolbarRow: boolean;
|
|
7
|
+
displayFilterPane: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* JTD-specific Dashboard component that handles runtime filters
|
|
11
|
+
* This component reuses DashboardById logic but is specifically designed for JTD use cases
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const JTDDashboard: ({ dashboardOid, filters: runtimeFilters, mergeTargetDashboardFilters, displayToolbarRow, displayFilterPane, }: JTDDashboardProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DashboardProps } from '../dashboard/types';
|
|
3
3
|
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
4
|
+
import { WidgetsPanelLayout } from '../models';
|
|
4
5
|
export declare enum DashboardChangeType {
|
|
5
6
|
/** Dashboard filters have been updated */
|
|
6
7
|
FILTERS_UPDATE = "FILTERS.UPDATE",
|
|
7
8
|
/** Filters panel collapsed state changed */
|
|
8
|
-
UI_FILTERS_PANEL_COLLAPSE = "UI.FILTERS.PANEL.COLLAPSE"
|
|
9
|
+
UI_FILTERS_PANEL_COLLAPSE = "UI.FILTERS.PANEL.COLLAPSE",
|
|
10
|
+
/** Widgets panel layout updated */
|
|
11
|
+
WIDGETS_PANEL_LAYOUT_UPDATE = "WIDGETS_PANEL_LAYOUT.UPDATE"
|
|
9
12
|
}
|
|
10
13
|
export type DashboardChangeAction = {
|
|
11
14
|
type: DashboardChangeType.FILTERS_UPDATE;
|
|
@@ -13,6 +16,9 @@ export type DashboardChangeAction = {
|
|
|
13
16
|
} | {
|
|
14
17
|
type: DashboardChangeType.UI_FILTERS_PANEL_COLLAPSE;
|
|
15
18
|
payload: boolean;
|
|
19
|
+
} | {
|
|
20
|
+
type: DashboardChangeType.WIDGETS_PANEL_LAYOUT_UPDATE;
|
|
21
|
+
payload: WidgetsPanelLayout;
|
|
16
22
|
};
|
|
17
23
|
/**
|
|
18
24
|
* React component that renders a dashboard whose elements are customizable. It includes internal logic of applying common filters to widgets.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DashboardHeaderToolbarMenuItem {
|
|
3
|
+
title: string;
|
|
4
|
+
icon?: JSX.Element;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface UseDashboardHeaderToolbarProps {
|
|
9
|
+
menuItems: DashboardHeaderToolbarMenuItem[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hook that returns a toolbar element for dashboard header
|
|
13
|
+
*/
|
|
14
|
+
export declare const useDashboardHeaderToolbar: ({ menuItems }: UseDashboardHeaderToolbarProps) => {
|
|
15
|
+
toolbar: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export default useDashboardHeaderToolbar;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WidgetsPanelLayout } from '../../models';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the useEditModeToolbar hook
|
|
5
|
+
*/
|
|
6
|
+
export interface UseEditModeToolbarProps {
|
|
7
|
+
/**
|
|
8
|
+
* Initial layout to track history for
|
|
9
|
+
*/
|
|
10
|
+
initialLayout: WidgetsPanelLayout;
|
|
11
|
+
/**
|
|
12
|
+
* Optional callback when layout is applied
|
|
13
|
+
*/
|
|
14
|
+
onApply?: (layout: WidgetsPanelLayout) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Optional callback when edit is canceled
|
|
17
|
+
*/
|
|
18
|
+
onCancel?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Maximum number of history entries to store
|
|
21
|
+
* @default 20
|
|
22
|
+
*/
|
|
23
|
+
historyCapacity?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Return type for the useEditModeToolbar hook
|
|
27
|
+
*/
|
|
28
|
+
export interface UseEditModeToolbarResult {
|
|
29
|
+
/**
|
|
30
|
+
* Current layout state
|
|
31
|
+
*/
|
|
32
|
+
layout: WidgetsPanelLayout;
|
|
33
|
+
/**
|
|
34
|
+
* Function to update layout state and track in history
|
|
35
|
+
*/
|
|
36
|
+
setLayout: (layout: WidgetsPanelLayout | ((prev: WidgetsPanelLayout) => WidgetsPanelLayout)) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Whether there are unsaved changes
|
|
39
|
+
*/
|
|
40
|
+
hasChanges: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Toolbar component with undo, redo, cancel, apply buttons
|
|
43
|
+
*/
|
|
44
|
+
toolbar: () => JSX.Element;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Hook that provides layout state management with history tracking and a toolbar with undo/redo/cancel/apply buttons
|
|
48
|
+
*
|
|
49
|
+
* @param props Configuration options for the toolbar
|
|
50
|
+
* @returns Layout state and toolbar component
|
|
51
|
+
*/
|
|
52
|
+
export declare function useEditModeToolbar({ initialLayout, onApply, onCancel, historyCapacity, }: UseEditModeToolbarProps): UseEditModeToolbarResult;
|
|
@@ -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
|
+
};
|
|
@@ -3,6 +3,7 @@ import { WidgetProps } from '../props';
|
|
|
3
3
|
import { DashboardChangeAction } from '../dashboard/dashboard';
|
|
4
4
|
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
5
5
|
import { FiltersPanelConfig } from '../filters/components/filters-panel/types';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
6
7
|
export type { DashboardStyleOptions, WidgetsPanelColumnLayout, WidgetsPanelLayout, WidgetsPanelCell, WidgetsPanelRow, WidgetsPanelColumn, } from '../models';
|
|
7
8
|
/**
|
|
8
9
|
* Props of the {@link DashboardById} component.
|
|
@@ -88,9 +89,16 @@ export interface DashboardConfig {
|
|
|
88
89
|
*/
|
|
89
90
|
responsive?: boolean;
|
|
90
91
|
/**
|
|
91
|
-
* If true
|
|
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.
|
|
92
96
|
*
|
|
93
|
-
*
|
|
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
|
|
94
102
|
*/
|
|
95
103
|
editMode?: boolean;
|
|
96
104
|
};
|
|
@@ -170,4 +178,5 @@ export interface DashboardProps {
|
|
|
170
178
|
*/
|
|
171
179
|
export interface DashboardHeaderProps {
|
|
172
180
|
title: string;
|
|
181
|
+
toolbar?: () => ReactNode;
|
|
173
182
|
}
|
|
@@ -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 {};
|
package/dist/packages/sdk-ui/src/data-browser/data-schema-browser/data-schema-browser.styles.d.ts
ADDED
|
@@ -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
|
/**
|
|
@@ -8,11 +8,14 @@ interface ErrorBoundaryProps {
|
|
|
8
8
|
error?: AbstractTranslatableError | Error | string;
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
resetKeys?: any[];
|
|
11
|
-
onError?: (error: Error) => void;
|
|
11
|
+
onError?: (error: Error) => void | ReactNode;
|
|
12
12
|
isContainerComponent?: boolean;
|
|
13
|
+
/** If set to true, children will be rendered when an error is provided via props, but not when caught during rendering */
|
|
14
|
+
shouldRenderChildrenWithProvidedError?: boolean;
|
|
13
15
|
}
|
|
14
16
|
type ErrorBoundaryState = {
|
|
15
17
|
error: AbstractTranslatableError | Error | string | null;
|
|
18
|
+
customErrorUI: ReactNode | null;
|
|
16
19
|
};
|
|
17
20
|
/**
|
|
18
21
|
* This component is used to catch errors thrown by the UI component and display an error message
|
|
@@ -24,11 +27,12 @@ type ErrorBoundaryState = {
|
|
|
24
27
|
*/
|
|
25
28
|
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
26
29
|
showErrorBox: boolean;
|
|
27
|
-
onError?: (error: Error) => void;
|
|
30
|
+
onError?: (error: Error) => void | ReactNode;
|
|
28
31
|
isContainerComponent: boolean;
|
|
29
32
|
constructor(props: ErrorBoundaryProps);
|
|
30
33
|
static getDerivedStateFromError(error: Error): {
|
|
31
34
|
error: Error;
|
|
35
|
+
customErrorUI: null;
|
|
32
36
|
};
|
|
33
37
|
componentDidCatch(error: Error): void;
|
|
34
38
|
componentDidUpdate(prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState): void;
|
|
@@ -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';
|
|
@@ -2,6 +2,7 @@ import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
|
2
2
|
import { DashboardStyleOptions, TabbersOptions, WidgetModel } from '../../models';
|
|
3
3
|
import { type WidgetsOptions } from './types';
|
|
4
4
|
import { DashboardLayoutOptions } from '../../dashboard';
|
|
5
|
+
import { DashboardSettings } from '../../api/types/dashboard-dto';
|
|
5
6
|
/**
|
|
6
7
|
* Model of Sisense Fusion dashboard defined in the abstractions of Compose SDK.
|
|
7
8
|
*
|
|
@@ -55,4 +56,10 @@ export interface DashboardModel {
|
|
|
55
56
|
* @internal
|
|
56
57
|
*/
|
|
57
58
|
tabbersOptions?: TabbersOptions;
|
|
59
|
+
/**
|
|
60
|
+
* Dashboard settings.
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
settings?: DashboardSettings;
|
|
58
65
|
}
|
|
@@ -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 { Filter } from '@sisense/sdk-data';
|
|
2
|
-
import { CascadingFilterDto, FilterDto } from '../../api/types/dashboard-dto';
|
|
2
|
+
import { CascadingFilterDto, FilterDto, LayoutDto } from '../../api/types/dashboard-dto';
|
|
3
|
+
import { WidgetsPanelLayout } from '../../dashboard/types';
|
|
3
4
|
/**
|
|
4
5
|
* Translates a {@link Filter} to a {@link FilterDto}.
|
|
5
6
|
*
|
|
@@ -8,3 +9,4 @@ import { CascadingFilterDto, FilterDto } from '../../api/types/dashboard-dto';
|
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
10
11
|
export declare function filterToFilterDto(filter: Filter): FilterDto | CascadingFilterDto;
|
|
12
|
+
export declare function layoutToLayoutDto(layout: WidgetsPanelLayout): LayoutDto;
|
|
@@ -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,9 +50,14 @@ 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
|
-
* Options for
|
|
60
|
+
* Options for TabberWidets in a dashboard
|
|
55
61
|
*
|
|
56
62
|
* This property actually moves responsibility on the layout management from the tabber widgets to the dashboard,
|
|
57
63
|
* storing all the tabbers configs in the single place
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DashboardModel, WidgetModel } from '../../../models';
|
|
1
|
+
import { DashboardModel, WidgetModel, WidgetsPanelLayout } from '../../../models';
|
|
2
2
|
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
3
3
|
import { RestApi } from '../../../api/rest-api';
|
|
4
4
|
export type UseDashboardModelState = DashboardModel | null;
|
|
@@ -8,8 +8,7 @@ export type UseDashboardModelState = DashboardModel | null;
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export declare enum UseDashboardModelActionTypeInternal {
|
|
11
|
-
DASHBOARD_INIT = "DASHBOARD.INIT"
|
|
12
|
-
DASHBOARD_UPDATE_LAYOUT = "DASHBOARD.UPDATE_LAYOUT"
|
|
11
|
+
DASHBOARD_INIT = "DASHBOARD.INIT"
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
15
14
|
* Action types for the dashboard model state used in {@link useDashboardModel}.
|
|
@@ -18,7 +17,8 @@ export declare enum UseDashboardModelActionTypeInternal {
|
|
|
18
17
|
*/
|
|
19
18
|
export declare enum UseDashboardModelActionType {
|
|
20
19
|
FILTERS_UPDATE = "FILTERS.UPDATE",
|
|
21
|
-
ADD_WIDGET = "WIDGETS.ADD"
|
|
20
|
+
ADD_WIDGET = "WIDGETS.ADD",
|
|
21
|
+
WIDGETS_PANEL_LAYOUT_UPDATE = "WIDGETS_PANEL_LAYOUT.UPDATE"
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Internal actions for the dashboard model state used in {@link useDashboardModel}.
|
|
@@ -34,7 +34,7 @@ export type UseDashboardModelInternalAction = UseDashboardModelAction | {
|
|
|
34
34
|
*
|
|
35
35
|
* @internal
|
|
36
36
|
*/
|
|
37
|
-
export type UseDashboardModelAction = UseDashboardModelFilterUpdateAction | UseDashboardModelAddWidgetAction;
|
|
37
|
+
export type UseDashboardModelAction = UseDashboardModelFilterUpdateAction | UseDashboardModelAddWidgetAction | UseDashboardModelLayoutUpdateAction;
|
|
38
38
|
/**
|
|
39
39
|
* Filter update actions for the dashboard model state used in {@link useDashboardModel}.
|
|
40
40
|
*
|
|
@@ -53,6 +53,15 @@ export type UseDashboardModelAddWidgetAction = {
|
|
|
53
53
|
type: UseDashboardModelActionType.ADD_WIDGET;
|
|
54
54
|
payload: WidgetModel;
|
|
55
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Layout update action for the dashboard model state used in {@link useDashboardModel}.
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export type UseDashboardModelLayoutUpdateAction = {
|
|
62
|
+
type: UseDashboardModelActionType.WIDGETS_PANEL_LAYOUT_UPDATE;
|
|
63
|
+
payload: WidgetsPanelLayout;
|
|
64
|
+
};
|
|
56
65
|
/**
|
|
57
66
|
* Reducer for the dashboard model state used in {@link useDashboardModel}.
|
|
58
67
|
*
|
package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GetDashboardModelParams } from '
|
|
2
|
-
import {
|
|
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;
|
package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-persistence.d.ts
ADDED
|
@@ -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;
|