@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,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Optional, Inject, createComponent, NgModule, EventEmitter, Component, ViewChild, Input, Output } from '@angular/core';
3
- import { DataObserver, CustomThemeProvider, CustomSisenseContextProvider, CustomWidgetsProviderAdapter, createClientApplication, TabberButtonsWidget, createWrapperElement, getDashboardModel, getDashboardModels, HookAdapter, useComposedDashboardInternal, createHookApiFacade, useGetFilterMembers, getHierarchyModels, executeQuery, executeQueryByWidgetId, executePivotQuery, useExecuteCsvQueryInternal, useExecuteCustomWidgetQueryInternal, getWidgetModel, getDefaultThemeSettings, getThemeSettingsByOid, ComponentAdapter, Chart, PivotTable, Table, ContextMenu, Dashboard, DashboardById, DrilldownBreadcrumbs, CriteriaFilterTile, DateRangeFilterTile, FilterTile, FiltersPanel, MemberFilterTile, RelativeDateFilterTile, ChartWidget, DrilldownWidget, createWrapperElementHandler, createComponentRenderer, PivotTableWidget, TableWidget, Widget, WidgetById, dashboardModelTranslator as dashboardModelTranslator$1, dashboardHelpers as dashboardHelpers$1, widgetModelTranslator as widgetModelTranslator$1 } from '@sisense/sdk-ui-preact';
3
+ import { DataObserver, CustomThemeProvider, CustomSisenseContextProvider, CustomWidgetsProviderAdapter, createClientApplication, TabberButtonsWidget, createWrapperElement, getDashboardModel, getDashboardModels, HookAdapter, useComposedDashboardInternal, createHookApiFacade, useGetFilterMembers, getHierarchyModels, executeQuery, executeQueryByWidgetId, executePivotQuery, useExecuteCsvQueryInternal, useExecuteCustomWidgetQueryInternal, getWidgetModel, useJtdWidget, getDefaultThemeSettings, getThemeSettingsByOid, ComponentAdapter, Chart, PivotTable, Table, ContextMenu, Dashboard, DashboardById, DrilldownBreadcrumbs, CriteriaFilterTile, DateRangeFilterTile, FilterTile, FiltersPanel, MemberFilterTile, RelativeDateFilterTile, ChartWidget, DrilldownWidget, createWrapperElementHandler, createComponentRenderer, PivotTableWidget, TableWidget, Widget, WidgetById, dashboardModelTranslator as dashboardModelTranslator$1, dashboardHelpers as dashboardHelpers$1, widgetModelTranslator as widgetModelTranslator$1 } from '@sisense/sdk-ui-preact';
4
4
  export { boxWhiskerProcessResult, extractDimensionsAndMeasures } from '@sisense/sdk-ui-preact';
5
5
  import { ReplaySubject, firstValueFrom, concat, of, BehaviorSubject, skip } from 'rxjs';
6
6
  import { __decorate } from 'tslib';
@@ -285,7 +285,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
285
285
  args: [SISENSE_CONTEXT_CONFIG_TOKEN]
286
286
  }] }]; } });
287
287
 
288
- var packageVersion = '2.16.1';
288
+ var packageVersion = '2.18.0';
289
289
 
