@sisense/sdk-ui-angular 1.18.1 → 1.20.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 (27) hide show
  1. package/dist/esm2020/lib/component-wrapper-helpers/context-connectors.mjs +20 -2
  2. package/dist/esm2020/lib/components/dashboard/dashboard-by-id.component.mjs +16 -6
  3. package/dist/esm2020/lib/components/dashboard/dashboard.component.mjs +18 -14
  4. package/dist/esm2020/lib/components/widgets/chart-widget.component.mjs +2 -2
  5. package/dist/esm2020/lib/components/widgets/drilldown-widget.component.mjs +1 -1
  6. package/dist/esm2020/lib/sdk-ui-core-exports.mjs +2 -2
  7. package/dist/esm2020/lib/services/index.mjs +2 -1
  8. package/dist/esm2020/lib/services/plugins.service.mjs +55 -0
  9. package/dist/esm2020/public-api.mjs +3 -1
  10. package/dist/esm2020/version.mjs +2 -2
  11. package/dist/fesm2015/sisense-sdk-ui-angular.mjs +107 -22
  12. package/dist/fesm2015/sisense-sdk-ui-angular.mjs.map +1 -1
  13. package/dist/fesm2020/sisense-sdk-ui-angular.mjs +107 -22
  14. package/dist/fesm2020/sisense-sdk-ui-angular.mjs.map +1 -1
  15. package/dist/lib/component-wrapper-helpers/context-connectors.d.ts +9 -1
  16. package/dist/lib/components/dashboard/dashboard-by-id.component.d.ts +17 -2
  17. package/dist/lib/components/dashboard/dashboard.component.d.ts +20 -13
  18. package/dist/lib/components/widgets/chart-widget.component.d.ts +1 -1
  19. package/dist/lib/components/widgets/drilldown-widget.component.d.ts +1 -1
  20. package/dist/lib/sdk-ui-core-exports.d.ts +2 -2
  21. package/dist/lib/services/index.d.ts +1 -0
  22. package/dist/lib/services/plugins.service.d.ts +37 -0
  23. package/dist/lib/services/theme.service.d.ts +2 -151
  24. package/dist/package.json +1 -1
  25. package/dist/public-api.d.ts +2 -0
  26. package/dist/version.d.ts +1 -1
  27. package/package.json +4 -4
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { EventEmitter, Component, ViewChild, Input, Output, InjectionToken, Injectable, Inject, NgModule, Optional } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
- import { ComponentAdapter, createElement, BasicMemberFilterTile, createContextProviderRenderer, CustomThemeProvider, CustomSisenseContextProvider, createClientApplication, executeQuery, executeQueryByWidgetId, getDashboardModel, getDashboardModels, getWidgetModel, getDefaultThemeSettings, getThemeSettingsByOid, MemberFilterTile, DateRangeFilterTile, Chart, Table, PivotTable, TableWidget, DashboardWidget, createWrapperElementHandler, createWrapperElement, DrilldownWidget, createComponentRenderer, ChartWidget, DashboardById, Dashboard, DrilldownBreadcrumbs, ContextMenu } from '@sisense/sdk-ui-preact';
5
- export { boxWhiskerProcessResult } from '@sisense/sdk-ui-preact';
4
+ import { ComponentAdapter, createElement, BasicMemberFilterTile, createContextProviderRenderer, CustomThemeProvider, CustomSisenseContextProvider, CustomPluginsProvider, createClientApplication, executeQuery, executeQueryByWidgetId, getDashboardModel, getDashboardModels, getWidgetModel, getDefaultThemeSettings, getThemeSettingsByOid, MemberFilterTile, DateRangeFilterTile, Chart, Table, PivotTable, TableWidget, DashboardWidget, createWrapperElementHandler, createWrapperElement, DrilldownWidget, createComponentRenderer, ChartWidget, DashboardById, Dashboard, DrilldownBreadcrumbs, ContextMenu } from '@sisense/sdk-ui-preact';
5
+ export { boxWhiskerProcessResult, dashboardModelTranslator, widgetModelTranslator } from '@sisense/sdk-ui-preact';
6
6
  import { map, BehaviorSubject } from 'rxjs';
7
7
  import { __decorate } from 'tslib';
8
8
  import merge from 'ts-deepmerge';
@@ -125,6 +125,24 @@ const createSisenseContextConnector = (sisenseContextService) => {
125
125
  renderContextProvider: createContextProviderRenderer(CustomSisenseContextProvider),
126
126
  };
