@sisense/sdk-ui-angular 2.17.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm2020/lib/components/charts/pivot-table.component.mjs +21 -3
- package/dist/esm2020/lib/components/widgets/pivot-table-widget.component.mjs +24 -3
- package/dist/esm2020/lib/components/widgets/widget.component.mjs +1 -1
- package/dist/esm2020/lib/helpers/widget-props-preact-translator.mjs +5 -2
- package/dist/esm2020/lib/sdk-ui-core-exports.mjs +1 -1
- package/dist/esm2020/lib/services/dashboard.service.mjs +18 -6
- package/dist/esm2020/lib/services/widget.service.mjs +146 -6
- package/dist/esm2020/lib/types/chart-event-props.mjs +1 -1
- package/dist/esm2020/lib/types/data-point.mjs +1 -1
- package/dist/esm2020/lib/utilities/widget-model-translator.mjs +52 -1
- package/dist/esm2020/public-api.mjs +1 -1
- package/dist/esm2020/version.mjs +2 -2
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs +257 -15
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs +257 -15
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/lib/components/charts/pivot-table.component.d.ts +16 -3
- package/dist/lib/components/widgets/pivot-table-widget.component.d.ts +22 -3
- package/dist/lib/components/widgets/widget.component.d.ts +8 -4
- package/dist/lib/sdk-ui-core-exports.d.ts +1 -1
- package/dist/lib/services/dashboard.service.d.ts +13 -5
- package/dist/lib/services/widget.service.d.ts +100 -2
- package/dist/lib/types/chart-event-props.d.ts +15 -1
- package/dist/lib/types/data-point.d.ts +13 -2
- package/dist/lib/utilities/widget-model-translator.d.ts +50 -1
- package/dist/package.json +1 -1
- package/dist/public-api.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,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.
|
|
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({
|
|
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
|
-
|
|
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
|
};
|
|
@@ -813,8 +828,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
813
828
|
* @fusionEmbed
|
|
814
829
|
*/
|
|
815
830
|
let WidgetService = class WidgetService {
|
|
816
|
-
constructor(sisenseContextService) {
|
|
831
|
+
constructor(sisenseContextService, themeService) {
|
|
817
832
|
this.sisenseContextService = sisenseContextService;
|
|
833
|
+
this.themeService = themeService;
|
|
818
834
|
}
|
|
819
835
|
/**
|
|
820
836
|
* Retrieves an existing widget model from the Sisense instance.
|
|
@@ -827,18 +843,153 @@ let WidgetService = class WidgetService {
|
|
|
827
843
|
const app = await this.sisenseContextService.getApp();
|
|
828
844
|
return getWidgetModel(app.httpClient, dashboardOid, widgetOid);
|
|
829
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
|
+
}
|
|
830
981
|
};
|
|
831
|
-
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 });
|
|
832
983
|
WidgetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, providedIn: 'root' });
|
|
833
984
|
WidgetService = __decorate([
|
|
834
|
-
TrackableService(['getWidgetModel'])
|
|
985
|
+
TrackableService(['getWidgetModel', 'createJtdWidget'])
|
|
835
986
|
], WidgetService);
|
|
836
987
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, decorators: [{
|
|
837
988
|
type: Injectable,
|
|
838
989
|
args: [{
|
|
839
990
|
providedIn: 'root',
|
|
840
991
|
}]
|
|
841
|
-
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
992
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }]; } });
|
|
842
993
|
|
|
843
994
|
class DecoratorsModule {
|
|
844
995
|
constructor(sisenseContextService) {
|
|
@@ -2671,6 +2822,18 @@ class PivotTableComponent {
|
|
|
2671
2822
|
constructor(sisenseContextService, themeService) {
|
|
2672
2823
|
this.sisenseContextService = sisenseContextService;
|
|
2673
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();
|
|
2674
2837
|
this.componentAdapter = new ComponentAdapter(PivotTable, [
|
|
2675
2838
|
createSisenseContextConnector(this.sisenseContextService),
|
|
2676
2839
|
createThemeContextConnector(this.themeService),
|
|
@@ -2693,6 +2856,8 @@ class PivotTableComponent {
|
|
|
2693
2856
|
filters: this.filters,
|
|
2694
2857
|
highlights: this.highlights,
|
|
2695
2858
|
styleOptions: this.styleOptions,
|
|
2859
|
+
onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
|
|
2860
|
+
onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
|
|
2696
2861
|
};
|
|
2697
2862
|
}
|
|
2698
2863
|
/** @internal */
|
|
@@ -2701,7 +2866,7 @@ class PivotTableComponent {
|
|
|
2701
2866
|
}
|
|
2702
2867
|
}
|
|
2703
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 });
|
|
2704
|
-
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"] });
|
|
2705
2870
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableComponent, decorators: [{
|
|
2706
2871
|
type: Component,
|
|
2707
2872
|
args: [{ selector: 'csdk-pivot-table', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
|
|
@@ -2718,6 +2883,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2718
2883
|
type: Input
|
|
2719
2884
|
}], styleOptions: [{
|
|
2720
2885
|
type: Input
|
|
2886
|
+
}], dataPointClick: [{
|
|
2887
|
+
type: Output
|
|
2888
|
+
}], dataPointContextMenu: [{
|
|
2889
|
+
type: Output
|
|
2721
2890
|
}] } });
|
|
2722
2891
|
|
|
2723
2892
|
/**
|
|
@@ -5186,6 +5355,18 @@ class PivotTableWidgetComponent {
|
|
|
5186
5355
|
constructor(sisenseContextService, themeService) {
|
|
5187
5356
|
this.sisenseContextService = sisenseContextService;
|
|
5188
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();
|
|
5189
5370
|
this.componentAdapter = new ComponentAdapter(PivotTableWidget, [
|
|
5190
5371
|
createSisenseContextConnector(this.sisenseContextService),
|
|
5191
5372
|
createThemeContextConnector(this.themeService),
|
|
@@ -5208,8 +5389,11 @@ class PivotTableWidgetComponent {
|
|
|
5208
5389
|
filters: this.filters,
|
|
5209
5390
|
highlights: this.highlights,
|
|
5210
5391
|
styleOptions: this.styleOptions,
|
|
5392
|
+
drilldownOptions: this.drilldownOptions,
|
|
5211
5393
|
title: this.title,
|
|
5212
5394
|
description: this.description,
|
|
5395
|
+
onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
|
|
5396
|
+
onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
|
|
5213
5397
|
};
|
|
5214
5398
|
}
|
|
5215
5399
|
/** @internal */
|
|
@@ -5218,7 +5402,7 @@ class PivotTableWidgetComponent {
|
|
|
5218
5402
|
}
|
|
5219
5403
|
}
|
|
5220
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 });
|
|
5221
|
-
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"] });
|
|
5222
5406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableWidgetComponent, decorators: [{
|
|
5223
5407
|
type: Component,
|
|
5224
5408
|
args: [{ selector: 'csdk-pivot-table-widget', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
|
|
@@ -5235,10 +5419,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5235
5419
|
type: Input
|
|
5236
5420
|
}], styleOptions: [{
|
|
5237
5421
|
type: Input
|
|
5422
|
+
}], drilldownOptions: [{
|
|
5423
|
+
type: Input
|
|
5238
5424
|
}], title: [{
|
|
5239
5425
|
type: Input
|
|
5240
5426
|
}], description: [{
|
|
5241
5427
|
type: Input
|
|
5428
|
+
}], dataPointClick: [{
|
|
5429
|
+
type: Output
|
|
5430
|
+
}], dataPointContextMenu: [{
|
|
5431
|
+
type: Output
|
|
5242
5432
|
}] } });
|
|
5243
5433
|
|
|
5244
5434
|
/**
|
|
@@ -6256,6 +6446,57 @@ const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
|
|
|
6256
6446
|
function toTextWidgetProps(widgetModel) {
|
|
6257
6447
|
return widgetModelTranslator$1.toTextWidgetProps(widgetModel);
|
|
6258
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
|
+
}
|
|
6259
6500
|
|
|
6260
6501
|
var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
6261
6502
|
__proto__: null,
|
|
@@ -6266,7 +6507,8 @@ var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
|
6266
6507
|
toPivotTableProps: toPivotTableProps,
|
|
6267
6508
|
toPivotTableWidgetProps: toPivotTableWidgetProps,
|
|
6268
6509
|
toTableProps: toTableProps,
|
|
6269
|
-
toTextWidgetProps: toTextWidgetProps
|
|
6510
|
+
toTextWidgetProps: toTextWidgetProps,
|
|
6511
|
+
toWidgetProps: toWidgetProps
|
|
6270
6512
|
});
|
|
6271
6513
|
|
|
6272
6514
|
/**
|