@sisense/sdk-ui-angular 1.32.0 → 1.33.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/ai/lib/components/chatbot.component.d.ts +1 -2
- package/dist/ai/lib/components/get-nlg-insights.component.d.ts +1 -2
- package/dist/esm2020/ai/lib/components/chatbot.component.mjs +2 -3
- package/dist/esm2020/ai/lib/components/get-nlg-insights.component.mjs +2 -3
- package/dist/esm2020/lib/components/dashboard/dashboard-by-id.component.mjs +4 -4
- package/dist/esm2020/lib/components/dashboard/dashboard.component.mjs +1 -1
- package/dist/esm2020/lib/components/widgets/index.mjs +2 -1
- package/dist/esm2020/lib/components/widgets/pivot-table-widget.component.mjs +127 -0
- package/dist/esm2020/lib/sdk-ui-core-exports.mjs +2 -2
- package/dist/esm2020/lib/sdk-ui.module.mjs +8 -4
- package/dist/esm2020/lib/services/query.service.mjs +31 -5
- package/dist/esm2020/lib/types/dashboard-config.mjs +2 -0
- package/dist/esm2020/lib/types/index.mjs +2 -1
- package/dist/esm2020/lib/utilities/dashboard-helpers.mjs +119 -0
- package/dist/esm2020/lib/utilities/dashboard-model-translator.mjs +49 -0
- package/dist/esm2020/lib/utilities/index.mjs +7 -0
- package/dist/esm2020/lib/utilities/widget-model-translator.mjs +304 -0
- package/dist/esm2020/public-api.mjs +2 -1
- package/dist/esm2020/version.mjs +2 -2
- package/dist/fesm2015/sisense-sdk-ui-angular-ai.mjs +2 -4
- package/dist/fesm2015/sisense-sdk-ui-angular-ai.mjs.map +1 -1
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs +663 -13
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/fesm2020/sisense-sdk-ui-angular-ai.mjs +2 -4
- package/dist/fesm2020/sisense-sdk-ui-angular-ai.mjs.map +1 -1
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs +660 -12
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/lib/components/dashboard/dashboard-by-id.component.d.ts +8 -5
- package/dist/lib/components/dashboard/dashboard.component.d.ts +5 -2
- package/dist/lib/components/widgets/index.d.ts +1 -0
- package/dist/lib/components/widgets/pivot-table-widget.component.d.ts +127 -0
- package/dist/lib/sdk-ui-core-exports.d.ts +2 -2
- package/dist/lib/sdk-ui.module.d.ts +4 -3
- package/dist/lib/services/query.service.d.ts +29 -3
- package/dist/lib/types/dashboard-config.d.ts +24 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/utilities/dashboard-helpers.d.ts +105 -0
- package/dist/lib/utilities/dashboard-model-translator.d.ts +47 -0
- package/dist/lib/utilities/index.d.ts +23 -0
- package/dist/lib/utilities/widget-model-translator.d.ts +289 -0
- package/dist/package.json +1 -1
- package/dist/public-api.d.ts +2 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, Injectable, Inject, NgModule, Optional, EventEmitter, Component, ViewChild, Input, Output } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { createContextProviderRenderer, CustomThemeProvider, CustomSisenseContextProvider, CustomPluginsProvider, createClientApplication, executeQuery, executeQueryByWidgetId, getDashboardModel, getDashboardModels, getWidgetModel, getHierarchyModels, getDefaultThemeSettings, getThemeSettingsByOid, ComponentAdapter, createElement, MemberFilterTile, DateRangeFilterTile, RelativeDateFilterTile, CriteriaFilterTile, Chart, Table, PivotTable, TableWidget, DashboardWidget, WidgetById, createWrapperElementHandler, createWrapperElement, DrilldownWidget, createComponentRenderer, ChartWidget, DashboardById, Dashboard, DrilldownBreadcrumbs, ContextMenu } from '@sisense/sdk-ui-preact';
|
|
5
|
-
export { boxWhiskerProcessResult
|
|
4
|
+
import { createContextProviderRenderer, CustomThemeProvider, CustomSisenseContextProvider, CustomPluginsProvider, createClientApplication, executeQuery, executeQueryByWidgetId, executePivotQuery, getDashboardModel, getDashboardModels, getWidgetModel, getHierarchyModels, getDefaultThemeSettings, getThemeSettingsByOid, ComponentAdapter, createElement, MemberFilterTile, DateRangeFilterTile, RelativeDateFilterTile, CriteriaFilterTile, Chart, Table, PivotTable, TableWidget, DashboardWidget, WidgetById, createWrapperElementHandler, createWrapperElement, DrilldownWidget, createComponentRenderer, ChartWidget, PivotTableWidget, DashboardById, Dashboard, DrilldownBreadcrumbs, ContextMenu, dashboardModelTranslator as dashboardModelTranslator$1, dashboardHelpers as dashboardHelpers$1, widgetModelTranslator as widgetModelTranslator$1 } from '@sisense/sdk-ui-preact';
|
|
5
|
+
export { boxWhiskerProcessResult } 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';
|
|
@@ -168,7 +168,7 @@ let QueryService = class QueryService {
|
|
|
168
168
|
* @return Query result
|
|
169
169
|
*/
|
|
170
170
|
async executeQuery(params) {
|
|
171
|
-
const { dataSource, dimensions, measures, filters, highlights, count, offset, onBeforeQuery } = params;
|
|
171
|
+
const { dataSource, dimensions, measures, filters, highlights, count, offset, beforeQuery, onBeforeQuery, } = params;
|
|
172
172
|
const app = await this.sisenseContextService.getApp();
|
|
173
173
|
const { filters: filterList, relations: filterRelations } = getFilterListAndRelationsJaql(filters);
|
|
174
174
|
const data = await executeQuery({
|
|
@@ -180,7 +180,7 @@ let QueryService = class QueryService {
|
|
|
180
180
|
highlights,
|
|
181
181
|
count,
|
|
182
182
|
offset,
|
|
183
|
-
}, app, { onBeforeQuery });
|
|
183
|
+
}, app, { onBeforeQuery: beforeQuery ?? onBeforeQuery });
|
|
184
184
|
return { data };
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
@@ -194,13 +194,39 @@ let QueryService = class QueryService {
|
|
|
194
194
|
return executeQueryByWidgetId({
|
|
195
195
|
...params,
|
|
196
196
|
app,
|
|
197
|
+
onBeforeQuery: params.beforeQuery ?? params.onBeforeQuery,
|
|
197
198
|
});
|
|
198
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Executes a data query for a pivot table.
|
|
202
|
+
*
|
|
203
|
+
* @param params - Pivot query parameters
|
|
204
|
+
* @return Pivot query result
|
|
205
|
+
* @beta
|
|
206
|
+
*/
|
|
207
|
+
async executePivotQuery(params) {
|
|
208
|
+
const { dataSource, rows, columns, values, grandTotals, filters, highlights, count, offset, beforeQuery, } = params;
|
|
209
|
+
const { filters: filterList, relations: filterRelations } = getFilterListAndRelationsJaql(filters);
|
|
210
|
+
const app = await this.sisenseContextService.getApp();
|
|
211
|
+
const data = await executePivotQuery({
|
|
212
|
+
dataSource,
|
|
213
|
+
rows,
|
|
214
|
+
columns,
|
|
215
|
+
values,
|
|
216
|
+
grandTotals,
|
|
217
|
+
filters: filterList,
|
|
218
|
+
filterRelations,
|
|
219
|
+
highlights,
|
|
220
|
+
count,
|
|
221
|
+
offset,
|
|
222
|
+
}, app, { onBeforeQuery: beforeQuery });
|
|
223
|
+
return { data };
|
|
224
|
+
}
|
|
199
225
|
};
|
|
200
226
|
QueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
201
227
|
QueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryService, providedIn: 'root' });
|
|
202
228
|
QueryService = __decorate([
|
|
203
|
-
TrackableService(['executeQuery', 'executeQueryByWidgetId'])
|
|
229
|
+
TrackableService(['executeQuery', 'executeQueryByWidgetId', 'executePivotQuery'])
|
|
204
230
|
], QueryService);
|
|
205
231
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryService, decorators: [{
|
|
206
232
|
type: Injectable,
|
|
@@ -390,7 +416,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
390
416
|
}]
|
|
391
417
|
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
392
418
|
|
|
393
|
-
var packageVersion = '1.
|
|
419
|
+
var packageVersion = '1.33.0';
|
|
394
420
|
|
|
395
421
|
function Trackable(target, propertyKey, descriptor) {
|
|
396
422
|
const originalMethod = descriptor.value;
|
|
@@ -4032,6 +4058,127 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4032
4058
|
type: Output
|
|
4033
4059
|
}] } });
|
|
4034
4060
|
|
|
4061
|
+
/**
|
|
4062
|
+
* The Pivot Table Widget component extends the {@link PivotTableComponent} component to support widget features,
|
|
4063
|
+
* including a header, widget style options, and more.
|
|
4064
|
+
*
|
|
4065
|
+
* @example
|
|
4066
|
+
* ```html
|
|
4067
|
+
<csdk-pivot-table-widget
|
|
4068
|
+
[dataSource]="pivotProps.dataSource"
|
|
4069
|
+
[dataOptions]="pivotProps.dataOptions"
|
|
4070
|
+
[filters]="pivotProps.filters"
|
|
4071
|
+
[styleOptions]="pivotProps.styleOptions"
|
|
4072
|
+
[title]="pivotProps.title"
|
|
4073
|
+
[description]="pivotProps.description"
|
|
4074
|
+
/>
|
|
4075
|
+
* ```
|
|
4076
|
+
* ```ts
|
|
4077
|
+
import { Component } from '@angular/core';
|
|
4078
|
+
import { type PivotTableWidgetProps } from '@sisense/sdk-ui-angular';
|
|
4079
|
+
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
4080
|
+
import * as DM from '../../assets/sample-ecommerce';
|
|
4081
|
+
|
|
4082
|
+
@Component({
|
|
4083
|
+
selector: 'app-analytics',
|
|
4084
|
+
templateUrl: './analytics.component.html',
|
|
4085
|
+
styleUrls: ['./analytics.component.scss'],
|
|
4086
|
+
})
|
|
4087
|
+
export class AnalyticsComponent {
|
|
4088
|
+
|
|
4089
|
+
pivotProps: PivotTableWidgetProps = {
|
|
4090
|
+
dataSource: DM.DataSource,
|
|
4091
|
+
dataOptions: {
|
|
4092
|
+
rows: [
|
|
4093
|
+
{ column: DM.Category.Category, includeSubTotals: true },
|
|
4094
|
+
{ column: DM.Commerce.AgeRange, includeSubTotals: true },
|
|
4095
|
+
DM.Commerce.Condition,
|
|
4096
|
+
],
|
|
4097
|
+
columns: [{ column: DM.Commerce.Gender, includeSubTotals: true }],
|
|
4098
|
+
values: [
|
|
4099
|
+
measureFactory.sum(DM.Commerce.Cost, 'Total Cost'),
|
|
4100
|
+
{
|
|
4101
|
+
column: measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue'),
|
|
4102
|
+
totalsCalculation: 'sum',
|
|
4103
|
+
dataBars: true,
|
|
4104
|
+
},
|
|
4105
|
+
],
|
|
4106
|
+
grandTotals: { title: 'Grand Total', rows: true, columns: true },
|
|
4107
|
+
},
|
|
4108
|
+
filters: [filterFactory.members(DM.Commerce.Gender, ['Female', 'Male'])],
|
|
4109
|
+
styleOptions: { width: 1400, height: 600, rowsPerPage: 25 },
|
|
4110
|
+
title: 'Pivot Table Widget',
|
|
4111
|
+
description: 'Pivot Table Widget Description',
|
|
4112
|
+
};
|
|
4113
|
+
}
|
|
4114
|
+
* ```
|
|
4115
|
+
* <img src="media://angular-pivot-table-widget-example.png" width="800px" />
|
|
4116
|
+
* @group Dashboards
|
|
4117
|
+
* @beta
|
|
4118
|
+
*/
|
|
4119
|
+
class PivotTableWidgetComponent {
|
|
4120
|
+
constructor(sisenseContextService, themeService) {
|
|
4121
|
+
this.sisenseContextService = sisenseContextService;
|
|
4122
|
+
this.themeService = themeService;
|
|
4123
|
+
this.componentAdapter = new ComponentAdapter(() => this.createPreactComponent(), [
|
|
4124
|
+
createSisenseContextConnector(this.sisenseContextService),
|
|
4125
|
+
createThemeContextConnector(this.themeService),
|
|
4126
|
+
]);
|
|
4127
|
+
}
|
|
4128
|
+
/** @internal */
|
|
4129
|
+
ngAfterViewInit() {
|
|
4130
|
+
this.componentAdapter.render(this.preactRef.nativeElement);
|
|
4131
|
+
}
|
|
4132
|
+
/** @internal */
|
|
4133
|
+
ngOnChanges() {
|
|
4134
|
+
if (this.preactRef) {
|
|
4135
|
+
this.componentAdapter.render(this.preactRef.nativeElement);
|
|
4136
|
+
}
|
|
4137
|
+
}
|
|
4138
|
+
createPreactComponent() {
|
|
4139
|
+
const props = {
|
|
4140
|
+
dataSource: this.dataSource,
|
|
4141
|
+
dataOptions: this.dataOptions,
|
|
4142
|
+
filters: this.filters,
|
|
4143
|
+
highlights: this.highlights,
|
|
4144
|
+
styleOptions: this.styleOptions,
|
|
4145
|
+
title: this.title,
|
|
4146
|
+
description: this.description,
|
|
4147
|
+
};
|
|
4148
|
+
return createElement(PivotTableWidget, props);
|
|
4149
|
+
}
|
|
4150
|
+
/** @internal */
|
|
4151
|
+
ngOnDestroy() {
|
|
4152
|
+
this.componentAdapter.destroy();
|
|
4153
|
+
}
|
|
4154
|
+
}
|
|
4155
|
+
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 });
|
|
4156
|
+
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 style=\"width: 100%; height: 100%\"></div>\n", isInline: true });
|
|
4157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableWidgetComponent, decorators: [{
|
|
4158
|
+
type: Component,
|
|
4159
|
+
args: [{
|
|
4160
|
+
selector: 'csdk-pivot-table-widget',
|
|
4161
|
+
template,
|
|
4162
|
+
}]
|
|
4163
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }]; }, propDecorators: { preactRef: [{
|
|
4164
|
+
type: ViewChild,
|
|
4165
|
+
args: [rootId]
|
|
4166
|
+
}], dataSource: [{
|
|
4167
|
+
type: Input
|
|
4168
|
+
}], dataOptions: [{
|
|
4169
|
+
type: Input
|
|
4170
|
+
}], filters: [{
|
|
4171
|
+
type: Input
|
|
4172
|
+
}], highlights: [{
|
|
4173
|
+
type: Input
|
|
4174
|
+
}], styleOptions: [{
|
|
4175
|
+
type: Input
|
|
4176
|
+
}], title: [{
|
|
4177
|
+
type: Input
|
|
4178
|
+
}], description: [{
|
|
4179
|
+
type: Input
|
|
4180
|
+
}] } });
|
|
4181
|
+
|
|
4035
4182
|
/**
|
|
4036
4183
|
* An Angular component used for easily rendering a dashboard by its ID created in a Sisense Fusion instance.
|
|
4037
4184
|
*
|
|
@@ -4111,7 +4258,7 @@ class DashboardByIdComponent {
|
|
|
4111
4258
|
createPreactComponent() {
|
|
4112
4259
|
const props = {
|
|
4113
4260
|
dashboardOid: this.dashboardOid,
|
|
4114
|
-
|
|
4261
|
+
config: this.config,
|
|
4115
4262
|
};
|
|
4116
4263
|
return createElement(DashboardById, props);
|
|
4117
4264
|
}
|
|
@@ -4123,7 +4270,7 @@ class DashboardByIdComponent {
|
|
|
4123
4270
|
}
|
|
4124
4271
|
}
|
|
4125
4272
|
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 });
|
|
4126
|
-
DashboardByIdComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DashboardByIdComponent, selector: "csdk-dashboard-by-id", inputs: { dashboardOid: "dashboardOid",
|
|
4273
|
+
DashboardByIdComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DashboardByIdComponent, selector: "csdk-dashboard-by-id", inputs: { dashboardOid: "dashboardOid", config: "config" }, 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 });
|
|
4127
4274
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardByIdComponent, decorators: [{
|
|
4128
4275
|
type: Component,
|
|
4129
4276
|
args: [{
|
|
@@ -4135,7 +4282,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4135
4282
|
args: [rootId]
|
|
4136
4283
|
}], dashboardOid: [{
|
|
4137
4284
|
type: Input
|
|
4138
|
-
}],
|
|
4285
|
+
}], config: [{
|
|
4139
4286
|
type: Input
|
|
4140
4287
|
}] } });
|
|
4141
4288
|
|
|
@@ -4519,7 +4666,8 @@ SdkUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "1
|
|
|
4519
4666
|
AreamapChartComponent,
|
|
4520
4667
|
PivotTableComponent,
|
|
4521
4668
|
DashboardByIdComponent,
|
|
4522
|
-
DashboardComponent
|
|
4669
|
+
DashboardComponent,
|
|
4670
|
+
PivotTableWidgetComponent], imports: [CommonModule, DecoratorsModule], exports: [ChartComponent,
|
|
4523
4671
|
TableComponent,
|
|
4524
4672
|
ChartWidgetComponent,
|
|
4525
4673
|
ColumnChartComponent,
|
|
@@ -4549,7 +4697,8 @@ SdkUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "1
|
|
|
4549
4697
|
AreamapChartComponent,
|
|
4550
4698
|
PivotTableComponent,
|
|
4551
4699
|
DashboardByIdComponent,
|
|
4552
|
-
DashboardComponent
|
|
4700
|
+
DashboardComponent,
|
|
4701
|
+
PivotTableWidgetComponent] });
|
|
4553
4702
|
SdkUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdkUiModule, imports: [CommonModule, DecoratorsModule] });
|
|
4554
4703
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdkUiModule, decorators: [{
|
|
4555
4704
|
type: NgModule,
|
|
@@ -4586,6 +4735,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4586
4735
|
PivotTableComponent,
|
|
4587
4736
|
DashboardByIdComponent,
|
|
4588
4737
|
DashboardComponent,
|
|
4738
|
+
PivotTableWidgetComponent,
|
|
4589
4739
|
],
|
|
4590
4740
|
imports: [CommonModule, DecoratorsModule],
|
|
4591
4741
|
exports: [
|
|
@@ -4620,11 +4770,509 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4620
4770
|
PivotTableComponent,
|
|
4621
4771
|
DashboardByIdComponent,
|
|
4622
4772
|
DashboardComponent,
|
|
4773
|
+
PivotTableWidgetComponent,
|
|
4623
4774
|
],
|
|
4624
4775
|
providers: [],
|
|
4625
4776
|
}]
|
|
4626
4777
|
}] });
|
|
4627
4778
|
|
|
4779
|
+
/**
|
|
4780
|
+
* Translates {@link DashboardModel} to {@link DashboardProps}.
|
|
4781
|
+
*
|
|
4782
|
+
* @example
|
|
4783
|
+
* ```html
|
|
4784
|
+
<csdk-dashboard
|
|
4785
|
+
*ngIf="dashboard"
|
|
4786
|
+
[title]="dashboard.title"
|
|
4787
|
+
[layoutOptions]="dashboard.layoutOptions"
|
|
4788
|
+
[widgets]="dashboard.widgets"
|
|
4789
|
+
[filters]="dashboard.filters"
|
|
4790
|
+
[defaultDataSource]="dashboard.defaultDataSource"
|
|
4791
|
+
[widgetsOptions]="dashboard.widgetsOptions"
|
|
4792
|
+
/>
|
|
4793
|
+
* ```
|
|
4794
|
+
*
|
|
4795
|
+
* ```ts
|
|
4796
|
+
import { Component } from '@angular/core';
|
|
4797
|
+
import {
|
|
4798
|
+
type DashboardProps,
|
|
4799
|
+
DashboardService,
|
|
4800
|
+
dashboardModelTranslator,
|
|
4801
|
+
} from '@sisense/sdk-ui-angular';
|
|
4802
|
+
|
|
4803
|
+
@Component({
|
|
4804
|
+
selector: 'app-dashboard',
|
|
4805
|
+
templateUrl: './dashboard.component.html',
|
|
4806
|
+
styleUrls: ['./dashboard.component.scss'],
|
|
4807
|
+
})
|
|
4808
|
+
export class DashboardComponent {
|
|
4809
|
+
dashboard: DashboardProps | null = null;
|
|
4810
|
+
|
|
4811
|
+
constructor(private dashboardService: DashboardService) {}
|
|
4812
|
+
|
|
4813
|
+
async ngOnInit(): Promise<void> {
|
|
4814
|
+
const dashboardModel = await this.dashboardService.getDashboardModel('your-dashboard-oid', {
|
|
4815
|
+
includeWidgets: true,
|
|
4816
|
+
includeFilters: true,
|
|
4817
|
+
});
|
|
4818
|
+
this.dashboard = dashboardModelTranslator.toDashboardProps(dashboardModel);
|
|
4819
|
+
}
|
|
4820
|
+
}
|
|
4821
|
+
* ```
|
|
4822
|
+
*/
|
|
4823
|
+
function toDashboardProps(dashboardModel) {
|
|
4824
|
+
return dashboardModelTranslator$1.toDashboardProps(dashboardModel);
|
|
4825
|
+
}
|
|
4826
|
+
|
|
4827
|
+
var dashboardModelTranslator = /*#__PURE__*/Object.freeze({
|
|
4828
|
+
__proto__: null,
|
|
4829
|
+
toDashboardProps: toDashboardProps
|
|
4830
|
+
});
|
|
4831
|
+
|
|
4832
|
+
/**
|
|
4833
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.replaceFilters}
|
|
4834
|
+
*
|
|
4835
|
+
* @example
|
|
4836
|
+
* Replace all filters on a dashboard with a new set of filters.
|
|
4837
|
+
* ```ts
|
|
4838
|
+
* const existingDashboard: DashboardProps = {...}
|
|
4839
|
+
* const newFilters: Filter[] = [{...}, {...}, ...];
|
|
4840
|
+
* const updatedDashboard = dashboardHelpers.replaceFilters(existingDashboard, newFilters);
|
|
4841
|
+
* ```
|
|
4842
|
+
* @param dashboard - The original dashboard (`DashboardProps`) whose filters are to be replaced.
|
|
4843
|
+
* @param newFilters - An array of new filters or filter relations to set on the dashboard.
|
|
4844
|
+
* @returns A new dashboard instance with the updated filters.
|
|
4845
|
+
*/
|
|
4846
|
+
const replaceFilters = (dashboard, newFilters) => {
|
|
4847
|
+
return dashboardHelpers$1.replaceFilters(dashboard, newFilters);
|
|
4848
|
+
};
|
|
4849
|
+
/**
|
|
4850
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.addFilter}
|
|
4851
|
+
*
|
|
4852
|
+
* @example
|
|
4853
|
+
* Add a new filter to a dashboard.
|
|
4854
|
+
* ```ts
|
|
4855
|
+
* const existingDashboard: DashboardProps = {...};
|
|
4856
|
+
* const newFilter: Filter = {...};
|
|
4857
|
+
* const updatedDashboard = dashboardHelpers.addFilter(existingDashboard, newFilter);
|
|
4858
|
+
* ```
|
|
4859
|
+
* @param dashboard - The original dashboard (`DashboardProps`) to which the filter will be added.
|
|
4860
|
+
* @param newFilter - The filter to add to the dashboard.
|
|
4861
|
+
* @returns A new dashboard instance with the new filter added.
|
|
4862
|
+
*/
|
|
4863
|
+
const addFilter = (dashboard, newFilter) => {
|
|
4864
|
+
return dashboardHelpers$1.addFilter(dashboard, newFilter);
|
|
4865
|
+
};
|
|
4866
|
+
/**
|
|
4867
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.addFilters}
|
|
4868
|
+
*
|
|
4869
|
+
* @example
|
|
4870
|
+
* Add multiple new filters to a dashboard.
|
|
4871
|
+
* ```ts
|
|
4872
|
+
* const existingDashboard: DashboardProps = {...};
|
|
4873
|
+
* const newFilters: Filter[] = [{...}, {...}, ...];
|
|
4874
|
+
* const updatedDashboard = dashboardHelpers.addFilters(existingDashboard, newFilters);
|
|
4875
|
+
* ```
|
|
4876
|
+
* @param dashboard - The original dashboard (`DashboardProps`) to which the filters will be added.
|
|
4877
|
+
* @param newFilters - An array of filters to add to the dashboard.
|
|
4878
|
+
* @returns A new dashboard instance with the new filters added.
|
|
4879
|
+
*/
|
|
4880
|
+
const addFilters = (dashboard, newFilters) => {
|
|
4881
|
+
return dashboardHelpers$1.addFilters(dashboard, newFilters);
|
|
4882
|
+
};
|
|
4883
|
+
/**
|
|
4884
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.replaceFilter}
|
|
4885
|
+
*
|
|
4886
|
+
* @example
|
|
4887
|
+
* Replace a filter in a dashboard.
|
|
4888
|
+
* ```ts
|
|
4889
|
+
* const existingDashboard: DashboardProps = {...};
|
|
4890
|
+
* const filterToReplace: Filter = {...};
|
|
4891
|
+
* const newFilter: Filter = {...};
|
|
4892
|
+
* const updatedDashboard = dashboardHelpers.replaceFilter(existingDashboard, filterToReplace, newFilter);
|
|
4893
|
+
* ```
|
|
4894
|
+
* @param dashboard - The original dashboard (`DashboardProps`) containing the filter to be replaced.
|
|
4895
|
+
* @param filterToReplace - The existing filter to be replaced.
|
|
4896
|
+
* @param newFilter - The new filter to replace the existing one.
|
|
4897
|
+
* @returns A new dashboard instance with the specified filter replaced.
|
|
4898
|
+
*/
|
|
4899
|
+
const replaceFilter = (dashboard, filterToReplace, newFilter) => {
|
|
4900
|
+
return dashboardHelpers$1.replaceFilter(dashboard, filterToReplace, newFilter);
|
|
4901
|
+
};
|
|
4902
|
+
/**
|
|
4903
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.modifyFilter}
|
|
4904
|
+
*
|
|
4905
|
+
* @deprecated Use {@link replaceFilter} instead
|
|
4906
|
+
*
|
|
4907
|
+
* @param dashboard - The original dashboard (`DashboardProps`) containing the filter to modify.
|
|
4908
|
+
* @param filterToModify - The existing filter to be modified.
|
|
4909
|
+
* @param newFilter - The new filter to replace the existing one.
|
|
4910
|
+
* @returns A new dashboard instance with the specified filter modified.
|
|
4911
|
+
*/
|
|
4912
|
+
const modifyFilter = (dashboard, filterToModify, newFilter) => {
|
|
4913
|
+
return dashboardHelpers$1.modifyFilter(dashboard, filterToModify, newFilter);
|
|
4914
|
+
};
|
|
4915
|
+
/**
|
|
4916
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.removeFilter}
|
|
4917
|
+
*
|
|
4918
|
+
* @example
|
|
4919
|
+
* Remove a filter from a dashboard.
|
|
4920
|
+
* ```ts
|
|
4921
|
+
* const existingDashboard: DashboardProps = {...};
|
|
4922
|
+
* const filterToRemove: Filter = {...};
|
|
4923
|
+
* const updatedDashboard = dashboardHelpers.removeFilter(existingDashboard, filterToRemove);
|
|
4924
|
+
* ```
|
|
4925
|
+
* @param dashboard - The original dashboard (`DashboardProps`) from which to remove the filter.
|
|
4926
|
+
* @param filterToRemove - The filter to be removed.
|
|
4927
|
+
* @returns A new dashboard instance with the specified filter removed.
|
|
4928
|
+
*/
|
|
4929
|
+
const removeFilter = (dashboard, filterToRemove) => {
|
|
4930
|
+
return dashboardHelpers$1.removeFilter(dashboard, filterToRemove);
|
|
4931
|
+
};
|
|
4932
|
+
/**
|
|
4933
|
+
* {@inheritDoc @sisense/sdk-ui!dashboardHelpers.removeFilters}
|
|
4934
|
+
*
|
|
4935
|
+
* @example
|
|
4936
|
+
* Remove multiple filters from a dashboard.
|
|
4937
|
+
* ```ts
|
|
4938
|
+
* const existingDashboard: DashboardProps = {...};
|
|
4939
|
+
* const filtersToRemove: Filter[] = [{...}, {...}, ...];
|
|
4940
|
+
* const updatedDashboard = dashboardHelpers.removeFilters(existingDashboard, filtersToRemove);
|
|
4941
|
+
* ```
|
|
4942
|
+
* @param dashboard - The original dashboard (`DashboardProps`) from which the specified filters are removed.
|
|
4943
|
+
* @param filtersToRemove - An array of filters to remove.
|
|
4944
|
+
* @returns A new dashboard instance with the specified filters removed.
|
|
4945
|
+
*/
|
|
4946
|
+
const removeFilters = (dashboard, filtersToRemove) => {
|
|
4947
|
+
return dashboardHelpers$1.removeFilters(dashboard, filtersToRemove);
|
|
4948
|
+
};
|
|
4949
|
+
|
|
4950
|
+
var dashboardHelpers = /*#__PURE__*/Object.freeze({
|
|
4951
|
+
__proto__: null,
|
|
4952
|
+
addFilter: addFilter,
|
|
4953
|
+
addFilters: addFilters,
|
|
4954
|
+
modifyFilter: modifyFilter,
|
|
4955
|
+
removeFilter: removeFilter,
|
|
4956
|
+
removeFilters: removeFilters,
|
|
4957
|
+
replaceFilter: replaceFilter,
|
|
4958
|
+
replaceFilters: replaceFilters
|
|
4959
|
+
});
|
|
4960
|
+
|
|
4961
|
+
/**
|
|
4962
|
+
* Translates a {@link WidgetModel} to the parameters for executing a query for the widget.
|
|
4963
|
+
*
|
|
4964
|
+
* @example
|
|
4965
|
+
* ```ts
|
|
4966
|
+
const widgetModel = await widgetService.getWidgetModel({
|
|
4967
|
+
dashboardOid: 'your-dashboard-oid',
|
|
4968
|
+
widgetOid: 'your-widget-oid'
|
|
4969
|
+
});
|
|
4970
|
+
const executeQueryParams = widgetModelTranslator.toExecuteQueryParams(widgetModel);
|
|
4971
|
+
const queryResult = await queryService.executeQuery(executeQueryParams);
|
|
4972
|
+
* ```
|
|
4973
|
+
*
|
|
4974
|
+
* Note: this method is not supported for getting pivot query.
|
|
4975
|
+
* Use {@link toExecutePivotQueryParams} instead for getting query parameters for the pivot widget.
|
|
4976
|
+
*/
|
|
4977
|
+
const toExecuteQueryParams = (widgetModel) => {
|
|
4978
|
+
return widgetModelTranslator$1.toExecuteQueryParams(widgetModel);
|
|
4979
|
+
};
|
|
4980
|
+
/**
|
|
4981
|
+
* Translates a {@link WidgetModel} to the parameters for executing a query for the pivot widget.
|
|
4982
|
+
*
|
|
4983
|
+
* @example
|
|
4984
|
+
* ```ts
|
|
4985
|
+
const widgetModel = await widgetService.getWidgetModel({
|
|
4986
|
+
dashboardOid: 'your-dashboard-oid',
|
|
4987
|
+
widgetOid: 'your-widget-oid'
|
|
4988
|
+
});
|
|
4989
|
+
const executePivotQueryParams = widgetModelTranslator.toExecutePivotQueryParams(widgetModel);
|
|
4990
|
+
const queryResult = await queryService.executePivotQuery(executeQueryParams);
|
|
4991
|
+
* ```
|
|
4992
|
+
*
|
|
4993
|
+
* Note: this method is supported only for getting pivot query.
|
|
4994
|
+
* Use {@link toExecuteQueryParams} instead for getting query parameters for non-pivot widgets.
|
|
4995
|
+
*/
|
|
4996
|
+
const toExecutePivotQueryParams = (widgetModel) => {
|
|
4997
|
+
return widgetModelTranslator$1.toExecutePivotQueryParams(widgetModel);
|
|
4998
|
+
};
|
|
4999
|
+
/**
|
|
5000
|
+
* Translates a {@link WidgetModel} to the props for rendering a chart.
|
|
5001
|
+
*
|
|
5002
|
+
* @example
|
|
5003
|
+
* ```html
|
|
5004
|
+
<csdk-chart
|
|
5005
|
+
*ngIf="chartProps"
|
|
5006
|
+
[chartType]="chartProps.chartType"
|
|
5007
|
+
[dataSet]="chartProps.dataSet"
|
|
5008
|
+
[dataOptions]="chartProps.dataOptions"
|
|
5009
|
+
[filters]="chartProps.filters"
|
|
5010
|
+
[highlights]="chartProps.highlights"
|
|
5011
|
+
[styleOptions]="chartProps.styleOptions"
|
|
5012
|
+
/>
|
|
5013
|
+
* ```
|
|
5014
|
+
*
|
|
5015
|
+
* ```ts
|
|
5016
|
+
import { Component } from '@angular/core';
|
|
5017
|
+
import {
|
|
5018
|
+
type ChartProps
|
|
5019
|
+
WidgetService,
|
|
5020
|
+
widgetModelTranslator,
|
|
5021
|
+
} from '@sisense/sdk-ui-angular';
|
|
5022
|
+
|
|
5023
|
+
@Component({
|
|
5024
|
+
selector: 'app-example',
|
|
5025
|
+
templateUrl: './example.component.html',
|
|
5026
|
+
styleUrls: ['./example.component.scss'],
|
|
5027
|
+
})
|
|
5028
|
+
export class ExampleComponent {
|
|
5029
|
+
chartProps: ChartProps | null = null;
|
|
5030
|
+
|
|
5031
|
+
constructor(private widgetService: WidgetService) {}
|
|
5032
|
+
|
|
5033
|
+
async ngOnInit(): Promise<void> {
|
|
5034
|
+
const widgetModel = await widgetService.getWidgetModel({
|
|
5035
|
+
dashboardOid: 'your-dashboard-oid',
|
|
5036
|
+
widgetOid: 'your-widget-oid'
|
|
5037
|
+
});
|
|
5038
|
+
this.chartProps = widgetModelTranslator.toChartProps(widgetModel);
|
|
5039
|
+
}
|
|
5040
|
+
}
|
|
5041
|
+
* ```
|
|
5042
|
+
*
|
|
5043
|
+
* Note: this method is not supported for pivot widgets.
|
|
5044
|
+
* Use {@link toPivotTableProps} instead for getting props for the {@link PivotTableComponent}.
|
|
5045
|
+
*/
|
|
5046
|
+
function toChartProps(widgetModel) {
|
|
5047
|
+
return widgetModelTranslator$1.toChartProps(widgetModel);
|
|
5048
|
+
}
|
|
5049
|
+
/**
|
|
5050
|
+
* Translates a {@link WidgetModel} to the props for rendering a table.
|
|
5051
|
+
*
|
|
5052
|
+
* @example
|
|
5053
|
+
* ```html
|
|
5054
|
+
<csdk-table
|
|
5055
|
+
*ngIf="tableProps"
|
|
5056
|
+
[dataSet]="tableProps.dataSet"
|
|
5057
|
+
[dataOptions]="tableProps.dataOptions"
|
|
5058
|
+
[filters]="tableProps.filters"
|
|
5059
|
+
[styleOptions]="tableProps.styleOptions"
|
|
5060
|
+
/>
|
|
5061
|
+
* ```
|
|
5062
|
+
*
|
|
5063
|
+
* ```ts
|
|
5064
|
+
import { Component } from '@angular/core';
|
|
5065
|
+
import {
|
|
5066
|
+
type TableProps
|
|
5067
|
+
WidgetService,
|
|
5068
|
+
widgetModelTranslator,
|
|
5069
|
+
} from '@sisense/sdk-ui-angular';
|
|
5070
|
+
|
|
5071
|
+
@Component({
|
|
5072
|
+
selector: 'app-example',
|
|
5073
|
+
templateUrl: './example.component.html',
|
|
5074
|
+
styleUrls: ['./example.component.scss'],
|
|
5075
|
+
})
|
|
5076
|
+
export class ExampleComponent {
|
|
5077
|
+
tableProps: TableProps | null = null;
|
|
5078
|
+
|
|
5079
|
+
constructor(private widgetService: WidgetService) {}
|
|
5080
|
+
|
|
5081
|
+
async ngOnInit(): Promise<void> {
|
|
5082
|
+
const widgetModel = await widgetService.getWidgetModel({
|
|
5083
|
+
dashboardOid: 'your-dashboard-oid',
|
|
5084
|
+
widgetOid: 'your-widget-oid'
|
|
5085
|
+
});
|
|
5086
|
+
this.tableProps = widgetModelTranslator.toTableProps(widgetModel);
|
|
5087
|
+
}
|
|
5088
|
+
}
|
|
5089
|
+
* ```
|
|
5090
|
+
*
|
|
5091
|
+
* Note: this method is not supported for chart and pivot widgets.
|
|
5092
|
+
* Use {@link toChartProps} instead for getting props for the {@link ChartComponent}.
|
|
5093
|
+
* Use {@link toPivotTableProps} instead for getting props for the {@link PivotTableComponent}.
|
|
5094
|
+
*/
|
|
5095
|
+
function toTableProps(widgetModel) {
|
|
5096
|
+
return widgetModelTranslator$1.toTableProps(widgetModel);
|
|
5097
|
+
}
|
|
5098
|
+
/**
|
|
5099
|
+
* Translates a {@link WidgetModel} to the props for rendering a pivot table.
|
|
5100
|
+
*
|
|
5101
|
+
* @example
|
|
5102
|
+
* ```html
|
|
5103
|
+
<csdk-pivot-table
|
|
5104
|
+
*ngIf="pivotTableProps"
|
|
5105
|
+
[dataSet]="pivotTableProps.dataSet"
|
|
5106
|
+
[dataOptions]="pivotTableProps.dataOptions"
|
|
5107
|
+
[filters]="pivotTableProps.filters"
|
|
5108
|
+
[styleOptions]="pivotTableProps.styleOptions"
|
|
5109
|
+
/>
|
|
5110
|
+
* ```
|
|
5111
|
+
*
|
|
5112
|
+
* ```ts
|
|
5113
|
+
import { Component } from '@angular/core';
|
|
5114
|
+
import {
|
|
5115
|
+
type PivotTableProps
|
|
5116
|
+
WidgetService,
|
|
5117
|
+
widgetModelTranslator,
|
|
5118
|
+
} from '@sisense/sdk-ui-angular';
|
|
5119
|
+
|
|
5120
|
+
@Component({
|
|
5121
|
+
selector: 'app-example',
|
|
5122
|
+
templateUrl: './example.component.html',
|
|
5123
|
+
styleUrls: ['./example.component.scss'],
|
|
5124
|
+
})
|
|
5125
|
+
export class ExampleComponent {
|
|
5126
|
+
pivotTableProps: PivotTableProps | null = null;
|
|
5127
|
+
|
|
5128
|
+
constructor(private widgetService: WidgetService) {}
|
|
5129
|
+
|
|
5130
|
+
async ngOnInit(): Promise<void> {
|
|
5131
|
+
const widgetModel = await widgetService.getWidgetModel({
|
|
5132
|
+
dashboardOid: 'your-dashboard-oid',
|
|
5133
|
+
widgetOid: 'your-widget-oid'
|
|
5134
|
+
});
|
|
5135
|
+
this.pivotTableProps = widgetModelTranslator.toPivotTableProps(widgetModel);
|
|
5136
|
+
}
|
|
5137
|
+
}
|
|
5138
|
+
* ```
|
|
5139
|
+
*
|
|
5140
|
+
* Note: this method is not supported for chart or table widgets.
|
|
5141
|
+
* Use {@link toChartProps} instead for getting props for the {@link ChartComponent}.
|
|
5142
|
+
* Use {@link toTableProps} instead for getting props for the {@link TableComponent}.
|
|
5143
|
+
*/
|
|
5144
|
+
function toPivotTableProps(widgetModel) {
|
|
5145
|
+
return widgetModelTranslator$1.toPivotTableProps(widgetModel);
|
|
5146
|
+
}
|
|
5147
|
+
/**
|
|
5148
|
+
* Translates a {@link WidgetModel} to the props for rendering a chart widget.
|
|
5149
|
+
*
|
|
5150
|
+
* @example
|
|
5151
|
+
* ```html
|
|
5152
|
+
<csdk-chart-widget
|
|
5153
|
+
*ngIf="chartWidgetProps"
|
|
5154
|
+
[chartType]="chartWidgetProps.chartType"
|
|
5155
|
+
[dataSource]="chartWidgetProps.dataSource"
|
|
5156
|
+
[dataOptions]="chartWidgetProps.dataOptions"
|
|
5157
|
+
[filters]="chartWidgetProps.filters"
|
|
5158
|
+
[highlights]="chartWidgetProps.highlights"
|
|
5159
|
+
[styleOptions]="chartWidgetProps.styleOptions"
|
|
5160
|
+
/>
|
|
5161
|
+
* ```
|
|
5162
|
+
*
|
|
5163
|
+
* ```ts
|
|
5164
|
+
import { Component } from '@angular/core';
|
|
5165
|
+
import {
|
|
5166
|
+
type ChartWidgetProps
|
|
5167
|
+
WidgetService,
|
|
5168
|
+
widgetModelTranslator,
|
|
5169
|
+
} from '@sisense/sdk-ui-angular';
|
|
5170
|
+
|
|
5171
|
+
@Component({
|
|
5172
|
+
selector: 'app-example',
|
|
5173
|
+
templateUrl: './example.component.html',
|
|
5174
|
+
styleUrls: ['./example.component.scss'],
|
|
5175
|
+
})
|
|
5176
|
+
export class ExampleComponent {
|
|
5177
|
+
chartWidgetProps: ChartWidgetProps | null = null;
|
|
5178
|
+
|
|
5179
|
+
constructor(private widgetService: WidgetService) {}
|
|
5180
|
+
|
|
5181
|
+
async ngOnInit(): Promise<void> {
|
|
5182
|
+
const widgetModel = await widgetService.getWidgetModel({
|
|
5183
|
+
dashboardOid: 'your-dashboard-oid',
|
|
5184
|
+
widgetOid: 'your-widget-oid'
|
|
5185
|
+
});
|
|
5186
|
+
this.chartWidgetProps = widgetModelTranslator.toChartWidgetProps(widgetModel);
|
|
5187
|
+
}
|
|
5188
|
+
}
|
|
5189
|
+
* ```
|
|
5190
|
+
*
|
|
5191
|
+
* Note: this method is not supported for pivot widgets.
|
|
5192
|
+
*/
|
|
5193
|
+
function toChartWidgetProps(widgetModel) {
|
|
5194
|
+
return widgetModelTranslator$1.toChartWidgetProps(widgetModel);
|
|
5195
|
+
}
|
|
5196
|
+
/**
|
|
5197
|
+
* Translates a {@link WidgetModel} to the props for rendering a pivot table widget.
|
|
5198
|
+
*
|
|
5199
|
+
* @example
|
|
5200
|
+
* ```html
|
|
5201
|
+
<csdk-pivot-table-widget
|
|
5202
|
+
*ngIf="pivotWidgetProps"
|
|
5203
|
+
[dataSet]="pivotWidgetProps.dataSet"
|
|
5204
|
+
[dataOptions]="pivotWidgetProps.dataOptions"
|
|
5205
|
+
[filters]="pivotWidgetProps.filters"
|
|
5206
|
+
[styleOptions]="pivotWidgetProps.styleOptions"
|
|
5207
|
+
/>
|
|
5208
|
+
* ```
|
|
5209
|
+
*
|
|
5210
|
+
* ```ts
|
|
5211
|
+
import { Component } from '@angular/core';
|
|
5212
|
+
import {
|
|
5213
|
+
type PivotTableWidgetProps
|
|
5214
|
+
WidgetService,
|
|
5215
|
+
widgetModelTranslator,
|
|
5216
|
+
} from '@sisense/sdk-ui-angular';
|
|
5217
|
+
|
|
5218
|
+
@Component({
|
|
5219
|
+
selector: 'app-example',
|
|
5220
|
+
templateUrl: './example.component.html',
|
|
5221
|
+
styleUrls: ['./example.component.scss'],
|
|
5222
|
+
})
|
|
5223
|
+
export class ExampleComponent {
|
|
5224
|
+
pivotWidgetProps: PivotTableWidgetProps | null = null;
|
|
5225
|
+
|
|
5226
|
+
constructor(private widgetService: WidgetService) {}
|
|
5227
|
+
|
|
5228
|
+
async ngOnInit(): Promise<void> {
|
|
5229
|
+
const widgetModel = await widgetService.getWidgetModel({
|
|
5230
|
+
dashboardOid: 'your-dashboard-oid',
|
|
5231
|
+
widgetOid: 'your-widget-oid'
|
|
5232
|
+
});
|
|
5233
|
+
this.pivotWidgetProps = widgetModelTranslator.toPivotTableWidgetProps(widgetModel);
|
|
5234
|
+
}
|
|
5235
|
+
}
|
|
5236
|
+
* ```
|
|
5237
|
+
*
|
|
5238
|
+
* Note: this method is not supported for chart or table widgets.
|
|
5239
|
+
* Use {@link toChartWidgetProps} instead for getting props for the {@link ChartWidgetComponent}.
|
|
5240
|
+
*/
|
|
5241
|
+
function toPivotTableWidgetProps(widgetModel) {
|
|
5242
|
+
return widgetModelTranslator$1.toPivotTableWidgetProps(widgetModel);
|
|
5243
|
+
}
|
|
5244
|
+
/**
|
|
5245
|
+
* Translates a {@link WidgetModel} to the props for rendering a text widget.
|
|
5246
|
+
*
|
|
5247
|
+
* @example
|
|
5248
|
+
* ```ts
|
|
5249
|
+
const widgetModel = await widgetService.getWidgetModel({
|
|
5250
|
+
dashboardOid: 'your-dashboard-oid',
|
|
5251
|
+
widgetOid: 'your-widget-oid'
|
|
5252
|
+
});
|
|
5253
|
+
const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
|
|
5254
|
+
* ```
|
|
5255
|
+
*
|
|
5256
|
+
* Note: this method is not supported for chart or pivot widgets.
|
|
5257
|
+
* Use {@link toChartWidgetProps} instead for getting props for the {@link ChartWidgetComponent}.
|
|
5258
|
+
* Use {@link toPivotTableWidgetProps} instead for getting props for the pivot table widget.
|
|
5259
|
+
*/
|
|
5260
|
+
function toTextWidgetProps(widgetModel) {
|
|
5261
|
+
return widgetModelTranslator$1.toTextWidgetProps(widgetModel);
|
|
5262
|
+
}
|
|
5263
|
+
|
|
5264
|
+
var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
5265
|
+
__proto__: null,
|
|
5266
|
+
toChartProps: toChartProps,
|
|
5267
|
+
toChartWidgetProps: toChartWidgetProps,
|
|
5268
|
+
toExecutePivotQueryParams: toExecutePivotQueryParams,
|
|
5269
|
+
toExecuteQueryParams: toExecuteQueryParams,
|
|
5270
|
+
toPivotTableProps: toPivotTableProps,
|
|
5271
|
+
toPivotTableWidgetProps: toPivotTableWidgetProps,
|
|
5272
|
+
toTableProps: toTableProps,
|
|
5273
|
+
toTextWidgetProps: toTextWidgetProps
|
|
5274
|
+
});
|
|
5275
|
+
|
|
4628
5276
|
// This file re-exports common types/utils from @sisense/sdk-ui-preact
|
|
4629
5277
|
// Re-exports utils from @sisense/sdk-ui-preact
|
|
4630
5278
|
|
|
@@ -4636,5 +5284,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4636
5284
|
* Generated bundle index. Do not edit.
|
|
4637
5285
|
*/
|
|
4638
5286
|
|
|
4639
|
-
export { AreaChartComponent, AreaRangeChartComponent, AreamapChartComponent, BarChartComponent, BoxplotChartComponent, ChartComponent, ChartWidgetComponent, ColumnChartComponent, ContextMenuComponent, CriteriaFilterTileComponent, DashboardByIdComponent, DashboardComponent, DashboardService, DashboardWidgetComponent, DateRangeFilterTileComponent, DrilldownBreadcrumbsComponent, DrilldownWidgetComponent, FunnelChartComponent, HierarchyService, IndicatorChartComponent, LineChartComponent, MemberFilterTileComponent, PieChartComponent, PivotTableComponent, PluginsService, PolarChartComponent, QueryService, RelativeDateFilterTileComponent, SISENSE_CONTEXT_CONFIG_TOKEN, ScatterChartComponent, ScattermapChartComponent, SdkUiModule, SisenseContextService, SunburstChartComponent, THEME_CONFIG_TOKEN, TableComponent, TableWidgetComponent, ThemeService, TrackableService, TreemapChartComponent, WidgetByIdComponent, WidgetService, createPluginsContextConnector, createSisenseContextConnector, createThemeContextConnector };
|
|
5287
|
+
export { AreaChartComponent, AreaRangeChartComponent, AreamapChartComponent, BarChartComponent, BoxplotChartComponent, ChartComponent, ChartWidgetComponent, ColumnChartComponent, ContextMenuComponent, CriteriaFilterTileComponent, DashboardByIdComponent, DashboardComponent, DashboardService, DashboardWidgetComponent, DateRangeFilterTileComponent, DrilldownBreadcrumbsComponent, DrilldownWidgetComponent, FunnelChartComponent, HierarchyService, IndicatorChartComponent, LineChartComponent, MemberFilterTileComponent, PieChartComponent, PivotTableComponent, PivotTableWidgetComponent, PluginsService, PolarChartComponent, QueryService, RelativeDateFilterTileComponent, SISENSE_CONTEXT_CONFIG_TOKEN, ScatterChartComponent, ScattermapChartComponent, SdkUiModule, SisenseContextService, SunburstChartComponent, THEME_CONFIG_TOKEN, TableComponent, TableWidgetComponent, ThemeService, TrackableService, TreemapChartComponent, WidgetByIdComponent, WidgetService, createPluginsContextConnector, createSisenseContextConnector, createThemeContextConnector, dashboardHelpers, dashboardModelTranslator, widgetModelTranslator };
|
|
4640
5288
|
//# sourceMappingURL=sisense-sdk-ui-angular.mjs.map
|