@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 { __awaiter, __rest, __decorate } from 'tslib';
6
6
  import { ReplaySubject, firstValueFrom, concat, of, BehaviorSubject, skip } from 'rxjs';
@@ -287,7 +287,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
287
287
  }] }];
288
288
  } });
289
289
 
290
- var packageVersion = '2.16.1';
290
+ var packageVersion = '2.18.0';
291
291
 
292
292
  /**
293
293
  * Service for rendering components dynamically.
@@ -388,7 +388,10 @@ function translateToPreactWidgetProps(widgetProps) {
388
388
  nativeEvent,
389
389
  })
390
390
  : undefined, onDataPointContextMenu: dataPointContextMenu
391
- ? (...[point, nativeEvent]) => dataPointContextMenu({ point, nativeEvent })
391
+ ? (...[point, nativeEvent]) => dataPointContextMenu({
392
+ point,
393
+ nativeEvent,
394
+ })
392
395
  : undefined, onDataPointsSelected: dataPointsSelect
393
396
  ? (...[points, nativeEvent]) => dataPointsSelect({ points, nativeEvent })
394
397
  : undefined });
@@ -485,7 +488,7 @@ let DashboardService = class DashboardService {
485
488
  *
486
489
  * ```ts
487
490
  // Component behavior in example.component.ts
488
- import { Component } from '@angular/core';
491
+ import { Component, OnDestroy } from '@angular/core';
489
492
  import { BehaviorSubject } from 'rxjs';
490
493
  import { DashboardService, type DashboardProps } from '@sisense/sdk-ui-angular';
491
494
 
@@ -494,15 +497,20 @@ let DashboardService = class DashboardService {
494
497
  templateUrl: './example.component.html',
495
498
  styleUrls: ['./example.component.scss'],
496
499
  })
497
- export class ExampleComponent {
500
+ export class ExampleComponent implements OnDestroy {
498
501
  dashboard$: BehaviorSubject<DashboardProps> | undefined;
502
+ private composedDashboard: ReturnType<DashboardService['createComposedDashboard']> | undefined;
499
503
 
500
504
  constructor(private dashboardService: DashboardService) {}
501
505
 
502
506
  ngOnInit() {
503
507
  const initialDashboard: DashboardProps = { ... };
504
- const composedDashboard = this.dashboardService.createComposedDashboard(initialDashboard);
505
- this.dashboard$ = composedDashboard.dashboard$;
508
+ this.composedDashboard = this.dashboardService.createComposedDashboard(initialDashboard);
509
+ this.dashboard$ = this.composedDashboard.dashboard$;
510
+ }
511
+
512
+ ngOnDestroy() {
513
+ this.composedDashboard?.destroy();
506
514
  }
507
515
 
508
516
  trackByIndex = (index: number) => index;
@@ -512,7 +520,9 @@ let DashboardService = class DashboardService {
512
520
  * ```
513
521
  * @param initialDashboard - Initial dashboard
514
522
  * @param options - Configuration options
515
- * @returns Reactive composed dashboard object and API methods for interacting with it
523
+ * @returns Reactive composed dashboard object and API methods for interacting with it.
524
+ * The returned object includes a `destroy()` method that should be called when
525
+ * the dashboard is no longer needed to prevent memory leaks (e.g., in `ngOnDestroy`).
516
526
  */
517
527
  createComposedDashboard(initialDashboard, options = {}) {
518
528
  const hookAdapter = new HookAdapter((useComposedDashboardInternal), [createSisenseContextConnector(this.sisenseContextService)]);
@@ -523,10 +533,15 @@ let DashboardService = class DashboardService {
523
533
  hookAdapter.run(translateToPreactDashboardProps(initialDashboard), options);
524
534
  const setFilters = createHookApiFacade(hookAdapter, 'setFilters', true);
525
535
  const setWidgetsLayout = createHookApiFacade(hookAdapter, 'setWidgetsLayout', true);
536
+ const destroy = () => {
537
+ hookAdapter.destroy();
538
+ dashboard$.complete();
539
+ };
526
540
  return {
527
541
  dashboard$,
528
542
  setFilters,
529
543
  setWidgetsLayout,
544
+ destroy,
530
545
  };
531
546
  }
532
547
  };