290
290
  /**
291
291
  * Service for rendering components dynamically.
@@ -392,7 +392,10 @@ function translateToPreactWidgetProps(widgetProps) {
392
392
  })
393
393
  : undefined,
394
394
  onDataPointContextMenu: dataPointContextMenu
395
- ? (...[point, nativeEvent]) => dataPointContextMenu({ point, nativeEvent })
395
+ ? (...[point, nativeEvent]) => dataPointContextMenu({
396
+ point,
397
+ nativeEvent,
398
+ })
396
399
  : undefined,
397
400
  onDataPointsSelected: dataPointsSelect
398
401
  ? (...[points, nativeEvent]) => dataPointsSelect({ points, nativeEvent })
@@ -501,7 +504,7 @@ let DashboardService = class DashboardService {
501
504
  *
502
505
  * ```ts
503
506
  // Component behavior in example.component.ts
504
- import { Component } from '@angular/core';
507
+ import { Component, OnDestroy } from '@angular/core';
505
508
  import { BehaviorSubject } from 'rxjs';
506
509
  import { DashboardService, type DashboardProps } from '@sisense/sdk-ui-angular';
507
510
 
@@ -510,15 +513,20 @@ let DashboardService = class DashboardService {
510
513
  templateUrl: './example.component.html',
511
514
  styleUrls: ['./example.component.scss'],
512
515
  })
513
- export class ExampleComponent {
516
+ export class ExampleComponent implements OnDestroy {
514
517
  dashboard$: BehaviorSubject<DashboardProps> | undefined;
518
+ private composedDashboard: ReturnType<DashboardService['createComposedDashboard']> | undefined;
515
519
 
516
520
  constructor(private dashboardService: DashboardService) {}
517
521
 
518
522
  ngOnInit() {
519
523
  const initialDashboard: DashboardProps = { ... };
520
- const composedDashboard = this.dashboardService.createComposedDashboard(initialDashboard);
521
- this.dashboard$ = composedDashboard.dashboard$;
524
+ this.composedDashboard = this.dashboardService.createComposedDashboard(initialDashboard);
525
+ this.dashboard$ = this.composedDashboard.dashboard$;
526
+ }
527
+
528
+ ngOnDestroy() {
529
+ this.composedDashboard?.destroy();
522
530
  }
523
531
 
524
532
  trackByIndex = (index: number) => index;
@@ -528,7 +536,9 @@ let DashboardService = class DashboardService {
528
536
  * ```
529
537
  * @param initialDashboard - Initial dashboard
530
538
  * @param options - Configuration options
531
- * @returns Reactive composed dashboard object and API methods for interacting with it
539
+ * @returns Reactive composed dashboard object and API methods for interacting with it.
540
+ * The returned object includes a `destroy()` method that should be called when
541
+ * the dashboard is no longer needed to prevent memory leaks (e.g., in `ngOnDestroy`).
532
542
  */
533
543
  createComposedDashboard(initialDashboard, options = {}) {
534
544
  const hookAdapter = new HookAdapter((useComposedDashboardInternal), [createSisenseContextConnector(this.sisenseContextService)]);
@@ -539,10 +549,15 @@ let DashboardService = class DashboardService {
539
549
  hookAdapter.run(translateToPreactDashboardProps(initialDashboard), options);
540
550
  const setFilters = createHookApiFacade(hookAdapter, 'setFilters', true);
541
551
  const setWidgetsLayout = createHookApiFacade(hookAdapter, 'setWidgetsLayout', true);
552
+ const destroy = () => {
553
+ hookAdapter.destroy();
554
+ dashboard$.complete();
555
+ };
542
556
  return {
543
557
  dashboard$,
544
558
  setFilters,
545
559
  setWidgetsLayout,
560
+ destroy,
546
561
  };
547
562
  }
548
563
  };
