@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 { __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.
|
|
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({
|
|
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
|
-
|
|
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
|
};
|
|
@@ -807,8 +822,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
807
822
|
* @fusionEmbed
|
|
808
823
|
*/
|
|
809
824
|
let WidgetService = class WidgetService {
|
|
810
|
-
constructor(sisenseContextService) {
|
|
825
|
+
constructor(sisenseContextService, themeService) {
|
|
811
826
|
this.sisenseContextService = sisenseContextService;
|
|
827
|
+
this.themeService = themeService;
|
|
812
828
|
}
|
|
813
829
|
/**
|
|
814
830
|
* Retrieves an existing widget model from the Sisense instance.
|
|
@@ -823,18 +839,153 @@ let WidgetService = class WidgetService {
|
|
|
823
839
|
return getWidgetModel(app.httpClient, dashboardOid, widgetOid);
|
|
824
840
|
});
|
|
825
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
|
+
}
|
|
826
977
|
};
|
|
827
|
-
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 });
|
|
828
979
|
WidgetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, providedIn: 'root' });
|
|
829
980
|
WidgetService = __decorate([
|
|
830
|
-
TrackableService(['getWidgetModel'])
|
|
981
|
+
TrackableService(['getWidgetModel', 'createJtdWidget'])
|
|
831
982
|
], WidgetService);
|
|
832
983
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, decorators: [{
|
|
833
984
|
type: Injectable,
|
|
834
985
|
args: [{
|
|
835
986
|
providedIn: 'root',
|
|
836
987
|
}]
|
|
837
|
-
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
988
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }]; } });
|
|
838
989
|
|
|
839
990
|
class DecoratorsModule {
|
|
840
991
|
constructor(sisenseContextService) {
|
|
@@ -2679,6 +2830,18 @@ class PivotTableComponent {
|
|
|
2679
2830
|
constructor(sisenseContextService, themeService) {
|
|
2680
2831
|
this.sisenseContextService = sisenseContextService;
|
|
2681
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();
|
|
2682
2845
|
this.componentAdapter = new ComponentAdapter(PivotTable, [
|
|
2683
2846
|
createSisenseContextConnector(this.sisenseContextService),
|
|
2684
2847
|
createThemeContextConnector(this.themeService),
|
|
@@ -2701,6 +2864,8 @@ class PivotTableComponent {
|
|
|
2701
2864
|
filters: this.filters,
|
|
2702
2865
|
highlights: this.highlights,
|
|
2703
2866
|
styleOptions: this.styleOptions,
|
|
2867
|
+
onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
|
|
2868
|
+
onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
|
|
2704
2869
|
};
|
|
2705
2870
|
}
|
|
2706
2871
|
/** @internal */
|
|
@@ -2709,7 +2874,7 @@ class PivotTableComponent {
|
|
|
2709
2874
|
}
|
|
2710
2875
|
}
|
|
2711
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 });
|
|
2712
|
-
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"] });
|
|
2713
2878
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableComponent, decorators: [{
|
|
2714
2879
|
type: Component,
|
|
2715
2880
|
args: [{ selector: 'csdk-pivot-table', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
|
|
@@ -2726,6 +2891,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2726
2891
|
type: Input
|
|
2727
2892
|
}], styleOptions: [{
|
|
2728
2893
|
type: Input
|
|
2894
|
+
}], dataPointClick: [{
|
|
2895
|
+
type: Output
|
|
2896
|
+
}], dataPointContextMenu: [{
|
|
2897
|
+
type: Output
|
|
2729
2898
|
}] } });
|
|
2730
2899
|
|
|
2731
2900
|
/**
|
|
@@ -5183,6 +5352,18 @@ class PivotTableWidgetComponent {
|
|
|
5183
5352
|
constructor(sisenseContextService, themeService) {
|
|
5184
5353
|
this.sisenseContextService = sisenseContextService;
|
|
5185
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();
|
|
5186
5367
|
this.componentAdapter = new ComponentAdapter(PivotTableWidget, [
|
|
5187
5368
|
createSisenseContextConnector(this.sisenseContextService),
|
|
5188
5369
|
createThemeContextConnector(this.themeService),
|
|
@@ -5205,8 +5386,11 @@ class PivotTableWidgetComponent {
|
|
|
5205
5386
|
filters: this.filters,
|
|
5206
5387
|
highlights: this.highlights,
|
|
5207
5388
|
styleOptions: this.styleOptions,
|
|
5389
|
+
drilldownOptions: this.drilldownOptions,
|
|
5208
5390
|
title: this.title,
|
|
5209
5391
|
description: this.description,
|
|
5392
|
+
onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
|
|
5393
|
+
onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
|
|
5210
5394
|
};
|
|
5211
5395
|
}
|
|
5212
5396
|
/** @internal */
|
|
@@ -5215,7 +5399,7 @@ class PivotTableWidgetComponent {
|
|
|
5215
5399
|
}
|
|
5216
5400
|
}
|
|
5217
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 });
|
|
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"] });
|
|
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"] });
|
|
5219
5403
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableWidgetComponent, decorators: [{
|
|
5220
5404
|
type: Component,
|
|
5221
5405
|
args: [{ selector: 'csdk-pivot-table-widget', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
|
|
@@ -5232,10 +5416,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5232
5416
|
type: Input
|
|
5233
5417
|
}], styleOptions: [{
|
|
5234
5418
|
type: Input
|
|
5419
|
+
}], drilldownOptions: [{
|
|
5420
|
+
type: Input
|
|
5235
5421
|
}], title: [{
|
|
5236
5422
|
type: Input
|
|
5237
5423
|
}], description: [{
|
|
5238
5424
|
type: Input
|
|
5425
|
+
}], dataPointClick: [{
|
|
5426
|
+
type: Output
|
|
5427
|
+
}], dataPointContextMenu: [{
|
|
5428
|
+
type: Output
|
|
5239
5429
|
}] } });
|
|
5240
5430
|
|
|
5241
5431
|
/**
|
|
@@ -6255,6 +6445,57 @@ const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
|
|
|
6255
6445
|
function toTextWidgetProps(widgetModel) {
|
|
6256
6446
|
return widgetModelTranslator$1.toTextWidgetProps(widgetModel);
|
|
6257
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
|
+
}
|
|
6258
6499
|
|
|
6259
6500
|
var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
6260
6501
|
__proto__: null,
|
|
@@ -6265,7 +6506,8 @@ var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
|
6265
6506
|
toPivotTableProps: toPivotTableProps,
|
|
6266
6507
|
toPivotTableWidgetProps: toPivotTableWidgetProps,
|
|
6267
6508
|
toTableProps: toTableProps,
|
|
6268
|
-
toTextWidgetProps: toTextWidgetProps
|
|
6509
|
+
toTextWidgetProps: toTextWidgetProps,
|
|
6510
|
+
toWidgetProps: toWidgetProps
|
|
6269
6511
|
});
|
|
6270
6512
|
|
|
6271
6513
|
/**
|