@sisense/sdk-ui-angular 2.16.1 → 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.
Files changed (31) hide show
  1. package/dist/esm2020/lib/components/charts/pivot-table.component.mjs +28 -5
  2. package/dist/esm2020/lib/components/widgets/pivot-table-widget.component.mjs +25 -5
  3. package/dist/esm2020/lib/components/widgets/widget.component.mjs +1 -1
  4. package/dist/esm2020/lib/helpers/widget-props-preact-translator.mjs +5 -2
  5. package/dist/esm2020/lib/sdk-ui-core-exports.mjs +1 -1
  6. package/dist/esm2020/lib/services/dashboard.service.mjs +18 -6
  7. package/dist/esm2020/lib/services/query.service.mjs +1 -2
  8. package/dist/esm2020/lib/services/widget.service.mjs +146 -6
  9. package/dist/esm2020/lib/types/chart-event-props.mjs +1 -1
  10. package/dist/esm2020/lib/types/data-point.mjs +1 -1
  11. package/dist/esm2020/lib/utilities/widget-model-translator.mjs +52 -1
  12. package/dist/esm2020/public-api.mjs +1 -1
  13. package/dist/esm2020/version.mjs +2 -2
  14. package/dist/fesm2015/sisense-sdk-ui-angular.mjs +265 -20
  15. package/dist/fesm2015/sisense-sdk-ui-angular.mjs.map +1 -1
  16. package/dist/fesm2020/sisense-sdk-ui-angular.mjs +265 -20
  17. package/dist/fesm2020/sisense-sdk-ui-angular.mjs.map +1 -1
  18. package/dist/lib/components/charts/pivot-table.component.d.ts +23 -5
  19. package/dist/lib/components/widgets/pivot-table-widget.component.d.ts +23 -5
  20. package/dist/lib/components/widgets/widget.component.d.ts +8 -4
  21. package/dist/lib/sdk-ui-core-exports.d.ts +1 -1
  22. package/dist/lib/services/dashboard.service.d.ts +13 -5
  23. package/dist/lib/services/query.service.d.ts +0 -1
  24. package/dist/lib/services/widget.service.d.ts +100 -2
  25. package/dist/lib/types/chart-event-props.d.ts +15 -1
  26. package/dist/lib/types/data-point.d.ts +13 -2
  27. package/dist/lib/utilities/widget-model-translator.d.ts +50 -1
  28. package/dist/package.json +1 -1
  29. package/dist/public-api.d.ts +1 -1
  30. package/dist/version.d.ts +1 -1
  31. 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.
@@ -48,7 +49,7 @@ export class AnalyticsComponent {
48
49
  dataBars: true,
49
50
  },
50
51
  ],
51
- grandTotals: { title: 'Grand Total', rows: true, columns: true },
52
+ grandTotals: { rows: true, columns: true },
52
53
  };
53
54
 