@@ -701,7 +716,6 @@ let QueryService = class QueryService {
701
716
  *
702
717
  * @param params - Pivot query parameters
703
718
  * @return Pivot query result
704
- * @beta
705
719
  */
706
720
  executePivotQuery(params) {
707
721
  return __awaiter(this, void 0, void 0, function* () {
@@ -808,8 +822,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
808
822
  * @fusionEmbed
809
823
  */
810
824
  let WidgetService = class WidgetService {
811
- constructor(sisenseContextService) {
825
+ constructor(sisenseContextService, themeService) {
812
826
  this.sisenseContextService = sisenseContextService;
827
+ this.themeService = themeService;
813
828
  }
814
829
  /**
815
830
  * Retrieves an existing widget model from the Sisense instance.
@@ -824,18 +839,153 @@ let WidgetService = class WidgetService {
824
839
  return getWidgetModel(app.httpClient, dashboardOid, widgetOid);
825
840
  });
826
841
  }
842
+ /**
843
+ * Adds Jump To Dashboard (JTD) functionality to widget props.
844
+ *
845
+ * Jump To Dashboard (JTD) allows users to navigate from one dashboard to another when interacting with widgets,
846
+ * such as clicking on chart data points or using context menus. This method is particularly useful when rendering
847
+ * Widget components directly (not through a Dashboard component), but you still want JTD navigation functionality.
848
+ *
849
+ * For widgets that are part of a dashboard, consider using `applyJtdConfig` or `applyJtdConfigs` instead,
850
+ * as they apply JTD configuration at the dashboard level rather than individual widget level.
851
+ *
852
+ * Note: dashboard-only 'includeDashboardFilters' is not supported and would just be ignored, since we do not have a dashboard in the current context.
853
+ *
854
+ * This method enhances the provided widget props with JTD navigation capabilities, including:
855
+ * - Click and right-click event handlers for navigation
856
+ * - Hyperlink styling for actionable pivot cells (when applicable)
857
+ * - JTD icon display in widget headers
858
+ * @example
859
+ * ```TypeScript
860
+ * import { Component, OnDestroy } from '@angular/core';
861
+ * import {
862
+ * WidgetService,
863
+ * widgetModelTranslator,
864
+ * type WidgetProps,
865
+ * } from '@sisense/sdk-ui-angular';
866
+ * import { BehaviorSubject } from 'rxjs';
867
+ *
868
+ * @Component({
869
+ * selector: 'code-example',
870
+ * template: `
871
+ * <csdk-widget
872
+ * *ngIf="widgetProps$ && (widgetProps$ | async) as widgetProps"
873
+ * [id]="widgetProps.id"
874
+ * [widgetType]="widgetProps.widgetType"
875
+ * [chartType]="widgetProps.chartType"
876
+ * [title]="widgetProps.title"
877
+ * [dataSource]="widgetProps.dataSource"
878
+ * [dataOptions]="widgetProps.dataOptions"
879
+ * [filters]="widgetProps.filters"
880
+ * [highlights]="widgetProps.highlights"
881
+ * [styleOptions]="widgetProps.styleOptions"
882
+ * [beforeMenuOpen]="widgetProps.beforeMenuOpen"
883
+ * (dataPointClick)="widgetProps.dataPointClick?.($event)"
884
+ * (dataPointContextMenu)="widgetProps.dataPointContextMenu?.($event)"
885
+ * (dataPointsSelect)="widgetProps.dataPointsSelect?.($event)"
886
+ * />
887
+ * `,
888
+ * })
889
+ * export class CodeExample implements OnDestroy {
890
+ * constructor(private widgetService: WidgetService) {}
891
+ *
892
+ * widgetProps$: BehaviorSubject<WidgetProps | null> | null = null;
893
+ * private jtdDestroy: (() => void) | null = null;
894
+ *
895
+ * async ngOnInit(): Promise<void> {
896
+ * const widget = await this.widgetService.getWidgetModel({
897
+ * dashboardOid: '65a82171719e7f004018691c',
898
+ * widgetOid: '65a82171719e7f004018691f',
899
+ * });
900
+ *
901
+ * const baseProps = widget
902
+ * ? widgetModelTranslator.toWidgetProps(widget)
903
+ * : null;
904
+ *
905
+ * if (baseProps) {
906
+ * const jtdConfig = {
907
+ * targets: [{ id: 'target-dashboard-id', caption: 'Details' }],
908
+ * interaction: { triggerMethod: 'rightclick' },
909
+ * };
910
+ * const jtdResult = this.widgetService.createJtdWidget(
911
+ * baseProps,
912
+ * jtdConfig,
913
+ * );
914
+ * this.widgetProps$ = jtdResult.widget$;
915
+ * this.jtdDestroy = jtdResult.destroy;
916
+ * }
917
+ * }
918
+ *
919
+ * ngOnDestroy(): void {
920
+ * this.jtdDestroy?.();
921
+ * }
922
+ * }
923
+ * ```
924
+ *
925
+ * @param widgetProps - Base widget props to enhance with JTD functionality
926
+ * @param jtdConfig - JTD configuration defining navigation targets and behavior
927
+ * @returns Object containing:
928
+ * - `widget$`: The observable that emits enhanced widget props with JTD handlers.
929
+ * - `destroy`: Function to clean up resources. Call this when the component is destroyed.
930
+ * @group Dashboards
931
+ */
932
+ createJtdWidget(widgetProps, jtdConfig) {
933
+ // Create BehaviorSubject initialized with base props (or null)
934
+ const enhancedProps$ = new BehaviorSubject(widgetProps);
935
+ if (!widgetProps) {
936
+ return {
937
+ widget$: enhancedProps$,
938
+ destroy: () => {
939
+ enhancedProps$.complete();
940
+ },
941
+ };
942
+ }
943
+ // Create HookAdapter with useJtdWidget hook and context connectors
944
+ const hookAdapter = new HookAdapter(useJtdWidget, [
945
+ createSisenseContextConnector(this.sisenseContextService),
946
+ createThemeContextConnector(this.themeService),
947
+ ]);
948
+ // Convert Angular props to preact props
949
+ const preactProps = translateToPreactWidgetProps(widgetProps);
950
+ // Subscribe to hook adapter results and capture the subscription
951
+ const hookAdapterSubscription = hookAdapter.subscribe((enhancedPreactProps) => {
952
+ if (enhancedPreactProps) {
953
+ // Convert back to Angular props
954
+ const angularProps = translateFromPreactWidgetProps(enhancedPreactProps);
955
+ enhancedProps$.next(angularProps);
956
+ }
957
+ else {
958
+ enhancedProps$.next(null);
959
+ }
960
+ });
961
+ // Run the hook with widget props and JTD config
962
+ // This will trigger the subscription above asynchronously when React contexts are ready
963
+ hookAdapter.run(preactProps, jtdConfig);
964
+ // Return the BehaviorSubject and destroy function for cleanup
965
+ return {
966
+ widget$: enhancedProps$,
967
+ destroy: () => {
968
+ // Unsubscribe from hook adapter
969
+ hookAdapterSubscription.unsubscribe();
970
+ // Destroy the hook adapter to clean up React components and contexts
971
+ hookAdapter.destroy();
972
+ // Complete the BehaviorSubject to release subscribers and avoid leaks
973
+ enhancedProps$.complete();
974
+ },
975
+ };
976
+ }
827
977
  };
828
- WidgetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
978
+ 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 });
829
979
  WidgetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, providedIn: 'root' });
830
980
  WidgetService = __decorate([
831
- TrackableService(['getWidgetModel'])
981
+ TrackableService(['getWidgetModel', 'createJtdWidget'])
832
982
  ], WidgetService);
833
983
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, decorators: [{
834
984
  type: Injectable,
835
985
  args: [{
836
986
  providedIn: 'root',
837
987
  }]
838
- }], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
988
+ }], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }]; } });
839
989
 