127
127
  };
128
+ /**
129
+ * Creates plugins context connector
130
+ *
131
+ * @param pluginsService - The plugin service
132
+ * @internal
133
+ */
134
+ const createPluginsContextConnector = (pluginsService) => {
135
+ return {
136
+ prepareContext() {
137
+ return {
138
+ pluginMap: pluginsService.getPlugins().value,
139
+ registerPlugin: pluginsService.registerPlugin.bind(pluginsService),
140
+ getPlugin: pluginsService.getPlugin.bind(pluginsService),
141
+ };
142
+ },
143
+ renderContextProvider: createContextProviderRenderer(CustomPluginsProvider),
144
+ };
145
+ };
128
146
 
129
147
  /**
130
148
  * Token used to inject {@link SisenseContextConfig} into your application
@@ -249,6 +267,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
249
267
  }]
250
268
  }], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
251
269
 
270
+ /**
271
+ * Service for working with plugins fetched from an external environment.
272
+ *
273
+ * Provides methods for registering, retrieving, and interacting with plugins.
274
+ *
275
+ * @internal
276
+ * @group Contexts
277
+ */
278
+ class PluginsService {
279
+ constructor() {
280
+ this.pluginMap$ = new BehaviorSubject(new Map());
281
+ }
282
+ /**
283
+ * Registers a new plugin into the plugin map.
284
+ *
285
+ * @param pluginType - The unique identifier for the plugin type.
286
+ * @param plugin - The plugin instance to register.
287
+ */
288
+ registerPlugin(pluginType, plugin) {
289
+ const pluginMap = this.pluginMap$.value;
290
+ if (!pluginMap.has(pluginType)) {
291
+ pluginMap.set(pluginType, plugin);
292
+ this.pluginMap$.next(pluginMap);
293
+ }
294
+ }
295
+ /**
296
+ * Retrieves a plugin by its type.
297
+ *
298
+ * @param pluginType - The unique identifier for the plugin type.
299
+ * @returns The plugin instance if found, otherwise undefined.
300
+ */
301
+ getPlugin(pluginType) {
302
+ return this.pluginMap$.value.get(pluginType);
303
+ }
304
+ /**
305
+ * Retrieves a complete plugin map.
306
+ *
307
+ * @returns A plugin map.
308
+ */
309
+ getPlugins() {
310
+ return this.pluginMap$;
311
+ }
312
+ }
313
+ PluginsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PluginsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
314
+ PluginsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PluginsService, providedIn: 'root' });
315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PluginsService, decorators: [{
316
+ type: Injectable,
317
+ args: [{
318
+ providedIn: 'root',
319
+ }]
320
+ }], ctorParameters: function () { return []; } });
321
+
252
322
  /**
253
323
  * Service for working with Sisense Fusion dashboards.
254
324
  *
@@ -345,7 +415,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
345
415
  }]
346
416
  }], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
347
417
 
348
- var packageVersion = '1.18.1';
418
+ var packageVersion = '1.20.0';
349
419
 
350
420
  function Trackable(target, propertyKey, descriptor) {
351
421
  const originalMethod = descriptor.value;
@@ -3449,7 +3519,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3449
3519
  * ```
3450
3520
  * <img src="media://angular-chart-widget-example.png" width="800px" />
3451
3521
  *
3452
- * @group Chart Utilities
3522
+ * @group Dashboarding
3453
3523
  */