54
55
  pivotTable = {
@@ -61,8 +62,13 @@ export class AnalyticsComponent {
61
62
  }
62
63
  * ```
63
64
  * <img src="media://angular-pivot-table-example.png" width="800px" />
65
+ *
66
+ * @remarks
67
+ * Configuration options can also be applied within the scope of a `<SisenseContextProvider>` to control the default behavior of PivotTable, by changing available settings within `appConfig.chartConfig.tabular.*`
68
+ *
69
+ * Follow the link to {@link AppConfig} for more details on the available settings.
70
+ *
64
71
  * @group Data Grids
65
- * @beta
66
72
  */
67
73
  export declare class PivotTableComponent implements AfterViewInit, OnChanges, OnDestroy {
68
74
  private sisenseContextService;
@@ -99,6 +105,18 @@ export declare class PivotTableComponent implements AfterViewInit, OnChanges, On
99
105
  * @category Representation
100
106
  */
101
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>;
102
120
  private componentAdapter;
103
121
  constructor(sisenseContextService: SisenseContextService, themeService: ThemeService);
104
122
  /** @internal */
@@ -109,5 +127,5 @@ export declare class PivotTableComponent implements AfterViewInit, OnChanges, On
109
127
  /** @internal */
110
128
  ngOnDestroy(): void;
111
129
  static ɵfac: i0.ɵɵFactoryDeclaration<PivotTableComponent, never>;
112
- 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>;
113
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 Omit<PivotTableWidgetPropsPreact, 'onDataPointClick' | 'onDataPointContextMenu'> {
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,
@@ -53,7 +54,7 @@ export class AnalyticsComponent {
53
54
  dataBars: true,
54
55
  },
55
56
  ],
56
- grandTotals: { title: 'Grand Total', rows: true, columns: true },
57
+ grandTotals: { rows: true, columns: true },
57
58
  },
58
59
  filters: [filterFactory.members(DM.Commerce.Gender, ['Female', 'Male'])],
59
60
  styleOptions: { width: 1400, height: 600, rowsPerPage: 25 },
@@ -64,7 +65,6 @@ export class AnalyticsComponent {
64
65
  * ```
65
66
  * <img src="media://angular-pivot-table-widget-example.png" width="800px" />
66
67
  * @group Dashboards
67
- * @beta
68
68
  */
69
69
  export declare class PivotTableWidgetComponent implements AfterViewInit, OnChanges, OnDestroy {
70
70
  private sisenseContextService;
@@ -101,6 +101,12 @@ export declare class PivotTableWidgetComponent implements AfterViewInit, OnChang
101
101
  * @category Representation
102
102
  */
103
103
  styleOptions: PivotTableWidgetProps['styleOptions'];
104
+ /**
105
+ * {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.drilldownOptions}
106
+ *
107
+ * @category Widget
108
+ */
109
+ drilldownOptions: PivotTableWidgetProps['drilldownOptions'];
104
110
  /**
105
111
  * {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.title}
106
112
  *
@@ -113,6 +119,18 @@ export declare class PivotTableWidgetComponent implements AfterViewInit, OnChang
113
119
  * @category Widget
114
120
  */
115
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>;
116
134
  private componentAdapter;
117
135
  constructor(sisenseContextService: SisenseContextService, themeService: ThemeService);
118
136
  /** @internal */
@@ -123,5 +141,5 @@ export declare class PivotTableWidgetComponent implements AfterViewInit, OnChang
123
141
  /** @internal */
124
142
  ngOnDestroy(): void;
125
143
  static ɵfac: i0.ɵɵFactoryDeclaration<PivotTableWidgetComponent, never>;
126
- 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>;
127
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 { ChartDataPointClickEvent, ChartDataPointContextMenuEvent, ChartDataPointsEvent } from '../../types/data-point';
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<ChartDataPointClickEvent>;
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<ChartDataPointContextMenuEvent>;
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
- const composedDashboard = this.dashboardService.createComposedDashboard(initialDashboard);
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>;
@@ -66,7 +66,6 @@ export declare class QueryService {
66
66
  *
67
67
  * @param params - Pivot query parameters
68
68
  * @return Pivot query result
69
- * @beta
70
69
  */
71
70
  executePivotQuery(params: ExecutePivotQueryParams): Promise<{
72
71
  data: import("@sisense/sdk-data").PivotQueryResultData;
@@ -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
- constructor(sisenseContextService: SisenseContextService);
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
@@ -11,7 +11,7 @@
11
11
  "Sisense",
12
12
  "Compose SDK"
13
13
  ],
14
- "version": "2.16.1",
14
+ "version": "2.18.0",
15
15
  "author": "Sisense",
16
16
  "license": "SEE LICENSE IN LICENSE.md",
17
17
  "main": "dist",
@@ -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.16.1";
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.16.1",
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.16.1",
80
- "@sisense/sdk-tracking": "2.16.1",
81
- "@sisense/sdk-ui-preact": "2.16.1",
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"