@sisense/sdk-ui 2.1.0 → 2.2.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 +9 -9
- package/dist/ai.js +525 -636
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +70 -70
- package/dist/{derive-chart-family-DjbiaKLQ.cjs → derive-chart-family-BsbFdcgd.cjs} +129 -129
- package/dist/{derive-chart-family-BNMFblR9.js → derive-chart-family-C9IDI6UV.js} +11273 -11244
- package/dist/{dimensions-DeTiL-EZ.js → dimensions-HgrcPa-Q.js} +1 -1
- package/dist/{dimensions-DcsEnPSY.cjs → dimensions-mYUylB-h.cjs} +1 -1
- package/dist/index.cjs +25 -21
- package/dist/index.js +13422 -10141
- 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/common/hooks/use-state-with-history.d.ts +64 -0
- package/dist/packages/sdk-ui/src/dashboard/components/content-panel.d.ts +1 -1
- package/dist/packages/sdk-ui/src/dashboard/components/dashboard-header.d.ts +1 -1
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/cell-drop-overlay.d.ts +34 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/draggable-line.d.ts +24 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/draggable-widget-wrapper.d.ts +28 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/droppable-zone.d.ts +23 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/resizable-columns.d.ts +31 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/resizable-row.d.ts +39 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/row-drop-overlay.d.ts +30 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/const.d.ts +11 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/editable-layout.d.ts +28 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/helpers.d.ts +42 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/types.d.ts +78 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/utils.d.ts +5 -0
- package/dist/packages/sdk-ui/src/dashboard/constants.d.ts +0 -2
- 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/types.d.ts +9 -1
- package/dist/packages/sdk-ui/src/dashboard/use-dashboard-theme.d.ts +4 -0
- package/dist/packages/sdk-ui/src/error-boundary/error-boundary.d.ts +6 -2
- package/dist/packages/sdk-ui/src/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +7 -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 +30 -18
- 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/props.d.ts +4 -1
- package/dist/packages/sdk-ui/src/theme-provider/default-theme-settings.d.ts +3 -0
- package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +9 -0
- package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +18 -0
- package/dist/packages/sdk-ui/src/types.d.ts +14 -0
- package/dist/{use-common-filters-DcFu4qRs.cjs → use-common-filters-BKYG6WGA.cjs} +47 -47
- package/dist/{use-common-filters-CJNwlbbh.js → use-common-filters-DkwU7HJ3.js} +3685 -3550
- package/dist/{widget-composer-BEVCXjFv.js → widget-composer-CACtfvw6.js} +98 -95
- package/dist/{widget-composer-fYnr8SDo.cjs → widget-composer-JVl8mNCt.cjs} +1 -1
- package/package.json +10 -7
|
@@ -33,6 +33,7 @@ export declare class RestApi {
|
|
|
33
33
|
}[] | undefined;
|
|
34
34
|
layout?: import("./types/dashboard-dto").LayoutDto | undefined;
|
|
35
35
|
style?: import("./types/dashboard-dto").DashboardStyleDto | undefined;
|
|
36
|
+
settings?: import("./types/dashboard-dto").DashboardSettings | undefined;
|
|
36
37
|
} & import("../utils/utility-types").AnyObject)[]>;
|
|
37
38
|
/**
|
|
38
39
|
* Get a specific dashboard
|
|
@@ -41,6 +41,12 @@ export type DashboardStyleDto = {
|
|
|
41
41
|
paletteId?: string;
|
|
42
42
|
};
|
|
43
43
|
export declare const isCascadingFilterDto: (filter: FilterDto | CascadingFilterDto) => filter is CascadingFilterDto;
|
|
44
|
+
export type DashboardSettings = {
|
|
45
|
+
autoUpdateOnFiltersChange?: boolean;
|
|
46
|
+
useAcceleration?: boolean;
|
|
47
|
+
aiAssistantEnabled?: boolean;
|
|
48
|
+
managedByTool?: string;
|
|
49
|
+
};
|
|
44
50
|
/**
|
|
45
51
|
* @internal
|
|
46
52
|
*/
|
|
@@ -56,5 +62,6 @@ export type DashboardDto = {
|
|
|
56
62
|
}[];
|
|
57
63
|
layout?: LayoutDto;
|
|
58
64
|
style?: DashboardStyleDto;
|
|
65
|
+
settings?: DashboardSettings;
|
|
59
66
|
} & AnyObject;
|
|
60
67
|
export {};
|
|
@@ -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,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the CellDropOverlay component
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
type CellDropOverlayProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The unique identifier for the cell drop overlay
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* The ID of the widget related to the cell drop overlay
|
|
13
|
+
*/
|
|
14
|
+
widgetId: string;
|
|
15
|
+
/**
|
|
16
|
+
* The index of the column the widget is in
|
|
17
|
+
*/
|
|
18
|
+
columnIndex: number;
|
|
19
|
+
/**
|
|
20
|
+
* The index of the row the widget is in
|
|
21
|
+
*/
|
|
22
|
+
rowIndex: number;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to disable the side zones
|
|
25
|
+
*/
|
|
26
|
+
disableSideZones?: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Renders a cell drop overlay component that displays a replace zone and side zones for drag and drop operations.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare const CellDropOverlay: ({ id, widgetId, columnIndex, rowIndex, disableSideZones, }: CellDropOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export {};
|
package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/draggable-line.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The orientation of the draggable line
|
|
3
|
+
*/
|
|
4
|
+
type DraggableLineOrientation = 'vertical' | 'horizontal';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the DraggableLine component
|
|
7
|
+
*/
|
|
8
|
+
type DraggableLineProps = {
|
|
9
|
+
/**
|
|
10
|
+
* The unique identifier for the draggable line
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* The orientation of the draggable line
|
|
15
|
+
*/
|
|
16
|
+
orientation?: DraggableLineOrientation;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Renders a draggable line component that can be used to resize columns or rows
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare const DraggableLine: ({ id, orientation }: DraggableLineProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EditableLayoutDragData } from '../../../../dashboard/components/editable-layout/types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the DraggableWidgetWrapper component
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
type DraggableWidgetWrapperProps = {
|
|
9
|
+
/**
|
|
10
|
+
* The unique identifier for the draggable widget wrapper
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* The data for the draggable widget wrapper
|
|
15
|
+
*/
|
|
16
|
+
data: EditableLayoutDragData;
|
|
17
|
+
/**
|
|
18
|
+
* The child elements to render inside the wrapper
|
|
19
|
+
*/
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Renders a draggable widget wrapper component that allows for drag and drop operations.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare const DraggableWidgetWrapper: ({ id, data, children }: DraggableWidgetWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/droppable-zone.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EditableLayoutDropData } from '../../../../dashboard/components/editable-layout/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the DroppableZone component
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
type DroppableZoneProps = {
|
|
8
|
+
/**
|
|
9
|
+
* The unique identifier for the droppable zone
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* The data for the droppable zone
|
|
14
|
+
*/
|
|
15
|
+
data: EditableLayoutDropData;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Renders a droppable zone component that allows drop operations.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare const DroppableZone: ({ id, data }: DroppableZoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the ResizableColumns component
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
interface ResizableColumnsProps {
|
|
8
|
+
/**
|
|
9
|
+
* The child elements to render inside the resizable columns
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The widths of the columns (in percentage)
|
|
14
|
+
*/
|
|
15
|
+
widths: number[];
|
|
16
|
+
/**
|
|
17
|
+
* The minimum width of the columns (in percentage)
|
|
18
|
+
*/
|
|
19
|
+
minColWidth: number;
|
|
20
|
+
/**
|
|
21
|
+
* The callback function to call when the widths change
|
|
22
|
+
*/
|
|
23
|
+
onWidthsChange: (widths: number[]) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Renders a resizable columns component that allows for column resizing.
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare const ResizableColumns: ({ children, widths, minColWidth, onWidthsChange, }: ResizableColumnsProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export {};
|
package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/resizable-row.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the ResizableRow component
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
type ResizableRowProps = {
|
|
8
|
+
/**
|
|
9
|
+
* The child elements to render inside the resizable row
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The unique identifier
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* The height of the resizable row
|
|
18
|
+
*/
|
|
19
|
+
height: number;
|
|
20
|
+
/**
|
|
21
|
+
* The minimum height of the resizable row
|
|
22
|
+
*/
|
|
23
|
+
minHeight: number;
|
|
24
|
+
/**
|
|
25
|
+
* The maximum height of the resizable row
|
|
26
|
+
*/
|
|
27
|
+
maxHeight: number;
|
|
28
|
+
/**
|
|
29
|
+
* The callback function to call when the height changes
|
|
30
|
+
*/
|
|
31
|
+
onHeightChange: (height: number) => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Renders a resizable row component that allows for row resizing.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare const ResizableRow: ({ children, id, height, minHeight, maxHeight, onHeightChange, }: ResizableRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the RowDropOverlay component
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
type RowDropOverlayProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The unique identifier
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Referring to the column index
|
|
13
|
+
*/
|
|
14
|
+
columnIndex: number;
|
|
15
|
+
/**
|
|
16
|
+
* Referring to the row index
|
|
17
|
+
*/
|
|
18
|
+
rowIndex?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Whether is referring to the last row (different styling)
|
|
21
|
+
*/
|
|
22
|
+
isLastRow?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Renders a row drop overlay component that allows for drop operations.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const RowDropOverlay: ({ id, columnIndex, rowIndex, isLastRow }: RowDropOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export declare const MIN_ROW_HEIGHT = 60;
|
|
5
|
+
export declare const MAX_ROW_HEIGHT = 1500;
|
|
6
|
+
export declare const WIDGET_HEADER_HEIGHT = 32;
|
|
7
|
+
export declare const Z_INDEX_RESIZE_OVERLAY = 100;
|
|
8
|
+
export declare const Z_INDEX_RESIZE_LINE = 101;
|
|
9
|
+
export declare const Z_INDEX_CELL_DROPZONE = 102;
|
|
10
|
+
export declare const Z_INDEX_ROW_DROPZONE = 103;
|
|
11
|
+
export declare const Z_INDEX_ACTIVE_DRAGGABLE = 104;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { WidgetsPanelLayout } from '../../../models';
|
|
2
|
+
import { WidgetProps } from '../../../props';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link EditableLayout} component.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface EditableLayoutProps {
|
|
9
|
+
/**
|
|
10
|
+
* An object defining how the widgets should be laid out.
|
|
11
|
+
*/
|
|
12
|
+
layout: WidgetsPanelLayout;
|
|
13
|
+
/**
|
|
14
|
+
* A list of widget props to render.
|
|
15
|
+
*/
|
|
16
|
+
widgets: WidgetProps[];
|
|
17
|
+
/**
|
|
18
|
+
* A callback function that is called when the layout changes.
|
|
19
|
+
*/
|
|
20
|
+
onLayoutChange?: (layout: WidgetsPanelLayout) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A React used to render a layout of widgets that can resize and rearrange their positions using drag-and-drop.
|
|
24
|
+
*
|
|
25
|
+
* @param props - {@link EditableLayoutProps}
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare const EditableLayout: ({ layout, widgets, onLayoutChange }: EditableLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { WidgetsPanelColumn, WidgetsPanelColumnLayout, WidgetsPanelLayout } from '../../../models';
|
|
2
|
+
import { EditableLayoutDropData, EditableLayoutDragData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Updates the height of all cells in a specific row within a column layout.
|
|
5
|
+
*
|
|
6
|
+
* @param layout - The current layout to modify
|
|
7
|
+
* @param height - The new height to set for the cells
|
|
8
|
+
* @param columnIndex - The index of the column containing the row to update
|
|
9
|
+
* @param rowIndex - The index of the row to update
|
|
10
|
+
*
|
|
11
|
+
* @returns A new layout with updated cell heights
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function updateRowHeight(layout: WidgetsPanelColumnLayout, height: number, columnIndex: number, rowIndex: number): {
|
|
16
|
+
columns: WidgetsPanelColumn[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Updates the width percentages of columns or cells within a layout.
|
|
20
|
+
*
|
|
21
|
+
* @param layout - The current layout to modify
|
|
22
|
+
* @param widths - Array of width percentages to apply
|
|
23
|
+
* @param parentColumnIndex - Optional index of the parent column when updating cell widths
|
|
24
|
+
* @param parentRowIndex - Optional index of the parent row when updating cell widths
|
|
25
|
+
*
|
|
26
|
+
* @returns A new layout with updated width percentages
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare function updateLayoutWidths(layout: WidgetsPanelLayout, widths: number[], parentColumnIndex?: number, parentRowIndex?: number): WidgetsPanelColumnLayout;
|
|
31
|
+
/**
|
|
32
|
+
* Updates the layout based on drag and drop operations.
|
|
33
|
+
*
|
|
34
|
+
* @param layout - The current layout to modify
|
|
35
|
+
* @param dragData - Data about the dragged widget
|
|
36
|
+
* @param dropData - Data about the drop target and operation type
|
|
37
|
+
*
|
|
38
|
+
* @returns A new layout reflecting the drag and drop operation
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare function updateLayoutAfterDragAndDrop(layout: WidgetsPanelLayout, dragData: EditableLayoutDragData, dropData: EditableLayoutDropData): WidgetsPanelColumnLayout;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of drop operation
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare enum DropType {
|
|
7
|
+
/**
|
|
8
|
+
* Place the cell aside another cell to the left
|
|
9
|
+
*/
|
|
10
|
+
PLACE_LEFT = "PLACE_LEFT",
|
|
11
|
+
/**
|
|
12
|
+
* Place the cell aside another cell to the right
|
|
13
|
+
*/
|
|
14
|
+
PLACE_RIGHT = "PLACE_RIGHT",
|
|
15
|
+
/**
|
|
16
|
+
* Swap the position of two cells
|
|
17
|
+
*/
|
|
18
|
+
SWAP = "SWAP",
|
|
19
|
+
/**
|
|
20
|
+
* Move the cell to a new row
|
|
21
|
+
*/
|
|
22
|
+
NEW_ROW = "NEW_ROW"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Data about the dragged cell
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export type EditableLayoutDragData = {
|
|
30
|
+
/**
|
|
31
|
+
* The unique identifier of the widget
|
|
32
|
+
*/
|
|
33
|
+
widgetId: string;
|
|
34
|
+
/**
|
|
35
|
+
* The column index
|
|
36
|
+
*/
|
|
37
|
+
columnIndex: number;
|
|
38
|
+
/**
|
|
39
|
+
* The row index
|
|
40
|
+
*/
|
|
41
|
+
rowIndex: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Data about the drop target
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export type EditableLayoutDropData = {
|
|
49
|
+
/**
|
|
50
|
+
* The type of drop operation
|
|
51
|
+
*/
|
|
52
|
+
type: DropType.PLACE_LEFT | DropType.PLACE_RIGHT | DropType.SWAP;
|
|
53
|
+
/**
|
|
54
|
+
* The unique identifier of the widget
|
|
55
|
+
*/
|
|
56
|
+
widgetId: string;
|
|
57
|
+
/**
|
|
58
|
+
* The column index
|
|
59
|
+
*/
|
|
60
|
+
columnIndex: number;
|
|
61
|
+
/**
|
|
62
|
+
* The row index
|
|
63
|
+
*/
|
|
64
|
+
rowIndex: number;
|
|
65
|
+
} | {
|
|
66
|
+
/**
|
|
67
|
+
* The type of drop operation
|
|
68
|
+
*/
|
|
69
|
+
type: DropType.NEW_ROW;
|
|
70
|
+
/**
|
|
71
|
+
* The column index
|
|
72
|
+
*/
|
|
73
|
+
columnIndex: number;
|
|
74
|
+
/**
|
|
75
|
+
* The row index
|
|
76
|
+
*/
|
|
77
|
+
rowIndex?: number;
|
|
78
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EditableLayoutDragData, EditableLayoutDropData } from '../../../dashboard/components/editable-layout/types';
|
|
2
|
+
import { DragStartEvent } from '@dnd-kit/core';
|
|
3
|
+
export declare const isEditableLayoutDragData: (data: any | undefined) => data is EditableLayoutDragData;
|
|
4
|
+
export declare const isEditableLayoutDropData: (data: any) => data is EditableLayoutDropData;
|
|
5
|
+
export declare const getDraggingWidgetId: (event: DragStartEvent) => string | null;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { DeepRequired } from 'ts-essentials';
|
|
2
2
|
import { DashboardByIdConfig, DashboardConfig } from './types';
|
|
3
|
-
export declare const DASHBOARD_DIVIDER_COLOR = "#d5d5d5";
|
|
4
|
-
export declare const DASHBOARD_DIVIDER_WIDTH = 1;
|
|
5
3
|
export declare const DEFAULT_DASHBOARD_CONFIG: DeepRequired<DashboardConfig>;
|
|
6
4
|
export declare const DEFAULT_DASHBOARD_BY_ID_CONFIG: DeepRequired<DashboardByIdConfig>;
|
|
@@ -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;
|
|
@@ -3,7 +3,8 @@ 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
|
-
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
export type { DashboardStyleOptions, WidgetsPanelColumnLayout, WidgetsPanelLayout, WidgetsPanelCell, WidgetsPanelRow, WidgetsPanelColumn, } from '../models';
|
|
7
8
|
/**
|
|
8
9
|
* Props of the {@link DashboardById} component.
|
|
9
10
|
*/
|
|
@@ -87,6 +88,12 @@ export interface DashboardConfig {
|
|
|
87
88
|
* If not specified, the default value is `false`.
|
|
88
89
|
*/
|
|
89
90
|
responsive?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* If true will .
|
|
93
|
+
*
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
editMode?: boolean;
|
|
90
97
|
};
|
|
91
98
|
}
|
|
92
99
|
/**
|
|
@@ -164,4 +171,5 @@ export interface DashboardProps {
|
|
|
164
171
|
*/
|
|
165
172
|
export interface DashboardHeaderProps {
|
|
166
173
|
title: string;
|
|
174
|
+
toolbar?: () => ReactNode;
|
|
167
175
|
}
|
|
@@ -17,6 +17,8 @@ export declare const useDashboardThemeInternal: ({ styleOptions }: DashboardThem
|
|
|
17
17
|
backgroundColor: string;
|
|
18
18
|
dividerLineWidth: number;
|
|
19
19
|
dividerLineColor: string;
|
|
20
|
+
borderWidth: number;
|
|
21
|
+
borderColor: string;
|
|
20
22
|
};
|
|
21
23
|
palette?: import("..").ColorPaletteTheme | undefined;
|
|
22
24
|
};
|
|
@@ -34,6 +36,8 @@ export declare const useDashboardTheme: (args_0: DashboardThemeParams) => {
|
|
|
34
36
|
backgroundColor: string;
|
|
35
37
|
dividerLineWidth: number;
|
|
36
38
|
dividerLineColor: string;
|
|
39
|
+
borderWidth: number;
|
|
40
|
+
borderColor: string;
|
|
37
41
|
};
|
|
38
42
|
palette?: import("..").ColorPaletteTheme | undefined;
|
|
39
43
|
};
|