@@ -713,7 +728,6 @@ let QueryService = class QueryService {
713
728
  *
714
729
  * @param params - Pivot query parameters
715
730
  * @return Pivot query result
716
- * @beta
717
731
  */
718
732
  async executePivotQuery(params) {
719
733
  const { dataSource, rows, columns, values, grandTotals, filters, highlights, count, offset, beforeQuery, } = params;
@@ -814,8 +828,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
814
828
  * @fusionEmbed
815
829
  */
816
830
  let WidgetService = class WidgetService {
817
- constructor(sisenseContextService) {
831
+ constructor(sisenseContextService, themeService) {
818
832
  this.sisenseContextService = sisenseContextService;
833
+ this.themeService = themeService;
819
834
  }
820
835
  /**
821
836
  * Retrieves an existing widget model from the Sisense instance.
@@ -828,18 +843,153 @@ let WidgetService = class WidgetService {
828
843
  const app = await this.sisenseContextService.getApp();
829
844
  return getWidgetModel(app.httpClient, dashboardOid, widgetOid);
830
845
  }
846
+ /**
847
+ * Adds Jump To Dashboard (JTD) functionality to widget props.
848
+ *
849
+ * Jump To Dashboard (JTD) allows users to navigate from one dashboard to another when interacting with widgets,
850
+ * such as clicking on chart data points or using context menus. This method is particularly useful when rendering
851
+ * Widget components directly (not through a Dashboard component), but you still want JTD navigation functionality.
852
+ *
853
+ * For widgets that are part of a dashboard, consider using `applyJtdConfig` or `applyJtdConfigs` instead,
854
+ * as they apply JTD configuration at the dashboard level rather than individual widget level.
855
+ *
856
+ * Note: dashboard-only 'includeDashboardFilters' is not supported and would just be ignored, since we do not have a dashboard in the current context.
857
+ *
858
+ * This method enhances the provided widget props with JTD navigation capabilities, including:
859
+ * - Click and right-click event handlers for navigation
860
+ * - Hyperlink styling for actionable pivot cells (when applicable)
861
+ * - JTD icon display in widget headers
862
+ * @example
863
+ * ```TypeScript
864
+ * import { Component, OnDestroy } from '@angular/core';
865
+ * import {
866
+ * WidgetService,
867
+ * widgetModelTranslator,
868
+ * type WidgetProps,
869
+ * } from '@sisense/sdk-ui-angular';
870
+ * import { BehaviorSubject } from 'rxjs';
871
+ *
872
+ * @Component({
873
+ * selector: 'code-example',
874
+ * template: `
875
+ * <csdk-widget
876
+ * *ngIf="widgetProps$ && (widgetProps$ | async) as widgetProps"
877
+ * [id]="widgetProps.id"
878
+ * [widgetType]="widgetProps.widgetType"
879
+ * [chartType]="widgetProps.chartType"
880
+ * [title]="widgetProps.title"
881
+ * [dataSource]="widgetProps.dataSource"
882
+ * [dataOptions]="widgetProps.dataOptions"
883
+ * [filters]="widgetProps.filters"
884
+ * [highlights]="widgetProps.highlights"
885
+ * [styleOptions]="widgetProps.styleOptions"
886
+ * [beforeMenuOpen]="widgetProps.beforeMenuOpen"
887
+ * (dataPointClick)="widgetProps.dataPointClick?.($event)"
888
+ * (dataPointContextMenu)="widgetProps.dataPointContextMenu?.($event)"
889
+ * (dataPointsSelect)="widgetProps.dataPointsSelect?.($event)"
890
+ * />
891
+ * `,
892
+ * })
893
+ * export class CodeExample implements OnDestroy {
894
+ * constructor(private widgetService: WidgetService) {}
895
+ *
896
+ * widgetProps$: BehaviorSubject<WidgetProps | null> | null = null;
897
+ * private jtdDestroy: (() => void) | null = null;
898
+ *
899
+ * async ngOnInit(): Promise<void> {
900
+ * const widget = await this.widgetService.getWidgetModel({
901
+ * dashboardOid: '65a82171719e7f004018691c',
902
+ * widgetOid: '65a82171719e7f004018691f',
903
+ * });
904
+ *
905
+ * const baseProps = widget
906
+ * ? widgetModelTranslator.toWidgetProps(widget)
907
+ * : null;
908
+ *
909
+ * if (baseProps) {
910
+ * const jtdConfig = {
911
+ * targets: [{ id: 'target-dashboard-id', caption: 'Details' }],
912
+ * interaction: { triggerMethod: 'rightclick' },
913
+ * };
914
+ * const jtdResult = this.widgetService.createJtdWidget(
915
+ * baseProps,
916
+ * jtdConfig,
917
+ * );
918
+ * this.widgetProps$ = jtdResult.widget$;
919
+ * this.jtdDestroy = jtdResult.destroy;
920
+ * }
921
+ * }
922
+ *
923
+ * ngOnDestroy(): void {
924
+ * this.jtdDestroy?.();
925
+ * }
926
+ * }
927
+ * ```
928
+ *
929
+ * @param widgetProps - Base widget props to enhance with JTD functionality
930
+ * @param jtdConfig - JTD configuration defining navigation targets and behavior
931
+ * @returns Object containing:
932
+ * - `widget$`: The observable that emits enhanced widget props with JTD handlers.
933
+ * - `destroy`: Function to clean up resources. Call this when the component is destroyed.
934
+ * @group Dashboards
935
+ */
936
+ createJtdWidget(widgetProps, jtdConfig) {
937
+ // Create BehaviorSubject initialized with base props (or null)
938
+ const enhancedProps$ = new BehaviorSubject(widgetProps);
939
+ if (!widgetProps) {
940
+ return {
941
+ widget$: enhancedProps$,
942
+ destroy: () => {
943
+ enhancedProps$.complete();
944
+ },
945
+ };
946
+ }
947
+ // Create HookAdapter with useJtdWidget hook and context connectors
948
+ const hookAdapter = new HookAdapter(useJtdWidget, [
949
+ createSisenseContextConnector(this.sisenseContextService),
950
+ createThemeContextConnector(this.themeService),
951
+ ]);
952
+ // Convert Angular props to preact props
953
+ const preactProps = translateToPreactWidgetProps(widgetProps);
954
+ // Subscribe to hook adapter results and capture the subscription
955
+ const hookAdapterSubscription = hookAdapter.subscribe((enhancedPreactProps) => {
956
+ if (enhancedPreactProps) {
957
+ // Convert back to Angular props
958
+ const angularProps = translateFromPreactWidgetProps(enhancedPreactProps);
959
+ enhancedProps$.next(angularProps);
960
+ }
961
+ else {
962
+ enhancedProps$.next(null);
963
+ }
964
+ });
965
+ // Run the hook with widget props and JTD config
966
+ // This will trigger the subscription above asynchronously when React contexts are ready
967
+ hookAdapter.run(preactProps, jtdConfig);
968
+ // Return the BehaviorSubject and destroy function for cleanup
969
+ return {
970
+ widget$: enhancedProps$,
971
+ destroy: () => {
972
+ // Unsubscribe from hook adapter
973
+ hookAdapterSubscription.unsubscribe();
974
+ // Destroy the hook adapter to clean up React components and contexts
975
+ hookAdapter.destroy();
976
+ // Complete the BehaviorSubject to release subscribers and avoid leaks
977
+ enhancedProps$.complete();
978
+ },
979
+ };
980
+ }
831
981
  };
832
- WidgetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
982
+ WidgetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Injectable });
833
983
  WidgetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, providedIn: 'root' });