3454
3524
  class ChartWidgetComponent {
3455
3525
  constructor(sisenseContextService, themeService) {
@@ -3578,7 +3648,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3578
3648
  * ```
3579
3649
  * @group Fusion Embed
3580
3650
  * @fusionEmbed
3581
- * @alpha
3651
+ * @beta
3582
3652
  */
3583
3653
  class DashboardByIdComponent {
3584
3654
  /**
@@ -3599,12 +3669,21 @@ class DashboardByIdComponent {
3599
3669
  *
3600
3670
  * @category Constructor
3601
3671
  */
3602
- themeService) {
3672
+ themeService,
3673
+ /**
3674
+ * Plugin service
3675
+ *
3676
+ * @internal
3677
+ * @category Constructor
3678
+ */
3679
+ pluginService) {
3603
3680
  this.sisenseContextService = sisenseContextService;
3604
3681
  this.themeService = themeService;
3682
+ this.pluginService = pluginService;
3605
3683
  this.componentAdapter = new ComponentAdapter(() => this.createPreactComponent(), [
3606
3684
  createSisenseContextConnector(this.sisenseContextService),
3607
3685
  createThemeContextConnector(this.themeService),
3686
+ createPluginsContextConnector(this.pluginService),
3608
3687
  ]);
3609
3688
  }
3610
3689
  /**
@@ -3634,7 +3713,7 @@ class DashboardByIdComponent {
3634
3713
  this.componentAdapter.destroy();
3635
3714
  }
3636
3715
  }
3637
- DashboardByIdComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardByIdComponent, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
3716
+ DashboardByIdComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardByIdComponent, deps: [{ token: SisenseContextService }, { token: ThemeService }, { token: PluginsService }], target: i0.ɵɵFactoryTarget.Component });
3638
3717
  DashboardByIdComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DashboardByIdComponent, selector: "csdk-dashboard-by-id", inputs: { dashboardOid: "dashboardOid" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact style=\"width: 100%; height: 100%\"></div>\n", isInline: true });
3639
3718
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardByIdComponent, decorators: [{
3640
3719
  type: Component,
@@ -3642,7 +3721,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3642
3721
  selector: 'csdk-dashboard-by-id',
3643
3722
  template,
3644
3723
  }]
3645
- }], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }]; }, propDecorators: { preactRef: [{
3724
+ }], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }, { type: PluginsService }]; }, propDecorators: { preactRef: [{
3646
3725
  type: ViewChild,
3647
3726
  args: [rootId]
3648
3727
  }], dashboardOid: [{
@@ -3659,16 +3738,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3659
3738
  * <csdk-dashboard
3660
3739
  * *ngIf="dashboard"
3661
3740
  * [title]="dashboard!.title"
3662
- * [layout]="dashboard!.layout"
3741
+ * [layoutOptions]="dashboard!.layoutOptions"
3663
3742
  * [widgets]="dashboard!.widgets"
3664
3743
  * [filters]="dashboard!.filters"
3665
3744
  * [defaultDataSource]="dashboard!.dataSource"
3666
- * [widgetFilterOptions]="dashboard!.widgetFilterOptions"
3745
+ * [widgetsOptions]="dashboard!.widgetsOptions"
3667
3746
  * />
3668
3747
  * ```
3748
+ *
3669
3749
  * ```ts
3670
3750
  * import { Component } from '@angular/core';
3671
- * import { type DashboardModel, DashboardService } from '@sisense/sdk-ui-angular';
3751
+ * import { type DashboardProps, DashboardService } from '@sisense/sdk-ui-angular';
3672
3752
  *
3673
3753
  * @Component({
3674
3754
  * selector: 'app-dashboard',
@@ -3677,17 +3757,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3677
3757
  * })
3678
3758
  * export class DashboardComponent {
3679
3759
  *
3680
- * dashboard: DashboardModel | null = null;
3760
+ * dashboard: DashboardProps | null = null;
3681
3761
  *
3682
3762
  * constructor(private dashboardService: DashboardService) {}
3683
3763
  *
3684
3764
  * async ngOnInit(): Promise<void> {
3685
- * this.dashboard = await this.dashboardService.getDashboardModel('60f3e3e3e4b0e3e3e4b0e3e3', { includeWidgets: true, includeFilters: true });
3765
+ * const dashboardModel = await this.dashboardService.getDashboardModel('60f3e3e3e4b0e3e3e4b0e3e3', { includeWidgets: true, includeFilters: true });
3766
+ * this.dashboardProps = dashboardModelTranslator.toDashboardProps(dashboardModel);
3686
3767
  * }
3687
3768
  * ```
3688
- * @group Fusion Embed
3689
- * @fusionEmbed
3690
- * @alpha
3769
+ * @group Dashboarding
3770
+ * @beta
3691
3771
  */
3692
3772
  class DashboardComponent {
3693
3773
  /**
@@ -3733,11 +3813,12 @@ class DashboardComponent {
3733
3813
  createPreactComponent() {
3734
3814
  const props = {
3735
3815
  title: this.title,
3736
- layout: this.layout,
3816
+ layoutOptions: this.layoutOptions,
3817
+ config: this.config,
3737
3818
  widgets: this.widgets,
3738
3819
  filters: this.filters,
3739
3820
  defaultDataSource: this.defaultDataSource,
3740
- widgetFilterOptions: this.widgetFilterOptions,
3821
+ widgetsOptions: this.widgetsOptions,
3741
3822
  styleOptions: this.styleOptions,
3742
3823
  };
3743
3824
  return createElement(Dashboard, props);
@@ -3750,7 +3831,7 @@ class DashboardComponent {
3750
3831
  }
3751
3832
  }
3752
3833
  DashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardComponent, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
3753
- DashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DashboardComponent, selector: "csdk-dashboard", inputs: { title: "title", layout: "layout", widgets: "widgets", filters: "filters", defaultDataSource: "defaultDataSource", widgetFilterOptions: "widgetFilterOptions", styleOptions: "styleOptions" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact style=\"width: 100%; height: 100%\"></div>\n", isInline: true });
3834
+ DashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DashboardComponent, selector: "csdk-dashboard", inputs: { title: "title", layoutOptions: "layoutOptions", config: "config", widgets: "widgets", filters: "filters", defaultDataSource: "defaultDataSource", widgetsOptions: "widgetsOptions", styleOptions: "styleOptions" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact style=\"width: 100%; height: 100%\"></div>\n", isInline: true });
3754
3835
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardComponent, decorators: [{
3755
3836
  type: Component,
3756
3837
  args: [{
@@ -3762,7 +3843,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3762
3843
  args: [rootId]
3763
3844
  }], title: [{
3764
3845
  type: Input
3765
- }], layout: [{
3846
+ }], layoutOptions: [{
3847
+ type: Input
3848
+ }], config: [{
3766
3849
  type: Input
3767
3850
  }], widgets: [{
3768
3851
  type: Input
@@ -3770,7 +3853,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3770
3853
  type: Input
3771
3854
  }], defaultDataSource: [{
3772
3855
  type: Input
3773
- }], widgetFilterOptions: [{
3856
+ }], widgetsOptions: [{
3774
3857
  type: Input
3775
3858
  }], styleOptions: [{
3776
3859
  type: Input
@@ -4139,6 +4222,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4139
4222
  * Angular context modules, services, and variables
4140
4223
  * @groupDescription Queries
4141
4224
  * Angular query service
4225
+ * @groupDescription Dashboarding
4226
+ * Angular modules, services, and components for composing dashboards
4142
4227
  * @groupDescription Fusion Embed
4143
4228
  * Angular modules, services, and components for working with Fusion Embed dashboards, widgets, queries, and formulas
4144
4229
  * @groupDescription Interfaces
@@ -4151,5 +4236,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4151
4236
  * Generated bundle index. Do not edit.
4152
4237
  */
4153
4238
 
4154
- export { AreaChartComponent, AreaRangeChartComponent, AreamapChartComponent, BarChartComponent, BasicMemberFilterTileComponent, BoxplotChartComponent, ChartComponent, ChartWidgetComponent, ColumnChartComponent, ContextMenuComponent, DashboardByIdComponent, DashboardComponent, DashboardService, DashboardWidgetComponent, DateRangeFilterTileComponent, DrilldownBreadcrumbsComponent, DrilldownWidgetComponent, FunnelChartComponent, IndicatorChartComponent, LineChartComponent, MemberFilterTileComponent, PieChartComponent, PivotTableComponent, PolarChartComponent, QueryService, SISENSE_CONTEXT_CONFIG_TOKEN, ScatterChartComponent, ScattermapChartComponent, SdkUiModule, SisenseContextService, SunburstChartComponent, THEME_CONFIG_TOKEN, TableComponent, TableWidgetComponent, ThemeService, TreemapChartComponent, WidgetService };
4239
+ export { AreaChartComponent, AreaRangeChartComponent, AreamapChartComponent, BarChartComponent, BasicMemberFilterTileComponent, BoxplotChartComponent, ChartComponent, ChartWidgetComponent, ColumnChartComponent, ContextMenuComponent, DashboardByIdComponent, DashboardComponent, DashboardService, DashboardWidgetComponent, DateRangeFilterTileComponent, DrilldownBreadcrumbsComponent, DrilldownWidgetComponent, FunnelChartComponent, IndicatorChartComponent, LineChartComponent, MemberFilterTileComponent, PieChartComponent, PivotTableComponent, PluginsService, PolarChartComponent, QueryService, SISENSE_CONTEXT_CONFIG_TOKEN, ScatterChartComponent, ScattermapChartComponent, SdkUiModule, SisenseContextService, SunburstChartComponent, THEME_CONFIG_TOKEN, TableComponent, TableWidgetComponent, ThemeService, TreemapChartComponent, WidgetService };
4155
4240
  //# sourceMappingURL=sisense-sdk-ui-angular.mjs.map