intelica-library-components 1.1.146 → 1.1.148

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,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, signal, Pipe, Component, TemplateRef, ContentChild, Input, Directive, EventEmitter, ContentChildren, Output, HostListener, forwardRef, ViewChild, PLATFORM_ID, Inject, DestroyRef, output, input, effect, Optional, Host, InjectionToken } from '@angular/core';
2
+ import { Injectable, inject, signal, Pipe, Component, TemplateRef, ContentChild, Input, Directive, EventEmitter, ContentChildren, Output, HostListener, forwardRef, ViewChild, PLATFORM_ID, Inject, DestroyRef, output, input, effect, computed, ViewChildren, Optional, Host, InjectionToken } from '@angular/core';
3
3
  import { getCookie, setCookie } from 'typescript-cookie';
4
4
  import * as i1$4 from '@angular/common/http';
5
5
  import { HttpClient, HttpHeaders, HttpResponse, HttpParams } from '@angular/common/http';
6
- import { BehaviorSubject, catchError, throwError, Subject, Subscription, tap as tap$1, of, map, fromEvent, startWith, distinctUntilChanged, shareReplay, firstValueFrom } from 'rxjs';
6
+ import { BehaviorSubject, catchError, throwError, Subject, Subscription, tap as tap$1, of, map, fromEvent, startWith, distinctUntilChanged, firstValueFrom, shareReplay } from 'rxjs';
7
7
  import Swal from 'sweetalert2';
8
8
  import { tap, catchError as catchError$1 } from 'rxjs/operators';
9
9
  import * as i1 from '@angular/common';
@@ -51,15 +51,15 @@ import * as i2$4 from 'primeng/skeleton';
51
51
  import { SkeletonModule } from 'primeng/skeleton';
52
52
  import * as i1$3 from 'primeng/confirmdialog';
53
53
  import { ConfirmDialogModule } from 'primeng/confirmdialog';
54
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
54
+ import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
55
55
  import { Guid } from 'guid-typescript';
56
56
  import { ActivatedRoute, RouterLink } from '@angular/router';
57
57
  import { Breadcrumb } from 'primeng/breadcrumb';
58
+ import { createEmbeddingContext } from 'amazon-quicksight-embedding-sdk';
58
59
  import * as XLSX from 'xlsx';
59
60
  import { Workbook } from 'exceljs';
60
61
  import { saveAs } from 'file-saver';
61
62
  import JSEncrypt from 'jsencrypt';
62
- import { createEmbeddingContext } from 'amazon-quicksight-embedding-sdk';
63
63
  import * as signalR from '@microsoft/signalr';
64
64
 
65
65
  function GetCookieAttributes(environment) {
@@ -6141,6 +6141,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
6141
6141
  args: [{ selector: 'intelica-title', imports: [Button], template: "<div class=\"ptSectionTitle\">\n <div class=\"ptSectionTitle__icon\">\n <p-button class=\"prButton\" icon=\"icon icon-nav-left\" (onClick)=\"back.emit()\" />\n </div>\n <div class=\"ptSectionTitle__content\">\n <div class=\"ptSectionTitle__title\">\n {{ title() }}\n </div>\n </div>\n</div>" }]
6142
6142
  }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], back: [{ type: i0.Output, args: ["back"] }] } });
6143
6143
 
