@sisense/sdk-ui 2.3.0 → 2.4.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 +17 -16
- package/dist/ai.js +767 -670
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +4 -4
- package/dist/{derive-chart-family-DeTlU_Wm.cjs → derive-chart-family-Cqw-HJq1.cjs} +9 -9
- package/dist/{derive-chart-family-BtTi3OxL.js → derive-chart-family-woVAnbRi.js} +6914 -6864
- package/dist/{dimensions-Xxab6o5s.js → dimensions-BHdLQaOB.js} +1 -1
- package/dist/{dimensions-DpBTdNJ_.cjs → dimensions-oGJ_aWd5.cjs} +1 -1
- package/dist/index.cjs +20 -20
- package/dist/index.js +7758 -7446
- package/dist/index.umd.js +296 -295
- package/dist/packages/sdk-ui/src/ai/api/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/ai/common/icon-button.d.ts +1 -1
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/api/rest-api.d.ts +9 -4
- package/dist/packages/sdk-ui/src/app/client-application.d.ts +1 -1
- package/dist/packages/sdk-ui/src/common/components/button.d.ts +1 -0
- package/dist/packages/sdk-ui/src/common/components/menu/context-menu/context-menu.d.ts +1 -1
- package/dist/packages/sdk-ui/src/common/components/menu/context-menu/menu.d.ts +4 -2
- package/dist/packages/sdk-ui/src/common/components/menu/menu-button.d.ts +8 -0
- package/dist/packages/sdk-ui/src/common/components/menu/types.d.ts +3 -1
- package/dist/packages/sdk-ui/src/common/components/popper.d.ts +6 -1
- package/dist/packages/sdk-ui/src/common/hooks/use-defaults.d.ts +1 -2
- package/dist/packages/sdk-ui/src/common/icons/drag-handle-icon.d.ts +3 -0
- package/dist/packages/sdk-ui/src/custom-widgets-provider/custom-widgets-context.d.ts +8 -0
- package/dist/packages/sdk-ui/src/custom-widgets-provider/custom-widgets-provider-adapter.d.ts +17 -0
- package/dist/packages/sdk-ui/src/custom-widgets-provider/custom-widgets-provider.d.ts +9 -0
- package/dist/packages/sdk-ui/src/custom-widgets-provider/index.d.ts +6 -0
- package/dist/packages/sdk-ui/src/custom-widgets-provider/types.d.ts +19 -0
- package/dist/packages/sdk-ui/src/custom-widgets-provider/use-custom-widgets.d.ts +25 -0
- package/dist/packages/sdk-ui/src/custom-widgets-provider/use-execute-custom-widget-query.d.ts +35 -0
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/draggable-widget-wrapper.d.ts +12 -3
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/editable-layout.d.ts +12 -1
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/helpers.d.ts +57 -1
- package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/utils.d.ts +13 -0
- package/dist/packages/sdk-ui/src/dashboard/constants.d.ts +11 -3
- package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +11 -1
- package/dist/packages/sdk-ui/src/dashboard/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/dashboard/types.d.ts +72 -21
- package/dist/packages/sdk-ui/src/dashboard/use-dashboard-theme.d.ts +10 -0
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.d.ts +35 -4
- package/dist/packages/sdk-ui/src/filters/hooks/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +62 -24
- package/dist/packages/sdk-ui/src/index.d.ts +5 -5
- package/dist/packages/sdk-ui/src/indicator-canvas.d.ts +2 -0
- package/dist/packages/sdk-ui/src/models/dashboard/get-dashboard-model.d.ts +7 -0
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +21 -4
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-persistence.d.ts +8 -1
- package/dist/packages/sdk-ui/src/models/widget/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +3 -3
- package/dist/packages/sdk-ui/src/models/widget/widget-model.d.ts +3 -3
- package/dist/packages/sdk-ui/src/props.d.ts +52 -11
- package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +7 -2
- package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +14 -4
- package/dist/packages/sdk-ui/src/types.d.ts +59 -5
- package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +6 -6
- package/dist/packages/sdk-ui/src/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widgets/custom-widget.d.ts +8 -0
- package/dist/{use-common-filters-B2N7j9H-.cjs → use-common-filters-B2TXBt4b.cjs} +62 -62
- package/dist/{use-common-filters-BC4Vg9wu.js → use-common-filters-B3lFbmtY.js} +3792 -3850
- package/dist/{widget-composer-Bj5DrCSm.js → widget-composer-BCNu5BzM.js} +12 -12
- package/dist/{widget-composer-DjREvygd.cjs → widget-composer-DheWJukc.cjs} +2 -2
- package/package.json +7 -7
- package/dist/packages/sdk-ui/src/plugins-provider/custom-plugins-provider.d.ts +0 -19
- package/dist/packages/sdk-ui/src/plugins-provider/index.d.ts +0 -2
- package/dist/packages/sdk-ui/src/plugins-provider/plugins-context.d.ts +0 -9
- package/dist/packages/sdk-ui/src/plugins-provider/plugins-provider.d.ts +0 -18
- package/dist/packages/sdk-ui/src/plugins-provider/types.d.ts +0 -23
- package/dist/packages/sdk-ui/src/plugins-provider/use-execute-plugin-query.d.ts +0 -24
- package/dist/packages/sdk-ui/src/widgets/plugin-widget.d.ts +0 -8
|
@@ -79,7 +79,7 @@ export interface NlqResponseData extends ExpandedQueryModel {
|
|
|
79
79
|
/** The response message for the chat */
|
|
80
80
|
userMsg: string;
|
|
81
81
|
/** @internal */
|
|
82
|
-
clarification
|
|
82
|
+
clarification?: string;
|
|
83
83
|
}
|
|
84
84
|
export interface NlqResponse {
|
|
85
85
|
data: NlqResponseData;
|
|
@@ -5,7 +5,7 @@ interface IconButtonProps extends MuiIconButtonProps {
|
|
|
5
5
|
}
|
|
6
6
|
declare const IconButton: import("@emotion/styled").StyledComponent<import("@mui/material/IconButton").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
7
7
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
8
|
-
}, "loading" | "children" | "
|
|
8
|
+
}, "loading" | "children" | "disabled" | "size" | "className" | "style" | "tabIndex" | "color" | "sx" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "loadingIndicator"> & {
|
|
9
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
10
10
|
} & IconButtonProps, {}, {}>;
|
|
11
11
|
export default IconButton;
|
|
@@ -12,7 +12,7 @@ type ExtraWidgetCodeProps = {
|
|
|
12
12
|
componentString: string;
|
|
13
13
|
extraImportsString: string;
|
|
14
14
|
idString?: string;
|
|
15
|
-
widgetTypeString?: 'chart' | 'pivot' | 'text' | '
|
|
15
|
+
widgetTypeString?: 'chart' | 'pivot' | 'text' | 'custom';
|
|
16
16
|
};
|
|
17
17
|
/** @internal */
|
|
18
18
|
export type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
@@ -240,7 +240,7 @@ export type TemplateKeyMapByWidgetType = {
|
|
|
240
240
|
chart: CodeTemplateKey;
|
|
241
241
|
pivot: CodeTemplateKey;
|
|
242
242
|
text?: CodeTemplateKey;
|
|
243
|
-
|
|
243
|
+
custom?: CodeTemplateKey;
|
|
244
244
|
};
|
|
245
245
|
/** TYPE FOR DASHBOARD CODE */
|
|
246
246
|
/**
|
|
@@ -13,6 +13,7 @@ type GetDashboardsOptions = {
|
|
|
13
13
|
};
|
|
14
14
|
type GetDashboardOptions = {
|
|
15
15
|
fields?: string[];
|
|
16
|
+
sharedMode?: boolean;
|
|
16
17
|
};
|
|
17
18
|
export declare class RestApi {
|
|
18
19
|
private httpClient;
|
|
@@ -42,11 +43,11 @@ export declare class RestApi {
|
|
|
42
43
|
/**
|
|
43
44
|
* Get all widgets of a specific dashboard
|
|
44
45
|
*/
|
|
45
|
-
getDashboardWidgets: (dashboardOid: string) => Promise<WidgetDto[] | undefined>;
|
|
46
|
+
getDashboardWidgets: (dashboardOid: string, sharedMode?: boolean) => Promise<WidgetDto[] | undefined>;
|
|
46
47
|
/**
|
|
47
48
|
* Get a specific widget from a dashboard
|
|
48
49
|
*/
|
|
49
|
-
getWidget: (widgetOid: string, dashboardOid: string) => Promise<WidgetDto | undefined>;
|
|
50
|
+
getWidget: (widgetOid: string, dashboardOid: string, sharedMode?: boolean) => Promise<WidgetDto | undefined>;
|
|
50
51
|
/**
|
|
51
52
|
* Get a GeoJSON data for all countries
|
|
52
53
|
*/
|
|
@@ -66,11 +67,15 @@ export declare class RestApi {
|
|
|
66
67
|
/**
|
|
67
68
|
* Partially update a dashboard
|
|
68
69
|
*/
|
|
69
|
-
patchDashboard: (dashboardOid: string, dashboard: Partial<DashboardDto
|
|
70
|
+
patchDashboard: (dashboardOid: string, dashboard: Partial<DashboardDto>, sharedMode?: boolean) => Promise<DashboardDto | undefined>;
|
|
70
71
|
/**
|
|
71
72
|
* Add widget to a dashboard
|
|
72
73
|
*/
|
|
73
|
-
addWidgetToDashboard: (dashboardOid: string, widgetDto: WidgetDto) => Promise<WidgetDto | undefined>;
|
|
74
|
+
addWidgetToDashboard: (dashboardOid: string, widgetDto: WidgetDto, sharedMode?: boolean) => Promise<WidgetDto | undefined>;
|
|
75
|
+
/**
|
|
76
|
+
* Delete widget from a dashboard
|
|
77
|
+
*/
|
|
78
|
+
deleteWidgetFromDashboard: (dashboardOid: string, widgetOid: string, sharedMode?: boolean) => Promise<void | undefined>;
|
|
74
79
|
/**
|
|
75
80
|
* Get shared formulas by ids
|
|
76
81
|
*
|
|
@@ -68,7 +68,7 @@ export type AppConfig = {
|
|
|
68
68
|
/**
|
|
69
69
|
* Configuration of the tabber widget
|
|
70
70
|
*
|
|
71
|
-
* Set the `tabberConfig.enabled` property to `true` to enable the tabber widget support. Otherwise, the tabber widget will be treated as 'unknown
|
|
71
|
+
* Set the `tabberConfig.enabled` property to `true` to enable the tabber widget support. Otherwise, the tabber widget will be treated as 'unknown custom widget type'.
|
|
72
72
|
* Only tabber widgets that are configured using the Fusion UI as documented [here](https://docs.sisense.com/main/SisenseLinux/tabber.htm#Creating) are supported.
|
|
73
73
|
*/
|
|
74
74
|
tabberConfig?: {
|
|
@@ -4,4 +4,4 @@ import { ContextMenuProps } from '../../../../props';
|
|
|
4
4
|
*
|
|
5
5
|
* @group Drilldown
|
|
6
6
|
*/
|
|
7
|
-
export declare const ContextMenu: ({ position, itemSections, children, closeContextMenu, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const ContextMenu: ({ position, itemSections, children, closeContextMenu, alignment, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { MenuPosition } from '../../../../index';
|
|
2
|
+
import { MenuPosition, MenuAlignment } from '../../../../index';
|
|
3
3
|
type MenuProps = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
open: boolean;
|
|
6
6
|
position: MenuPosition | null;
|
|
7
7
|
onClose: () => void;
|
|
8
|
+
/** @internal */
|
|
9
|
+
alignment?: MenuAlignment;
|
|
8
10
|
};
|
|
9
|
-
export declare const Menu: ({ children, open, position, onClose }: MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const Menu: ({ children, open, position, onClose, alignment }: MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
2
|
+
type MenuButtonProps = {
|
|
3
|
+
color?: string;
|
|
4
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const MenuButton: ({ color, onClick, ariaLabel, ...restProps }: MenuButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { MenuPosition, MenuItemSection } from '../../../types';
|
|
1
|
+
import { MenuPosition, MenuItemSection, MenuAlignment } from '../../../types';
|
|
2
2
|
export type MenuOptions = {
|
|
3
3
|
/** @internal */
|
|
4
4
|
readonly id?: string;
|
|
5
5
|
position: MenuPosition;
|
|
6
6
|
itemSections: MenuItemSection[];
|
|
7
7
|
onClose?: () => void;
|
|
8
|
+
/** @internal */
|
|
9
|
+
alignment?: MenuAlignment;
|
|
8
10
|
};
|
|
9
11
|
/** @internal */
|
|
10
12
|
export type BeforeMenuOpenHandler = (options: MenuOptions) => MenuOptions | null;
|
|
@@ -4,6 +4,11 @@ type PopperProps = {
|
|
|
4
4
|
open: boolean;
|
|
5
5
|
anchorEl: HTMLElement | null;
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
|
+
/**
|
|
8
|
+
* If true, the click event will not be propagated to the parent elements outside of the popper.
|
|
9
|
+
* Useful for React to Preact compatibility issues related to different event handling mechanisms - virtual DOM vs real DOM.
|
|
10
|
+
*/
|
|
11
|
+
preventClickPropagation?: boolean;
|
|
7
12
|
};
|
|
8
|
-
export declare const Popper: ({ children, open, anchorEl, style }: PopperProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const Popper: ({ children, open, anchorEl, style, preventClickPropagation, }: PopperProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
14
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DeepRequired } from 'ts-essentials';
|
|
2
1
|
import { AnyObject } from '../../utils/utility-types';
|
|
3
2
|
/**
|
|
4
3
|
* Merges the provided configuration with the default configuration.
|
|
@@ -7,4 +6,4 @@ import { AnyObject } from '../../utils/utility-types';
|
|
|
7
6
|
* @param defaults - The default configuration.
|
|
8
7
|
* @returns The merged configuration.
|
|
9
8
|
*/
|
|
10
|
-
export declare const useDefaults: <Config extends AnyObject>(config: Config | undefined, defaults:
|
|
9
|
+
export declare const useDefaults: <Config extends AnyObject>(config: Config | undefined, defaults: Config) => Config;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { CustomWidgetComponent, CustomWidgetComponentProps } from './types.js';
|
|
3
|
+
import { CustomContextProviderProps } from '../types.js';
|
|
4
|
+
/** @internal */
|
|
5
|
+
export type CustomWidgetsProviderAdapterProps = CustomContextProviderProps<CustomWidgetsContextAdapter<CustomWidgetComponentProps>>;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export type CustomWidgetsContextAdapter<T = CustomWidgetComponentProps> = {
|
|
8
|
+
customWidgetsMap: Map<string, CustomWidgetComponent<T>>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Custom Widget Provider Adapter component that allows passing external custom widgets context.
|
|
12
|
+
*
|
|
13
|
+
* Note: it is designed to serve as a bridge for passing pre-initialized custom widget data between an external wrapper and child React components.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare const CustomWidgetsProviderAdapter: React.FC<PropsWithChildren<CustomWidgetsProviderAdapterProps>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
3
|
+
import { GenericDataOptions } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Props passed to a user-defined custom widget component.
|
|
6
|
+
*/
|
|
7
|
+
export interface CustomWidgetComponentProps<DataOptions = GenericDataOptions, StyleOptions = any> {
|
|
8
|
+
dataSource?: DataSource;
|
|
9
|
+
dataOptions: DataOptions;
|
|
10
|
+
styleOptions: StyleOptions;
|
|
11
|
+
filters?: Filter[] | FilterRelations;
|
|
12
|
+
highlights?: Filter[];
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A user-defined custom widget component. This is can be specified when registering a
|
|
17
|
+
* custom widget with `registerCustomWidget` from the `useCustomWidgets` hook.
|
|
18
|
+
*/
|
|
19
|
+
export type CustomWidgetComponent<Props = CustomWidgetComponentProps> = (props: Props) => ReactNode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CustomWidgetComponent } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that provides API for configuring custom widgets.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* Example of registering a custom widget in a dashboard:
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { useCustomWidgets, DashboardById } from '@sisense/sdk-ui';
|
|
9
|
+
* import CustomHistogramWidget from './custom-histogram-widget';
|
|
10
|
+
*
|
|
11
|
+
* const Example = () => {
|
|
12
|
+
* const { registerCustomWidget } = useCustomWidgets();
|
|
13
|
+
* registerCustomWidget('histogramwidget', CustomHistogramWidget);
|
|
14
|
+
*
|
|
15
|
+
* return <DashboardById dashboardOid="your-dashboard-oid" />;
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @group Dashboards
|
|
20
|
+
*/
|
|
21
|
+
export declare const useCustomWidgets: () => {
|
|
22
|
+
registerCustomWidget: <T = any>(customWidgetType: string, customWidget: CustomWidgetComponent<T>) => void;
|
|
23
|
+
hasCustomWidget: (customWidgetType: string) => boolean;
|
|
24
|
+
getCustomWidget: (customWidgetType: string) => CustomWidgetComponent<any> | undefined;
|
|
25
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Attribute, Measure } from '@sisense/sdk-data';
|
|
2
|
+
import { GenericDataOptions } from '../types';
|
|
3
|
+
import { CustomWidgetComponentProps } from './types';
|
|
4
|
+
import { ExecuteQueryParams, QueryState } from '../query-execution/types';
|
|
5
|
+
import { HookEnableParam } from '../common/hooks/types';
|
|
6
|
+
/**
|
|
7
|
+
* State of a query execution retrieving data of a custom widget.
|
|
8
|
+
*/
|
|
9
|
+
export type CustomWidgetQueryState = QueryState;
|
|
10
|
+
/**
|
|
11
|
+
* Parameters for executing a query for a custom widget.
|
|
12
|
+
*/
|
|
13
|
+
export interface ExecuteCustomWidgetQueryParams extends CustomWidgetComponentProps, HookEnableParam, Pick<ExecuteQueryParams, 'onBeforeQuery' | 'count' | 'offset' | 'ungroup'> {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Utility function for converting data options to parameters for executing a query.
|
|
17
|
+
*
|
|
18
|
+
* @group Dashboards
|
|
19
|
+
*/
|
|
20
|
+
export declare function extractDimensionsAndMeasures(dataOptions: GenericDataOptions): {
|
|
21
|
+
dimensions: Attribute[];
|
|
22
|
+
measures: Measure[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* {@link useExecuteCustomWidgetQuery} without tracking to be used inside other hooks or components in Compose SDK.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function useExecuteCustomWidgetQueryInternal({ dataSource, dataOptions, filters, highlights, count, offset, ungroup, onBeforeQuery, }: ExecuteCustomWidgetQueryParams): CustomWidgetQueryState;
|
|
30
|
+
/**
|
|
31
|
+
* React hook that takes a custom widget component's props and executes a data query.
|
|
32
|
+
*
|
|
33
|
+
* @group Queries
|
|
34
|
+
*/
|
|
35
|
+
export declare const useExecuteCustomWidgetQuery: (args_0: ExecuteCustomWidgetQueryParams) => QueryState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { EditableLayoutDragData } from '../../../../dashboard/components/editable-layout/types';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Props for the DraggableWidgetWrapper component
|
|
5
5
|
*
|
|
@@ -17,12 +17,21 @@ type DraggableWidgetWrapperProps = {
|
|
|
17
17
|
/**
|
|
18
18
|
* The child elements to render inside the wrapper
|
|
19
19
|
*/
|
|
20
|
-
children:
|
|
20
|
+
children: (withDragHandle: (element: ReactNode) => ReactNode) => ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Options for drag handle
|
|
23
|
+
*/
|
|
24
|
+
dragHandleOptions?: {
|
|
25
|
+
icon?: {
|
|
26
|
+
visible?: boolean;
|
|
27
|
+
color?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
21
30
|
};
|
|
22
31
|
/**
|
|
23
32
|
* Renders a draggable widget wrapper component that allows for drag and drop operations.
|
|
24
33
|
*
|
|
25
34
|
* @internal
|
|
26
35
|
*/
|
|
27
|
-
export declare const DraggableWidgetWrapper: ({ id, data, children }: DraggableWidgetWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const DraggableWidgetWrapper: ({ id, data, children, dragHandleOptions, }: DraggableWidgetWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
37
|
export {};
|
|
@@ -18,6 +18,17 @@ export interface EditableLayoutProps {
|
|
|
18
18
|
* A callback function that is called when the layout changes.
|
|
19
19
|
*/
|
|
20
20
|
onLayoutChange?: (layout: WidgetsPanelLayout) => void;
|
|
21
|
+
/**
|
|
22
|
+
* The configuration for the editable layout.
|
|
23
|
+
*/
|
|
24
|
+
config?: {
|
|
25
|
+
/**
|
|
26
|
+
* Flag indicating whether the drag handle icon is visible.
|
|
27
|
+
*
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
showDragHandleIcon?: boolean;
|
|
31
|
+
};
|
|
21
32
|
}
|
|
22
33
|
/**
|
|
23
34
|
* A React used to render a layout of widgets that can resize and rearrange their positions using drag-and-drop.
|
|
@@ -25,4 +36,4 @@ export interface EditableLayoutProps {
|
|
|
25
36
|
* @param props - {@link EditableLayoutProps}
|
|
26
37
|
* @internal
|
|
27
38
|
*/
|
|
28
|
-
export declare const EditableLayout: ({ layout, widgets, onLayoutChange }: EditableLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare const EditableLayout: ({ layout, widgets, onLayoutChange, config, }: EditableLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WidgetsPanelColumn, WidgetsPanelColumnLayout, WidgetsPanelLayout } from '../../../models';
|
|
1
|
+
import { WidgetsPanelColumn, WidgetsPanelColumnLayout, WidgetsPanelLayout, WidgetsPanelRow } from '../../../models';
|
|
2
2
|
import { EditableLayoutDropData, EditableLayoutDragData } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Updates the height of all cells in a specific row within a column layout.
|
|
@@ -28,6 +28,62 @@ export declare function updateRowHeight(layout: WidgetsPanelColumnLayout, height
|
|
|
28
28
|
* @internal
|
|
29
29
|
*/
|
|
30
30
|
export declare function updateLayoutWidths(layout: WidgetsPanelLayout, widths: number[], parentColumnIndex?: number, parentRowIndex?: number): WidgetsPanelColumnLayout;
|
|
31
|
+
/**
|
|
32
|
+
* Deletes a widget from a layout.
|
|
33
|
+
*
|
|
34
|
+
* @param layout - The current layout to modify
|
|
35
|
+
* @param columnIndex - Index of the column containing the widget
|
|
36
|
+
* @param rowIndex - Index of the row containing the widget
|
|
37
|
+
* @param widgetId - ID of the widget to delete
|
|
38
|
+
*
|
|
39
|
+
* @returns A new layout with the widget removed
|
|
40
|
+
*
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export declare function deleteWidgetFromLayout(layout: WidgetsPanelLayout, columnIndex: number, rowIndex: number, widgetId: string): {
|
|
44
|
+
columns: WidgetsPanelColumn[];
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Deletes widgets from a layout.
|
|
48
|
+
*
|
|
49
|
+
* @param layout - The current layout to modify
|
|
50
|
+
* @param widgetIds - IDs of the widgets to delete
|
|
51
|
+
*
|
|
52
|
+
* @returns A new layout with the widgets removed
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export declare function deleteWidgetsFromLayout(layout: WidgetsPanelLayout, widgetIds: string[]): {
|
|
57
|
+
columns: {
|
|
58
|
+
rows: WidgetsPanelRow[];
|
|
59
|
+
widthPercentage: number;
|
|
60
|
+
}[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Finds widgets that were deleted from a layout.
|
|
64
|
+
*
|
|
65
|
+
* @param previousLayout - The previous layout
|
|
66
|
+
* @param newLayout - The new layout
|
|
67
|
+
*
|
|
68
|
+
* @returns An array of widget IDs that were deleted
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
export declare function findDeletedWidgetsFromLayout(previousLayout: WidgetsPanelLayout, newLayout: WidgetsPanelLayout): string[];
|
|
73
|
+
/**
|
|
74
|
+
* Distributes equal width to all cells in a row.
|
|
75
|
+
*
|
|
76
|
+
* @param layout - The current layout to modify
|
|
77
|
+
* @param columnIndex - Index of the column containing the row
|
|
78
|
+
* @param rowIndex - Index of the row to distribute the width to
|
|
79
|
+
*
|
|
80
|
+
* @returns A new layout with the width distributed
|
|
81
|
+
*
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export declare const distributeEqualWidthInRow: (layout: WidgetsPanelLayout, columnIndex: number, rowIndex: number) => {
|
|
85
|
+
columns: WidgetsPanelColumn[];
|
|
86
|
+
};
|
|
31
87
|
/**
|
|
32
88
|
* Updates the layout based on drag and drop operations.
|
|
33
89
|
*
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { EditableLayoutDragData, EditableLayoutDropData } from '../../../dashboard/components/editable-layout/types';
|
|
2
2
|
import { DragStartEvent } from '@dnd-kit/core';
|
|
3
|
+
import { RenderTitleHandler, RenderToolbarHandler } from '../../../types';
|
|
3
4
|
export declare const isEditableLayoutDragData: (data: any | undefined) => data is EditableLayoutDragData;
|
|
4
5
|
export declare const isEditableLayoutDropData: (data: any) => data is EditableLayoutDropData;
|
|
5
6
|
export declare const getDraggingWidgetId: (event: DragStartEvent) => string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Compose multiple RenderToolbarHandler functions into one.
|
|
9
|
+
* Each handler gets a chance to modify the toolbar.
|
|
10
|
+
* If it returns `null`, the previous toolbar is passed to the next handler.
|
|
11
|
+
*/
|
|
12
|
+
export declare function composeToolbarHandlers(...handlers: (RenderToolbarHandler | undefined)[]): RenderToolbarHandler;
|
|
13
|
+
/**
|
|
14
|
+
* Compose multiple RenderTitleHandler functions into one.
|
|
15
|
+
* Each handler gets a chance to modify the title.
|
|
16
|
+
* If it returns `null`, the previous tile is passed to the next handler.
|
|
17
|
+
*/
|
|
18
|
+
export declare function composeTitleHandlers(...handlers: (RenderTitleHandler | undefined)[]): RenderTitleHandler;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { DeepRequired } from 'ts-essentials';
|
|
2
|
-
import { DashboardByIdConfig, DashboardConfig } from './types';
|
|
3
|
-
export declare const DEFAULT_DASHBOARD_CONFIG: DeepRequired<DashboardConfig
|
|
4
|
-
|
|
2
|
+
import { DashboardByIdConfig, DashboardConfig, EditModeConfig, WidgetsPanelConfig } from './types';
|
|
3
|
+
export declare const DEFAULT_DASHBOARD_CONFIG: DeepRequired<Omit<DashboardConfig, 'widgetsPanel'> & {
|
|
4
|
+
widgetsPanel: Omit<WidgetsPanelConfig, 'editMode'> & {
|
|
5
|
+
editMode: Omit<EditModeConfig, 'isEditing'>;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
8
|
+
export declare const DEFAULT_DASHBOARD_BY_ID_CONFIG: DeepRequired<Omit<DashboardByIdConfig, 'widgetsPanel'> & {
|
|
9
|
+
widgetsPanel: Omit<WidgetsPanelConfig, 'editMode'> & {
|
|
10
|
+
editMode: Omit<EditModeConfig, 'isEditing'>;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
@@ -8,7 +8,11 @@ export declare enum DashboardChangeType {
|
|
|
8
8
|
/** Filters panel collapsed state changed */
|
|
9
9
|
UI_FILTERS_PANEL_COLLAPSE = "UI.FILTERS.PANEL.COLLAPSE",
|
|
10
10
|
/** Widgets panel layout updated */
|
|
11
|
-
WIDGETS_PANEL_LAYOUT_UPDATE = "WIDGETS_PANEL_LAYOUT.UPDATE"
|
|
11
|
+
WIDGETS_PANEL_LAYOUT_UPDATE = "WIDGETS_PANEL_LAYOUT.UPDATE",
|
|
12
|
+
/** Edit mode isEditing changed */
|
|
13
|
+
WIDGETS_PANEL_LAYOUT_IS_EDITING_CHANGE = "WIDGETS_PANEL.EDIT_MODE.IS_EDITING.CHANGE",
|
|
14
|
+
/** Widgets deleted from the dashboard */
|
|
15
|
+
WIDGETS_DELETE = "WIDGETS.DELETE"
|
|
12
16
|
}
|
|
13
17
|
export type DashboardChangeAction = {
|
|
14
18
|
type: DashboardChangeType.FILTERS_UPDATE;
|
|
@@ -19,6 +23,12 @@ export type DashboardChangeAction = {
|
|
|
19
23
|
} | {
|
|
20
24
|
type: DashboardChangeType.WIDGETS_PANEL_LAYOUT_UPDATE;
|
|
21
25
|
payload: WidgetsPanelLayout;
|
|
26
|
+
} | {
|
|
27
|
+
type: DashboardChangeType.WIDGETS_PANEL_LAYOUT_IS_EDITING_CHANGE;
|
|
28
|
+
payload: boolean;
|
|
29
|
+
} | {
|
|
30
|
+
type: DashboardChangeType.WIDGETS_DELETE;
|
|
31
|
+
payload: string[];
|
|
22
32
|
};
|
|
23
33
|
/**
|
|
24
34
|
* React component that renders a dashboard whose elements are customizable. It includes internal logic of applying common filters to widgets.
|
|
@@ -2,4 +2,4 @@ export { DashboardById } from './dashboard-by-id';
|
|
|
2
2
|
export { Dashboard } from './dashboard';
|
|
3
3
|
export { useComposedDashboard, useComposedDashboardInternal, type ComposableDashboardProps, type UseComposedDashboardOptions, } from './use-composed-dashboard';
|
|
4
4
|
export { useDashboardTheme, type DashboardThemeParams } from './use-dashboard-theme';
|
|
5
|
-
export type { DashboardByIdProps, DashboardProps, DashboardLayoutOptions, DashboardStyleOptions, DashboardConfig, DashboardByIdConfig, DashboardFiltersPanelConfig, } from './types';
|
|
5
|
+
export type { DashboardByIdProps, DashboardProps, DashboardLayoutOptions, DashboardStyleOptions, DashboardConfig, DashboardByIdConfig, WidgetsPanelConfig, EditModeConfig, DashboardFiltersPanelConfig, } from './types';
|
|
@@ -59,6 +59,70 @@ export interface DashboardFiltersPanelConfig extends FiltersPanelConfig {
|
|
|
59
59
|
*/
|
|
60
60
|
persistCollapsedStateToLocalStorage?: boolean;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Widgets panel configuration
|
|
64
|
+
*/
|
|
65
|
+
export interface WidgetsPanelConfig {
|
|
66
|
+
/**
|
|
67
|
+
* If true adjust layout based on available width of widgets panel.
|
|
68
|
+
*
|
|
69
|
+
* If not specified, the default value is `false`.
|
|
70
|
+
*/
|
|
71
|
+
responsive?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Edit mode configuration.
|
|
74
|
+
* If enabled, an 'Edit Layout' action is visible to users on the dashboard toolbar.
|
|
75
|
+
* Clicking 'Edit Layout' opens the dashboard in editing mode, where the user can resize or reposition widgets using drag and drop.
|
|
76
|
+
* If history enabled, layout changes are temporarily stored during editing, with undo/redo buttons available on the toolbar.
|
|
77
|
+
* Finally, changes are confirmed or discarded with 'Apply' or 'Cancel' buttons.
|
|
78
|
+
*
|
|
79
|
+
* If persistence is enabled for the dashboard, changes to the layout will be saved to Fusion on clicking the 'Apply' button.
|
|
80
|
+
*
|
|
81
|
+
* This feature is in alpha.
|
|
82
|
+
*
|
|
83
|
+
* @alpha
|
|
84
|
+
*/
|
|
85
|
+
editMode?: EditModeConfig;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Edit mode configuration
|
|
89
|
+
*/
|
|
90
|
+
export interface EditModeConfig {
|
|
91
|
+
/** Flag indicating whether the edit layout feature is enabled
|
|
92
|
+
*
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
enabled: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Flag indicating whether the dashboard is currently in edit mode.
|
|
98
|
+
* If specified, will override inner mode state.
|
|
99
|
+
* */
|
|
100
|
+
isEditing?: boolean;
|
|
101
|
+
/** Configuration for the edit mode history */
|
|
102
|
+
applyChangesAsBatch?: {
|
|
103
|
+
/**
|
|
104
|
+
* If true, changes are applied when the user clicks 'Apply'
|
|
105
|
+
* or discarded when the user clicks 'Cancel'.
|
|
106
|
+
*
|
|
107
|
+
* If false, changes will be applied immediately as the user makes each change
|
|
108
|
+
* without confirmation or the ability to cancel/undo.
|
|
109
|
+
*
|
|
110
|
+
* @default: true
|
|
111
|
+
* */
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The maximum number of history items to keep.
|
|
115
|
+
*
|
|
116
|
+
* @default 20
|
|
117
|
+
*/
|
|
118
|
+
historyLimit?: number;
|
|
119
|
+
};
|
|
120
|
+
/** Flag indicating whether the drag handle icon is visible
|
|
121
|
+
*
|
|
122
|
+
* @default true
|
|
123
|
+
*/
|
|
124
|
+
showDragHandleIcon?: boolean;
|
|
125
|
+
}
|
|
62
126
|
/**
|
|
63
127
|
* Dashboard configuration
|
|
64
128
|
*/
|
|
@@ -81,27 +145,7 @@ export interface DashboardConfig {
|
|
|
81
145
|
/**
|
|
82
146
|
* Configuration for the widgets panel
|
|
83
147
|
*/
|
|
84
|
-
widgetsPanel?:
|
|
85
|
-
/**
|
|
86
|
-
* If true adjust layout based on available width of widgets panel.
|
|
87
|
-
*
|
|
88
|
-
* If not specified, the default value is `false`.
|
|
89
|
-
*/
|
|
90
|
-
responsive?: boolean;
|
|
91
|
-
/**
|
|
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.
|
|
96
|
-
*
|
|
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
|
|
102
|
-
*/
|
|
103
|
-
editMode?: boolean;
|
|
104
|
-
};
|
|
148
|
+
widgetsPanel?: WidgetsPanelConfig;
|
|
105
149
|
}
|
|
106
150
|
/**
|
|
107
151
|
* Dashboard configuration
|
|
@@ -117,6 +161,13 @@ export interface DashboardByIdConfig extends DashboardConfig {
|
|
|
117
161
|
* - Currently only changes to dashboard filters are persisted.
|
|
118
162
|
*/
|
|
119
163
|
persist?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Whether to load the dashboard in shared mode (co-authoring feature).
|
|
166
|
+
*
|
|
167
|
+
* @default false
|
|
168
|
+
* @internal
|
|
169
|
+
*/
|
|
170
|
+
sharedMode?: boolean;
|
|
120
171
|
}
|
|
121
172
|
/**
|
|
122
173
|
* Dashboard layout options
|
|
@@ -19,6 +19,11 @@ export declare const useDashboardThemeInternal: ({ styleOptions }: DashboardThem
|
|
|
19
19
|
dividerLineColor: string;
|
|
20
20
|
borderWidth: number;
|
|
21
21
|
borderColor: string;
|
|
22
|
+
toolbar: {
|
|
23
|
+
primaryTextColor: string;
|
|
24
|
+
secondaryTextColor: string;
|
|
25
|
+
backgroundColor: string;
|
|
26
|
+
};
|
|
22
27
|
};
|
|
23
28
|
palette?: import("..").ColorPaletteTheme | undefined;
|
|
24
29
|
};
|
|
@@ -38,6 +43,11 @@ export declare const useDashboardTheme: (args_0: DashboardThemeParams) => {
|
|
|
38
43
|
dividerLineColor: string;
|
|
39
44
|
borderWidth: number;
|
|
40
45
|
borderColor: string;
|
|
46
|
+
toolbar: {
|
|
47
|
+
primaryTextColor: string;
|
|
48
|
+
secondaryTextColor: string;
|
|
49
|
+
backgroundColor: string;
|
|
50
|
+
};
|
|
41
51
|
};
|
|
42
52
|
palette?: import("..").ColorPaletteTheme | undefined;
|
|
43
53
|
};
|