840
990
  class DecoratorsModule {
841
991
  constructor(sisenseContextService) {
@@ -2655,7 +2805,7 @@ export class AnalyticsComponent {
2655
2805
  dataBars: true,
2656
2806
  },
2657
2807
  ],
2658
- grandTotals: { title: 'Grand Total', rows: true, columns: true },
2808
+ grandTotals: { rows: true, columns: true },
2659
2809
  };
2660
2810
 
2661
2811
  pivotTable = {
@@ -2668,13 +2818,30 @@ export class AnalyticsComponent {
2668
2818
  }
2669
2819
  * ```
2670
2820
  * <img src="media://angular-pivot-table-example.png" width="800px" />
2821
+ *
2822
+ * @remarks
2823
+ * 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.*`
2824
+ *
2825
+ * Follow the link to {@link AppConfig} for more details on the available settings.
2826
+ *
2671
2827
  * @group Data Grids
2672
- * @beta
2673
2828
  */
2674
2829
  class PivotTableComponent {
2675
2830
  constructor(sisenseContextService, themeService) {
2676
2831
  this.sisenseContextService = sisenseContextService;
2677
2832
  this.themeService = themeService;
2833
+ /**
2834
+ * {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointClick}
2835
+ *
2836
+ * @category Callbacks
2837
+ */
2838
+ this.dataPointClick = new EventEmitter();
2839
+ /**
2840
+ * {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointContextMenu}
2841
+ *
2842
+ * @category Callbacks
2843
+ */
2844
+ this.dataPointContextMenu = new EventEmitter();
2678
2845
  this.componentAdapter = new ComponentAdapter(PivotTable, [
2679
2846
  createSisenseContextConnector(this.sisenseContextService),
2680
2847
  createThemeContextConnector(this.themeService),
@@ -2697,6 +2864,8 @@ class PivotTableComponent {
2697
2864
  filters: this.filters,
2698
2865
  highlights: this.highlights,
2699
2866
  styleOptions: this.styleOptions,
2867
+ onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
2868
+ onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
2700
2869
  };
2701
2870
  }
2702
2871
  /** @internal */
@@ -2705,7 +2874,7 @@ class PivotTableComponent {
2705
2874
  }
2706
2875
  }
2707
2876
  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 });
2708
- 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"] });
2877
+ 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"] });
2709
2878
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableComponent, decorators: [{
2710
2879
  type: Component,
2711
2880
  args: [{ selector: 'csdk-pivot-table', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
@@ -2722,6 +2891,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2722
2891
  type: Input
2723
2892
  }], styleOptions: [{
2724
2893
  type: Input
2894
+ }], dataPointClick: [{
2895
+ type: Output
2896
+ }], dataPointContextMenu: [{
2897
+ type: Output
2725
2898
  }] } });
