@sisense/sdk-ui 2.3.1 → 2.4.1
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-5O0nGmIH.cjs → derive-chart-family-Cqw-HJq1.cjs} +9 -9
- package/dist/{derive-chart-family-H5uuw6lv.js → derive-chart-family-woVAnbRi.js} +6909 -6862
- package/dist/{dimensions-aqixuZxM.js → dimensions-BHdLQaOB.js} +1 -1
- package/dist/{dimensions-R6yuR7CB.cjs → dimensions-oGJ_aWd5.cjs} +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.js +7589 -7286
- package/dist/index.umd.js +274 -273
- 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-CSwVz8Hy.js → use-common-filters-Br-CoziA.js} +3792 -3850
- package/dist/{use-common-filters-CN2YnxBs.cjs → use-common-filters-CCXbao1t.cjs} +62 -62
- package/dist/{widget-composer-BpeW0NNz.js → widget-composer-BCNu5BzM.js} +12 -12
- package/dist/{widget-composer-BB1-bv-q.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
|
@@ -5,22 +5,53 @@ import { FiltersPanelConfig } from './types';
|
|
|
5
5
|
* Props of the {@link FiltersPanel} component
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export interface FiltersPanelProps {
|
|
9
9
|
/** Array of filters to display */
|
|
10
10
|
filters: Filter[] | FilterRelations;
|
|
11
11
|
/** Callback to handle changes in filters */
|
|
12
12
|
onFiltersChange: (filters: Filter[] | FilterRelations) => void;
|
|
13
13
|
/** Default data source used for filter tiles */
|
|
14
14
|
defaultDataSource?: DataSource;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* All data sources available for filter tiles
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
16
20
|
dataSources?: DataSource[];
|
|
17
21
|
/** The configuration for the filters panel */
|
|
18
22
|
config?: FiltersPanelConfig;
|
|
19
|
-
}
|
|
23
|
+
}
|
|
20
24
|
/**
|
|
21
25
|
* Filters panel component that renders a list of filter tiles
|
|
22
26
|
*
|
|
27
|
+
* @example
|
|
28
|
+
* Here's how to render a filters panel with a set of filters.
|
|
29
|
+
* ```tsx
|
|
30
|
+
* import { useState } from 'react';
|
|
31
|
+
* import { FiltersPanel } from '@sisense/sdk-ui';
|
|
32
|
+
* import { filterFactory, type Filter, type FilterRelations } from '@sisense/sdk-data';
|
|
33
|
+
* import * as DM from './sample-ecommerce-model';
|
|
34
|
+
*
|
|
35
|
+
* export function Example() {
|
|
36
|
+
* const [filters, setFilters] = useState<Filter[]>([
|
|
37
|
+
* filterFactory.members(DM.Commerce.Gender, ['Male', 'Female']),
|
|
38
|
+
* filterFactory.members(DM.Commerce.AgeRange, ['0-18', '19-24']),
|
|
39
|
+
* ]);
|
|
40
|
+
*
|
|
41
|
+
* const handleFiltersChange = (updatedFilters: Filter[] | FilterRelations) => {
|
|
42
|
+
* console.log('Filters changed:', updatedFilters);
|
|
43
|
+
* };
|
|
44
|
+
*
|
|
45
|
+
* return (
|
|
46
|
+
* <FiltersPanel
|
|
47
|
+
* filters={filters}
|
|
48
|
+
* defaultDataSource={DM.DataSource}
|
|
49
|
+
* onFiltersChange={handleFiltersChange}
|
|
50
|
+
* />
|
|
51
|
+
* );
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
23
55
|
* @group Filter Tiles
|
|
24
|
-
* @alpha
|
|
25
56
|
*/
|
|
26
57
|
export declare const FiltersPanel: import("react").FunctionComponent<FiltersPanelProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useGetFilterMembers, type GetFilterMembersParams, type
|
|
1
|
+
export { useGetFilterMembers, type GetFilterMembersParams, type FilterMembersSuccessState, type FilterMembersLoadingState, type FilterMembersErrorState, type FilterMembersState, type GetFilterMembersResult, type GetFilterMembersData, } from './use-get-filter-members';
|
|
@@ -20,48 +20,87 @@ export interface GetFilterMembersParams extends HookEnableParam {
|
|
|
20
20
|
*/
|
|
21
21
|
count?: number;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Result data of retrieving filter members.
|
|
25
|
+
*/
|
|
26
|
+
export interface GetFilterMembersData {
|
|
27
|
+
/** Array of members that are currently selected */
|
|
28
|
+
selectedMembers: SelectedMember[];
|
|
29
|
+
/** Array of all available members */
|
|
30
|
+
allMembers: Member[];
|
|
31
|
+
/** Flag indicating whether members are excluded */
|
|
32
|
+
excludeMembers: boolean;
|
|
33
|
+
/** Flag indicating if multiple selection is enabled */
|
|
34
|
+
enableMultiSelection: boolean;
|
|
35
|
+
/** Flag indicating if there is a background filter applied */
|
|
36
|
+
hasBackgroundFilter: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* State of a filter members load that has succeeded.
|
|
40
|
+
*/
|
|
41
|
+
export interface FilterMembersSuccessState {
|
|
24
42
|
/** Whether the data fetching is loading */
|
|
25
|
-
isLoading:
|
|
26
|
-
/**
|
|
27
|
-
* Function to load more data rows
|
|
28
|
-
*
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
loadMore: (count: number) => void;
|
|
43
|
+
isLoading: false;
|
|
32
44
|
/** Whether the data fetching has failed */
|
|
33
45
|
isError: false;
|
|
46
|
+
/** Whether the data fetching has succeeded */
|
|
47
|
+
isSuccess: true;
|
|
48
|
+
/** The status of the data fetching execution */
|
|
49
|
+
status: 'success';
|
|
34
50
|
/** The error if any occurred */
|
|
35
51
|
error: undefined;
|
|
36
52
|
/** The result data */
|
|
37
|
-
data:
|
|
38
|
-
selectedMembers: SelectedMember[];
|
|
39
|
-
allMembers: Member[];
|
|
40
|
-
excludeMembers: boolean;
|
|
41
|
-
enableMultiSelection: boolean;
|
|
42
|
-
hasBackgroundFilter: boolean;
|
|
43
|
-
};
|
|
53
|
+
data: GetFilterMembersData;
|
|
44
54
|
}
|
|
45
|
-
|
|
55
|
+
/**
|
|
56
|
+
* State of a filter members load that is loading.
|
|
57
|
+
*/
|
|
58
|
+
export interface FilterMembersLoadingState {
|
|
46
59
|
/** Whether the data fetching is loading */
|
|
47
|
-
isLoading:
|
|
60
|
+
isLoading: true;
|
|
48
61
|
/** Whether the data fetching has failed */
|
|
49
|
-
|
|
62
|
+
isError: false;
|
|
63
|
+
/** Whether the data fetching has succeeded */
|
|
64
|
+
isSuccess: false;
|
|
65
|
+
/** The status of the data fetching execution */
|
|
66
|
+
status: 'loading';
|
|
50
67
|
/** The error if any occurred */
|
|
68
|
+
error: undefined;
|
|
69
|
+
/** The result data */
|
|
70
|
+
data: GetFilterMembersData;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* State of a filter members load that has failed.
|
|
74
|
+
*/
|
|
75
|
+
export interface FilterMembersErrorState {
|
|
76
|
+
/** Whether the data fetching is loading */
|
|
77
|
+
isLoading: false;
|
|
78
|
+
/** Whether the data fetching has failed */
|
|
51
79
|
isError: true;
|
|
80
|
+
/** Whether the data fetching has succeeded */
|
|
81
|
+
isSuccess: false;
|
|
82
|
+
/** The status of the data fetching execution */
|
|
83
|
+
status: 'error';
|
|
84
|
+
/** The error if any occurred */
|
|
85
|
+
error: Error;
|
|
52
86
|
/** The result data */
|
|
53
87
|
data: undefined;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* States of the {@link useGetFilterMembers} hook.
|
|
91
|
+
*/
|
|
92
|
+
export type FilterMembersState = FilterMembersLoadingState | FilterMembersErrorState | FilterMembersSuccessState;
|
|
93
|
+
/**
|
|
94
|
+
* Result of the {@link useGetFilterMembers} hook.
|
|
95
|
+
*/
|
|
96
|
+
export type GetFilterMembersResult = FilterMembersState & {
|
|
54
97
|
/**
|
|
55
98
|
* Function to load more data rows
|
|
56
99
|
*
|
|
57
100
|
* @internal
|
|
58
101
|
*/
|
|
59
102
|
loadMore: (count: number) => void;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* State for {@link useGetFilterMembers} hook.
|
|
63
|
-
*/
|
|
64
|
-
export type GetFilterMembersResult = GetFilterMembersError | GetFilterMembersSuccess;
|
|
103
|
+
};
|
|
65
104
|
/**
|
|
66
105
|
* {@link useGetFilterMembers} without tracking to be used inside other hooks or components in Compose SDK.
|
|
67
106
|
*
|
|
@@ -93,6 +132,5 @@ export declare const useGetFilterMembersInternal: ({ filter, defaultDataSource,
|
|
|
93
132
|
* @returns Results that contains the status of the filter query execution, the result data, or the error if any occurred
|
|
94
133
|
* @shortDescription Hook to fetch members of a filter
|
|
95
134
|
* @group Filter Tiles
|
|
96
|
-
* @beta
|
|
97
135
|
*/
|
|
98
136
|
export declare const useGetFilterMembers: (args_0: GetFilterMembersParams) => GetFilterMembersResult;
|
|
@@ -4,7 +4,7 @@ export { Chart } from './chart';
|
|
|
4
4
|
export { ThemeProvider } from './theme-provider';
|
|
5
5
|
export * from './dashboard';
|
|
6
6
|
export { WidgetById } from './widget-by-id/widget-by-id';
|
|
7
|
-
export { isChartWidgetProps, isPivotTableWidgetProps, isTextWidgetProps,
|
|
7
|
+
export { isChartWidgetProps, isPivotTableWidgetProps, isTextWidgetProps, isCustomWidgetProps, } from './widget-by-id/utils';
|
|
8
8
|
export { type CartesianWidgetType, type CategoricalWidgetType, type TabularWidgetType, type TextWidgetType, } from './widget-by-id/types';
|
|
9
9
|
export { getChartType } from './widget-by-id/utils';
|
|
10
10
|
export * from './query-execution';
|
|
@@ -38,10 +38,10 @@ export * from './areamap-chart';
|
|
|
38
38
|
export * from './area-range-chart';
|
|
39
39
|
export * from './sisense-context/custom-sisense-context-provider';
|
|
40
40
|
export * from './theme-provider/custom-theme-provider';
|
|
41
|
-
export * from './
|
|
42
|
-
export * from './
|
|
43
|
-
export {
|
|
44
|
-
export { extractDimensionsAndMeasures,
|
|
41
|
+
export * from './custom-widgets-provider/custom-widgets-provider-adapter';
|
|
42
|
+
export * from './custom-widgets-provider/types';
|
|
43
|
+
export { useCustomWidgets } from './custom-widgets-provider';
|
|
44
|
+
export { extractDimensionsAndMeasures, useExecuteCustomWidgetQuery, useExecuteCustomWidgetQueryInternal, type ExecuteCustomWidgetQueryParams, type CustomWidgetQueryState, } from './custom-widgets-provider';
|
|
45
45
|
export { getThemeSettingsByOid } from './themes/theme-loader';
|
|
46
46
|
export { getDefaultThemeSettings } from './theme-provider/default-theme-settings';
|
|
47
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';
|
|
@@ -5,6 +5,7 @@ import { IndicatorChartDesignOptions } from './chart-options-processor/translati
|
|
|
5
5
|
import { createIndicatorLegacyChartOptions } from './charts/indicator/indicator-legacy-chart-options';
|
|
6
6
|
import { ChartRendererProps } from './chart/types';
|
|
7
7
|
import { IndicatorRenderOptions } from './charts/indicator/indicator-render-options';
|
|
8
|
+
import { IndicatorDataPointEventHandler } from './props';
|
|
8
9
|
export type IndicatorLegacyChartOptions = ReturnType<typeof createIndicatorLegacyChartOptions>;
|
|
9
10
|
type IndicatorOnBeforeRender = (options: IndicatorRenderOptions) => IndicatorRenderOptions;
|
|
10
11
|
export interface IndicatorCanvasProps {
|
|
@@ -12,6 +13,7 @@ export interface IndicatorCanvasProps {
|
|
|
12
13
|
dataOptions: IndicatorChartDataOptionsInternal;
|
|
13
14
|
designOptions: IndicatorChartDesignOptions;
|
|
14
15
|
onBeforeRender?: IndicatorOnBeforeRender;
|
|
16
|
+
onDataPointClick?: IndicatorDataPointEventHandler;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* @internal
|
|
@@ -15,6 +15,13 @@ export interface GetDashboardModelOptions {
|
|
|
15
15
|
* If not specified, the default value is `false`
|
|
16
16
|
*/
|
|
17
17
|
includeFilters?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to load the dashboard in shared mode (co-authoring feature).
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
sharedMode?: boolean;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
27
|
* Retrieves a dashboard model by its OID.
|
|
@@ -8,7 +8,8 @@ export type UseDashboardModelState = DashboardModel | null;
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export declare enum UseDashboardModelActionTypeInternal {
|
|
11
|
-
DASHBOARD_INIT = "DASHBOARD.INIT"
|
|
11
|
+
DASHBOARD_INIT = "DASHBOARD.INIT",
|
|
12
|
+
UPDATE_WIDGETS_PANEL_LAYOUT_AND_WIDGETS_DELETE = "UPDATE_WIDGETS_PANEL_LAYOUT_AND_WIDGETS_DELETE"
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Action types for the dashboard model state used in {@link useDashboardModel}.
|
|
@@ -18,7 +19,8 @@ export declare enum UseDashboardModelActionTypeInternal {
|
|
|
18
19
|
export declare enum UseDashboardModelActionType {
|
|
19
20
|
FILTERS_UPDATE = "FILTERS.UPDATE",
|
|
20
21
|
ADD_WIDGET = "WIDGETS.ADD",
|
|
21
|
-
WIDGETS_PANEL_LAYOUT_UPDATE = "WIDGETS_PANEL_LAYOUT.UPDATE"
|
|
22
|
+
WIDGETS_PANEL_LAYOUT_UPDATE = "WIDGETS_PANEL_LAYOUT.UPDATE",
|
|
23
|
+
WIDGETS_DELETE = "WIDGETS.DELETE"
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
26
|
* Internal actions for the dashboard model state used in {@link useDashboardModel}.
|
|
@@ -28,13 +30,19 @@ export declare enum UseDashboardModelActionType {
|
|
|
28
30
|
export type UseDashboardModelInternalAction = UseDashboardModelAction | {
|
|
29
31
|
type: UseDashboardModelActionTypeInternal.DASHBOARD_INIT;
|
|
30
32
|
payload: DashboardModel;
|
|
33
|
+
} | {
|
|
34
|
+
type: UseDashboardModelActionTypeInternal.UPDATE_WIDGETS_PANEL_LAYOUT_AND_WIDGETS_DELETE;
|
|
35
|
+
payload: {
|
|
36
|
+
widgetsPanel: WidgetsPanelLayout;
|
|
37
|
+
widgets: string[];
|
|
38
|
+
};
|
|
31
39
|
};
|
|
32
40
|
/**
|
|
33
41
|
* Actions for the dashboard model state used in {@link useDashboardModel}.
|
|
34
42
|
*
|
|
35
43
|
* @internal
|
|
36
44
|
*/
|
|
37
|
-
export type UseDashboardModelAction = UseDashboardModelFilterUpdateAction | UseDashboardModelAddWidgetAction | UseDashboardModelLayoutUpdateAction;
|
|
45
|
+
export type UseDashboardModelAction = UseDashboardModelFilterUpdateAction | UseDashboardModelAddWidgetAction | UseDashboardModelLayoutUpdateAction | UseDashboardWidgetsDeleteAction;
|
|
38
46
|
/**
|
|
39
47
|
* Filter update actions for the dashboard model state used in {@link useDashboardModel}.
|
|
40
48
|
*
|
|
@@ -62,6 +70,15 @@ export type UseDashboardModelLayoutUpdateAction = {
|
|
|
62
70
|
type: UseDashboardModelActionType.WIDGETS_PANEL_LAYOUT_UPDATE;
|
|
63
71
|
payload: WidgetsPanelLayout;
|
|
64
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Layout update action for the dashboard model state used in {@link useDashboardModel}.
|
|
75
|
+
*
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
export type UseDashboardWidgetsDeleteAction = {
|
|
79
|
+
type: UseDashboardModelActionType.WIDGETS_DELETE;
|
|
80
|
+
payload: string[];
|
|
81
|
+
};
|
|
65
82
|
/**
|
|
66
83
|
* Reducer for the dashboard model state used in {@link useDashboardModel}.
|
|
67
84
|
*
|
|
@@ -91,4 +108,4 @@ export declare function translateFiltersAndRelationsToDto(filtersOrFilterRelatio
|
|
|
91
108
|
* @param reducer - The dashboard model reducer
|
|
92
109
|
* @internal
|
|
93
110
|
*/
|
|
94
|
-
export declare function persistDashboardModelMiddleware(dashboardOid: string | undefined, action: UseDashboardModelInternalAction, restApi: RestApi): Promise<UseDashboardModelInternalAction>;
|
|
111
|
+
export declare function persistDashboardModelMiddleware(dashboardOid: string | undefined, action: UseDashboardModelInternalAction, restApi: RestApi, sharedMode: boolean): Promise<UseDashboardModelInternalAction>;
|
package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts
CHANGED
|
@@ -39,4 +39,4 @@ export declare const useDashboardModel: (args_0: UseDashboardModelParams) => Use
|
|
|
39
39
|
*
|
|
40
40
|
* @internal
|
|
41
41
|
*/
|
|
42
|
-
export declare function useDashboardModelInternal({ dashboardOid, includeWidgets, includeFilters, persist, }: UseDashboardModelParams): UseDashboardModelResult;
|
|
42
|
+
export declare function useDashboardModelInternal({ dashboardOid, includeWidgets, includeFilters, persist, sharedMode, }: UseDashboardModelParams): UseDashboardModelResult;
|
package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-persistence.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ export interface UseDashboardPersistenceParams {
|
|
|
11
11
|
* @default true
|
|
12
12
|
*/
|
|
13
13
|
persist?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to load the dashboard in shared mode (co-authoring feature).
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
sharedMode?: boolean;
|
|
14
21
|
}
|
|
15
22
|
export interface UseDashboardPersistenceResult {
|
|
16
23
|
/**
|
|
@@ -31,4 +38,4 @@ export interface UseDashboardPersistenceResult {
|
|
|
31
38
|
* @returns Dashboard persistence state and dispatch function
|
|
32
39
|
* @internal
|
|
33
40
|
*/
|
|
34
|
-
export declare function useDashboardPersistence({ dashboard, persist, }: UseDashboardPersistenceParams): UseDashboardPersistenceResult;
|
|
41
|
+
export declare function useDashboardPersistence({ dashboard, persist, sharedMode, }: UseDashboardPersistenceParams): UseDashboardPersistenceResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecutePivotQueryParams, ExecuteQueryParams } from '../../query-execution';
|
|
2
2
|
import { WidgetModel } from './widget-model.js';
|
|
3
|
-
import { ChartProps, ChartWidgetProps, WidgetProps, PivotTableProps, PivotTableWidgetProps,
|
|
3
|
+
import { ChartProps, ChartWidgetProps, WidgetProps, PivotTableProps, PivotTableWidgetProps, CustomWidgetProps, TableProps, TableWidgetProps, TextWidgetProps, CommonWidgetProps } from '../../props';
|
|
4
4
|
import { JaqlDataSourceForDto } from '@sisense/sdk-data';
|
|
5
5
|
import { CompleteThemeSettings } from '../../types.js';
|
|
6
6
|
import { WidgetDto } from '../../widget-by-id/types.js';
|
|
@@ -117,11 +117,11 @@ export declare function toPivotTableWidgetProps(widgetModel: WidgetModel): Pivot
|
|
|
117
117
|
*/
|
|
118
118
|
export declare function toTextWidgetProps(widgetModel: WidgetModel): TextWidgetProps;
|
|
119
119
|
/**
|
|
120
|
-
* Translates a {@link WidgetModel} to the props for rendering a
|
|
120
|
+
* Translates a {@link WidgetModel} to the props for rendering a custom widget.
|
|
121
121
|
*
|
|
122
122
|
* @internal
|
|
123
123
|
*/
|
|
124
|
-
export declare function
|
|
124
|
+
export declare function toCustomWidgetProps(widgetModel: WidgetModel): CustomWidgetProps;
|
|
125
125
|
/**
|
|
126
126
|
* Translates {@link WidgetModel} to {@link CommonWidgetProps}.
|
|
127
127
|
*
|
|
@@ -35,11 +35,11 @@ export interface WidgetModel {
|
|
|
35
35
|
*/
|
|
36
36
|
widgetType: WidgetType;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Custom widget type. Only present for custom widgets.
|
|
39
39
|
*
|
|
40
|
-
* If this is a
|
|
40
|
+
* If this is a custom widget, this is typically the name/ID of the custom widget.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
customWidgetType: string;
|
|
43
43
|
/**
|
|
44
44
|
* Widget data options.
|
|
45
45
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Attribute, Filter, Measure, DataSource, Data, QueryResultData, FilterRelations } from '@sisense/sdk-data';
|
|
2
|
-
import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, ChartStyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, ThemeOid, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuItemSection, SunburstStyleOptions, ChartWidgetStyleOptions, TableWidgetStyleOptions, WidgetByIdStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions, AreamapStyleOptions, DataPoint, ScatterDataPoint, AreamapDataPoint, BoxplotDataPoint, ChartDataPoints, ScattermapDataPoint, PivotTableStyleOptions, PivotTableWidgetStyleOptions, RegularChartType, RegularChartStyleOptions, TabularChartStyleOptions, TableStyleOptions, AreaRangeStyleOptions, DrilldownSelection, TextWidgetStyleOptions, GenericDataOptions, IndicatorRenderOptions, TabberStyleProps,
|
|
2
|
+
import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, ChartStyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, ThemeOid, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuAlignment, MenuItemSection, SunburstStyleOptions, ChartWidgetStyleOptions, TableWidgetStyleOptions, WidgetByIdStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions, AreamapStyleOptions, DataPoint, ScatterDataPoint, AreamapDataPoint, BoxplotDataPoint, ChartDataPoints, ScattermapDataPoint, PivotTableStyleOptions, PivotTableWidgetStyleOptions, RegularChartType, RegularChartStyleOptions, TabularChartStyleOptions, TableStyleOptions, AreaRangeStyleOptions, DrilldownSelection, TextWidgetStyleOptions, GenericDataOptions, IndicatorRenderOptions, TabberStyleProps, IndicatorDataPoint, TextWidgetDataPoint, CustomWidgetStyleOptions } from './types';
|
|
3
3
|
import { HighchartsOptions } from './chart-options-processor/chart-options-service';
|
|
4
4
|
import { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
|
5
5
|
import { IndicatorChartDataOptions, BoxplotChartCustomDataOptions, BoxplotChartDataOptions, ScatterChartDataOptions, TableDataOptions, ScattermapChartDataOptions, AreamapChartDataOptions, PivotTableDataOptions, RegularChartDataOptions, TabularChartDataOptions, RangeChartDataOptions } from './chart-data-options/types';
|
|
@@ -278,6 +278,24 @@ export type BoxplotDataPointEventHandler = (
|
|
|
278
278
|
point: BoxplotDataPoint,
|
|
279
279
|
/** Native PointerEvent */
|
|
280
280
|
nativeEvent: PointerEvent) => void;
|
|
281
|
+
/**
|
|
282
|
+
* Click handler for when an indicator chart is clicked.
|
|
283
|
+
*/
|
|
284
|
+
export type IndicatorDataPointEventHandler = (
|
|
285
|
+
/** Data point that was clicked */
|
|
286
|
+
point: IndicatorDataPoint,
|
|
287
|
+
/** Native MouseEvent */
|
|
288
|
+
nativeEvent: MouseEvent) => void;
|
|
289
|
+
/**
|
|
290
|
+
* Click handler for when text widget is clicked.
|
|
291
|
+
*
|
|
292
|
+
* @internal
|
|
293
|
+
*/
|
|
294
|
+
export type TextWidgetDataPointEventHandler = (
|
|
295
|
+
/** Data point that was clicked */
|
|
296
|
+
point: TextWidgetDataPoint,
|
|
297
|
+
/** Native MouseEvent */
|
|
298
|
+
nativeEvent: MouseEvent) => void;
|
|
281
299
|
interface HighchartsBasedChartEventProps {
|
|
282
300
|
/**
|
|
283
301
|
* A callback that allows you to customize the underlying chart element before it is rendered.
|
|
@@ -413,6 +431,13 @@ interface IndicatorChartEventProps extends BaseChartEventProps {
|
|
|
413
431
|
* @category Callbacks
|
|
414
432
|
*/
|
|
415
433
|
onBeforeRender?: IndicatorBeforeRenderHandler;
|
|
434
|
+
/**
|
|
435
|
+
* A callback that allows you to customize what happens when indicator chart is clicked.
|
|
436
|
+
*
|
|
437
|
+
* @category Callbacks
|
|
438
|
+
* @internal
|
|
439
|
+
*/
|
|
440
|
+
onDataPointClick?: IndicatorDataPointEventHandler;
|
|
416
441
|
}
|
|
417
442
|
/**
|
|
418
443
|
* Base Chart Props to be extended by {@link ChartProps}
|
|
@@ -521,7 +546,7 @@ interface ChartEventProps extends BaseChartEventProps {
|
|
|
521
546
|
*
|
|
522
547
|
* @category Callbacks
|
|
523
548
|
*/
|
|
524
|
-
onDataPointClick?: DataPointEventHandler | ScatterDataPointEventHandler | AreamapDataPointEventHandler | BoxplotDataPointEventHandler | ScattermapDataPointEventHandler;
|
|
549
|
+
onDataPointClick?: DataPointEventHandler | ScatterDataPointEventHandler | AreamapDataPointEventHandler | BoxplotDataPointEventHandler | ScattermapDataPointEventHandler | IndicatorDataPointEventHandler;
|
|
525
550
|
/**
|
|
526
551
|
* Context menu handler callback for a data point
|
|
527
552
|
*
|
|
@@ -1158,17 +1183,25 @@ export interface TextWidgetProps {
|
|
|
1158
1183
|
* @category Widget
|
|
1159
1184
|
*/
|
|
1160
1185
|
styleOptions: TextWidgetStyleOptions;
|
|
1186
|
+
/**
|
|
1187
|
+
* A callback that allows you to customize what happens when a text widget is clicked.
|
|
1188
|
+
* Since TextWidget doesn't have specific data points, this fires when clicking anywhere on the widget.
|
|
1189
|
+
*
|
|
1190
|
+
* @category Callbacks
|
|
1191
|
+
* @internal
|
|
1192
|
+
*/
|
|
1193
|
+
onDataPointClick?: TextWidgetDataPointEventHandler;
|
|
1161
1194
|
}
|
|
1162
1195
|
/**
|
|
1163
|
-
* Props for the
|
|
1196
|
+
* Props for the Custom Widget component
|
|
1164
1197
|
*/
|
|
1165
|
-
export interface
|
|
1198
|
+
export interface CustomWidgetProps {
|
|
1166
1199
|
/**
|
|
1167
|
-
*
|
|
1200
|
+
* Custom widget type. This is typically the name/ID of the custom widget.
|
|
1168
1201
|
*
|
|
1169
1202
|
* @category Widget
|
|
1170
1203
|
*/
|
|
1171
|
-
|
|
1204
|
+
customWidgetType: string;
|
|
1172
1205
|
/**
|
|
1173
1206
|
* Data source the query is run against - e.g. `Sample ECommerce`
|
|
1174
1207
|
*
|
|
@@ -1196,17 +1229,17 @@ export interface PluginWidgetProps {
|
|
|
1196
1229
|
*/
|
|
1197
1230
|
dataOptions: GenericDataOptions;
|
|
1198
1231
|
/**
|
|
1199
|
-
* Style options for the
|
|
1232
|
+
* Style options for the custom widget.
|
|
1200
1233
|
*
|
|
1201
1234
|
* @category Widget
|
|
1202
1235
|
*/
|
|
1203
|
-
styleOptions?:
|
|
1236
|
+
styleOptions?: CustomWidgetStyleOptions;
|
|
1204
1237
|
/**
|
|
1205
1238
|
* Title of the widget
|
|
1206
1239
|
*
|
|
1207
1240
|
* @category Widget
|
|
1208
1241
|
*/
|
|
1209
|
-
title
|
|
1242
|
+
title?: string;
|
|
1210
1243
|
/**
|
|
1211
1244
|
* Description of the widget
|
|
1212
1245
|
*
|
|
@@ -1238,11 +1271,11 @@ export type WithCommonWidgetProps<BaseWidget, Type extends WidgetType> = BaseWid
|
|
|
1238
1271
|
/**
|
|
1239
1272
|
* Type of the widget component.
|
|
1240
1273
|
*/
|
|
1241
|
-
export type WidgetType = 'chart' | 'pivot' | 'text' | '
|
|
1274
|
+
export type WidgetType = 'chart' | 'pivot' | 'text' | 'custom';
|
|
1242
1275
|
/**
|
|
1243
1276
|
* Props for the widget component within a container component like dashboard.
|
|
1244
1277
|
*/
|
|
1245
|
-
export type WidgetProps = WithCommonWidgetProps<ChartWidgetProps, 'chart'> | WithCommonWidgetProps<PivotTableWidgetProps, 'pivot'> | WithCommonWidgetProps<TextWidgetProps, 'text'> | WithCommonWidgetProps<
|
|
1278
|
+
export type WidgetProps = WithCommonWidgetProps<ChartWidgetProps, 'chart'> | WithCommonWidgetProps<PivotTableWidgetProps, 'pivot'> | WithCommonWidgetProps<TextWidgetProps, 'text'> | WithCommonWidgetProps<CustomWidgetProps, 'custom'>;
|
|
1246
1279
|
/**
|
|
1247
1280
|
* Props for the facade widget component.
|
|
1248
1281
|
*
|
|
@@ -1411,6 +1444,14 @@ export interface ContextMenuProps {
|
|
|
1411
1444
|
* @category Widget
|
|
1412
1445
|
*/
|
|
1413
1446
|
children?: React.ReactNode;
|
|
1447
|
+
/**
|
|
1448
|
+
* Menu alignment configuration for positioning
|
|
1449
|
+
*
|
|
1450
|
+
* @category Widget
|
|
1451
|
+
*
|
|
1452
|
+
* @internal
|
|
1453
|
+
*/
|
|
1454
|
+
alignment?: MenuAlignment;
|
|
1414
1455
|
}
|
|
1415
1456
|
/**
|
|
1416
1457
|
* Props of the {@link DrilldownBreadcrumbs} component.
|
|
@@ -40,7 +40,7 @@ export declare const translation: {
|
|
|
40
40
|
onlyTableWidgetSupported: string;
|
|
41
41
|
onlyPivotWidgetSupported: string;
|
|
42
42
|
onlyTextWidgetSupported: string;
|
|
43
|
-
|
|
43
|
+
onlyCustomWidgetSupported: string;
|
|
44
44
|
unsupportedWidgetType: string;
|
|
45
45
|
unsupportedFusionWidgetType: string;
|
|
46
46
|
};
|
|
@@ -223,8 +223,12 @@ export declare const translation: {
|
|
|
223
223
|
details: string;
|
|
224
224
|
tooltip: string;
|
|
225
225
|
};
|
|
226
|
+
menu: {
|
|
227
|
+
deleteWidget: string;
|
|
228
|
+
distributeEqualWidth: string;
|
|
229
|
+
};
|
|
226
230
|
};
|
|
227
|
-
|
|
231
|
+
customWidgets: {
|
|
228
232
|
registerPrompt: string;
|
|
229
233
|
};
|
|
230
234
|
ai: {
|
|
@@ -363,6 +367,7 @@ export declare const translation: {
|
|
|
363
367
|
cancel: string;
|
|
364
368
|
apply: string;
|
|
365
369
|
editLayout: string;
|
|
370
|
+
viewMode: string;
|
|
366
371
|
};
|
|
367
372
|
};
|
|
368
373
|
jumpToDashboard: {
|
|
@@ -50,7 +50,7 @@ export declare const resources: {
|
|
|
50
50
|
onlyTableWidgetSupported: string;
|
|
51
51
|
onlyPivotWidgetSupported: string;
|
|
52
52
|
onlyTextWidgetSupported: string;
|
|
53
|
-
|
|
53
|
+
onlyCustomWidgetSupported: string;
|
|
54
54
|
unsupportedWidgetType: string;
|
|
55
55
|
unsupportedFusionWidgetType: string;
|
|
56
56
|
};
|
|
@@ -233,8 +233,12 @@ export declare const resources: {
|
|
|
233
233
|
details: string;
|
|
234
234
|
tooltip: string;
|
|
235
235
|
};
|
|
236
|
+
menu: {
|
|
237
|
+
deleteWidget: string;
|
|
238
|
+
distributeEqualWidth: string;
|
|
239
|
+
};
|
|
236
240
|
};
|
|
237
|
-
|
|
241
|
+
customWidgets: {
|
|
238
242
|
registerPrompt: string;
|
|
239
243
|
};
|
|
240
244
|
ai: {
|
|
@@ -373,6 +377,7 @@ export declare const resources: {
|
|
|
373
377
|
cancel: string;
|
|
374
378
|
apply: string;
|
|
375
379
|
editLayout: string;
|
|
380
|
+
viewMode: string;
|
|
376
381
|
};
|
|
377
382
|
};
|
|
378
383
|
jumpToDashboard: {
|
|
@@ -421,7 +426,7 @@ export declare const resources: {
|
|
|
421
426
|
onlyTableWidgetSupported: string;
|
|
422
427
|
onlyPivotWidgetSupported: string;
|
|
423
428
|
onlyTextWidgetSupported: string;
|
|
424
|
-
|
|
429
|
+
onlyCustomWidgetSupported: string;
|
|
425
430
|
unsupportedWidgetType: string;
|
|
426
431
|
unsupportedFusionWidgetType: string;
|
|
427
432
|
};
|
|
@@ -604,8 +609,12 @@ export declare const resources: {
|
|
|
604
609
|
details: string;
|
|
605
610
|
tooltip: string;
|
|
606
611
|
};
|
|
612
|
+
menu: {
|
|
613
|
+
deleteWidget: string;
|
|
614
|
+
distributeEqualWidth: string;
|
|
615
|
+
};
|
|
607
616
|
};
|
|
608
|
-
|
|
617
|
+
customWidgets: {
|
|
609
618
|
registerPrompt: string;
|
|
610
619
|
};
|
|
611
620
|
ai: {
|
|
@@ -744,6 +753,7 @@ export declare const resources: {
|
|
|
744
753
|
cancel: string;
|
|
745
754
|
apply: string;
|
|
746
755
|
editLayout: string;
|
|
756
|
+
viewMode: string;
|
|
747
757
|
};
|
|
748
758
|
};
|
|
749
759
|
jumpToDashboard: {
|