834
984
  WidgetService = __decorate([
835
- TrackableService(['getWidgetModel'])
985
+ TrackableService(['getWidgetModel', 'createJtdWidget'])
836
986
  ], WidgetService);
837
987
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, decorators: [{
838
988
  type: Injectable,
839
989
  args: [{
840
990
  providedIn: 'root',
841
991
  }]
842
- }], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
992
+ }], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }]; } });
843
993
 
844
994
  class DecoratorsModule {
845
995
  constructor(sisenseContextService) {
@@ -2647,7 +2797,7 @@ export class AnalyticsComponent {
2647
2797
  dataBars: true,
2648
2798
  },
2649
2799
  ],
2650
- grandTotals: { title: 'Grand Total', rows: true, columns: true },
2800
+ grandTotals: { rows: true, columns: true },
2651
2801
  };
2652
2802
 
2653
2803
  pivotTable = {
@@ -2660,13 +2810,30 @@ export class AnalyticsComponent {
2660
2810
  }
2661
2811
  * ```
2662
2812
  * <img src="media://angular-pivot-table-example.png" width="800px" />
2813
+ *
2814
+ * @remarks
2815
+ * 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.*`
2816
+ *
2817
+ * Follow the link to {@link AppConfig} for more details on the available settings.
2818
+ *
2663
2819
  * @group Data Grids
2664
- * @beta
2665
2820
  */
2666
2821
  class PivotTableComponent {
2667
2822
  constructor(sisenseContextService, themeService) {
2668
2823
  this.sisenseContextService = sisenseContextService;
2669
2824
  this.themeService = themeService;
2825
+ /**
2826
+ * {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointClick}
2827
+ *
2828
+ * @category Callbacks
2829
+ */
2830
+ this.dataPointClick = new EventEmitter();
2831
+ /**
2832
+ * {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointContextMenu}
2833
+ *
2834
+ * @category Callbacks
2835
+ */
2836
+ this.dataPointContextMenu = new EventEmitter();
2670
2837
  this.componentAdapter = new ComponentAdapter(PivotTable, [
2671
2838
  createSisenseContextConnector(this.sisenseContextService),
2672
2839
  createThemeContextConnector(this.themeService),
@@ -2689,6 +2856,8 @@ class PivotTableComponent {
2689
2856
  filters: this.filters,
2690
2857
  highlights: this.highlights,
2691
2858
  styleOptions: this.styleOptions,
2859
+ onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
2860
+ onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
2692
2861
  };
2693
2862
  }
2694
2863
  /** @internal */
@@ -2697,7 +2866,7 @@ class PivotTableComponent {
2697
2866
  }
2698
2867
  }
2699
2868
  PivotTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableComponent, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
2700
- PivotTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PivotTableComponent, selector: "csdk-pivot-table", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
2869
+ PivotTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PivotTableComponent, selector: "csdk-pivot-table", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
2701
2870
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableComponent, decorators: [{
2702
2871
  type: Component,
2703
2872
  args: [{ selector: 'csdk-pivot-table', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
@@ -2714,6 +2883,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2714
2883
  type: Input
2715
2884
  }], styleOptions: [{
2716
2885
  type: Input
2886
+ }], dataPointClick: [{
2887
+ type: Output
2888
+ }], dataPointContextMenu: [{
2889
+ type: Output
2717
2890
  }] } });
2718
2891
 
2719
2892
  /**
@@ -5166,7 +5339,7 @@ export class AnalyticsComponent {
5166
5339
  dataBars: true,
5167
5340
  },
5168
5341
  ],
5169
- grandTotals: { title: 'Grand Total', rows: true, columns: true },
5342
+ grandTotals: { rows: true, columns: true },
5170
5343
  },
5171
5344
  filters: [filterFactory.members(DM.Commerce.Gender, ['Female', 'Male'])],
5172
5345
  styleOptions: { width: 1400, height: 600, rowsPerPage: 25 },
@@ -5177,12 +5350,23 @@ export class AnalyticsComponent {
5177
5350
  * ```
5178
5351
  * <img src="media://angular-pivot-table-widget-example.png" width="800px" />
5179
5352
  * @group Dashboards
5180
- * @beta
5181
5353
  */
5182
5354
  class PivotTableWidgetComponent {
5183
5355
  constructor(sisenseContextService, themeService) {
5184
5356
  this.sisenseContextService = sisenseContextService;
5185
5357
  this.themeService = themeService;
5358
+ /**
5359
+ * {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.onDataPointClick}
5360
+ *
5361
+ * @category Callbacks
5362
+ */
5363
+ this.dataPointClick = new EventEmitter();
5364
+ /**
5365
+ * {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.onDataPointContextMenu}
5366
+ *
5367
+ * @category Callbacks
5368
+ */
5369
+ this.dataPointContextMenu = new EventEmitter();
5186
5370
  this.componentAdapter = new ComponentAdapter(PivotTableWidget, [
5187
5371
  createSisenseContextConnector(this.sisenseContextService),
5188
5372
  createThemeContextConnector(this.themeService),
@@ -5205,8 +5389,11 @@ class PivotTableWidgetComponent {
5205
5389
  filters: this.filters,
5206
5390
  highlights: this.highlights,
5207
5391
  styleOptions: this.styleOptions,
5392
+ drilldownOptions: this.drilldownOptions,
5208
5393
  title: this.title,
5209
5394
  description: this.description,
5395
+ onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
5396
+ onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
5210
5397
  };
5211
5398
  }
5212
5399
  /** @internal */
@@ -5215,7 +5402,7 @@ class PivotTableWidgetComponent {
5215
5402
  }
5216
5403
  }
5217
5404
  PivotTableWidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableWidgetComponent, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
5218
- PivotTableWidgetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PivotTableWidgetComponent, selector: "csdk-pivot-table-widget", inputs: { dataSource: "dataSource", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", title: "title", description: "description" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
5405
+ PivotTableWidgetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PivotTableWidgetComponent, selector: "csdk-pivot-table-widget", inputs: { dataSource: "dataSource", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", drilldownOptions: "drilldownOptions", title: "title", description: "description" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
5219
5406
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableWidgetComponent, decorators: [{
5220
5407
  type: Component,
5221
5408
  args: [{ selector: 'csdk-pivot-table-widget', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
@@ -5232,10 +5419,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
5232
5419
  type: Input
5233
5420
  }], styleOptions: [{
5234
5421
  type: Input
5422
+ }], drilldownOptions: [{
5423
+ type: Input
5235
5424
  }], title: [{
5236
5425
  type: Input
5237
5426
  }], description: [{
5238
5427
  type: Input
5428
+ }], dataPointClick: [{
5429
+ type: Output
5430
+ }], dataPointContextMenu: [{
5431
+ type: Output
5239
5432
  }] } });
5240
5433
 
5241
5434
  /**
@@ -6253,6 +6446,57 @@ const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
6253
6446
  function toTextWidgetProps(widgetModel) {
6254
6447
  return widgetModelTranslator$1.toTextWidgetProps(widgetModel);
6255
6448
  }
6449
+ /**
6450
+ * Translates {@link WidgetModel} to {@link WidgetProps}.
6451
+ *
6452
+ * @example
6453
+ * ```html
6454
+ * <csdk-widget
6455
+ * *ngIf="widgetProps"
6456
+ * [id]="widgetProps.id"
6457
+ * [widgetType]="widgetProps.widgetType"
6458
+ * [chartType]="widgetProps.chartType"
6459
+ * [dataSource]="widgetProps.dataSource"
6460
+ * [dataOptions]="widgetProps.dataOptions"
6461
+ * [filters]="widgetProps.filters"
6462
+ * [highlights]="widgetProps.highlights"
6463
+ * [styleOptions]="widgetProps.styleOptions"
6464
+ * [title]="widgetProps.title"
6465
+ * [description]="widgetProps.description"
6466
+ * />
6467
+ * ```
6468
+ *
6469
+ * ```ts
6470
+ * import { Component } from '@angular/core';
6471
+ * import {
6472
+ * type WidgetProps,
6473
+ * WidgetService,
6474
+ * widgetModelTranslator,
6475
+ * } from '@sisense/sdk-ui-angular';
6476
+ *
6477
+ * @Component({
6478
+ * selector: 'app-example',
6479
+ * templateUrl: './example.component.html',
6480
+ * styleUrls: ['./example.component.scss'],
6481
+ * })
6482
+ * export class ExampleComponent {
6483
+ * widgetProps: WidgetProps | null = null;
6484
+ *
6485
+ * constructor(private widgetService: WidgetService) {}
6486
+ *
6487
+ * async ngOnInit(): Promise<void> {
6488
+ * const widgetModel = await widgetService.getWidgetModel({
6489
+ * dashboardOid: 'your-dashboard-oid',
6490
+ * widgetOid: 'your-widget-oid'
6491
+ * });
6492
+ * this.widgetProps = widgetModelTranslator.toWidgetProps(widgetModel);
6493
+ * }
6494
+ * }
6495
+ * ```
6496
+ */
6497
+ function toWidgetProps(widgetModel) {
6498
+ return widgetModelTranslator$1.toWidgetProps(widgetModel);
6499
+ }
6256
6500
 
6257
6501
  var widgetModelTranslator = /*#__PURE__*/Object.freeze({
6258
6502
  __proto__: null,
@@ -6263,7 +6507,8 @@ var widgetModelTranslator = /*#__PURE__*/Object.freeze({
6263
6507
  toPivotTableProps: toPivotTableProps,
6264
6508
  toPivotTableWidgetProps: toPivotTableWidgetProps,
6265
6509
  toTableProps: toTableProps,
6266
- toTextWidgetProps: toTextWidgetProps
6510
+ toTextWidgetProps: toTextWidgetProps,
6511
+ toWidgetProps: toWidgetProps
6267
6512
  });
6268
6513
 
6269
6514
  /**