2726
2899
 
2727
2900
  /**
@@ -5163,7 +5336,7 @@ export class AnalyticsComponent {
5163
5336
  dataBars: true,
5164
5337
  },
5165
5338
  ],
5166
- grandTotals: { title: 'Grand Total', rows: true, columns: true },
5339
+ grandTotals: { rows: true, columns: true },
5167
5340
  },
5168
5341
  filters: [filterFactory.members(DM.Commerce.Gender, ['Female', 'Male'])],
5169
5342
  styleOptions: { width: 1400, height: 600, rowsPerPage: 25 },
@@ -5174,12 +5347,23 @@ export class AnalyticsComponent {
5174
5347
  * ```
5175
5348
  * <img src="media://angular-pivot-table-widget-example.png" width="800px" />
5176
5349
  * @group Dashboards
5177
- * @beta
5178
5350
  */
5179
5351
  class PivotTableWidgetComponent {
5180
5352
  constructor(sisenseContextService, themeService) {
5181
5353
  this.sisenseContextService = sisenseContextService;
5182
5354
  this.themeService = themeService;
5355
+ /**
5356
+ * {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.onDataPointClick}
5357
+ *
5358
+ * @category Callbacks
5359
+ */
5360
+ this.dataPointClick = new EventEmitter();
5361
+ /**
5362
+ * {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.onDataPointContextMenu}
5363
+ *
5364
+ * @category Callbacks
5365
+ */
5366
+ this.dataPointContextMenu = new EventEmitter();
5183
5367
  this.componentAdapter = new ComponentAdapter(PivotTableWidget, [
5184
5368
  createSisenseContextConnector(this.sisenseContextService),
5185
5369
  createThemeContextConnector(this.themeService),
@@ -5202,8 +5386,11 @@ class PivotTableWidgetComponent {
5202
5386
  filters: this.filters,
5203
5387
  highlights: this.highlights,
5204
5388
  styleOptions: this.styleOptions,
5389
+ drilldownOptions: this.drilldownOptions,
5205
5390
  title: this.title,
5206
5391
  description: this.description,
5392
+ onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
5393
+ onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
5207
5394
  };
5208
5395
  }
5209
5396
  /** @internal */
@@ -5212,7 +5399,7 @@ class PivotTableWidgetComponent {
5212
5399
  }
5213
5400
  }
5214
5401
  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 });
