@sisense/sdk-ui-angular 2.17.0 → 2.18.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/esm2020/lib/components/charts/pivot-table.component.mjs +21 -3
- package/dist/esm2020/lib/components/widgets/pivot-table-widget.component.mjs +24 -3
- package/dist/esm2020/lib/components/widgets/widget.component.mjs +1 -1
- package/dist/esm2020/lib/helpers/widget-props-preact-translator.mjs +5 -2
- package/dist/esm2020/lib/sdk-ui-core-exports.mjs +1 -1
- package/dist/esm2020/lib/services/dashboard.service.mjs +18 -6
- package/dist/esm2020/lib/services/widget.service.mjs +146 -6
- package/dist/esm2020/lib/types/chart-event-props.mjs +1 -1
- package/dist/esm2020/lib/types/data-point.mjs +1 -1
- package/dist/esm2020/lib/utilities/widget-model-translator.mjs +52 -1
- package/dist/esm2020/public-api.mjs +1 -1
- package/dist/esm2020/version.mjs +2 -2
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs +257 -15
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs +257 -15
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/lib/components/charts/pivot-table.component.d.ts +16 -3
- package/dist/lib/components/widgets/pivot-table-widget.component.d.ts +22 -3
- package/dist/lib/components/widgets/widget.component.d.ts +8 -4
- package/dist/lib/sdk-ui-core-exports.d.ts +1 -1
- package/dist/lib/services/dashboard.service.d.ts +13 -5
- package/dist/lib/services/widget.service.d.ts +100 -2
- package/dist/lib/types/chart-event-props.d.ts +15 -1
- package/dist/lib/types/data-point.d.ts +13 -2
- package/dist/lib/utilities/widget-model-translator.d.ts +50 -1
- package/dist/package.json +1 -1
- package/dist/public-api.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef, OnChanges, OnDestroy } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy } from '@angular/core';
|
|
2
2
|
import { type PivotTableProps as PivotTablePropsPreact } from '@sisense/sdk-ui-preact';
|
|
3
3
|
import { SisenseContextService } from '../../services';
|
|
4
4
|
import { ThemeService } from '../../services';
|
|
5
|
+
import type { PivotTableDataPointEvent, PivotTableEventProps, WithoutPreactChartEventProps } from '../../types';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
/**
|
|
7
8
|
* Props of the {@link PivotTableComponent}.
|
|
8
9
|
*/
|
|
9
|
-
export interface PivotTableProps extends PivotTablePropsPreact {
|
|
10
|
+
export interface PivotTableProps extends WithoutPreactChartEventProps<PivotTablePropsPreact>, PivotTableEventProps {
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Pivot Table with and pagination.
|
|
@@ -104,6 +105,18 @@ export declare class PivotTableComponent implements AfterViewInit, OnChanges, On
|
|
|
104
105
|
* @category Representation
|
|
105
106
|
*/
|
|
106
107
|
styleOptions: PivotTableProps['styleOptions'];
|
|
108
|
+
/**
|
|
109
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointClick}
|
|
110
|
+
*
|
|
111
|
+
* @category Callbacks
|
|
112
|
+
*/
|
|
113
|
+
dataPointClick: EventEmitter<PivotTableDataPointEvent>;
|
|
114
|
+
/**
|
|
115
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointContextMenu}
|
|
116
|
+
*
|
|
117
|
+
* @category Callbacks
|
|
118
|
+
*/
|
|
119
|
+
dataPointContextMenu: EventEmitter<PivotTableDataPointEvent>;
|
|
107
120
|
private componentAdapter;
|
|
108
121
|
constructor(sisenseContextService: SisenseContextService, themeService: ThemeService);
|
|
109
122
|
/** @internal */
|
|
@@ -114,5 +127,5 @@ export declare class PivotTableComponent implements AfterViewInit, OnChanges, On
|
|
|
114
127
|
/** @internal */
|
|
115
128
|
ngOnDestroy(): void;
|
|
116
129
|
static ɵfac: i0.ɵɵFactoryDeclaration<PivotTableComponent, never>;
|
|
117
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PivotTableComponent, "csdk-pivot-table", never, { "dataSet": "dataSet"; "dataOptions": "dataOptions"; "filters": "filters"; "highlights": "highlights"; "styleOptions": "styleOptions"; }, {}, never, never, false, never>;
|
|
130
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PivotTableComponent, "csdk-pivot-table", never, { "dataSet": "dataSet"; "dataOptions": "dataOptions"; "filters": "filters"; "highlights": "highlights"; "styleOptions": "styleOptions"; }, { "dataPointClick": "dataPointClick"; "dataPointContextMenu": "dataPointContextMenu"; }, never, never, false, never>;
|
|
118
131
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef, OnChanges, OnDestroy } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy } from '@angular/core';
|
|
2
2
|
import { type PivotTableWidgetProps as PivotTableWidgetPropsPreact } from '@sisense/sdk-ui-preact';
|
|
3
3
|
import { SisenseContextService } from '../../services';
|
|
4
4
|
import { ThemeService } from '../../services';
|
|
5
|
+
import type { PivotTableDataPointEvent, PivotTableEventProps, WithoutPreactChartEventProps } from '../../types';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
/**
|
|
7
8
|
* Props of the {@link PivotTableWidgetComponent}.
|
|
8
9
|
*/
|
|
9
|
-
export interface PivotTableWidgetProps extends
|
|
10
|
+
export interface PivotTableWidgetProps extends WithoutPreactChartEventProps<PivotTableWidgetPropsPreact>, PivotTableEventProps {
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* The Pivot Table Widget component extends the {@link PivotTableComponent} component to support widget features,
|
|
@@ -100,6 +101,12 @@ export declare class PivotTableWidgetComponent implements AfterViewInit, OnChang
|
|
|
100
101
|
* @category Representation
|
|
101
102
|
*/
|
|
102
103
|
styleOptions: PivotTableWidgetProps['styleOptions'];
|
|
104
|
+
/**
|
|
105
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.drilldownOptions}
|
|
106
|
+
*
|
|
107
|
+
* @category Widget
|
|
108
|
+
*/
|
|
109
|
+
drilldownOptions: PivotTableWidgetProps['drilldownOptions'];
|
|
103
110
|
/**
|
|
104
111
|
* {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.title}
|
|
105
112
|
*
|
|
@@ -112,6 +119,18 @@ export declare class PivotTableWidgetComponent implements AfterViewInit, OnChang
|
|
|
112
119
|
* @category Widget
|
|
113
120
|
*/
|
|
114
121
|
description: PivotTableWidgetProps['description'];
|
|
122
|
+
/**
|
|
123
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.onDataPointClick}
|
|
124
|
+
*
|
|
125
|
+
* @category Callbacks
|
|
126
|
+
*/
|
|
127
|
+
dataPointClick: EventEmitter<PivotTableDataPointEvent>;
|
|
128
|
+
/**
|
|
129
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.onDataPointContextMenu}
|
|
130
|
+
*
|
|
131
|
+
* @category Callbacks
|
|
132
|
+
*/
|
|
133
|
+
dataPointContextMenu: EventEmitter<PivotTableDataPointEvent>;
|
|
115
134
|
private componentAdapter;
|
|
116
135
|
constructor(sisenseContextService: SisenseContextService, themeService: ThemeService);
|
|
117
136
|
/** @internal */
|
|
@@ -122,5 +141,5 @@ export declare class PivotTableWidgetComponent implements AfterViewInit, OnChang
|
|
|
122
141
|
/** @internal */
|
|
123
142
|
ngOnDestroy(): void;
|
|
124
143
|
static ɵfac: i0.ɵɵFactoryDeclaration<PivotTableWidgetComponent, never>;
|
|
125
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PivotTableWidgetComponent, "csdk-pivot-table-widget", never, { "dataSource": "dataSource"; "dataOptions": "dataOptions"; "filters": "filters"; "highlights": "highlights"; "styleOptions": "styleOptions"; "title": "title"; "description": "description"; }, {}, never, never, false, never>;
|
|
144
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PivotTableWidgetComponent, "csdk-pivot-table-widget", never, { "dataSource": "dataSource"; "dataOptions": "dataOptions"; "filters": "filters"; "highlights": "highlights"; "styleOptions": "styleOptions"; "drilldownOptions": "drilldownOptions"; "title": "title"; "description": "description"; }, { "dataPointClick": "dataPointClick"; "dataPointContextMenu": "dataPointContextMenu"; }, never, never, false, never>;
|
|
126
145
|
}
|
|
@@ -3,7 +3,7 @@ import { type BeforeMenuOpenHandler, CustomWidgetProps, type SoftUnion, TextWidg
|
|
|
3
3
|
import { SisenseContextService } from '../../services/sisense-context.service';
|
|
4
4
|
import { ThemeService } from '../../services/theme.service';
|
|
5
5
|
import { TextWidgetEventProps, WithoutPreactChartEventProps } from '../../types';
|
|
6
|
-
import {
|
|
6
|
+
import { ChartDataPointsEvent, ChartDataPointsEventHandler, WidgetDataPointClickEvent, WidgetDataPointClickEventHandler, WidgetDataPointContextMenuEvent, WidgetDataPointContextMenuEventHandler } from '../../types/data-point';
|
|
7
7
|
import { ChartWidgetProps } from './chart-widget.component';
|
|
8
8
|
import { PivotTableWidgetProps } from './pivot-table-widget.component';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
@@ -35,7 +35,11 @@ export type WithCommonWidgetProps<BaseWidget, Type> = BaseWidget & {
|
|
|
35
35
|
/**
|
|
36
36
|
* Props of the {@link WidgetComponent}.
|
|
37
37
|
*/
|
|
38
|
-
export type WidgetProps = SoftUnion<WithCommonWidgetProps<ChartWidgetProps, 'chart'> | WithCommonWidgetProps<PivotTableWidgetProps, 'pivot'> | WithCommonWidgetProps<TextWidgetProps, 'text'> | WithCommonWidgetProps<CustomWidgetProps, 'custom'
|
|
38
|
+
export type WidgetProps = SoftUnion<WithCommonWidgetProps<ChartWidgetProps, 'chart'> | WithCommonWidgetProps<PivotTableWidgetProps, 'pivot'> | WithCommonWidgetProps<TextWidgetProps, 'text'> | WithCommonWidgetProps<CustomWidgetProps, 'custom'>> & {
|
|
39
|
+
dataPointClick?: WidgetDataPointClickEventHandler;
|
|
40
|
+
dataPointContextMenu?: WidgetDataPointContextMenuEventHandler;
|
|
41
|
+
dataPointsSelect?: ChartDataPointsEventHandler;
|
|
42
|
+
};
|
|
39
43
|
/**
|
|
40
44
|
* Facade component that renders a widget within a dashboard based on the widget type.
|
|
41
45
|
*
|
|
@@ -188,13 +192,13 @@ export declare class WidgetComponent implements AfterViewInit, OnChanges, OnDest
|
|
|
188
192
|
*
|
|
189
193
|
* @category Callbacks
|
|
190
194
|
*/
|
|
191
|
-
dataPointClick: EventEmitter<
|
|
195
|
+
dataPointClick: EventEmitter<WidgetDataPointClickEvent>;
|
|
192
196
|
/**
|
|
193
197
|
* {@inheritDoc @sisense/sdk-ui!ChartWidgetProps.onDataPointContextMenu}
|
|
194
198
|
*
|
|
195
199
|
* @category Callbacks
|
|
196
200
|
*/
|
|
197
|
-
dataPointContextMenu: EventEmitter<
|
|
201
|
+
dataPointContextMenu: EventEmitter<WidgetDataPointContextMenuEvent>;
|
|
198
202
|
/**
|
|
199
203
|
* {@inheritDoc @sisense/sdk-ui!ChartWidgetProps.onDataPointsSelected}
|
|
200
204
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { boxWhiskerProcessResult, extractDimensionsAndMeasures } from '@sisense/sdk-ui-preact';
|
|
2
|
-
export type { AppConfig, AreamapChartDataOptions, AreamapChartType, AreamapStyleOptions, AreaRangeStyleOptions, AreaStyleOptions, AreaSubtype, AxisLabel, BeforeRenderHandler, BoxplotChartCustomDataOptions, BoxplotChartDataOptions, BoxplotChartType, BoxplotDataPoint, BoxplotStyleOptions, BoxplotSubtype, BoxWhiskerType, CalendarDayOfWeek, CalendarHeatmapChartDataOptions, CalendarHeatmapChartType, CalendarHeatmapDataPoint, CalendarHeatmapStyleOptions, CalendarHeatmapSubtype, CalendarHeatmapViewType, CartesianChartDataOptions, CartesianChartType, CartesianWidgetType, CategoricalChartDataOptions, CategoricalChartType, CategoricalWidgetType, ChartDataOptions, ChartStyleOptions, ChartType, ChartWidgetStyleOptions, Color, ColorPaletteTheme, CommonWidgetProps, ConditionalDataColorOptions, Convolution, DashboardLayoutOptions, DashboardModel, DashStyle, DataColorCondition, DataColorOptions, DataLimits, DataPoint, DateConfig, DateLevel, DayOfWeek, DecimalScale, DrilldownOptions, DrilldownSelection, EndCapType, FilterVariant, FunnelStyleOptions, GaugeIndicatorStyleOptions, GetDashboardModelOptions, GetDashboardModelsOptions, Hierarchy, HierarchyModel, HighchartsOptions, IndicatorBeforeRenderHandler, IndicatorChartDataOptions, IndicatorChartType, IndicatorComponents, IndicatorDataPoint, IndicatorRenderOptions, IndicatorStyleOptions, Labels, Legend, LineOptions, LineStyleOptions, LineSubtype, LineWidth, Markers, Member, MenuItemSection, MenuPosition, MonthOfYear, MultiColumnValueToColorMap, Navigator, NumberFormatConfig, NumericBarIndicatorStyleOptions, NumericSimpleIndicatorStyleOptions, PieStyleOptions, PieSubtype, PivotRowsSort, PivotTableDataOptions, PivotTableStyleOptions, PivotTableWidgetStyleOptions, PolarStyleOptions, PolarSubtype, RangeChartDataOptions, RangeChartType, RangeDataColorOptions, ScatterChartDataOptions, ScatterChartType, ScatterDataPoint, ScattermapChartDataOptions, ScattermapChartType, ScattermapLocationLevel, ScattermapMarkers, ScattermapStyleOptions, ScatterMarkerSize, ScatterStyleOptions, SeriesChartType, SeriesLabels, SortDirection, StackableStyleOptions, StackableSubtype, StyledColumn, StyledMeasureColumn, StreamgraphStyleOptions, SunburstStyleOptions, TableDataOptions, TableStyleOptions, TableType, TabularWidgetType, ThemeOid, ThemeSettings, TranslationConfig, TreemapStyleOptions, UniformDataColorOptions, ValueToColorMap, WidgetByIdStyleOptions, WidgetDataOptions, WidgetId, WidgetModel, WidgetsOptions, WidgetsPanelColumnLayout, WidgetsPanelLayout, WidgetStyleOptions, WidgetType, X2Title, } from '@sisense/sdk-ui-preact';
|
|
2
|
+
export type { AppConfig, AreamapChartDataOptions, AreamapChartType, AreamapStyleOptions, AreaRangeStyleOptions, AreaStyleOptions, AreaSubtype, AxisLabel, BeforeRenderHandler, BoxplotChartCustomDataOptions, BoxplotChartDataOptions, BoxplotChartType, BoxplotDataPoint, BoxplotStyleOptions, BoxplotSubtype, BoxWhiskerType, CalendarDayOfWeek, CalendarHeatmapChartDataOptions, CalendarHeatmapChartType, CalendarHeatmapDataPoint, CalendarHeatmapStyleOptions, CalendarHeatmapSubtype, CalendarHeatmapViewType, CartesianChartDataOptions, CartesianChartType, CartesianWidgetType, CategoricalChartDataOptions, CategoricalChartType, CategoricalWidgetType, ChartDataOptions, ChartStyleOptions, ChartType, ChartWidgetStyleOptions, Color, ColorPaletteTheme, CommonWidgetProps, ConditionalDataColorOptions, Convolution, DashboardLayoutOptions, DashboardModel, DashStyle, DataColorCondition, DataColorOptions, DataLimits, DataOptionLocation, DataPoint, DateConfig, DateLevel, DayOfWeek, DecimalScale, DrilldownOptions, DrilldownSelection, EndCapType, FilterVariant, FunnelStyleOptions, GaugeIndicatorStyleOptions, GetDashboardModelOptions, GetDashboardModelsOptions, Hierarchy, HierarchyModel, HighchartsOptions, IndicatorBeforeRenderHandler, IndicatorChartDataOptions, IndicatorChartType, IndicatorComponents, IndicatorDataPoint, IndicatorRenderOptions, IndicatorStyleOptions, Labels, Legend, LineOptions, LineStyleOptions, LineSubtype, LineWidth, Markers, Member, MenuItemSection, MenuPosition, MonthOfYear, MultiColumnValueToColorMap, Navigator, NumberFormatConfig, NumericBarIndicatorStyleOptions, NumericSimpleIndicatorStyleOptions, PieStyleOptions, PieSubtype, PivotRowsSort, PivotTableDataOptions, PivotTableDrilldownOptions, PivotTableNonSelectableDrilldownOptions, PivotTableSelectableDrilldownOptions, PivotTableStyleOptions, PivotTableWidgetStyleOptions, PolarStyleOptions, PolarSubtype, RangeChartDataOptions, RangeChartType, RangeDataColorOptions, ScatterChartDataOptions, ScatterChartType, ScatterDataPoint, ScattermapChartDataOptions, ScattermapChartType, ScattermapLocationLevel, ScattermapMarkers, ScattermapStyleOptions, ScatterMarkerSize, ScatterStyleOptions, SeriesChartType, SeriesLabels, SortDirection, StackableStyleOptions, StackableSubtype, StyledColumn, StyledMeasureColumn, StreamgraphStyleOptions, SunburstStyleOptions, TableDataOptions, TableStyleOptions, TableType, TabularWidgetType, ThemeOid, ThemeSettings, TranslationConfig, TreemapStyleOptions, UniformDataColorOptions, ValueToColorMap, WidgetByIdStyleOptions, WidgetDataOptions, WidgetId, JumpToDashboardConfig, JumpToDashboardConfigForPivot, WidgetModel, WidgetsOptions, WidgetsPanelColumnLayout, WidgetsPanelLayout, WidgetStyleOptions, WidgetType, X2Title, } from '@sisense/sdk-ui-preact';
|
|
@@ -71,7 +71,7 @@ export declare class DashboardService {
|
|
|
71
71
|
*
|
|
72
72
|
* ```ts
|
|
73
73
|
// Component behavior in example.component.ts
|
|
74
|
-
import { Component } from '@angular/core';
|
|
74
|
+
import { Component, OnDestroy } from '@angular/core';
|
|
75
75
|
import { BehaviorSubject } from 'rxjs';
|
|
76
76
|
import { DashboardService, type DashboardProps } from '@sisense/sdk-ui-angular';
|
|
77
77
|
|
|
@@ -80,15 +80,20 @@ export declare class DashboardService {
|
|
|
80
80
|
templateUrl: './example.component.html',
|
|
81
81
|
styleUrls: ['./example.component.scss'],
|
|
82
82
|
})
|
|
83
|
-
export class ExampleComponent {
|
|
83
|
+
export class ExampleComponent implements OnDestroy {
|
|
84
84
|
dashboard$: BehaviorSubject<DashboardProps> | undefined;
|
|
85
|
+
private composedDashboard: ReturnType<DashboardService['createComposedDashboard']> | undefined;
|
|
85
86
|
|
|
86
87
|
constructor(private dashboardService: DashboardService) {}
|
|
87
88
|
|
|
88
89
|
ngOnInit() {
|
|
89
90
|
const initialDashboard: DashboardProps = { ... };
|
|
90
|
-
|
|
91
|
-
this.dashboard$ = composedDashboard.dashboard$;
|
|
91
|
+
this.composedDashboard = this.dashboardService.createComposedDashboard(initialDashboard);
|
|
92
|
+
this.dashboard$ = this.composedDashboard.dashboard$;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
ngOnDestroy() {
|
|
96
|
+
this.composedDashboard?.destroy();
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
trackByIndex = (index: number) => index;
|
|
@@ -98,12 +103,15 @@ export declare class DashboardService {
|
|
|
98
103
|
* ```
|
|
99
104
|
* @param initialDashboard - Initial dashboard
|
|
100
105
|
* @param options - Configuration options
|
|
101
|
-
* @returns Reactive composed dashboard object and API methods for interacting with it
|
|
106
|
+
* @returns Reactive composed dashboard object and API methods for interacting with it.
|
|
107
|
+
* The returned object includes a `destroy()` method that should be called when
|
|
108
|
+
* the dashboard is no longer needed to prevent memory leaks (e.g., in `ngOnDestroy`).
|
|
102
109
|
*/
|
|
103
110
|
createComposedDashboard<D extends ComposableDashboardProps | DashboardProps>(initialDashboard: D, options?: UseComposedDashboardOptions): {
|
|
104
111
|
dashboard$: BehaviorSubject<D>;
|
|
105
112
|
setFilters: (filters: Filter[] | FilterRelations) => Promise<void>;
|
|
106
113
|
setWidgetsLayout: (newLayout: WidgetsPanelLayout) => Promise<void>;
|
|
114
|
+
destroy: () => void;
|
|
107
115
|
};
|
|
108
116
|
static ɵfac: i0.ɵɵFactoryDeclaration<DashboardService, never>;
|
|
109
117
|
static ɵprov: i0.ɵɵInjectableDeclaration<DashboardService>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { type GetWidgetModelParams as GetWidgetModelParamsPreact } from '@sisense/sdk-ui-preact';
|
|
1
|
+
import { type GetWidgetModelParams as GetWidgetModelParamsPreact, type JumpToDashboardConfig, type JumpToDashboardConfigForPivot } from '@sisense/sdk-ui-preact';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { type WidgetProps } from '../components/widgets/widget.component';
|
|
2
4
|
import { SisenseContextService } from './sisense-context.service';
|
|
5
|
+
import { ThemeService } from './theme.service';
|
|
3
6
|
import * as i0 from "@angular/core";
|
|
4
7
|
/**
|
|
5
8
|
* Parameters for retrieving an existing widget model from the Sisense instance
|
|
@@ -14,7 +17,8 @@ export interface GetWidgetModelParams extends Omit<GetWidgetModelParamsPreact, '
|
|
|
14
17
|
*/
|
|
15
18
|
export declare class WidgetService {
|
|
16
19
|
private sisenseContextService;
|
|
17
|
-
|
|
20
|
+
private themeService;
|
|
21
|
+
constructor(sisenseContextService: SisenseContextService, themeService: ThemeService);
|
|
18
22
|
/**
|
|
19
23
|
* Retrieves an existing widget model from the Sisense instance.
|
|
20
24
|
*
|
|
@@ -22,6 +26,100 @@ export declare class WidgetService {
|
|
|
22
26
|
* @returns Widget model
|
|
23
27
|
*/
|
|
24
28
|
getWidgetModel(params: GetWidgetModelParams): Promise<import("@sisense/sdk-ui-preact").WidgetModel>;
|
|
29
|
+
/**
|
|
30
|
+
* Adds Jump To Dashboard (JTD) functionality to widget props.
|
|
31
|
+
*
|
|
32
|
+
* Jump To Dashboard (JTD) allows users to navigate from one dashboard to another when interacting with widgets,
|
|
33
|
+
* such as clicking on chart data points or using context menus. This method is particularly useful when rendering
|
|
34
|
+
* Widget components directly (not through a Dashboard component), but you still want JTD navigation functionality.
|
|
35
|
+
*
|
|
36
|
+
* For widgets that are part of a dashboard, consider using `applyJtdConfig` or `applyJtdConfigs` instead,
|
|
37
|
+
* as they apply JTD configuration at the dashboard level rather than individual widget level.
|
|
38
|
+
*
|
|
39
|
+
* Note: dashboard-only 'includeDashboardFilters' is not supported and would just be ignored, since we do not have a dashboard in the current context.
|
|
40
|
+
*
|
|
41
|
+
* This method enhances the provided widget props with JTD navigation capabilities, including:
|
|
42
|
+
* - Click and right-click event handlers for navigation
|
|
43
|
+
* - Hyperlink styling for actionable pivot cells (when applicable)
|
|
44
|
+
* - JTD icon display in widget headers
|
|
45
|
+
* @example
|
|
46
|
+
* ```TypeScript
|
|
47
|
+
* import { Component, OnDestroy } from '@angular/core';
|
|
48
|
+
* import {
|
|
49
|
+
* WidgetService,
|
|
50
|
+
* widgetModelTranslator,
|
|
51
|
+
* type WidgetProps,
|
|
52
|
+
* } from '@sisense/sdk-ui-angular';
|
|
53
|
+
* import { BehaviorSubject } from 'rxjs';
|
|
54
|
+
*
|
|
55
|
+
* @Component({
|
|
56
|
+
* selector: 'code-example',
|
|
57
|
+
* template: `
|
|
58
|
+
* <csdk-widget
|
|
59
|
+
* *ngIf="widgetProps$ && (widgetProps$ | async) as widgetProps"
|
|
60
|
+
* [id]="widgetProps.id"
|
|
61
|
+
* [widgetType]="widgetProps.widgetType"
|
|
62
|
+
* [chartType]="widgetProps.chartType"
|
|
63
|
+
* [title]="widgetProps.title"
|
|
64
|
+
* [dataSource]="widgetProps.dataSource"
|
|
65
|
+
* [dataOptions]="widgetProps.dataOptions"
|
|
66
|
+
* [filters]="widgetProps.filters"
|
|
67
|
+
* [highlights]="widgetProps.highlights"
|
|
68
|
+
* [styleOptions]="widgetProps.styleOptions"
|
|
69
|
+
* [beforeMenuOpen]="widgetProps.beforeMenuOpen"
|
|
70
|
+
* (dataPointClick)="widgetProps.dataPointClick?.($event)"
|
|
71
|
+
* (dataPointContextMenu)="widgetProps.dataPointContextMenu?.($event)"
|
|
72
|
+
* (dataPointsSelect)="widgetProps.dataPointsSelect?.($event)"
|
|
73
|
+
* />
|
|
74
|
+
* `,
|
|
75
|
+
* })
|
|
76
|
+
* export class CodeExample implements OnDestroy {
|
|
77
|
+
* constructor(private widgetService: WidgetService) {}
|
|
78
|
+
*
|
|
79
|
+
* widgetProps$: BehaviorSubject<WidgetProps | null> | null = null;
|
|
80
|
+
* private jtdDestroy: (() => void) | null = null;
|
|
81
|
+
*
|
|
82
|
+
* async ngOnInit(): Promise<void> {
|
|
83
|
+
* const widget = await this.widgetService.getWidgetModel({
|
|
84
|
+
* dashboardOid: '65a82171719e7f004018691c',
|
|
85
|
+
* widgetOid: '65a82171719e7f004018691f',
|
|
86
|
+
* });
|
|
87
|
+
*
|
|
88
|
+
* const baseProps = widget
|
|
89
|
+
* ? widgetModelTranslator.toWidgetProps(widget)
|
|
90
|
+
* : null;
|
|
91
|
+
*
|
|
92
|
+
* if (baseProps) {
|
|
93
|
+
* const jtdConfig = {
|
|
94
|
+
* targets: [{ id: 'target-dashboard-id', caption: 'Details' }],
|
|
95
|
+
* interaction: { triggerMethod: 'rightclick' },
|
|
96
|
+
* };
|
|
97
|
+
* const jtdResult = this.widgetService.createJtdWidget(
|
|
98
|
+
* baseProps,
|
|
99
|
+
* jtdConfig,
|
|
100
|
+
* );
|
|
101
|
+
* this.widgetProps$ = jtdResult.widget$;
|
|
102
|
+
* this.jtdDestroy = jtdResult.destroy;
|
|
103
|
+
* }
|
|
104
|
+
* }
|
|
105
|
+
*
|
|
106
|
+
* ngOnDestroy(): void {
|
|
107
|
+
* this.jtdDestroy?.();
|
|
108
|
+
* }
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @param widgetProps - Base widget props to enhance with JTD functionality
|
|
113
|
+
* @param jtdConfig - JTD configuration defining navigation targets and behavior
|
|
114
|
+
* @returns Object containing:
|
|
115
|
+
* - `widget$`: The observable that emits enhanced widget props with JTD handlers.
|
|
116
|
+
* - `destroy`: Function to clean up resources. Call this when the component is destroyed.
|
|
117
|
+
* @group Dashboards
|
|
118
|
+
*/
|
|
119
|
+
createJtdWidget(widgetProps: WidgetProps | null, jtdConfig: JumpToDashboardConfig | JumpToDashboardConfigForPivot): {
|
|
120
|
+
widget$: BehaviorSubject<WidgetProps | null>;
|
|
121
|
+
destroy: () => void;
|
|
122
|
+
};
|
|
25
123
|
static ɵfac: i0.ɵɵFactoryDeclaration<WidgetService, never>;
|
|
26
124
|
static ɵprov: i0.ɵɵInjectableDeclaration<WidgetService>;
|
|
27
125
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Data } from '@sisense/sdk-data';
|
|
2
2
|
import type { BeforeRenderHandler, IndicatorBeforeRenderHandler } from '@sisense/sdk-ui-preact';
|
|
3
|
-
import type { AreamapDataPointEventHandler, BoxplotDataPointEventHandler, CalendarHeatmapDataPointEventHandler, CalendarHeatmapDataPointsEventHandler, ChartDataPointClickEventHandler, ChartDataPointContextMenuEventHandler, ChartDataPointsEventHandler, DataPointEventHandler, DataPointsEventHandler, IndicatorDataPointEventHandler, ScatterDataPointEventHandler, ScatterDataPointsEventHandler, ScattermapDataPointEventHandler } from './data-point';
|
|
3
|
+
import type { AreamapDataPointEventHandler, BoxplotDataPointEventHandler, CalendarHeatmapDataPointEventHandler, CalendarHeatmapDataPointsEventHandler, ChartDataPointClickEventHandler, ChartDataPointContextMenuEventHandler, ChartDataPointsEventHandler, DataPointEventHandler, DataPointsEventHandler, IndicatorDataPointEventHandler, PivotTableDataPointEventHandler, ScatterDataPointEventHandler, ScatterDataPointsEventHandler, ScattermapDataPointEventHandler } from './data-point';
|
|
4
4
|
export interface HighchartsBasedChartEventProps {
|
|
5
5
|
/**
|
|
6
6
|
* {@inheritDoc @sisense/sdk-ui!ChartProps.onBeforeRender}
|
|
@@ -152,6 +152,20 @@ export interface CalendarHeatmapChartEventProps extends BaseChartEventProps, Hig
|
|
|
152
152
|
*/
|
|
153
153
|
dataPointsSelect?: CalendarHeatmapDataPointsEventHandler;
|
|
154
154
|
}
|
|
155
|
+
export interface PivotTableEventProps {
|
|
156
|
+
/**
|
|
157
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointClick}
|
|
158
|
+
*
|
|
159
|
+
* @category Callbacks
|
|
160
|
+
*/
|
|
161
|
+
dataPointClick?: PivotTableDataPointEventHandler;
|
|
162
|
+
/**
|
|
163
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointContextMenu}
|
|
164
|
+
*
|
|
165
|
+
* @category Callbacks
|
|
166
|
+
*/
|
|
167
|
+
dataPointContextMenu?: PivotTableDataPointEventHandler;
|
|
168
|
+
}
|
|
155
169
|
export interface ChartEventProps extends BaseChartEventProps {
|
|
156
170
|
/**
|
|
157
171
|
* {@inheritDoc @sisense/sdk-ui!ChartProps.onDataPointClick}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AreamapDataPoint, BoxplotDataPoint, CalendarHeatmapDataPoint, DataPoint, IndicatorDataPoint, ScatterDataPoint, ScattermapDataPoint, TextWidgetDataPoint } from '@sisense/sdk-ui-preact';
|
|
1
|
+
import { AreamapDataPoint, BoxplotDataPoint, CalendarHeatmapDataPoint, DataPoint, IndicatorDataPoint, PivotTableDataPoint, ScatterDataPoint, ScattermapDataPoint, TextWidgetDataPoint } from '@sisense/sdk-ui-preact';
|
|
2
2
|
export type DataPointEvent = {
|
|
3
3
|
/** Data point that was clicked */
|
|
4
4
|
point: DataPoint;
|
|
@@ -54,8 +54,9 @@ export type TextWidgetDataPointEvent = {
|
|
|
54
54
|
nativeEvent: MouseEvent;
|
|
55
55
|
};
|
|
56
56
|
export type ChartDataPointClickEvent = DataPointEvent | ScatterDataPointEvent | BoxplotDataPointEvent | AreamapDataPointEvent | ScattermapDataPointEvent | IndicatorDataPointEvent | CalendarHeatmapDataPointEvent;
|
|
57
|
-
export type WidgetDataPointClickEvent = ChartDataPointClickEvent | TextWidgetDataPointEvent;
|
|
57
|
+
export type WidgetDataPointClickEvent = ChartDataPointClickEvent | TextWidgetDataPointEvent | PivotTableDataPointEvent;
|
|
58
58
|
export type ChartDataPointContextMenuEvent = DataPointEvent | ScatterDataPointEvent | BoxplotDataPointEvent | CalendarHeatmapDataPointEvent;
|
|
59
|
+
export type WidgetDataPointContextMenuEvent = ChartDataPointContextMenuEvent | PivotTableDataPointEvent;
|
|
59
60
|
export type DataPointsEvent = {
|
|
60
61
|
/** Data points that were selected */
|
|
61
62
|
points: DataPoint[];
|
|
@@ -74,6 +75,12 @@ export type BoxplotDataPointsEvent = {
|
|
|
74
75
|
/** Native MouseEvent */
|
|
75
76
|
nativeEvent: MouseEvent;
|
|
76
77
|
};
|
|
78
|
+
export type PivotTableDataPointEvent = {
|
|
79
|
+
/** Data point that was clicked */
|
|
80
|
+
point: PivotTableDataPoint;
|
|
81
|
+
/** Native MouseEvent */
|
|
82
|
+
nativeEvent: MouseEvent;
|
|
83
|
+
};
|
|
77
84
|
export type ChartDataPointsEvent = DataPointsEvent | ScatterDataPointsEvent | CalendarHeatmapDataPointsEvent;
|
|
78
85
|
/**
|
|
79
86
|
* A handler function that allows you to customize what happens when certain events occur to
|
|
@@ -108,6 +115,8 @@ export type WidgetDataPointClickEventHandler = (event: WidgetDataPointClickEvent
|
|
|
108
115
|
* Context menu handler for when a data point on the Chart is right-clicked.
|
|
109
116
|
*/
|
|
110
117
|
export type ChartDataPointContextMenuEventHandler = (event: ChartDataPointContextMenuEvent) => void;
|
|
118
|
+
/** Context menu handler for when a data point on Widget is right-clicked. */
|
|
119
|
+
export type WidgetDataPointContextMenuEventHandler = (event: WidgetDataPointContextMenuEvent) => void;
|
|
111
120
|
/** Click handler for when multiple scatter data points are selected. */
|
|
112
121
|
export type ScatterDataPointsEventHandler = (event: ScatterDataPointsEvent) => void;
|
|
113
122
|
/** Click handler for when multiple data points are selected. */
|
|
@@ -122,3 +131,5 @@ export type CalendarHeatmapDataPointEventHandler = (event: CalendarHeatmapDataPo
|
|
|
122
131
|
export type CalendarHeatmapDataPointsEventHandler = (event: CalendarHeatmapDataPointsEvent) => void;
|
|
123
132
|
/** Click handler for when multiple data points on Chart are selected. */
|
|
124
133
|
export type ChartDataPointsEventHandler = (event: ChartDataPointsEvent) => void;
|
|
134
|
+
/** Click handler for when a pivot table data point is clicked. */
|
|
135
|
+
export type PivotTableDataPointEventHandler = (event: PivotTableDataPointEvent) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type WidgetModel } from '@sisense/sdk-ui-preact';
|
|
2
|
-
import { ChartProps, ChartWidgetProps, PivotTableProps, PivotTableWidgetProps, TableProps, type TextWidgetProps } from '../components';
|
|
2
|
+
import { ChartProps, ChartWidgetProps, PivotTableProps, PivotTableWidgetProps, TableProps, type TextWidgetProps, type WidgetProps } from '../components';
|
|
3
3
|
import { ExecutePivotQueryParams, ExecuteQueryParams } from '../services';
|
|
4
4
|
/**
|
|
5
5
|
* Translates a {@link WidgetModel} to the parameters for executing a query for the widget.
|
|
@@ -287,3 +287,52 @@ const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
|
|
|
287
287
|
* Use {@link toPivotTableWidgetProps} instead for getting props for the pivot table widget.
|
|
288
288
|
*/
|
|
289
289
|
export declare function toTextWidgetProps(widgetModel: WidgetModel): TextWidgetProps;
|
|
290
|
+
/**
|
|
291
|
+
* Translates {@link WidgetModel} to {@link WidgetProps}.
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```html
|
|
295
|
+
* <csdk-widget
|
|
296
|
+
* *ngIf="widgetProps"
|
|
297
|
+
* [id]="widgetProps.id"
|
|
298
|
+
* [widgetType]="widgetProps.widgetType"
|
|
299
|
+
* [chartType]="widgetProps.chartType"
|
|
300
|
+
* [dataSource]="widgetProps.dataSource"
|
|
301
|
+
* [dataOptions]="widgetProps.dataOptions"
|
|
302
|
+
* [filters]="widgetProps.filters"
|
|
303
|
+
* [highlights]="widgetProps.highlights"
|
|
304
|
+
* [styleOptions]="widgetProps.styleOptions"
|
|
305
|
+
* [title]="widgetProps.title"
|
|
306
|
+
* [description]="widgetProps.description"
|
|
307
|
+
* />
|
|
308
|
+
* ```
|
|
309
|
+
*
|
|
310
|
+
* ```ts
|
|
311
|
+
* import { Component } from '@angular/core';
|
|
312
|
+
* import {
|
|
313
|
+
* type WidgetProps,
|
|
314
|
+
* WidgetService,
|
|
315
|
+
* widgetModelTranslator,
|
|
316
|
+
* } from '@sisense/sdk-ui-angular';
|
|
317
|
+
*
|
|
318
|
+
* @Component({
|
|
319
|
+
* selector: 'app-example',
|
|
320
|
+
* templateUrl: './example.component.html',
|
|
321
|
+
* styleUrls: ['./example.component.scss'],
|
|
322
|
+
* })
|
|
323
|
+
* export class ExampleComponent {
|
|
324
|
+
* widgetProps: WidgetProps | null = null;
|
|
325
|
+
*
|
|
326
|
+
* constructor(private widgetService: WidgetService) {}
|
|
327
|
+
*
|
|
328
|
+
* async ngOnInit(): Promise<void> {
|
|
329
|
+
* const widgetModel = await widgetService.getWidgetModel({
|
|
330
|
+
* dashboardOid: 'your-dashboard-oid',
|
|
331
|
+
* widgetOid: 'your-widget-oid'
|
|
332
|
+
* });
|
|
333
|
+
* this.widgetProps = widgetModelTranslator.toWidgetProps(widgetModel);
|
|
334
|
+
* }
|
|
335
|
+
* }
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
export declare function toWidgetProps(widgetModel: WidgetModel): WidgetProps;
|
package/dist/package.json
CHANGED
package/dist/public-api.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './lib/components';
|
|
|
5
5
|
export * from './lib/sdk-ui.module';
|
|
6
6
|
export * from './lib/sdk-ui-core-exports';
|
|
7
7
|
export * from './lib/services';
|
|
8
|
-
export type { AreamapDataPointEvent, AreamapDataPointEventHandler, BoxplotDataPointEvent, BoxplotDataPointEventHandler, BoxplotDataPointsEvent, CalendarHeatmapDataPointEvent, CalendarHeatmapDataPointEventHandler, CalendarHeatmapDataPointsEvent, CalendarHeatmapDataPointsEventHandler, ChartDataPointClickEvent, ChartDataPointClickEventHandler, ChartDataPointContextMenuEvent, ChartDataPointContextMenuEventHandler, ChartDataPointsEvent, ChartDataPointsEventHandler, DataPointEvent, DataPointEventHandler, DataPointsEvent, DataPointsEventHandler, FilterChangeEvent, FilterChangeEventHandler, FilterDeleteEventHandler, FilterEditEvent, FilterEditEventHandler, FiltersPanelChangeEvent, FiltersPanelChangeEventHandler, IndicatorDataPointEvent, IndicatorDataPointEventHandler, ScatterDataPointEvent, ScatterDataPointEventHandler, ScatterDataPointsEvent, ScatterDataPointsEventHandler, ScattermapDataPointEvent, ScattermapDataPointEventHandler, } from './lib/types';
|
|
8
|
+
export type { AreamapDataPointEvent, AreamapDataPointEventHandler, BoxplotDataPointEvent, BoxplotDataPointEventHandler, BoxplotDataPointsEvent, CalendarHeatmapDataPointEvent, CalendarHeatmapDataPointEventHandler, CalendarHeatmapDataPointsEvent, CalendarHeatmapDataPointsEventHandler, ChartDataPointClickEvent, ChartDataPointClickEventHandler, ChartDataPointContextMenuEvent, ChartDataPointContextMenuEventHandler, ChartDataPointsEvent, ChartDataPointsEventHandler, DataPointEvent, DataPointEventHandler, DataPointsEvent, DataPointsEventHandler, FilterChangeEvent, FilterChangeEventHandler, FilterDeleteEventHandler, FilterEditEvent, FilterEditEventHandler, FiltersPanelChangeEvent, FiltersPanelChangeEventHandler, IndicatorDataPointEvent, IndicatorDataPointEventHandler, ScatterDataPointEvent, ScatterDataPointEventHandler, ScatterDataPointsEvent, ScatterDataPointsEventHandler, WidgetDataPointClickEventHandler, WidgetDataPointContextMenuEventHandler, ScattermapDataPointEvent, ScattermapDataPointEventHandler, PivotTableDataPointEvent, PivotTableDataPointEventHandler, WidgetDataPointClickEvent, WidgetDataPointContextMenuEvent, TextWidgetDataPointEvent, } from './lib/types';
|
|
9
9
|
export * from './lib/utilities';
|
|
10
10
|
export { createCustomWidgetsContextConnector, createSisenseContextConnector, createThemeContextConnector, } from './lib/component-wrapper-helpers';
|
|
11
11
|
export { TrackableService } from './lib/decorators';
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.
|
|
1
|
+
declare const _default: "2.18.0";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Sisense",
|
|
12
12
|
"Compose SDK"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.18.0",
|
|
15
15
|
"author": "Sisense",
|
|
16
16
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
17
17
|
"main": "dist",
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@sisense/sdk-data": "2.
|
|
80
|
-
"@sisense/sdk-tracking": "2.
|
|
81
|
-
"@sisense/sdk-ui-preact": "2.
|
|
79
|
+
"@sisense/sdk-data": "2.18.0",
|
|
80
|
+
"@sisense/sdk-tracking": "2.18.0",
|
|
81
|
+
"@sisense/sdk-ui-preact": "2.18.0",
|
|
82
82
|
"rxjs": "^7.8.1",
|
|
83
83
|
"ts-deepmerge": "^6.2.0",
|
|
84
84
|
"tslib": "^2.3.0"
|