@sisense/sdk-ui 1.23.0 → 1.24.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 +29 -29
- package/dist/ai.js +332 -325
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +3 -3
- package/dist/index.cjs +119 -118
- package/dist/index.js +6943 -7725
- package/dist/packages/sdk-ui/src/ai/chart/chart-insights.d.ts +2 -1
- package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +7 -2
- package/dist/packages/sdk-ui/src/ai/icons/exclamation-mark-brand-icon.d.ts +3 -0
- package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +2 -0
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +5 -1
- package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +2 -2
- package/dist/packages/sdk-ui/src/analytics-composer/widget/widget-composer.d.ts +1 -0
- package/dist/packages/sdk-ui/src/api/rest-api.d.ts +12 -1
- package/dist/packages/sdk-ui/src/chart/advanced-chart.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart/regular-chart.d.ts +3 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/category-chart-options.d.ts +2 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/sunburst/sunburst-options.d.ts +2 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-options.d.ts +2 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +3 -2
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +2 -0
- package/dist/packages/sdk-ui/src/dashboard/components/dashboard-container.d.ts +1 -1
- package/dist/packages/sdk-ui/src/dashboard/components/horizontal-collapse.d.ts +6 -0
- package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +6 -1
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-filters-panel-collapsed-state.d.ts +8 -0
- package/dist/packages/sdk-ui/src/dashboard/types.d.ts +19 -1
- package/dist/packages/sdk-ui/src/decorators/component-decorators/with-error-boundary.d.ts +3 -1
- package/dist/packages/sdk-ui/src/error-boundary/error-boundary.d.ts +4 -2
- package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/custom-filter-tile.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/helpers.d.ts +6 -0
- package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +2 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +1 -0
- package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel-tile.d.ts +3 -1
- package/dist/packages/sdk-ui/src/filters/components/icons/trash-icon.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/unsupported-filter-tile.d.ts +3 -1
- package/dist/packages/sdk-ui/src/index.d.ts +3 -1
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dasboard-model-utils.d.ts +2 -4
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +24 -16
- package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +1 -0
- package/dist/packages/sdk-ui/src/models/hierarchy/get-hierarchy-models.d.ts +6 -1
- package/dist/packages/sdk-ui/src/models/hierarchy/types.d.ts +3 -0
- package/dist/packages/sdk-ui/src/models/hierarchy/use-get-hierarchy-models.d.ts +4 -4
- package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +11 -1
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-render-pivot.d.ts +3 -1
- package/dist/packages/sdk-ui/src/props.d.ts +11 -3
- package/dist/packages/sdk-ui/src/sisense-context/sisense-context.d.ts +2 -0
- package/dist/packages/sdk-ui/src/table/table-component.d.ts +1 -1
- package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +10 -0
- package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +20 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +2 -2
- package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/widgets/common/widget-container.d.ts +2 -0
- package/dist/packages/sdk-ui/src/widgets/common/widget-errors-and-warnings-context.d.ts +14 -0
- package/dist/packages/sdk-ui/src/widgets/common/widget-header-info-button.d.ts +3 -1
- package/dist/packages/sdk-ui/src/widgets/common/widget-header.d.ts +2 -0
- package/dist/useQuery-CIeSzN0Z.js +7945 -0
- package/dist/useQuery-LqaaNBLw.cjs +175 -0
- package/dist/widget-composer-CvgsMHyb.cjs +237 -0
- package/dist/widget-composer-L8kmRhgX.js +624 -0
- package/dist/widget-model-translator-CYeCKnTa.js +116687 -0
- package/dist/widget-model-translator-_Z-8UaTN.cjs +917 -0
- package/package.json +7 -7
- package/dist/derive-chart-family-CTpRObm1.js +0 -44117
- package/dist/derive-chart-family-DcALKnKU.cjs +0 -271
- package/dist/packages/sdk-ui/src/dashboard/components/HorizontalCollapse.d.ts +0 -5
- package/dist/useQuery-1xZMqnAI.js +0 -79308
- package/dist/useQuery-D9rZ58KS.cjs +0 -821
- package/dist/widget-composer-B17DVa2A.cjs +0 -101
- package/dist/widget-composer-DqjH_6dw.js +0 -448
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GetNlgQueryResultRequest } from '../../ai';
|
|
2
2
|
export interface ChartInsightsProps {
|
|
3
|
+
summary: string;
|
|
3
4
|
nlgRequest: GetNlgQueryResultRequest;
|
|
4
5
|
}
|
|
5
|
-
export declare const ChartInsights: ({ nlgRequest }: ChartInsightsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const ChartInsights: ({ summary, nlgRequest }: ChartInsightsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Filter } from '@sisense/sdk-data';
|
|
1
|
+
import { Filter, Data } from '@sisense/sdk-data';
|
|
2
2
|
import type { NlqResponseData } from '../../ai';
|
|
3
3
|
/**
|
|
4
4
|
* Props for {@link NlqChartWidget} component.
|
|
@@ -15,6 +15,11 @@ export interface NlqChartWidgetProps {
|
|
|
15
15
|
* The dashboard filters to be applied to the chart
|
|
16
16
|
*/
|
|
17
17
|
filters?: Filter[];
|
|
18
|
+
/**
|
|
19
|
+
* A callback that allows to modify data immediately after it has been retrieved.
|
|
20
|
+
* Can be used to inject modification of queried data.
|
|
21
|
+
*/
|
|
22
|
+
onDataReady?: (data: Data) => Data;
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
25
|
* React component that renders a chart widget based on NLQ response data.
|
|
@@ -38,4 +43,4 @@ export interface NlqChartWidgetProps {
|
|
|
38
43
|
* @group Generative AI
|
|
39
44
|
* @internal
|
|
40
45
|
*/
|
|
41
|
-
export declare const NlqChartWidget: ({ nlqResponse, filters }: NlqChartWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare const NlqChartWidget: ({ nlqResponse, onDataReady, filters }: NlqChartWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExpandedQueryModel, SimpleQueryModel } from '../types.js';
|
|
2
|
+
import { DynamicChartType } from '../../chart-options-processor/translations/types.js';
|
|
2
3
|
export declare function toKebabCase(str: string): string;
|
|
3
4
|
export declare function capitalizeFirstLetter(str: string): string;
|
|
4
5
|
/**
|
|
@@ -11,3 +12,4 @@ export declare function sanitizeDimensionId(str: string): string;
|
|
|
11
12
|
export declare function validateQueryModel(model: any): SimpleQueryModel;
|
|
12
13
|
export declare function isEmptyQueryModel(queryModel: ExpandedQueryModel | undefined | null): boolean;
|
|
13
14
|
export declare function escapeSingleQuotes(str?: string): string | undefined;
|
|
15
|
+
export declare function validateChartType(chartType: DynamicChartType): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WidgetProps } from '../props';
|
|
2
2
|
import { ChartDataOptions } from '../types';
|
|
3
3
|
import { MetadataItem } from '@sisense/sdk-data';
|
|
4
|
+
import { DynamicChartType } from '../chart-options-processor/translations/types.js';
|
|
4
5
|
export type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
5
6
|
export type AllPossibleChartOptionKeys = KeysOfUnion<ChartDataOptions>;
|
|
6
7
|
export type AxesMappingKey = Exclude<AllPossibleChartOptionKeys, 'seriesToColorMap'>;
|
|
@@ -22,6 +23,8 @@ export interface ExpandedQueryModel {
|
|
|
22
23
|
chartRecommendations: ChartRecommendations | {};
|
|
23
24
|
jaql: {
|
|
24
25
|
datasource: {
|
|
26
|
+
id?: string;
|
|
27
|
+
type?: 'elasticube' | 'live';
|
|
25
28
|
title: string;
|
|
26
29
|
};
|
|
27
30
|
metadata: MetadataItem[];
|
|
@@ -82,7 +85,7 @@ export type UiFramework = 'react' | 'vue' | 'angular';
|
|
|
82
85
|
* Code Template Key
|
|
83
86
|
* @internal
|
|
84
87
|
*/
|
|
85
|
-
export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'widgetByIdTmpl';
|
|
88
|
+
export type CodeTemplateKey = 'baseChartTmpl' | 'chartTmpl' | 'chartWidgetTmpl' | 'widgetByIdTmpl' | 'executeQueryByWidgetIdTmpl' | 'executeQueryWidgetTmpl';
|
|
86
89
|
/**
|
|
87
90
|
* Code Templates
|
|
88
91
|
* @internal
|
|
@@ -125,6 +128,7 @@ export type ClientSideWidgetCodeParams = WidgetCodeConfig & {
|
|
|
125
128
|
export type ByIdWidgetCodeParams = WidgetCodeConfig & {
|
|
126
129
|
dashboardOid: string;
|
|
127
130
|
widgetOid: string;
|
|
131
|
+
chartType: DynamicChartType;
|
|
128
132
|
};
|
|
129
133
|
/**
|
|
130
134
|
* Widget Code Params
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ByIdWidgetCodeParams, ClientSideWidgetCodeParams } from '../types.js';
|
|
2
|
-
export declare const toWidgetCodeById: ({ dashboardOid, widgetOid, uiFramework, }: ByIdWidgetCodeParams) => string;
|
|
3
|
-
export declare const toWidgetCodeClientSide: ({ widgetProps, uiFramework, }: ClientSideWidgetCodeParams) => string;
|
|
2
|
+
export declare const toWidgetCodeById: ({ dashboardOid, widgetOid, uiFramework, chartType, includeChart, }: ByIdWidgetCodeParams) => string;
|
|
3
|
+
export declare const toWidgetCodeClientSide: ({ widgetProps, uiFramework, includeChart, }: ClientSideWidgetCodeParams) => string;
|
|
@@ -3,6 +3,7 @@ import { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
|
|
|
3
3
|
import { type DataSource } from '@sisense/sdk-data';
|
|
4
4
|
import { HierarchyDto, WidgetDto } from '../widget-by-id/types';
|
|
5
5
|
import type { DashboardDto } from './types/dashboard-dto';
|
|
6
|
+
import { TranslatableError } from '../translation/translatable-error';
|
|
6
7
|
import { PaletteDto } from '../api/types/palette-dto';
|
|
7
8
|
import { GetHierarchiesOptions } from '../models/hierarchy/types';
|
|
8
9
|
type GetDashboardsOptions = {
|
|
@@ -53,6 +54,16 @@ export declare class RestApi {
|
|
|
53
54
|
* Partially update a dashboard
|
|
54
55
|
*/
|
|
55
56
|
patchDashboard: (dashboardOid: string, dashboard: Partial<DashboardDto>) => Promise<DashboardDto | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* Add widget to a dashboard
|
|
59
|
+
*/
|
|
60
|
+
addWidgetToDashboard: (dashboardOid: string, widgetDto: WidgetDto) => Promise<WidgetDto | undefined>;
|
|
61
|
+
}
|
|
62
|
+
export declare const useRestApi: () => {
|
|
63
|
+
restApi: RestApi | undefined;
|
|
64
|
+
isReady: boolean;
|
|
65
|
+
};
|
|
66
|
+
export declare class RestApiNotReadyError extends TranslatableError {
|
|
67
|
+
constructor();
|
|
56
68
|
}
|
|
57
|
-
export declare const useGetApi: () => RestApi;
|
|
58
69
|
export {};
|
|
@@ -4,4 +4,4 @@ import { RegularChartProps } from '../props.js';
|
|
|
4
4
|
* @param props
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
|
-
export declare const AdvancedChart: (props: RegularChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const AdvancedChart: (props: RegularChartProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Data } from '@sisense/sdk-data';
|
|
1
2
|
import { RegularChartProps } from '../props';
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
@@ -5,3 +6,5 @@ import { RegularChartProps } from '../props';
|
|
|
5
6
|
* @returns
|
|
6
7
|
*/
|
|
7
8
|
export declare const RegularChart: (props: RegularChartProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
/** Type guard for Data */
|
|
10
|
+
export declare function isData(data: any): data is Data;
|
|
@@ -3,6 +3,7 @@ import { ChartType, OptionsWithAlerts, CompleteThemeSettings } from '../types';
|
|
|
3
3
|
import { CategoricalChartData } from '../chart-data/types';
|
|
4
4
|
import { HighchartsOptionsInternal } from './chart-options-service';
|
|
5
5
|
import { ChartDataOptionsInternal } from '../chart-data-options/types';
|
|
6
|
+
import { TFunction } from '@sisense/sdk-common';
|
|
6
7
|
/**
|
|
7
8
|
* Convert intermediate chart data, data options, and design options
|
|
8
9
|
* into pure highcharts config data.
|
|
@@ -13,4 +14,4 @@ import { ChartDataOptionsInternal } from '../chart-data-options/types';
|
|
|
13
14
|
* @param dataOptions -
|
|
14
15
|
* @param themeSettings -
|
|
15
16
|
*/
|
|
16
|
-
export declare const getCategoricalChartOptions: (chartData: CategoricalChartData, chartType: ChartType, chartDesignOptions: ChartDesignOptions, dataOptions: ChartDataOptionsInternal, themeSettings?: CompleteThemeSettings) => OptionsWithAlerts<HighchartsOptionsInternal>;
|
|
17
|
+
export declare const getCategoricalChartOptions: (chartData: CategoricalChartData, chartType: ChartType, chartDesignOptions: ChartDesignOptions, dataOptions: ChartDataOptionsInternal, translate: TFunction, themeSettings?: CompleteThemeSettings) => OptionsWithAlerts<HighchartsOptionsInternal>;
|
package/dist/packages/sdk-ui/src/chart-options-processor/translations/sunburst/sunburst-options.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ import { HighchartsOptionsInternal } from '../../chart-options-service';
|
|
|
3
3
|
import { CategoricalChartDataOptionsInternal } from '../../../chart-data-options/types';
|
|
4
4
|
import { CompleteThemeSettings } from '../../../types';
|
|
5
5
|
import { SunburstChartDesignOptions } from '../design-options';
|
|
6
|
-
|
|
6
|
+
import { TFunction } from '@sisense/sdk-common';
|
|
7
|
+
export declare function prepareSunburstOptions(chartData: CategoricalChartData, dataOptions: CategoricalChartDataOptionsInternal, designOptions: SunburstChartDesignOptions, translate: TFunction, themeSettings?: CompleteThemeSettings): HighchartsOptionsInternal;
|
package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-options.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ import { HighchartsOptionsInternal } from '../../chart-options-service';
|
|
|
3
3
|
import { CategoricalChartDataOptionsInternal } from '../../../chart-data-options/types';
|
|
4
4
|
import { CompleteThemeSettings } from '../../../types';
|
|
5
5
|
import { TreemapChartDesignOptions } from '../design-options';
|
|
6
|
-
|
|
6
|
+
import { TFunction } from '@sisense/sdk-common';
|
|
7
|
+
export declare function prepareTreemapOptions(chartData: CategoricalChartData, dataOptions: CategoricalChartDataOptionsInternal, designOptions: TreemapChartDesignOptions, translate: TFunction, themeSettings?: CompleteThemeSettings): HighchartsOptionsInternal;
|
package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-tooltip.d.ts
CHANGED
|
@@ -2,11 +2,12 @@ import { CategoricalChartDataOptionsInternal } from '../../../chart-data-options
|
|
|
2
2
|
import { TreemapChartDesignOptions } from '../design-options';
|
|
3
3
|
import { TooltipSettings } from '../../tooltip';
|
|
4
4
|
import { TooltipFormatterContextObject } from '@sisense/sisense-charts';
|
|
5
|
+
import { TFunction } from '@sisense/sdk-common';
|
|
5
6
|
type TooltipFormatterOptions = {
|
|
6
7
|
displayTotalContribution: boolean;
|
|
7
8
|
displayColorCircles: boolean;
|
|
8
9
|
shouldSkip: (context: TooltipFormatterContextObject) => boolean;
|
|
9
10
|
};
|
|
10
|
-
export declare const getTreemapTooltipSettings: (chartDataOptions: CategoricalChartDataOptionsInternal, designOptions: TreemapChartDesignOptions, formatterOptions?: TooltipFormatterOptions) => TooltipSettings;
|
|
11
|
-
export declare function treemapTooltipFormatter(context: TooltipFormatterContextObject, chartDataOptions: CategoricalChartDataOptionsInternal, designOptions: TreemapChartDesignOptions, formatterOptions?: TooltipFormatterOptions): string | false;
|
|
11
|
+
export declare const getTreemapTooltipSettings: (chartDataOptions: CategoricalChartDataOptionsInternal, designOptions: TreemapChartDesignOptions, translate: TFunction, formatterOptions?: TooltipFormatterOptions) => TooltipSettings;
|
|
12
|
+
export declare function treemapTooltipFormatter(context: TooltipFormatterContextObject, chartDataOptions: CategoricalChartDataOptionsInternal, designOptions: TreemapChartDesignOptions, translate: TFunction, formatterOptions?: TooltipFormatterOptions): string | false;
|
|
12
13
|
export {};
|
|
@@ -64,4 +64,6 @@ export declare const isTable: (chartType: ChartType | TableType) => chartType is
|
|
|
64
64
|
export declare const isBoxplot: (chartType: ChartType) => chartType is "boxplot";
|
|
65
65
|
export declare const isAreamap: (chartType: ChartType) => chartType is "areamap";
|
|
66
66
|
export declare const isRange: (chartType: ChartType) => chartType is "arearange";
|
|
67
|
+
export declare const ALL_CHART_TYPES: readonly ["line", "area", "bar", "column", "polar", "pie", "funnel", "treemap", "sunburst", "scatter", "table", "indicator", "boxplot", "areamap", "image", "scattermap", "arearange"];
|
|
68
|
+
export type DynamicChartType = (typeof ALL_CHART_TYPES)[number];
|
|
67
69
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DashboardContainerProps } from '../../dashboard/types';
|
|
2
|
-
export declare const DashboardContainer: ({ title, layoutOptions, config, widgets, filters, onFiltersChange, defaultDataSource, }: DashboardContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DashboardContainer: ({ title, layoutOptions, config, widgets, filters, onFiltersChange, defaultDataSource, onChange, }: DashboardContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare const HorizontalCollapse: ({ collapsed, onCollapsedChange, children, }: {
|
|
3
|
+
collapsed?: boolean | undefined;
|
|
4
|
+
onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,11 +3,16 @@ import { DashboardProps } from '../dashboard/types';
|
|
|
3
3
|
import { Filter } from '@sisense/sdk-data';
|
|
4
4
|
export declare enum DashboardChangeType {
|
|
5
5
|
/** Dashboard filters have been updated */
|
|
6
|
-
FILTERS_UPDATE = "FILTERS.UPDATE"
|
|
6
|
+
FILTERS_UPDATE = "FILTERS.UPDATE",
|
|
7
|
+
/** Filters panel collapsed state changed */
|
|
8
|
+
UI_FILTERS_PANEL_COLLAPSE = "UI.FILTERS.PANEL.COLLAPSE"
|
|
7
9
|
}
|
|
8
10
|
export type DashboardChangeAction = {
|
|
9
11
|
type: DashboardChangeType.FILTERS_UPDATE;
|
|
10
12
|
payload: Filter[];
|
|
13
|
+
} | {
|
|
14
|
+
type: DashboardChangeType.UI_FILTERS_PANEL_COLLAPSE;
|
|
15
|
+
payload: boolean;
|
|
11
16
|
};
|
|
12
17
|
/**
|
|
13
18
|
* React component that renders a dashboard whose elements are customizable. It includes internal logic of applying common filters to widgets.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare const LS_KEY_FILTERS_PANEL_COLLAPSED = "csdk_dashboard_filters_panel_collapsed";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const useFiltersPanelCollapsedState: (initialState?: boolean, shouldUseLocalStorage?: boolean) => [boolean, (state: boolean) => void];
|
|
@@ -34,6 +34,12 @@ export interface DashboardContainerProps {
|
|
|
34
34
|
filters: Filter[];
|
|
35
35
|
onFiltersChange: (filters: Filter[]) => void;
|
|
36
36
|
defaultDataSource?: DataSource;
|
|
37
|
+
/**
|
|
38
|
+
* Callback to receive changes
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
onChange?: (action: DashboardChangeAction) => void;
|
|
37
43
|
}
|
|
38
44
|
/**
|
|
39
45
|
* Dashboard configuration
|
|
@@ -42,7 +48,19 @@ export interface DashboardContainerProps {
|
|
|
42
48
|
*/
|
|
43
49
|
export interface DashboardConfig {
|
|
44
50
|
filtersPanel?: {
|
|
45
|
-
isVisible
|
|
51
|
+
isVisible?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Boolean flag that controls the initial "collapsed" state of the filters panel.
|
|
54
|
+
*
|
|
55
|
+
* If not specified, the default value is `false`.
|
|
56
|
+
*/
|
|
57
|
+
isCollapsedInitially?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Setting this to true will use the isCollapsed state from local storage, if available, and store any changes to local storage.
|
|
60
|
+
* This state is shared across all dashboards.
|
|
61
|
+
* This state has a higher priority than "initialIsCollapsed" when enabled.
|
|
62
|
+
*/
|
|
63
|
+
persistCollapsedStateToLocalStorage?: boolean;
|
|
46
64
|
};
|
|
47
65
|
toolbar?: {
|
|
48
66
|
isVisible: boolean;
|
|
@@ -2,4 +2,6 @@ import { ComponentDecorator } from './as-sisense-component';
|
|
|
2
2
|
/**
|
|
3
3
|
* Adds error boundary to the component
|
|
4
4
|
*/
|
|
5
|
-
export declare const withErrorBoundary: ComponentDecorator<
|
|
5
|
+
export declare const withErrorBoundary: ComponentDecorator<{
|
|
6
|
+
componentName: string;
|
|
7
|
+
}>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component, ReactNode } from 'react';
|
|
2
|
-
import { SisenseContextPayload } from '../sisense-context/sisense-context';
|
|
3
2
|
import { AbstractTranslatableError } from '@sisense/sdk-common';
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
@@ -9,6 +8,8 @@ interface ErrorBoundaryProps {
|
|
|
9
8
|
error?: AbstractTranslatableError | Error | string;
|
|
10
9
|
children: ReactNode;
|
|
11
10
|
resetKeys?: any[];
|
|
11
|
+
onError?: (error: Error) => void;
|
|
12
|
+
isContainerComponent?: boolean;
|
|
12
13
|
}
|
|
13
14
|
type ErrorBoundaryState = {
|
|
14
15
|
error: AbstractTranslatableError | Error | string | null;
|
|
@@ -23,7 +24,8 @@ type ErrorBoundaryState = {
|
|
|
23
24
|
*/
|
|
24
25
|
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
25
26
|
showErrorBox: boolean;
|
|
26
|
-
|
|
27
|
+
onError?: (error: Error) => void;
|
|
28
|
+
isContainerComponent: boolean;
|
|
27
29
|
constructor(props: ErrorBoundaryProps);
|
|
28
30
|
static getDerivedStateFromError(error: Error): {
|
|
29
31
|
error: Error;
|
package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface CascadingFilterTileProps {
|
|
|
19
19
|
arrangement?: FilterVariant;
|
|
20
20
|
/** Callback returning filter object, or null for failure */
|
|
21
21
|
onChange: (filter: Filter) => void;
|
|
22
|
+
/** Filter delete callback */
|
|
23
|
+
onDelete?: () => void;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
26
|
* UI component representing group of cascading (dependent) filters.
|
package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export interface CriteriaFilterTileProps {
|
|
|
14
14
|
arrangement?: FilterVariant;
|
|
15
15
|
/** Callback returning filter object, or null for failure */
|
|
16
16
|
onUpdate: (filter: Filter | null) => void;
|
|
17
|
+
/** Filter delete callback */
|
|
18
|
+
onDelete?: () => void;
|
|
17
19
|
/** List of available measures to rank by. Required only for ranking filters. */
|
|
18
20
|
measures?: Measure[];
|
|
19
21
|
/**
|
|
@@ -15,6 +15,8 @@ export interface CustomFilterTileProps {
|
|
|
15
15
|
* @param filter - Custom filter
|
|
16
16
|
*/
|
|
17
17
|
onUpdate: (filter: Filter | null) => void;
|
|
18
|
+
/** Filter delete callback */
|
|
19
|
+
onDelete?: () => void;
|
|
18
20
|
/** Design options for the tile @internal */
|
|
19
21
|
tileDesignOptions?: FilterTileDesignOptions;
|
|
20
22
|
}
|
|
@@ -19,7 +19,8 @@ export interface RelativeDateFilterProps {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const RelativeDateFilter: FunctionComponent<RelativeDateFilterProps>;
|
|
21
21
|
export declare const DATE_OPS_MAP: {
|
|
22
|
-
readonly
|
|
22
|
+
readonly last: "dateFilter.last";
|
|
23
|
+
readonly next: "dateFilter.next";
|
|
23
24
|
};
|
|
24
25
|
export declare const DATE_LEVELS_MAP: {
|
|
25
26
|
readonly [x: string]: "dateFilter.days" | "dateFilter.weeks" | "dateFilter.months" | "dateFilter.quarters" | "dateFilter.years";
|
|
@@ -9,6 +9,8 @@ export type FiltersPanelTileProps = {
|
|
|
9
9
|
filter: Filter;
|
|
10
10
|
/** Callback to handle filter change */
|
|
11
11
|
onChange: (filter: Filter | null) => void;
|
|
12
|
+
/** Filter delete callback */
|
|
13
|
+
onDelete?: () => void;
|
|
12
14
|
/** Default data source used for filter tiles */
|
|
13
15
|
defaultDataSource?: DataSource;
|
|
14
16
|
};
|
|
@@ -17,4 +19,4 @@ export type FiltersPanelTileProps = {
|
|
|
17
19
|
*
|
|
18
20
|
* @internal
|
|
19
21
|
*/
|
|
20
|
-
export declare const FiltersPanelTile: ({ filter, onChange, defaultDataSource, }: FiltersPanelTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const FiltersPanelTile: ({ filter, onChange, onDelete, defaultDataSource, }: FiltersPanelTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const TrashIcon: (props: Pick<SVGProps<SVGElement>, 'className' | 'width' | 'height'>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const TrashIcon: (props: Pick<SVGProps<SVGElement>, 'className' | 'width' | 'height' | 'fill'>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface MemberFilterTileProps {
|
|
|
19
19
|
filter: Filter | null;
|
|
20
20
|
/** Callback indicating when the source member filter object should be updated */
|
|
21
21
|
onChange: (filter: Filter | null) => void;
|
|
22
|
+
/** Filter delete callback */
|
|
23
|
+
onDelete?: () => void;
|
|
22
24
|
/** List of filters this filter is dependent on */
|
|
23
25
|
parentFilters?: Filter[];
|
|
24
26
|
/** Design options for the tile @internal */
|
|
@@ -3,10 +3,12 @@ import { Filter } from '@sisense/sdk-data';
|
|
|
3
3
|
export type UnsupportedFilterTileProps = {
|
|
4
4
|
filter: Filter;
|
|
5
5
|
design?: FilterTileDesignOptions;
|
|
6
|
+
/** Filter delete callback */
|
|
7
|
+
onDelete?: () => void;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
8
10
|
* Filter tile component that renders an unsupported filter (which is not recognized by the JAQL to Filter translation)
|
|
9
11
|
*
|
|
10
12
|
* @internal
|
|
11
13
|
*/
|
|
12
|
-
export declare const UnsupportedFilterTile: ({ filter, design }: UnsupportedFilterTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const UnsupportedFilterTile: ({ filter, design, onDelete }: UnsupportedFilterTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,9 @@ export { ThemeProvider } from './theme-provider';
|
|
|
5
5
|
export * from './dashboard';
|
|
6
6
|
export { DashboardWidget } from './widget-by-id/dashboard-widget';
|
|
7
7
|
export { WidgetById } from './widget-by-id/widget-by-id';
|
|
8
|
+
export { isChartWidgetProps, isPivotTableWidgetProps, isTextWidgetProps, isPluginWidgetProps, } from './widget-by-id/utils';
|
|
8
9
|
export { type WidgetType, type CartesianWidgetType, type CategoricalWidgetType, type TabularWidgetType, type TextWidgetType, } from './widget-by-id/types';
|
|
10
|
+
export { getChartType } from './widget-by-id/utils';
|
|
9
11
|
export * from './query-execution';
|
|
10
12
|
export { executeQuery } from './query/execute-query';
|
|
11
13
|
export { SisenseContextProvider } from './sisense-context/sisense-context-provider';
|
|
@@ -43,7 +45,7 @@ export { usePlugins } from './plugins-provider/plugins-provider';
|
|
|
43
45
|
export { extractDimensionsAndMeasures, useExecutePluginQuery, } from './plugins-provider/use-execute-plugin-query';
|
|
44
46
|
export { getThemeSettingsByOid } from './themes/theme-loader';
|
|
45
47
|
export { getDefaultThemeSettings } from './theme-provider/default-theme-settings';
|
|
46
|
-
export { useGetDashboardModel, useGetDashboardModels, getDashboardModel, getDashboardModels, useGetWidgetModel, getWidgetModel, translateToDashboardResponse, translateToDashboardsResponse, useGetHierarchyModels, getHierarchyModels, 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 as WidgetsPanelColumnLayout, type WidgetsPanelLayout as WidgetsPanelLayout, type WidgetId, type WidgetsOptions, type CommonFiltersOptions, type CommonFiltersApplyMode, type FiltersIgnoringRules, type HierarchyModel, type Hierarchy, type HierarchyId, type
|
|
48
|
+
export { useGetDashboardModel, useGetDashboardModels, useDashboardModel, getDashboardModel, getDashboardModels, useGetWidgetModel, getWidgetModel, translateToDashboardResponse, translateToDashboardsResponse, useGetHierarchyModels, getHierarchyModels, 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 as WidgetsPanelColumnLayout, type WidgetsPanelLayout as WidgetsPanelLayout, type WidgetId, type WidgetsOptions, type CommonFiltersOptions, type CommonFiltersApplyMode, type FiltersIgnoringRules, type HierarchyModel, type Hierarchy, type HierarchyId, type GetHierarchyModelsParams, type HierarchyModelsState, type HierarchyModelsLoadingState, type HierarchyModelsErrorState, type HierarchyModelsSuccessState, UseDashboardModelActionType, } from './models';
|
|
47
49
|
/**
|
|
48
50
|
* Utility functions to translate a Fusion widget model from and to other widget data structures
|
|
49
51
|
*
|
package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dasboard-model-utils.d.ts
CHANGED
|
@@ -3,20 +3,18 @@ import { DashboardChangeAction } from '../../../dashboard/dashboard';
|
|
|
3
3
|
import { Authenticator } from '@sisense/sdk-rest-client';
|
|
4
4
|
/**
|
|
5
5
|
* Convert a dashboard change action to a use dashboard model action.
|
|
6
|
-
* @param action - The dashboard change action to convert
|
|
7
6
|
*
|
|
7
|
+
* @param action - The dashboard change action to convert
|
|
8
8
|
* @returns The useDashboardModel action or null if the action is not supported
|
|
9
|
-
*
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
11
|
export declare function dashboardChangeActionToUseDashboardModelAction(action: DashboardChangeAction): UseDashboardModelAction | null;
|
|
13
12
|
/**
|
|
14
13
|
* Check if the persistence is supported and log a warning if it is not.
|
|
14
|
+
*
|
|
15
15
|
* @param authType - The authentication type
|
|
16
16
|
* @param shouldWarn - Whether to log a warning
|
|
17
|
-
*
|
|
18
17
|
* @returns True if the persistence is supported, false otherwise
|
|
19
|
-
*
|
|
20
18
|
* @internal
|
|
21
19
|
*/
|
|
22
20
|
export declare function checkPersistenceSupport(authType: Authenticator['type'], shouldWarn: boolean): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DashboardModel } from '../../../models';
|
|
1
|
+
import { DashboardModel, WidgetModel } from '../../../models';
|
|
2
2
|
import { Filter } from '@sisense/sdk-data';
|
|
3
3
|
import { RestApi } from '../../../api/rest-api';
|
|
4
4
|
export type UseDashboardModelState = DashboardModel | null;
|
|
@@ -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
|
+
DASHBOARD_UPDATE_LAYOUT = "DASHBOARD.UPDATE_LAYOUT"
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Action types for the dashboard model state used in {@link useDashboardModel}.
|
|
@@ -16,14 +17,15 @@ export declare enum UseDashboardModelActionTypeInternal {
|
|
|
16
17
|
* @internal
|
|
17
18
|
*/
|
|
18
19
|
export declare enum UseDashboardModelActionType {
|
|
19
|
-
FILTERS_UPDATE = "FILTERS.UPDATE"
|
|
20
|
+
FILTERS_UPDATE = "FILTERS.UPDATE",
|
|
21
|
+
ADD_WIDGET = "WIDGETS.ADD"
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Internal actions for the dashboard model state used in {@link useDashboardModel}.
|
|
23
25
|
*
|
|
24
26
|
* @internal
|
|
25
27
|
*/
|
|
26
|
-
type UseDashboardModelInternalAction = UseDashboardModelAction | {
|
|
28
|
+
export type UseDashboardModelInternalAction = UseDashboardModelAction | {
|
|
27
29
|
type: UseDashboardModelActionTypeInternal.DASHBOARD_INIT;
|
|
28
30
|
payload: DashboardModel;
|
|
29
31
|
};
|
|
@@ -32,32 +34,38 @@ type UseDashboardModelInternalAction = UseDashboardModelAction | {
|
|
|
32
34
|
*
|
|
33
35
|
* @internal
|
|
34
36
|
*/
|
|
35
|
-
export type UseDashboardModelAction =
|
|
37
|
+
export type UseDashboardModelAction = UseDashboardModelFilterUpdateAction | UseDashboardModelAddWidgetAction;
|
|
38
|
+
/**
|
|
39
|
+
* Filter update actions for the dashboard model state used in {@link useDashboardModel}.
|
|
40
|
+
*
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export type UseDashboardModelFilterUpdateAction = {
|
|
36
44
|
type: UseDashboardModelActionType.FILTERS_UPDATE;
|
|
37
45
|
payload: Filter[];
|
|
38
46
|
};
|
|
39
47
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param state
|
|
42
|
-
* @param action
|
|
48
|
+
* Add widget action for the dashboard model state used in {@link useDashboardModel}.
|
|
43
49
|
*
|
|
44
50
|
* @internal
|
|
45
51
|
*/
|
|
46
|
-
export
|
|
52
|
+
export type UseDashboardModelAddWidgetAction = {
|
|
53
|
+
type: UseDashboardModelActionType.ADD_WIDGET;
|
|
54
|
+
payload: WidgetModel;
|
|
55
|
+
};
|
|
47
56
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @param restApi - The Sisense REST API instance
|
|
50
|
-
* @param reducer - The dashboard model reducer
|
|
57
|
+
* Reducer for the dashboard model state used in {@link useDashboardModel}.
|
|
51
58
|
*
|
|
59
|
+
* @param state
|
|
60
|
+
* @param action
|
|
52
61
|
* @internal
|
|
53
62
|
*/
|
|
54
|
-
export declare function
|
|
63
|
+
export declare function dashboardReducer(state: UseDashboardModelState, action: UseDashboardModelInternalAction): UseDashboardModelState;
|
|
55
64
|
/**
|
|
56
65
|
* Middleware that persists the dashboard model changes to the Sisense server.
|
|
66
|
+
*
|
|
57
67
|
* @param restApi - The Sisense REST API instance
|
|
58
68
|
* @param reducer - The dashboard model reducer
|
|
59
|
-
*
|
|
60
69
|
* @internal
|
|
61
70
|
*/
|
|
62
|
-
export declare function persistDashboardModelMiddleware(
|
|
63
|
-
export {};
|
|
71
|
+
export declare function persistDashboardModelMiddleware(dashbordOid: string | undefined, action: UseDashboardModelInternalAction, restApi: RestApi): Promise<UseDashboardModelInternalAction>;
|
package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { UseDashboardModelAction } from './use-dashboard-model-reducer';
|
|
|
4
4
|
export interface UseDashboardModelParams extends GetDashboardModelParams {
|
|
5
5
|
/**
|
|
6
6
|
* Boolean flag indicating whether changes to the dashboard state should be saved to the dashboard in Fusion
|
|
7
|
+
*
|
|
7
8
|
* @default true
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
|
+
import { HierarchyModel } from '../../models';
|
|
2
3
|
import { DataSource } from '@sisense/sdk-data';
|
|
3
4
|
import { GetHierarchiesOptions } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Options for retrieving hierarchy models.
|
|
7
|
+
*/
|
|
8
|
+
export type GetHierarchyModelsOptions = GetHierarchiesOptions;
|
|
4
9
|
/** @internal */
|
|
5
|
-
export declare function getHierarchyModels(http: HttpClient, options:
|
|
10
|
+
export declare function getHierarchyModels(http: HttpClient, options: GetHierarchyModelsOptions, defaultDataSource?: DataSource): Promise<HierarchyModel[]>;
|