5215
- 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"] });
5402
+ 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"] });
5216
5403
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableWidgetComponent, decorators: [{
5217
5404
  type: Component,
5218
5405
  args: [{ selector: 'csdk-pivot-table-widget', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
@@ -5229,10 +5416,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
5229
5416
  type: Input
5230
5417
  }], styleOptions: [{
5231
5418
  type: Input
5419
+ }], drilldownOptions: [{
5420
+ type: Input
5232
5421
  }], title: [{
5233
5422
  type: Input
5234
5423
  }], description: [{
5235
5424
  type: Input
5425
+ }], dataPointClick: [{
5426
+ type: Output
5427
+ }], dataPointContextMenu: [{
5428
+ type: Output
5236
5429
  }] } });
5237
5430
 
5238
5431
  /**
@@ -6252,6 +6445,57 @@ const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
6252
6445
  function toTextWidgetProps(widgetModel) {
6253
6446
  return widgetModelTranslator$1.toTextWidgetProps(widgetModel);
6254
6447
  }
6448
+ /**
6449
+ * Translates {@link WidgetModel} to {@link WidgetProps}.
6450
+ *
6451
+ * @example
6452
+ * ```html
6453
+ * <csdk-widget
6454
+ * *ngIf="widgetProps"
6455
+ * [id]="widgetProps.id"
6456
+ * [widgetType]="widgetProps.widgetType"
6457
+ * [chartType]="widgetProps.chartType"
6458
+ * [dataSource]="widgetProps.dataSource"
6459
+ * [dataOptions]="widgetProps.dataOptions"
6460
+ * [filters]="widgetProps.filters"
6461
+ * [highlights]="widgetProps.highlights"
6462
+ * [styleOptions]="widgetProps.styleOptions"
6463
+ * [title]="widgetProps.title"
6464
+ * [description]="widgetProps.description"
6465
+ * />
6466
+ * ```
6467
+ *
6468
+ * ```ts
6469
+ * import { Component } from '@angular/core';
6470
+ * import {
6471
+ * type WidgetProps,
6472
+ * WidgetService,
6473
+ * widgetModelTranslator,
6474
+ * } from '@sisense/sdk-ui-angular';
6475
+ *
6476
+ * @Component({
6477
+ * selector: 'app-example',
6478
+ * templateUrl: './example.component.html',
6479
+ * styleUrls: ['./example.component.scss'],
6480
+ * })
6481
+ * export class ExampleComponent {
6482
+ * widgetProps: WidgetProps | null = null;
6483
+ *
6484
+ * constructor(private widgetService: WidgetService) {}
6485
+ *
6486
+ * async ngOnInit(): Promise<void> {
6487
+ * const widgetModel = await widgetService.getWidgetModel({
6488
+ * dashboardOid: 'your-dashboard-oid',
6489
+ * widgetOid: 'your-widget-oid'
6490
+ * });
6491
+ * this.widgetProps = widgetModelTranslator.toWidgetProps(widgetModel);
6492
+ * }
6493
+ * }
6494
+ * ```
6495
+ */
6496
+ function toWidgetProps(widgetModel) {
6497
+ return widgetModelTranslator$1.toWidgetProps(widgetModel);
6498
+ }
6255
6499
 
6256
6500
  var widgetModelTranslator = /*#__PURE__*/Object.freeze({
6257
6501
  __proto__: null,
@@ -6262,7 +6506,8 @@ var widgetModelTranslator = /*#__PURE__*/Object.freeze({
6262
6506
  toPivotTableProps: toPivotTableProps,
6263
6507
  toPivotTableWidgetProps: toPivotTableWidgetProps,
6264
6508
  toTableProps: toTableProps,
6265
- toTextWidgetProps: toTextWidgetProps
6509
+ toTextWidgetProps: toTextWidgetProps,
6510
+ toWidgetProps: toWidgetProps
6266
6511
  });
6267
6512
 
6268
6513
  /**