6144
+ class Shared {
6145
+ http = inject(HttpClient);
6146
+ configService = inject(ConfigService);
6147
+ path = `${this.configService.environment?.sharedPath}/Quicksight`;
6148
+ getEmbedUrl(dashboardId) {
6149
+ return this.http.get(`${this.path}/embed-url/${dashboardId}`);
6150
+ }
6151
+ getEmbedVisualUrl(request) {
6152
+ let params = new HttpParams()
6153
+ .set('dashboardId', request.dashboardId)
6154
+ .set('sheetId', request.sheetId)
6155
+ .set('visualId', request.visualId);
6156
+ Object.entries(request.parameters).forEach(([key, values]) => {
6157
+ values.forEach(value => {
6158
+ params = params.append(`parameters[${key}]`, value);
6159
+ });
6160
+ });
6161
+ return this.http.get(`${this.path}/embed-visual-url`, { params });
6162
+ }
6163
+ getEmbedVisualUrlsAnonymous(request) {
6164
+ let params = new HttpParams()
6165
+ .set('dashboardId', request.dashboardId)
6166
+ .set('sheetId', request.sheetId)
6167
+ .set('visualId', request.visualId);
6168
+ Object.entries(request.parameters).forEach(([key, values]) => {
6169
+ values.forEach(value => {
6170
+ params = params.append(`parameters[${key}]`, value);
6171
+ });
6172
+ });
6173
+ return this.http.get(`${this.path}/embed-visual-anonymous`, { params });
6174
+ }
6175
+ async createEmbedContext(embedUrl, container, options) {
6176
+ const embeddingContext = await createEmbeddingContext();
6177
+ await embeddingContext.embedDashboard({
6178
+ url: embedUrl,
6179
+ container,
6180
+ ...(options?.height && { height: options.height }),
6181
+ ...(options?.width && { width: options.width }),
6182
+ });
6183
+ }
6184
+ async embedDashboard(dashboardId, container, options) {
6185
+ const { embedUrl } = await firstValueFrom(this.getEmbedUrl(dashboardId));
6186
+ await this.createEmbedContext(embedUrl, container, options);
6187
+ }
6188
+ async createEmbedVisualContext(embedUrl, container, options) {
6189
+ const embeddingContext = await createEmbeddingContext();
6190
+ await embeddingContext.embedVisual({
6191
+ url: embedUrl,
6192
+ container,
6193
+ ...(options?.height && { height: options.height }),
6194
+ ...(options?.width && { width: options.width }),
6195
+ }, { scaleToContainer: true, fitToIframeWidth: false });
6196
+ }
6197
+ async embedSequentialVisuals(dashboardId, sheetId, parameters, configs, onVisualLoaded) {
6198
+ for (const config of configs) {
6199
+ config.container?.nativeElement?.replaceChildren();
6200
+ const { visual } = await firstValueFrom(this.getEmbedVisualUrl({ dashboardId, sheetId, visualId: config.visualId, parameters }));
6201
+ if (!visual)
6202
+ continue;
6203
+ await this.createEmbedVisualContext(visual.embedUrl, config.container.nativeElement);
6204
+ onVisualLoaded?.(config.visualId);
6205
+ }
6206
+ }
6207
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6208
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, providedIn: 'root' });
6209
+ }
6210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, decorators: [{
6211
+ type: Injectable,
6212
+ args: [{
6213
+ providedIn: 'root',
6214
+ }]
6215
+ }] });
6216
+
6217
+ class DashboardQsComponent {
6218
+ sharedService = inject(Shared);
6219
+ route = inject(ActivatedRoute);
6220
+ containers;
6221
+ routeData = toSignal(this.route.data, { initialValue: this.route.snapshot.data });
6222
+ dashboardId = computed(() => this.routeData()['dashboardId'], ...(ngDevMode ? [{ debugName: "dashboardId" }] : []));
6223
+ height = computed(() => this.routeData()['height'] ?? '700px', ...(ngDevMode ? [{ debugName: "height" }] : []));
6224
+ isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
6225
+ viewReady = signal(false, ...(ngDevMode ? [{ debugName: "viewReady" }] : []));
6226
+ constructor() {
6227
+ effect(() => {
6228
+ const id = this.dashboardId();
6229
+ if (!this.viewReady() || !id)
6230
+ return;
6231
+ this.EmbedDashboard(id);
6232
+ });
6233
+ }
6234
+ ngAfterViewInit() {
6235
+ this.viewReady.set(true);
6236
+ }
6237
+ async EmbedDashboard(dashboardId) {
6238
+ const container = this.containers.first?.nativeElement;
6239
+ if (!container)
6240
+ return;
6241
+ this.isLoading.set(true);
6242
+ try {
6243
+ await this.sharedService.embedDashboard(dashboardId, container);
6244
+ }
6245
+ catch (error) {
6246
+ console.error('Error embedding dashboard:', error);
6247
+ }
6248
+ finally {
6249
+ this.isLoading.set(false);
6250
+ }
6251
+ }
6252
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6253
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.23", 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>" });
6254
+ }
6255
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsComponent, decorators: [{
6256
+ type: Component,
6257
+ args: [{ selector: 'intelica-dashboard-qs', imports: [], template: "<div #visualContainer [style.height]=\"height()\" [class.hidden]=\"isLoading()\"></div>" }]
6258
+ }], ctorParameters: () => [], propDecorators: { containers: [{
6259
+ type: ViewChildren,
6260
+ args: ['visualContainer']
6261
+ }] } });
6262
+
6144
6263
  class CheckboxFilterDirective extends FilterDirective {
6145
6264
  constructor() {
6146
6265
  super(FilterTypeEnum.Checkbox);
@@ -8350,75 +8469,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
8350
8469
  args: [{ providedIn: "root" }]
8351
8470
  }] });
8352
8471
 
