intelica-library-project 20.0.2 → 20.0.3
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,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, EventEmitter, forwardRef, Output, Input, Component, Pipe, Injectable, TemplateRef, ContentChild, Directive, ContentChildren, PLATFORM_ID, Inject } from '@angular/core';
|
|
2
|
+
import { inject, EventEmitter, forwardRef, Output, Input, Component, Pipe, Injectable, TemplateRef, ContentChild, Directive, ContentChildren, PLATFORM_ID, Inject, input, output, computed, signal, effect, ViewChildren, DestroyRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormBuilder, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import * as i2 from 'primeng/radiobutton';
|
|
@@ -7,13 +7,13 @@ import { RadioButtonModule } from 'primeng/radiobutton';
|
|
|
7
7
|
import { Popover } from 'primeng/popover';
|
|
8
8
|
import { InputText, InputTextModule } from 'primeng/inputtext';
|
|
9
9
|
import * as i1$1 from '@angular/common';
|
|
10
|
-
import { CommonModule, DatePipe, isPlatformBrowser } from '@angular/common';
|
|
10
|
+
import { CommonModule, DatePipe, isPlatformBrowser, NgClass } from '@angular/common';
|
|
11
11
|
import * as i5 from 'primeng/tooltip';
|
|
12
|
-
import { TooltipModule } from 'primeng/tooltip';
|
|
13
|
-
import { GlobalTermService, TermPipe, FormatDateConstants, ConfigService, Color, getColor } from 'intelica-library-base';
|
|
12
|
+
import { TooltipModule, Tooltip } from 'primeng/tooltip';
|
|
13
|
+
import { GlobalTermService, TermPipe, FormatDateConstants, ConfigService, GlobalFavoriteService, Color, getColor } from 'intelica-library-base';
|
|
14
14
|
import * as i4 from 'primeng/button';
|
|
15
|
-
import { ButtonModule } from 'primeng/button';
|
|
16
|
-
import { Subscription, Subject, BehaviorSubject, of, tap,
|
|
15
|
+
import { ButtonModule, Button } from 'primeng/button';
|
|
16
|
+
import { Subscription, Subject, BehaviorSubject, firstValueFrom, map, distinctUntilChanged, of, tap, shareReplay, throwError } from 'rxjs';
|
|
17
17
|
import { BadgeModule } from 'primeng/badge';
|
|
18
18
|
import * as i6 from 'primeng/checkbox';
|
|
19
19
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
@@ -29,9 +29,14 @@ import moment from 'moment';
|
|
|
29
29
|
import * as _ from 'lodash';
|
|
30
30
|
import * as i4$1 from 'primeng/api';
|
|
31
31
|
import * as i2$2 from 'primeng/skeleton';
|
|
32
|
-
import { SkeletonModule } from 'primeng/skeleton';
|
|
32
|
+
import { SkeletonModule, Skeleton } from 'primeng/skeleton';
|
|
33
33
|
import * as echarts from 'echarts';
|
|
34
|
+
import { Breadcrumb } from 'primeng/breadcrumb';
|
|
35
|
+
import { RouterLink, ActivatedRoute } from '@angular/router';
|
|
34
36
|
import { HttpClient } from '@angular/common/http';
|
|
37
|
+
import { createEmbeddingContext } from 'amazon-quicksight-embedding-sdk';
|
|
38
|
+
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
39
|
+
import { Panel } from 'primeng/panel';
|
|
35
40
|
import { catchError } from 'rxjs/operators';
|
|
36
41
|
|
|
37
42
|
var SearchInputEnum;
|
|
@@ -2133,6 +2138,381 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
|
|
|
2133
2138
|
type: Output
|
|
2134
2139
|
}] } });
|
|
2135
2140
|
|
|
2141
|
+
class BreadCrumbComponent {
|
|
2142
|
+
fullItems = input([], ...(ngDevMode ? [{ debugName: "fullItems" }] : []));
|
|
2143
|
+
itemClick = output();
|
|
2144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: BreadCrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.23", type: BreadCrumbComponent, isStandalone: true, selector: "intelica-bread-crumb", inputs: { fullItems: { classPropertyName: "fullItems", publicName: "fullItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, ngImport: i0, template: "<p-breadcrumb class=\"prBreadcrumb\" [model]=\"fullItems()\">\n <ng-template pTemplate=\"item\" let-item>\n <a [routerLink]=\"item.routerLink\" [pTooltip]=\"item.tooltip\" tooltipStyleClass=\"prTooltip\"\n [tooltipPosition]=\"item.tooltipPosition\" [tooltipStyleClass]=\"item.tooltipStyleClass\">\n <span>{{ item.label }}</span>\n </a>\n </ng-template>\n <ng-template pTemplate=\"separator\">\n <span class=\"breadcrumb-separator\">\n <i class=\"icon icon-arrow-right icon--xs\"></i>\n </span>\n </ng-template>\n</p-breadcrumb>", dependencies: [{ kind: "component", type: Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip"] }] });
|
|
2146
|
+
}
|
|
2147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: BreadCrumbComponent, decorators: [{
|
|
2148
|
+
type: Component,
|
|
2149
|
+
args: [{ selector: 'intelica-bread-crumb', imports: [Breadcrumb, RouterLink, Tooltip,], template: "<p-breadcrumb class=\"prBreadcrumb\" [model]=\"fullItems()\">\n <ng-template pTemplate=\"item\" let-item>\n <a [routerLink]=\"item.routerLink\" [pTooltip]=\"item.tooltip\" tooltipStyleClass=\"prTooltip\"\n [tooltipPosition]=\"item.tooltipPosition\" [tooltipStyleClass]=\"item.tooltipStyleClass\">\n <span>{{ item.label }}</span>\n </a>\n </ng-template>\n <ng-template pTemplate=\"separator\">\n <span class=\"breadcrumb-separator\">\n <i class=\"icon icon-arrow-right icon--xs\"></i>\n </span>\n </ng-template>\n</p-breadcrumb>" }]
|
|
2150
|
+
}], propDecorators: { fullItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullItems", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
|
|
2151
|
+
|
|
2152
|
+
class TitleComponent {
|
|
2153
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2154
|
+
back = output();
|
|
2155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: TitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2156
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.23", type: TitleComponent, isStandalone: true, selector: "intelica-title", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { back: "back" }, ngImport: i0, 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>", dependencies: [{ kind: "component", type: Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }] });
|
|
2157
|
+
}
|
|
2158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: TitleComponent, decorators: [{
|
|
2159
|
+
type: Component,
|
|
2160
|
+
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>" }]
|
|
2161
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], back: [{ type: i0.Output, args: ["back"] }] } });
|
|
2162
|
+
|
|
2163
|
+
const QuicksightEventName = {
|
|
2164
|
+
ERROR_OCCURRED: "ERROR_OCCURRED",
|
|
2165
|
+
CONTENT_LOADED: "CONTENT_LOADED",
|
|
2166
|
+
PARAMETERS_CHANGED: "PARAMETERS_CHANGED",
|
|
2167
|
+
SIZE_CHANGED: "SIZE_CHANGED",
|
|
2168
|
+
SELECTED_SHEET_CHANGED: "SELECTED_SHEET_CHANGED",
|
|
2169
|
+
MODAL_OPENED: "MODAL_OPENED",
|
|
2170
|
+
EXPERIENCE_INITIALIZED: "EXPERIENCE_INITIALIZED",
|
|
2171
|
+
};
|
|
2172
|
+
const QUICKSIGHT_AUTH_ERROR_CODES = ["Forbidden", "Unauthorized", "EmbeddingNotAuthorized", "TokenExpired"];
|
|
2173
|
+
function isQuicksightSessionExpiredEvent(event) {
|
|
2174
|
+
if (event.eventName !== QuicksightEventName.ERROR_OCCURRED)
|
|
2175
|
+
return false;
|
|
2176
|
+
const code = event.data?.errorCode ?? event.data?.code ?? "";
|
|
2177
|
+
return typeof code === "string" && QUICKSIGHT_AUTH_ERROR_CODES.some(c => code.includes(c));
|
|
2178
|
+
}
|
|
2179
|
+
function dispatchQuicksightEvent(event, outputs) {
|
|
2180
|
+
outputs.sdkEvent.emit(event);
|
|
2181
|
+
if (event.eventName === QuicksightEventName.CONTENT_LOADED)
|
|
2182
|
+
outputs.contentLoaded?.emit(event);
|
|
2183
|
+
if (event.eventName === QuicksightEventName.ERROR_OCCURRED) {
|
|
2184
|
+
outputs.errorOccurred?.emit(event);
|
|
2185
|
+
if (isQuicksightSessionExpiredEvent(event))
|
|
2186
|
+
outputs.sessionExpired?.emit(event);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
class Shared {
|
|
2190
|
+
http = inject(HttpClient);
|
|
2191
|
+
configService = inject(ConfigService);
|
|
2192
|
+
path = `${this.configService.environment?.sharedPath}/Quicksight`;
|
|
2193
|
+
getEmbedUrl(command) {
|
|
2194
|
+
return this.http.post(`${this.path}/embed-url`, command);
|
|
2195
|
+
}
|
|
2196
|
+
getEmbedVisualUrl(command) {
|
|
2197
|
+
return this.http.post(`${this.path}/embed-visual-url`, command);
|
|
2198
|
+
}
|
|
2199
|
+
getEmbedVisualUrlsAnonymous(command) {
|
|
2200
|
+
return this.http.post(`${this.path}/embed-visual-anonymous`, command);
|
|
2201
|
+
}
|
|
2202
|
+
async createEmbedContext(embedUrl, container, options) {
|
|
2203
|
+
const embeddingContext = await createEmbeddingContext();
|
|
2204
|
+
await embeddingContext.embedDashboard({
|
|
2205
|
+
url: embedUrl,
|
|
2206
|
+
container,
|
|
2207
|
+
...(options?.height && { height: options.height }),
|
|
2208
|
+
...(options?.width && { width: options.width }),
|
|
2209
|
+
...(options?.onChange && { onChange: this.toSdkChangeListener(options.onChange) }),
|
|
2210
|
+
});
|
|
2211
|
+
}
|
|
2212
|
+
async embedDashboard(command, container, options) {
|
|
2213
|
+
container.replaceChildren();
|
|
2214
|
+
const embedUrl = await firstValueFrom(this.getEmbedUrl(command));
|
|
2215
|
+
await this.createEmbedContext(embedUrl, container, options);
|
|
2216
|
+
}
|
|
2217
|
+
async embedDashboardInteractive(command, container, options) {
|
|
2218
|
+
container.replaceChildren();
|
|
2219
|
+
const embedUrl = await firstValueFrom(this.getEmbedUrl({ ...command, parameters: undefined }));
|
|
2220
|
+
const embeddingContext = await createEmbeddingContext();
|
|
2221
|
+
const sdkParameters = command.parameters ? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values })) : undefined;
|
|
2222
|
+
return await embeddingContext.embedDashboard({
|
|
2223
|
+
url: embedUrl,
|
|
2224
|
+
container,
|
|
2225
|
+
...(options?.height && { height: options.height }),
|
|
2226
|
+
...(options?.width && { width: options.width }),
|
|
2227
|
+
...(options?.onChange && { onChange: this.toSdkChangeListener(options.onChange) }),
|
|
2228
|
+
}, sdkParameters ? { parameters: sdkParameters } : undefined);
|
|
2229
|
+
}
|
|
2230
|
+
toSdkChangeListener(emit) {
|
|
2231
|
+
return (changeEvent) => {
|
|
2232
|
+
emit({
|
|
2233
|
+
eventName: changeEvent?.eventName,
|
|
2234
|
+
eventLevel: changeEvent?.eventLevel,
|
|
2235
|
+
message: changeEvent?.message,
|
|
2236
|
+
data: changeEvent?.data,
|
|
2237
|
+
});
|
|
2238
|
+
};
|
|
2239
|
+
}
|
|
2240
|
+
async setDashboardParameters(dashboard, parameters) {
|
|
2241
|
+
const sdkParameters = Object.entries(parameters).map(([Name, Values]) => ({ Name, Values }));
|
|
2242
|
+
await dashboard.setParameters(sdkParameters);
|
|
2243
|
+
}
|
|
2244
|
+
async createEmbedVisualContext(embedUrl, container, options) {
|
|
2245
|
+
const embeddingContext = await createEmbeddingContext();
|
|
2246
|
+
await embeddingContext.embedVisual({
|
|
2247
|
+
url: embedUrl,
|
|
2248
|
+
container,
|
|
2249
|
+
...(options?.height && { height: options.height }),
|
|
2250
|
+
...(options?.width && { width: options.width }),
|
|
2251
|
+
}, { scaleToContainer: true, fitToIframeWidth: false });
|
|
2252
|
+
}
|
|
2253
|
+
async embedSequentialVisuals(command, configs, onVisualLoaded) {
|
|
2254
|
+
for (const config of configs) {
|
|
2255
|
+
config.container?.nativeElement?.replaceChildren();
|
|
2256
|
+
const { visual } = await firstValueFrom(this.getEmbedVisualUrl({ dashboardId: command.dashboardId, sheetId: command.sheetId, visualId: config.visualId, parameters: command.parameters }));
|
|
2257
|
+
if (!visual)
|
|
2258
|
+
continue;
|
|
2259
|
+
await this.createEmbedVisualContext(visual.embedUrl, config.container.nativeElement);
|
|
2260
|
+
onVisualLoaded?.(config.visualId);
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
async embedSequentialVisualsInteractive(command, configs, onVisualLoaded) {
|
|
2264
|
+
const refs = new Map();
|
|
2265
|
+
const sdkParameters = command.parameters ? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values })) : undefined;
|
|
2266
|
+
for (const config of configs) {
|
|
2267
|
+
config.container?.nativeElement?.replaceChildren();
|
|
2268
|
+
const { visual } = await firstValueFrom(this.getEmbedVisualUrl({ dashboardId: command.dashboardId, sheetId: command.sheetId, visualId: config.visualId, parameters: {} }));
|
|
2269
|
+
if (!visual)
|
|
2270
|
+
continue;
|
|
2271
|
+
const embeddingContext = await createEmbeddingContext();
|
|
2272
|
+
const visualRef = await embeddingContext.embedVisual({ url: visual.embedUrl, container: config.container.nativeElement }, {
|
|
2273
|
+
scaleToContainer: true,
|
|
2274
|
+
fitToIframeWidth: false,
|
|
2275
|
+
...(sdkParameters ? { parameters: sdkParameters } : {}),
|
|
2276
|
+
});
|
|
2277
|
+
refs.set(config.visualId, visualRef);
|
|
2278
|
+
onVisualLoaded?.(config.visualId, visualRef);
|
|
2279
|
+
}
|
|
2280
|
+
return refs;
|
|
2281
|
+
}
|
|
2282
|
+
async setVisualParameters(visual, parameters) {
|
|
2283
|
+
const sdkParameters = Object.entries(parameters).map(([Name, Values]) => ({ Name, Values }));
|
|
2284
|
+
await visual.setParameters(sdkParameters);
|
|
2285
|
+
}
|
|
2286
|
+
async setVisualsParameters(visuals, parameters) {
|
|
2287
|
+
const sdkParameters = Object.entries(parameters).map(([Name, Values]) => ({ Name, Values }));
|
|
2288
|
+
await Promise.all([...visuals].map(v => v.setParameters(sdkParameters)));
|
|
2289
|
+
}
|
|
2290
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2291
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, providedIn: "root" });
|
|
2292
|
+
}
|
|
2293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: Shared, decorators: [{
|
|
2294
|
+
type: Injectable,
|
|
2295
|
+
args: [{
|
|
2296
|
+
providedIn: "root",
|
|
2297
|
+
}]
|
|
2298
|
+
}] });
|
|
2299
|
+
|
|
2300
|
+
class DashboardQsComponent {
|
|
2301
|
+
sharedService = inject(Shared);
|
|
2302
|
+
route = inject(ActivatedRoute);
|
|
2303
|
+
containers;
|
|
2304
|
+
dashboardIdInput = input(undefined, ...(ngDevMode ? [{ debugName: "dashboardIdInput", alias: 'dashboardId' }] : [{ alias: 'dashboardId' }]));
|
|
2305
|
+
parametersInput = input(undefined, ...(ngDevMode ? [{ debugName: "parametersInput", alias: 'parameters' }] : [{ alias: 'parameters' }]));
|
|
2306
|
+
heightInput = input(undefined, ...(ngDevMode ? [{ debugName: "heightInput", alias: 'height' }] : [{ alias: 'height' }]));
|
|
2307
|
+
routeData = toSignal(this.route.data, { initialValue: this.route.snapshot.data });
|
|
2308
|
+
dashboardId = computed(() => this.dashboardIdInput() ?? this.routeData()['dashboardId'], ...(ngDevMode ? [{ debugName: "dashboardId" }] : []));
|
|
2309
|
+
parameters = computed(() => this.parametersInput() ?? this.routeData()['parameters'], ...(ngDevMode ? [{ debugName: "parameters" }] : []));
|
|
2310
|
+
height = computed(() => this.heightInput() ?? this.routeData()['height'], ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
2311
|
+
isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
2312
|
+
isLoadingChange = output();
|
|
2313
|
+
sdkEvent = output();
|
|
2314
|
+
contentLoaded = output();
|
|
2315
|
+
errorOccurred = output();
|
|
2316
|
+
sessionExpired = output();
|
|
2317
|
+
viewReady = signal(false, ...(ngDevMode ? [{ debugName: "viewReady" }] : []));
|
|
2318
|
+
constructor() {
|
|
2319
|
+
effect(() => {
|
|
2320
|
+
this.isLoadingChange.emit(this.isLoading());
|
|
2321
|
+
});
|
|
2322
|
+
effect(() => {
|
|
2323
|
+
const id = this.dashboardId();
|
|
2324
|
+
const parameters = this.parameters();
|
|
2325
|
+
if (!this.viewReady() || !id)
|
|
2326
|
+
return;
|
|
2327
|
+
this.EmbedDashboard(id, parameters);
|
|
2328
|
+
});
|
|
2329
|
+
}
|
|
2330
|
+
ngAfterViewInit() {
|
|
2331
|
+
this.viewReady.set(true);
|
|
2332
|
+
}
|
|
2333
|
+
async EmbedDashboard(dashboardId, parameters) {
|
|
2334
|
+
const container = this.containers.first?.nativeElement;
|
|
2335
|
+
if (!container)
|
|
2336
|
+
return;
|
|
2337
|
+
this.isLoading.set(true);
|
|
2338
|
+
try {
|
|
2339
|
+
await this.sharedService.embedDashboard({ dashboardId, parameters }, container, {
|
|
2340
|
+
height: this.height() ?? `${window.innerHeight - 50}px`,
|
|
2341
|
+
onChange: event => dispatchQuicksightEvent(event, this),
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
catch (error) {
|
|
2345
|
+
console.error('Error embedding dashboard:', error);
|
|
2346
|
+
}
|
|
2347
|
+
finally {
|
|
2348
|
+
setTimeout(() => this.isLoading.set(false), 2000);
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2352
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.23", type: DashboardQsComponent, isStandalone: true, selector: "intelica-dashboard-qs", inputs: { dashboardIdInput: { classPropertyName: "dashboardIdInput", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null }, parametersInput: { classPropertyName: "parametersInput", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, heightInput: { classPropertyName: "heightInput", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isLoadingChange: "isLoadingChange", sdkEvent: "sdkEvent", contentLoaded: "contentLoaded", errorOccurred: "errorOccurred", sessionExpired: "sessionExpired" }, viewQueries: [{ propertyName: "containers", predicate: ["visualContainer"], descendants: true }], ngImport: i0, template: "@if (isLoading()) {\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 93.02\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(4); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 244.87 / 123.12\" />\n </p-panel>\n }\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 303.7\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(2); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 517.1 / 123.12\" />\n </p-panel>\n }\n </div>\n</div>\n}\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Panel, selector: "p-panel", inputs: ["id", "toggleable", "header", "collapsed", "styleClass", "iconPos", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|
|
2353
|
+
}
|
|
2354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsComponent, decorators: [{
|
|
2355
|
+
type: Component,
|
|
2356
|
+
args: [{ selector: 'intelica-dashboard-qs', imports: [Skeleton, Panel], template: "@if (isLoading()) {\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 93.02\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(4); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 244.87 / 123.12\" />\n </p-panel>\n }\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 303.7\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(2); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 517.1 / 123.12\" />\n </p-panel>\n }\n </div>\n</div>\n}\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>" }]
|
|
2357
|
+
}], ctorParameters: () => [], propDecorators: { containers: [{
|
|
2358
|
+
type: ViewChildren,
|
|
2359
|
+
args: ['visualContainer']
|
|
2360
|
+
}], dashboardIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], parametersInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], heightInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], isLoadingChange: [{ type: i0.Output, args: ["isLoadingChange"] }], sdkEvent: [{ type: i0.Output, args: ["sdkEvent"] }], contentLoaded: [{ type: i0.Output, args: ["contentLoaded"] }], errorOccurred: [{ type: i0.Output, args: ["errorOccurred"] }], sessionExpired: [{ type: i0.Output, args: ["sessionExpired"] }] } });
|
|
2361
|
+
|
|
2362
|
+
class DashboardQsInteractiveComponent {
|
|
2363
|
+
sharedService = inject(Shared);
|
|
2364
|
+
route = inject(ActivatedRoute);
|
|
2365
|
+
containers;
|
|
2366
|
+
dashboardIdInput = input(undefined, ...(ngDevMode ? [{ debugName: "dashboardIdInput", alias: 'dashboardId' }] : [{ alias: 'dashboardId' }]));
|
|
2367
|
+
parametersInput = input(undefined, ...(ngDevMode ? [{ debugName: "parametersInput", alias: 'parameters' }] : [{ alias: 'parameters' }]));
|
|
2368
|
+
heightInput = input(undefined, ...(ngDevMode ? [{ debugName: "heightInput", alias: 'height' }] : [{ alias: 'height' }]));
|
|
2369
|
+
routeData = toSignal(this.route.data, { initialValue: this.route.snapshot.data });
|
|
2370
|
+
dashboardId = computed(() => this.dashboardIdInput() ?? this.routeData()['dashboardId'], ...(ngDevMode ? [{ debugName: "dashboardId" }] : []));
|
|
2371
|
+
parameters = computed(() => this.parametersInput() ?? this.routeData()['parameters'], ...(ngDevMode ? [{ debugName: "parameters" }] : []));
|
|
2372
|
+
height = computed(() => this.heightInput() ?? this.routeData()['height'], ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
2373
|
+
isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
2374
|
+
isLoadingChange = output();
|
|
2375
|
+
sdkEvent = output();
|
|
2376
|
+
contentLoaded = output();
|
|
2377
|
+
errorOccurred = output();
|
|
2378
|
+
sessionExpired = output();
|
|
2379
|
+
viewReady = signal(false, ...(ngDevMode ? [{ debugName: "viewReady" }] : []));
|
|
2380
|
+
dashboardRef = null;
|
|
2381
|
+
lastEmbeddedId = undefined;
|
|
2382
|
+
constructor() {
|
|
2383
|
+
effect(() => {
|
|
2384
|
+
this.isLoadingChange.emit(this.isLoading());
|
|
2385
|
+
});
|
|
2386
|
+
effect(() => {
|
|
2387
|
+
const id = this.dashboardId();
|
|
2388
|
+
if (!this.viewReady() || !id)
|
|
2389
|
+
return;
|
|
2390
|
+
if (id === this.lastEmbeddedId)
|
|
2391
|
+
return;
|
|
2392
|
+
this.lastEmbeddedId = id;
|
|
2393
|
+
this.firstEmbed(id);
|
|
2394
|
+
});
|
|
2395
|
+
effect(() => {
|
|
2396
|
+
const params = this.parameters();
|
|
2397
|
+
if (!this.dashboardRef || !params)
|
|
2398
|
+
return;
|
|
2399
|
+
this.isLoading.set(true);
|
|
2400
|
+
this.sharedService.setDashboardParameters(this.dashboardRef, params)
|
|
2401
|
+
.finally(() => setTimeout(() => this.isLoading.set(false), 2000));
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2404
|
+
ngAfterViewInit() {
|
|
2405
|
+
this.viewReady.set(true);
|
|
2406
|
+
}
|
|
2407
|
+
async firstEmbed(dashboardId) {
|
|
2408
|
+
const container = this.containers.first?.nativeElement;
|
|
2409
|
+
if (!container)
|
|
2410
|
+
return;
|
|
2411
|
+
this.isLoading.set(true);
|
|
2412
|
+
try {
|
|
2413
|
+
this.dashboardRef = await this.sharedService.embedDashboardInteractive({ dashboardId, parameters: this.parameters() }, container, {
|
|
2414
|
+
height: this.height() ?? `${window.innerHeight - 50}px`,
|
|
2415
|
+
onChange: event => dispatchQuicksightEvent(event, this),
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
catch (error) {
|
|
2419
|
+
console.error('Error embedding dashboard:', error);
|
|
2420
|
+
}
|
|
2421
|
+
finally {
|
|
2422
|
+
setTimeout(() => this.isLoading.set(false), 2000);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsInteractiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2426
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.23", type: DashboardQsInteractiveComponent, isStandalone: true, selector: "intelica-dashboard-qs-interactive", inputs: { dashboardIdInput: { classPropertyName: "dashboardIdInput", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null }, parametersInput: { classPropertyName: "parametersInput", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, heightInput: { classPropertyName: "heightInput", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isLoadingChange: "isLoadingChange", sdkEvent: "sdkEvent", contentLoaded: "contentLoaded", errorOccurred: "errorOccurred", sessionExpired: "sessionExpired" }, viewQueries: [{ propertyName: "containers", predicate: ["visualContainer"], descendants: true }], ngImport: i0, template: "@if (isLoading()) {\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 93.02\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(4); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 244.87 / 123.12\" />\n </p-panel>\n }\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 303.7\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(2); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 517.1 / 123.12\" />\n </p-panel>\n }\n </div>\n</div>\n}\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Panel, selector: "p-panel", inputs: ["id", "toggleable", "header", "collapsed", "styleClass", "iconPos", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|
|
2427
|
+
}
|
|
2428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsInteractiveComponent, decorators: [{
|
|
2429
|
+
type: Component,
|
|
2430
|
+
args: [{ selector: 'intelica-dashboard-qs-interactive', imports: [Skeleton, Panel], template: "@if (isLoading()) {\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 93.02\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(4); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 244.87 / 123.12\" />\n </p-panel>\n }\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 303.7\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(2); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 517.1 / 123.12\" />\n </p-panel>\n }\n </div>\n</div>\n}\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>" }]
|
|
2431
|
+
}], ctorParameters: () => [], propDecorators: { containers: [{
|
|
2432
|
+
type: ViewChildren,
|
|
2433
|
+
args: ['visualContainer']
|
|
2434
|
+
}], dashboardIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], parametersInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], heightInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], isLoadingChange: [{ type: i0.Output, args: ["isLoadingChange"] }], sdkEvent: [{ type: i0.Output, args: ["sdkEvent"] }], contentLoaded: [{ type: i0.Output, args: ["contentLoaded"] }], errorOccurred: [{ type: i0.Output, args: ["errorOccurred"] }], sessionExpired: [{ type: i0.Output, args: ["sessionExpired"] }] } });
|
|
2435
|
+
|
|
2436
|
+
class AddFavoritesService {
|
|
2437
|
+
favoritesService = inject(GlobalFavoriteService);
|
|
2438
|
+
globalTermService = inject(GlobalTermService);
|
|
2439
|
+
addPageToFavorites() {
|
|
2440
|
+
return this.favoritesService.create().pipe(map(() => void 0));
|
|
2441
|
+
}
|
|
2442
|
+
isPageFavorite(pageRoot) {
|
|
2443
|
+
const resolvedPageRoot = this.resolvePageRoot(pageRoot);
|
|
2444
|
+
return this.favoritesService.favoritesChanges().pipe(map(() => this.favoritesService.isFavoriteByPageRoot(resolvedPageRoot)), distinctUntilChanged());
|
|
2445
|
+
}
|
|
2446
|
+
watchPageFavorite(pageRoot) {
|
|
2447
|
+
const resolvedPageRoot = this.resolvePageRoot(pageRoot);
|
|
2448
|
+
return this.favoritesService.favoritesChanges().pipe(map(() => this.favoritesService.isFavoriteByPageRoot(resolvedPageRoot)), distinctUntilChanged());
|
|
2449
|
+
}
|
|
2450
|
+
removeFromFavorites(pageRoot) {
|
|
2451
|
+
const resolvedPageRoot = this.resolvePageRoot(pageRoot);
|
|
2452
|
+
return this.favoritesService.removeFavoriteByPageRoot(resolvedPageRoot);
|
|
2453
|
+
}
|
|
2454
|
+
resolvePageRoot(pageRoot) {
|
|
2455
|
+
return pageRoot?.trim() || this.globalTermService.GetPageRoot();
|
|
2456
|
+
}
|
|
2457
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: AddFavoritesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2458
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: AddFavoritesService, providedIn: "root" });
|
|
2459
|
+
}
|
|
2460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: AddFavoritesService, decorators: [{
|
|
2461
|
+
type: Injectable,
|
|
2462
|
+
args: [{
|
|
2463
|
+
providedIn: "root",
|
|
2464
|
+
}]
|
|
2465
|
+
}] });
|
|
2466
|
+
|
|
2467
|
+
const ICON_ON = "icon-favorites-on";
|
|
2468
|
+
const ICON_OFF = "icon-favorites-off";
|
|
2469
|
+
class AddFavoritesComponent {
|
|
2470
|
+
termService = inject(GlobalTermService);
|
|
2471
|
+
addFavoriteService = inject(AddFavoritesService);
|
|
2472
|
+
destroyRef = inject(DestroyRef);
|
|
2473
|
+
favoriteChanged = output();
|
|
2474
|
+
isFavorite = false;
|
|
2475
|
+
isToggling = false;
|
|
2476
|
+
iconClass = ICON_OFF;
|
|
2477
|
+
ngOnInit() {
|
|
2478
|
+
this.loadInitialState();
|
|
2479
|
+
}
|
|
2480
|
+
toggleFavorite() {
|
|
2481
|
+
if (this.isToggling)
|
|
2482
|
+
return;
|
|
2483
|
+
this.isToggling = true;
|
|
2484
|
+
const nextFavorite = !this.isFavorite;
|
|
2485
|
+
const action$ = this.isFavorite ? this.addFavoriteService.removeFromFavorites() : this.addFavoriteService.addPageToFavorites();
|
|
2486
|
+
action$.subscribe({
|
|
2487
|
+
next: () => {
|
|
2488
|
+
this.favoriteChanged.emit(nextFavorite);
|
|
2489
|
+
},
|
|
2490
|
+
complete: () => (this.isToggling = false),
|
|
2491
|
+
error: () => (this.isToggling = false),
|
|
2492
|
+
});
|
|
2493
|
+
}
|
|
2494
|
+
loadInitialState() {
|
|
2495
|
+
this.addFavoriteService
|
|
2496
|
+
.watchPageFavorite()
|
|
2497
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
2498
|
+
.subscribe({
|
|
2499
|
+
next: isFavorite => {
|
|
2500
|
+
this.isFavorite = isFavorite;
|
|
2501
|
+
this.updateIcon();
|
|
2502
|
+
},
|
|
2503
|
+
});
|
|
2504
|
+
}
|
|
2505
|
+
updateIcon() {
|
|
2506
|
+
this.iconClass = this.isFavorite ? ICON_ON : ICON_OFF;
|
|
2507
|
+
}
|
|
2508
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: AddFavoritesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2509
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.23", type: AddFavoritesComponent, isStandalone: true, selector: "intelica-add-favorites", outputs: { favoriteChanged: "favoriteChanged" }, ngImport: i0, template: "<p-button class=\"prButton\" severity=\"secondary\" [disabled]=\"isToggling\" (onClick)=\"toggleFavorite()\">\n\t<i class=\"icon p-button-icon-left\" [ngClass]=\"iconClass\" pButtonIcon></i>\n\t<span pButtonLabel>{{ \"ADD_TO_FAVORITES\" | term : termService.languageCode }}</span>\n</p-button>\n", dependencies: [{ kind: "component", type: Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: TermPipe, name: "term" }] });
|
|
2510
|
+
}
|
|
2511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: AddFavoritesComponent, decorators: [{
|
|
2512
|
+
type: Component,
|
|
2513
|
+
args: [{ selector: "intelica-add-favorites", imports: [Button, TermPipe, NgClass], template: "<p-button class=\"prButton\" severity=\"secondary\" [disabled]=\"isToggling\" (onClick)=\"toggleFavorite()\">\n\t<i class=\"icon p-button-icon-left\" [ngClass]=\"iconClass\" pButtonIcon></i>\n\t<span pButtonLabel>{{ \"ADD_TO_FAVORITES\" | term : termService.languageCode }}</span>\n</p-button>\n" }]
|
|
2514
|
+
}], propDecorators: { favoriteChanged: [{ type: i0.Output, args: ["favoriteChanged"] }] } });
|
|
2515
|
+
|
|
2136
2516
|
class PageElementService {
|
|
2137
2517
|
_http = inject(HttpClient);
|
|
2138
2518
|
_configService = inject(ConfigService);
|
|
@@ -2970,5 +3350,5 @@ class PageInformation {
|
|
|
2970
3350
|
* Generated bundle index. Do not edit.
|
|
2971
3351
|
*/
|
|
2972
3352
|
|
|
2973
|
-
export { ColumnComponent, ColumnGroupComponent, EchartComponent, EchartService, ElementService, FormatAmountPipe, FormatCellPipe, OrderConstants, PageElementService, PageInformation, RequestCacheService, RowResumenComponent, SearchComponent, SearchInputEnum, SharedService, SkeletonTableComponent, SortingComponent, TableComponent, TableFetchComponent, TruncatePipe, darkenColor };
|
|
3353
|
+
export { AddFavoritesComponent, AddFavoritesService, BreadCrumbComponent, ColumnComponent, ColumnGroupComponent, DashboardQsComponent, DashboardQsInteractiveComponent, EchartComponent, EchartService, ElementService, FormatAmountPipe, FormatCellPipe, OrderConstants, PageElementService, PageInformation, QuicksightEventName, RequestCacheService, RowResumenComponent, SearchComponent, SearchInputEnum, Shared, SharedService, SkeletonTableComponent, SortingComponent, TableComponent, TableFetchComponent, TitleComponent, TruncatePipe, darkenColor, dispatchQuicksightEvent, isQuicksightSessionExpiredEvent };
|
|
2974
3354
|
//# sourceMappingURL=intelica-library-project.mjs.map
|