@sisense/sdk-ui-angular 1.18.1 → 1.19.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.
@@ -1,7 +1,7 @@
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';
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
5
  export { boxWhiskerProcessResult } from '@sisense/sdk-ui-preact';
6
6
  import { map, BehaviorSubject } from 'rxjs';
7
7
  import { __decorate } from 'tslib';
@@ -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.19.0';
349
419
 
350
420
  function Trackable(target, propertyKey, descriptor) {
351
421
  const originalMethod = descriptor.value;
@@ -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: [{
@@ -4151,5 +4230,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4151
4230
  * Generated bundle index. Do not edit.
4152
4231
  */
4153
4232
 
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 };
4233
+ 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
4234
  //# sourceMappingURL=sisense-sdk-ui-angular.mjs.map