intelica-library-ui 0.1.226 → 0.1.228
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/fesm2022/intelica-library-ui.mjs +125 -58
- package/fesm2022/intelica-library-ui.mjs.map +1 -1
- package/lib/components/dashboard-qs/dashboard-qs.component.d.ts +17 -0
- package/lib/dto/embed-visual-command.d.ts +1 -1
- package/lib/dto/embed-visual-url-response.d.ts +2 -2
- package/lib/services/shared.d.ts +17 -3
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable, signal, Pipe, Component, HostListener, Directive, EventEmitter, Output, Input, forwardRef, TemplateRef, ContentChild, ContentChildren, ViewChild, PLATFORM_ID, Inject, ChangeDetectorRef, Optional, Host } from '@angular/core';
|
|
2
|
+
import { inject, Injectable, signal, Pipe, Component, HostListener, Directive, EventEmitter, Output, Input, forwardRef, TemplateRef, ContentChild, ContentChildren, ViewChild, PLATFORM_ID, Inject, ChangeDetectorRef, computed, effect, ViewChildren, Optional, Host } from '@angular/core';
|
|
3
3
|
import { getCookie, Cookies, setCookie } from 'typescript-cookie';
|
|
4
4
|
import { HttpClient, HttpHeaders, HttpResponse, HttpParams } from '@angular/common/http';
|
|
5
|
-
import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription, of, tap as tap$1, map } from 'rxjs';
|
|
5
|
+
import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription, firstValueFrom, of, tap as tap$1, map } from 'rxjs';
|
|
6
6
|
import Swal from 'sweetalert2';
|
|
7
7
|
import { tap } from 'rxjs/operators';
|
|
8
8
|
import * as i1 from '@angular/common';
|
|
@@ -46,11 +46,13 @@ import { DropdownModule } from 'primeng/dropdown';
|
|
|
46
46
|
import { OverlayPanelModule } from 'primeng/overlaypanel';
|
|
47
47
|
import * as i4$2 from 'primeng/accordion';
|
|
48
48
|
import { AccordionModule } from 'primeng/accordion';
|
|
49
|
+
import { ActivatedRoute } from '@angular/router';
|
|
50
|
+
import { createEmbeddingContext } from 'amazon-quicksight-embedding-sdk';
|
|
51
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
49
52
|
import * as XLSX from 'xlsx';
|
|
50
53
|
import { Workbook } from 'exceljs';
|
|
51
54
|
import { saveAs } from 'file-saver';
|
|
52
55
|
import pako from 'pako';
|
|
53
|
-
import { createEmbeddingContext } from 'amazon-quicksight-embedding-sdk';
|
|
54
56
|
import JSEncrypt from 'jsencrypt';
|
|
55
57
|
import Aura from '@primeng/themes/aura';
|
|
56
58
|
import { definePreset } from '@primeng/themes';
|
|
@@ -6638,6 +6640,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6638
6640
|
type: Output
|
|
6639
6641
|
}] } });
|
|
6640
6642
|
|
|
6643
|
+
class Shared {
|
|
6644
|
+
http = inject(HttpClient);
|
|
6645
|
+
configService = inject(ConfigService);
|
|
6646
|
+
path = `${this.configService.environment?.sharedPath}/Quicksight`;
|
|
6647
|
+
getEmbedUrl(dashboardId) {
|
|
6648
|
+
return this.http.get(`${this.path}/embed-url/${dashboardId}`);
|
|
6649
|
+
}
|
|
6650
|
+
getEmbedVisualUrl(request) {
|
|
6651
|
+
let params = new HttpParams()
|
|
6652
|
+
.set('dashboardId', request.dashboardId)
|
|
6653
|
+
.set('sheetId', request.sheetId)
|
|
6654
|
+
.set('visualId', request.visualId);
|
|
6655
|
+
Object.entries(request.parameters).forEach(([key, values]) => {
|
|
6656
|
+
values.forEach(value => {
|
|
6657
|
+
params = params.append(`parameters[${key}]`, value);
|
|
6658
|
+
});
|
|
6659
|
+
});
|
|
6660
|
+
return this.http.get(`${this.path}/embed-visual-url`, { params });
|
|
6661
|
+
}
|
|
6662
|
+
getEmbedVisualUrlsAnonymous(request) {
|
|
6663
|
+
let params = new HttpParams()
|
|
6664
|
+
.set('dashboardId', request.dashboardId)
|
|
6665
|
+
.set('sheetId', request.sheetId)
|
|
6666
|
+
.set('visualId', request.visualId);
|
|
6667
|
+
Object.entries(request.parameters).forEach(([key, values]) => {
|
|
6668
|
+
values.forEach(value => {
|
|
6669
|
+
params = params.append(`parameters[${key}]`, value);
|
|
6670
|
+
});
|
|
6671
|
+
});
|
|
6672
|
+
return this.http.get(`${this.path}/embed-visual-anonymous`, { params });
|
|
6673
|
+
}
|
|
6674
|
+
async createEmbedContext(embedUrl, container, options) {
|
|
6675
|
+
const embeddingContext = await createEmbeddingContext();
|
|
6676
|
+
await embeddingContext.embedDashboard({
|
|
6677
|
+
url: embedUrl,
|
|
6678
|
+
container,
|
|
6679
|
+
...(options?.height && { height: options.height }),
|
|
6680
|
+
...(options?.width && { width: options.width }),
|
|
6681
|
+
});
|
|
6682
|
+
}
|
|
6683
|
+
async embedDashboard(dashboardId, container, options) {
|
|
6684
|
+
const { embedUrl } = await firstValueFrom(this.getEmbedUrl(dashboardId));
|
|
6685
|
+
await this.createEmbedContext(embedUrl, container, options);
|
|
6686
|
+
}
|
|
6687
|
+
async createEmbedVisualContext(embedUrl, container, options) {
|
|
6688
|
+
const embeddingContext = await createEmbeddingContext();
|
|
6689
|
+
await embeddingContext.embedVisual({
|
|
6690
|
+
url: embedUrl,
|
|
6691
|
+
container,
|
|
6692
|
+
...(options?.height && { height: options.height }),
|
|
6693
|
+
...(options?.width && { width: options.width }),
|
|
6694
|
+
}, { scaleToContainer: true, fitToIframeWidth: false });
|
|
6695
|
+
}
|
|
6696
|
+
async embedSequentialVisuals(dashboardId, sheetId, parameters, configs, onVisualLoaded) {
|
|
6697
|
+
for (const config of configs) {
|
|
6698
|
+
config.container?.nativeElement?.replaceChildren();
|
|
6699
|
+
const { visual } = await firstValueFrom(this.getEmbedVisualUrl({ dashboardId, sheetId, visualId: config.visualId, parameters }));
|
|
6700
|
+
if (!visual)
|
|
6701
|
+
continue;
|
|
6702
|
+
await this.createEmbedVisualContext(visual.embedUrl, config.container.nativeElement);
|
|
6703
|
+
onVisualLoaded?.(config.visualId);
|
|
6704
|
+
}
|
|
6705
|
+
}
|
|
6706
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: Shared, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6707
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: Shared, providedIn: 'root' });
|
|
6708
|
+
}
|
|
6709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: Shared, decorators: [{
|
|
6710
|
+
type: Injectable,
|
|
6711
|
+
args: [{
|
|
6712
|
+
providedIn: 'root',
|
|
6713
|
+
}]
|
|
6714
|
+
}] });
|
|
6715
|
+
|
|
6716
|
+
class DashboardQsComponent {
|
|
6717
|
+
sharedService = inject(Shared);
|
|
6718
|
+
route = inject(ActivatedRoute);
|
|
6719
|
+
containers;
|
|
6720
|
+
routeData = toSignal(this.route.data, { initialValue: this.route.snapshot.data });
|
|
6721
|
+
dashboardId = computed(() => this.routeData()['dashboardId']);
|
|
6722
|
+
height = computed(() => this.routeData()['height'] ?? '700px');
|
|
6723
|
+
isLoading = signal(true);
|
|
6724
|
+
viewReady = signal(false);
|
|
6725
|
+
constructor() {
|
|
6726
|
+
effect(() => {
|
|
6727
|
+
const id = this.dashboardId();
|
|
6728
|
+
if (!this.viewReady() || !id)
|
|
6729
|
+
return;
|
|
6730
|
+
this.EmbedDashboard(id);
|
|
6731
|
+
});
|
|
6732
|
+
}
|
|
6733
|
+
ngAfterViewInit() {
|
|
6734
|
+
this.viewReady.set(true);
|
|
6735
|
+
}
|
|
6736
|
+
async EmbedDashboard(dashboardId) {
|
|
6737
|
+
const container = this.containers.first?.nativeElement;
|
|
6738
|
+
if (!container)
|
|
6739
|
+
return;
|
|
6740
|
+
this.isLoading.set(true);
|
|
6741
|
+
try {
|
|
6742
|
+
await this.sharedService.embedDashboard(dashboardId, container);
|
|
6743
|
+
}
|
|
6744
|
+
catch (error) {
|
|
6745
|
+
console.error('Error embedding dashboard:', error);
|
|
6746
|
+
}
|
|
6747
|
+
finally {
|
|
6748
|
+
this.isLoading.set(false);
|
|
6749
|
+
}
|
|
6750
|
+
}
|
|
6751
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6752
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: DashboardQsComponent, isStandalone: true, selector: "intelica-dashboard-qs", viewQueries: [{ propertyName: "containers", predicate: ["visualContainer"], descendants: true }], ngImport: i0, template: "<div #visualContainer [style.height]=\"height()\" [class.hidden]=\"isLoading()\"></div>" });
|
|
6753
|
+
}
|
|
6754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsComponent, decorators: [{
|
|
6755
|
+
type: Component,
|
|
6756
|
+
args: [{ selector: 'intelica-dashboard-qs', imports: [], template: "<div #visualContainer [style.height]=\"height()\" [class.hidden]=\"isLoading()\"></div>" }]
|
|
6757
|
+
}], ctorParameters: () => [], propDecorators: { containers: [{
|
|
6758
|
+
type: ViewChildren,
|
|
6759
|
+
args: ['visualContainer']
|
|
6760
|
+
}] } });
|
|
6761
|
+
|
|
6641
6762
|
class CheckboxFilterDirective extends FilterDirective {
|
|
6642
6763
|
constructor() {
|
|
6643
6764
|
super(FilterTypeEnum.Checkbox);
|
|
@@ -8164,60 +8285,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
8164
8285
|
args: [{ providedIn: "root" }]
|
|
8165
8286
|
}] });
|
|
8166
8287
|
|
|
8167
|
-
class Shared {
|
|
8168
|
-
http = inject(HttpClient);
|
|
8169
|
-
configService = inject(ConfigService);
|
|
8170
|
-
path = `${this.configService.environment?.sharedPath}/Quicksight`;
|
|
8171
|
-
getEmbedUrl(dashboardId) {
|
|
8172
|
-
return this.http.get(`${this.path}/embed-url/${dashboardId}`);
|
|
8173
|
-
}
|
|
8174
|
-
getEmbedVisualUrls(request) {
|
|
8175
|
-
let params = new HttpParams()
|
|
8176
|
-
.set('dashboardId', request.dashboardId)
|
|
8177
|
-
.set('sheetId', request.sheetId);
|
|
8178
|
-
request.visualIds.forEach(id => {
|
|
8179
|
-
params = params.append('visualIds', id);
|
|
8180
|
-
});
|
|
8181
|
-
Object.entries(request.parameters).forEach(([key, values]) => {
|
|
8182
|
-
values.forEach(value => {
|
|
8183
|
-
params = params.append(`parameters[${key}]`, value);
|
|
8184
|
-
});
|
|
8185
|
-
});
|
|
8186
|
-
return this.http.get(`${this.path}/embed-visual-urls`, { params });
|
|
8187
|
-
}
|
|
8188
|
-
getEmbedVisualUrlsAnonymous(request) {
|
|
8189
|
-
let params = new HttpParams()
|
|
8190
|
-
.set('dashboardId', request.dashboardId)
|
|
8191
|
-
.set('sheetId', request.sheetId);
|
|
8192
|
-
request.visualIds.forEach(id => {
|
|
8193
|
-
params = params.append('visualIds', id);
|
|
8194
|
-
});
|
|
8195
|
-
Object.entries(request.parameters).forEach(([key, values]) => {
|
|
8196
|
-
values.forEach(value => {
|
|
8197
|
-
params = params.append(`parameters[${key}]`, value);
|
|
8198
|
-
});
|
|
8199
|
-
});
|
|
8200
|
-
return this.http.get(`${this.path}/embed-visual-anonymous`, { params });
|
|
8201
|
-
}
|
|
8202
|
-
async createEmbedContext(embedUrl, container, options) {
|
|
8203
|
-
const embeddingContext = await createEmbeddingContext();
|
|
8204
|
-
await embeddingContext.embedDashboard({
|
|
8205
|
-
url: embedUrl,
|
|
8206
|
-
container,
|
|
8207
|
-
...(options?.height && { height: options.height }),
|
|
8208
|
-
...(options?.width && { width: options.width }),
|
|
8209
|
-
});
|
|
8210
|
-
}
|
|
8211
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: Shared, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8212
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: Shared, providedIn: 'root' });
|
|
8213
|
-
}
|
|
8214
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: Shared, decorators: [{
|
|
8215
|
-
type: Injectable,
|
|
8216
|
-
args: [{
|
|
8217
|
-
providedIn: 'root',
|
|
8218
|
-
}]
|
|
8219
|
-
}] });
|
|
8220
|
-
|
|
8221
8288
|
/**
|
|
8222
8289
|
* Función de comparación genérica para ordenar objetos por un campo específico.
|
|
8223
8290
|
*
|
|
@@ -10615,5 +10682,5 @@ const IntelicaTheme = definePreset(Aura, {
|
|
|
10615
10682
|
* Generated bundle index. Do not edit.
|
|
10616
10683
|
*/
|
|
10617
10684
|
|
|
10618
|
-
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, CompressService, ConfigService, CookieAttributesGeneral, DataDirective, DateFilterDirective, DateModeOptions, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaCellCheckboxDirective, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, RecordPerPageComponent, RefreshTokenInterceptor, ResponseHeadersInterceptor, RouteGuard, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, Shared, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TitlesComponent, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TreeTableFetchComponent, TruncatePipe, decryptData, encryptData, getColor };
|
|
10685
|
+
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, CompressService, ConfigService, CookieAttributesGeneral, DashboardQsComponent, DataDirective, DateFilterDirective, DateModeOptions, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaCellCheckboxDirective, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, RecordPerPageComponent, RefreshTokenInterceptor, ResponseHeadersInterceptor, RouteGuard, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, Shared, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TitlesComponent, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TreeTableFetchComponent, TruncatePipe, decryptData, encryptData, getColor };
|
|
10619
10686
|
//# sourceMappingURL=intelica-library-ui.mjs.map
|