8353
- class Shared {
8354
- http = inject(HttpClient);
8355
- configService = inject(ConfigService);
8356
- path = `${this.configService.environment?.sharedPath}/Quicksight`;
8357
- getEmbedUrl(dashboardId) {
8358
- return this.http.get(`${this.path}/embed-url/${dashboardId}`);
8359
- }
8360
- getEmbedVisualUrl(request) {
8361
- let params = new HttpParams()
8362
- .set('dashboardId', request.dashboardId)
8363
- .set('sheetId', request.sheetId)
8364
- .set('visualId', request.visualId);
8365
- Object.entries(request.parameters).forEach(([key, values]) => {
8366
- values.forEach(value => {
8367
- params = params.append(`parameters[${key}]`, value);
8368
- });
8369
- });
8370
- return this.http.get(`${this.path}/embed-visual-url`, { params });
8371
- }
8372
- getEmbedVisualUrlsAnonymous(request) {
8373
- let params = new HttpParams()
8374
- .set('dashboardId', request.dashboardId)
8375
- .set('sheetId', request.sheetId)
8376
- .set('visualId', request.visualId);
8377
- Object.entries(request.parameters).forEach(([key, values]) => {
8378
- values.forEach(value => {
8379
- params = params.append(`parameters[${key}]`, value);
8380
- });
8381
- });
8382
- return this.http.get(`${this.path}/embed-visual-anonymous`, { params });
8383
- }
8384
- async createEmbedContext(embedUrl, container, options) {
8385
- const embeddingContext = await createEmbeddingContext();
8386
- await embeddingContext.embedDashboard({
8387
- url: embedUrl,
8388
- container,
8389
- ...(options?.height && { height: options.height }),
8390
- ...(options?.width && { width: options.width }),
8391
- });
8392
- }
8393
- async createEmbedVisualContext(embedUrl, container, options) {
8394
- const embeddingContext = await createEmbeddingContext();
8395
- await embeddingContext.embedVisual({
8396
- url: embedUrl,
8397
- container,
8398
- ...(options?.height && { height: options.height }),
8399
- ...(options?.width && { width: options.width }),
8400
- }, { scaleToContainer: true, fitToIframeWidth: false });
8401
- }
8402
- async embedSequentialVisuals(dashboardId, sheetId, parameters, configs, onVisualLoaded) {
8403
- for (const config of configs) {
8404
- config.container?.nativeElement?.replaceChildren();
8405
- const { visual } = await firstValueFrom(this.getEmbedVisualUrl({ dashboardId, sheetId, visualId: config.visualId, parameters }));
8406
- if (!visual)
8407
- continue;
8408
- await this.createEmbedVisualContext(visual.embedUrl, config.container.nativeElement);
8409
- onVisualLoaded?.(config.visualId);
8410
- }
8411
- }
8412
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
8413
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, providedIn: 'root' });
8414
- }
8415
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, decorators: [{
8416
- type: Injectable,
8417
- args: [{
8418
- providedIn: 'root',
8419
- }]
8420
- }] });
8421
-
8422
8472
  /**
8423
8473
  * Función de comparación genérica para ordenar objetos por un campo específico.
8424
8474
  *
@@ -9091,5 +9141,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
9091
9141
  * Generated bundle index. Do not edit.
9092
9142
  */
9093
9143
 
9094
- export { ALERT_DEFAULTS, ALERT_ICON_OVERRIDES, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AddFavoritesComponent, AlertButtonMode, AlertService, AlertType, BreadCrumbComponent, ButtonSplitComponent, CheckboxFilterDirective, ClientContextSelector, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFavoriteService, GlobalFeatureFlagService, GlobalMenuService, GlobalTermService, GoogleTaskManagerService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaSessionService, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, NotificationJobService, NotificationOrchestratorService, NotificationService, NotificationSignalRService, OrderConstants, PageInformation, PageRootChildGuard, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RequestCacheService, ResponseHeadersInterceptor, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SetsesioninformationComponent, Shared, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TitleComponent, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
9144
+ export { ALERT_DEFAULTS, ALERT_ICON_OVERRIDES, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AddFavoritesComponent, AlertButtonMode, AlertService, AlertType, BreadCrumbComponent, ButtonSplitComponent, CheckboxFilterDirective, ClientContextSelector, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DashboardQsComponent, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFavoriteService, GlobalFeatureFlagService, GlobalMenuService, GlobalTermService, GoogleTaskManagerService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaSessionService, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, NotificationJobService, NotificationOrchestratorService, NotificationService, NotificationSignalRService, OrderConstants, PageInformation, PageRootChildGuard, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RequestCacheService, ResponseHeadersInterceptor, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SetsesioninformationComponent, Shared, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TitleComponent, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
9095
9145
  //# sourceMappingURL=intelica-library-components.mjs.map