intelica-library-ui 0.1.230 → 0.1.232
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 +177 -21
- package/fesm2022/intelica-library-ui.mjs.map +1 -1
- package/lib/components/dashboard-qs/dashboard-qs.component.d.ts +7 -1
- package/lib/components/dashboard-qs-interactive/dashboard-qs-interactive.component.d.ts +30 -0
- package/lib/constants/quicksight.constants.d.ts +10 -0
- package/lib/dto/embed-dashboard-response.d.ts +5 -0
- package/lib/functions/quicksight-event.util.d.ts +3 -0
- package/lib/model/quicksight.model.d.ts +30 -0
- package/lib/services/shared.d.ts +14 -18
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
|
@@ -263,6 +263,17 @@ const DateModeOptions = {
|
|
|
263
263
|
Year: { value: "year", format: "y" },
|
|
264
264
|
};
|
|
265
265
|
|
|
266
|
+
const QuicksightEventName = {
|
|
267
|
+
ERROR_OCCURRED: "ERROR_OCCURRED",
|
|
268
|
+
CONTENT_LOADED: "CONTENT_LOADED",
|
|
269
|
+
PARAMETERS_CHANGED: "PARAMETERS_CHANGED",
|
|
270
|
+
SIZE_CHANGED: "SIZE_CHANGED",
|
|
271
|
+
SELECTED_SHEET_CHANGED: "SELECTED_SHEET_CHANGED",
|
|
272
|
+
MODAL_OPENED: "MODAL_OPENED",
|
|
273
|
+
EXPERIENCE_INITIALIZED: "EXPERIENCE_INITIALIZED",
|
|
274
|
+
};
|
|
275
|
+
const QUICKSIGHT_AUTH_ERROR_CODES = ["Forbidden", "Unauthorized", "EmbeddingNotAuthorized", "TokenExpired"];
|
|
276
|
+
|
|
266
277
|
class FeatureFlagService {
|
|
267
278
|
_http = inject(HttpClient);
|
|
268
279
|
_configService = inject(ConfigService);
|
|
@@ -6645,15 +6656,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6645
6656
|
class Shared {
|
|
6646
6657
|
http = inject(HttpClient);
|
|
6647
6658
|
configService = inject(ConfigService);
|
|
6648
|
-
|
|
6659
|
+
sweetAlertService = inject(SweetAlertService);
|
|
6660
|
+
termPipe = inject(TermPipe);
|
|
6661
|
+
globalTermService = inject(GlobalTermService);
|
|
6662
|
+
path = `${this.configService.environment?.sharedPath}`;
|
|
6663
|
+
sessionTimer;
|
|
6664
|
+
scheduleSessionExpiry(expiresInMinutes) {
|
|
6665
|
+
this.clearSessionTimer();
|
|
6666
|
+
this.sessionTimer = setTimeout(() => this.handleSessionExpired(), Math.max((expiresInMinutes - 1) * 60_000, 30_000));
|
|
6667
|
+
}
|
|
6668
|
+
clearSessionTimer() {
|
|
6669
|
+
clearTimeout(this.sessionTimer);
|
|
6670
|
+
}
|
|
6671
|
+
async handleSessionExpired() {
|
|
6672
|
+
const result = await this.sweetAlertService.confirmBox(this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_MESSAGE', this.globalTermService.languageCode), this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_CONFIRM', this.globalTermService.languageCode), this.termPipe.transform('CANCEL', this.globalTermService.languageCode), this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_TITLE', this.globalTermService.languageCode));
|
|
6673
|
+
if (result.isConfirmed)
|
|
6674
|
+
window.location.reload();
|
|
6675
|
+
}
|
|
6649
6676
|
getEmbedUrl(command) {
|
|
6650
|
-
return this.http.post(`${this.path}/embed-url`, command);
|
|
6677
|
+
return this.http.post(`${this.path}/quicksight-embed-url`, command);
|
|
6651
6678
|
}
|
|
6652
6679
|
getEmbedVisualUrl(command) {
|
|
6653
|
-
return this.http.post(`${this.path}/embed-visual-url`, command);
|
|
6680
|
+
return this.http.post(`${this.path}/quicksight-embed-visual-url`, command);
|
|
6654
6681
|
}
|
|
6655
6682
|
getEmbedVisualUrlsAnonymous(command) {
|
|
6656
|
-
return this.http.post(`${this.path}/embed-visual-anonymous`, command);
|
|
6683
|
+
return this.http.post(`${this.path}/quicksight-embed-visual-anonymous`, command);
|
|
6657
6684
|
}
|
|
6658
6685
|
async createEmbedContext(embedUrl, container, options) {
|
|
6659
6686
|
const embeddingContext = await createEmbeddingContext();
|
|
@@ -6662,26 +6689,41 @@ class Shared {
|
|
|
6662
6689
|
container,
|
|
6663
6690
|
...(options?.height && { height: options.height }),
|
|
6664
6691
|
...(options?.width && { width: options.width }),
|
|
6692
|
+
}, {
|
|
6693
|
+
...(options?.onMessage && { onMessage: this.toSdkMessageListener(options.onMessage) }),
|
|
6665
6694
|
});
|
|
6666
6695
|
}
|
|
6667
6696
|
async embedDashboard(command, container, options) {
|
|
6668
6697
|
container.replaceChildren();
|
|
6669
|
-
const
|
|
6670
|
-
|
|
6698
|
+
const dashResponse = await firstValueFrom(this.getEmbedUrl(command));
|
|
6699
|
+
this.scheduleSessionExpiry(dashResponse.expiresInMinutes);
|
|
6700
|
+
await this.createEmbedContext(dashResponse.embedUrl, container, options);
|
|
6671
6701
|
}
|
|
6672
6702
|
async embedDashboardInteractive(command, container, options) {
|
|
6673
6703
|
container.replaceChildren();
|
|
6674
|
-
const
|
|
6704
|
+
const dashResponse = await firstValueFrom(this.getEmbedUrl({ ...command, parameters: undefined }));
|
|
6705
|
+
this.scheduleSessionExpiry(dashResponse.expiresInMinutes);
|
|
6675
6706
|
const embeddingContext = await createEmbeddingContext();
|
|
6676
|
-
const sdkParameters = command.parameters
|
|
6677
|
-
? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values }))
|
|
6678
|
-
: undefined;
|
|
6707
|
+
const sdkParameters = command.parameters ? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values })) : undefined;
|
|
6679
6708
|
return await embeddingContext.embedDashboard({
|
|
6680
|
-
url: embedUrl,
|
|
6709
|
+
url: dashResponse.embedUrl,
|
|
6681
6710
|
container,
|
|
6682
6711
|
...(options?.height && { height: options.height }),
|
|
6683
6712
|
...(options?.width && { width: options.width }),
|
|
6684
|
-
},
|
|
6713
|
+
}, {
|
|
6714
|
+
...(sdkParameters ? { parameters: sdkParameters } : {}),
|
|
6715
|
+
...(options?.onMessage && { onMessage: this.toSdkMessageListener(options.onMessage) }),
|
|
6716
|
+
});
|
|
6717
|
+
}
|
|
6718
|
+
toSdkMessageListener(emit) {
|
|
6719
|
+
return (changeEvent) => {
|
|
6720
|
+
emit({
|
|
6721
|
+
eventName: changeEvent?.eventName,
|
|
6722
|
+
eventLevel: changeEvent?.eventLevel,
|
|
6723
|
+
message: changeEvent?.message,
|
|
6724
|
+
data: changeEvent?.data,
|
|
6725
|
+
});
|
|
6726
|
+
};
|
|
6685
6727
|
}
|
|
6686
6728
|
async setDashboardParameters(dashboard, parameters) {
|
|
6687
6729
|
const sdkParameters = Object.entries(parameters).map(([Name, Values]) => ({ Name, Values }));
|
|
@@ -6708,16 +6750,18 @@ class Shared {
|
|
|
6708
6750
|
}
|
|
6709
6751
|
async embedSequentialVisualsInteractive(command, configs, onVisualLoaded) {
|
|
6710
6752
|
const refs = new Map();
|
|
6711
|
-
const sdkParameters = command.parameters
|
|
6712
|
-
? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values }))
|
|
6713
|
-
: undefined;
|
|
6753
|
+
const sdkParameters = command.parameters ? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values })) : undefined;
|
|
6714
6754
|
for (const config of configs) {
|
|
6715
6755
|
config.container?.nativeElement?.replaceChildren();
|
|
6716
6756
|
const { visual } = await firstValueFrom(this.getEmbedVisualUrl({ dashboardId: command.dashboardId, sheetId: command.sheetId, visualId: config.visualId, parameters: {} }));
|
|
6717
6757
|
if (!visual)
|
|
6718
6758
|
continue;
|
|
6719
6759
|
const embeddingContext = await createEmbeddingContext();
|
|
6720
|
-
const visualRef = await embeddingContext.embedVisual({ url: visual.embedUrl, container: config.container.nativeElement }, {
|
|
6760
|
+
const visualRef = await embeddingContext.embedVisual({ url: visual.embedUrl, container: config.container.nativeElement }, {
|
|
6761
|
+
scaleToContainer: true,
|
|
6762
|
+
fitToIframeWidth: false,
|
|
6763
|
+
...(sdkParameters ? { parameters: sdkParameters } : {}),
|
|
6764
|
+
});
|
|
6721
6765
|
refs.set(config.visualId, visualRef);
|
|
6722
6766
|
onVisualLoaded?.(config.visualId, visualRef);
|
|
6723
6767
|
}
|
|
@@ -6741,6 +6785,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6741
6785
|
}]
|
|
6742
6786
|
}] });
|
|
6743
6787
|
|
|
6788
|
+
function isQuicksightSessionExpiredEvent(event) {
|
|
6789
|
+
if (event.eventName !== QuicksightEventName.ERROR_OCCURRED)
|
|
6790
|
+
return false;
|
|
6791
|
+
const code = event.data?.errorCode ?? event.data?.code ?? "";
|
|
6792
|
+
return typeof code === "string" && QUICKSIGHT_AUTH_ERROR_CODES.some(c => code.includes(c));
|
|
6793
|
+
}
|
|
6794
|
+
function dispatchQuicksightEvent(event, outputs) {
|
|
6795
|
+
outputs.sdkEvent.emit(event);
|
|
6796
|
+
if (event.eventName === QuicksightEventName.CONTENT_LOADED)
|
|
6797
|
+
outputs.contentLoaded?.emit(event);
|
|
6798
|
+
if (event.eventName === QuicksightEventName.ERROR_OCCURRED) {
|
|
6799
|
+
outputs.errorOccurred?.emit(event);
|
|
6800
|
+
if (isQuicksightSessionExpiredEvent(event))
|
|
6801
|
+
outputs.sessionExpired?.emit(event);
|
|
6802
|
+
}
|
|
6803
|
+
}
|
|
6804
|
+
|
|
6744
6805
|
class DashboardQsComponent {
|
|
6745
6806
|
sharedService = inject(Shared);
|
|
6746
6807
|
route = inject(ActivatedRoute);
|
|
@@ -6754,6 +6815,10 @@ class DashboardQsComponent {
|
|
|
6754
6815
|
height = computed(() => this.heightInput() ?? this.routeData()['height']);
|
|
6755
6816
|
isLoading = signal(true);
|
|
6756
6817
|
isLoadingChange = output();
|
|
6818
|
+
sdkEvent = output();
|
|
6819
|
+
contentLoaded = output();
|
|
6820
|
+
errorOccurred = output();
|
|
6821
|
+
sessionExpired = output();
|
|
6757
6822
|
viewReady = signal(false);
|
|
6758
6823
|
constructor() {
|
|
6759
6824
|
effect(() => {
|
|
@@ -6776,17 +6841,27 @@ class DashboardQsComponent {
|
|
|
6776
6841
|
return;
|
|
6777
6842
|
this.isLoading.set(true);
|
|
6778
6843
|
try {
|
|
6779
|
-
await this.sharedService.embedDashboard({ dashboardId, parameters }, container, {
|
|
6844
|
+
await this.sharedService.embedDashboard({ dashboardId, parameters }, container, {
|
|
6845
|
+
height: this.height() ?? `${window.innerHeight - 50}px`,
|
|
6846
|
+
onMessage: event => {
|
|
6847
|
+
dispatchQuicksightEvent(event, this);
|
|
6848
|
+
if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED)
|
|
6849
|
+
this.isLoading.set(false);
|
|
6850
|
+
if (isQuicksightSessionExpiredEvent(event))
|
|
6851
|
+
this.sharedService.handleSessionExpired();
|
|
6852
|
+
},
|
|
6853
|
+
});
|
|
6780
6854
|
}
|
|
6781
6855
|
catch (error) {
|
|
6782
6856
|
console.error('Error embedding dashboard:', error);
|
|
6783
|
-
}
|
|
6784
|
-
finally {
|
|
6785
6857
|
this.isLoading.set(false);
|
|
6786
6858
|
}
|
|
6787
6859
|
}
|
|
6860
|
+
ngOnDestroy() {
|
|
6861
|
+
this.sharedService.clearSessionTimer();
|
|
6862
|
+
}
|
|
6788
6863
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6789
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", 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" }, viewQueries: [{ propertyName: "containers", predicate: ["visualContainer"], descendants: true }], ngImport: i0, template: "@if (isLoading()) {\r\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 93.02' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(4); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '244.87 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 303.7' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(2); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '517.1 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n</div>\r\n}\r\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: PanelModule }, { kind: "component", type: i2$4.Panel, selector: "p-panel", inputs: ["toggleable", "header", "collapsed", "style", "styleClass", "iconPos", "expandIcon", "collapseIcon", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|
|
6864
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", 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()) {\r\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 93.02' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(4); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '244.87 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 303.7' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(2); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '517.1 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n</div>\r\n}\r\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: PanelModule }, { kind: "component", type: i2$4.Panel, selector: "p-panel", inputs: ["toggleable", "header", "collapsed", "style", "styleClass", "iconPos", "expandIcon", "collapseIcon", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|
|
6790
6865
|
}
|
|
6791
6866
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsComponent, decorators: [{
|
|
6792
6867
|
type: Component,
|
|
@@ -6796,6 +6871,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6796
6871
|
args: ['visualContainer']
|
|
6797
6872
|
}] } });
|
|
6798
6873
|
|
|
6874
|
+
class DashboardQsInteractiveComponent {
|
|
6875
|
+
sharedService = inject(Shared);
|
|
6876
|
+
route = inject(ActivatedRoute);
|
|
6877
|
+
containers;
|
|
6878
|
+
dashboardIdInput = input(undefined, { alias: 'dashboardId' });
|
|
6879
|
+
parametersInput = input(undefined, { alias: 'parameters' });
|
|
6880
|
+
heightInput = input(undefined, { alias: 'height' });
|
|
6881
|
+
routeData = toSignal(this.route.data, { initialValue: this.route.snapshot.data });
|
|
6882
|
+
dashboardId = computed(() => this.dashboardIdInput() ?? this.routeData()['dashboardId']);
|
|
6883
|
+
parameters = computed(() => this.parametersInput() ?? this.routeData()['parameters']);
|
|
6884
|
+
height = computed(() => this.heightInput() ?? this.routeData()['height']);
|
|
6885
|
+
isLoading = signal(true);
|
|
6886
|
+
isLoadingChange = output();
|
|
6887
|
+
sdkEvent = output();
|
|
6888
|
+
contentLoaded = output();
|
|
6889
|
+
errorOccurred = output();
|
|
6890
|
+
sessionExpired = output();
|
|
6891
|
+
viewReady = signal(false);
|
|
6892
|
+
dashboardRef = null;
|
|
6893
|
+
lastEmbeddedId = undefined;
|
|
6894
|
+
constructor() {
|
|
6895
|
+
effect(() => {
|
|
6896
|
+
this.isLoadingChange.emit(this.isLoading());
|
|
6897
|
+
});
|
|
6898
|
+
effect(() => {
|
|
6899
|
+
const id = this.dashboardId();
|
|
6900
|
+
if (!this.viewReady() || !id)
|
|
6901
|
+
return;
|
|
6902
|
+
if (id === this.lastEmbeddedId)
|
|
6903
|
+
return;
|
|
6904
|
+
this.lastEmbeddedId = id;
|
|
6905
|
+
this.firstEmbed(id);
|
|
6906
|
+
});
|
|
6907
|
+
effect(() => {
|
|
6908
|
+
const params = this.parameters();
|
|
6909
|
+
if (!this.dashboardRef || !params)
|
|
6910
|
+
return;
|
|
6911
|
+
this.isLoading.set(true);
|
|
6912
|
+
this.sharedService.setDashboardParameters(this.dashboardRef, params)
|
|
6913
|
+
.catch(() => this.isLoading.set(false));
|
|
6914
|
+
});
|
|
6915
|
+
}
|
|
6916
|
+
ngAfterViewInit() {
|
|
6917
|
+
this.viewReady.set(true);
|
|
6918
|
+
}
|
|
6919
|
+
async firstEmbed(dashboardId) {
|
|
6920
|
+
const container = this.containers.first?.nativeElement;
|
|
6921
|
+
if (!container)
|
|
6922
|
+
return;
|
|
6923
|
+
this.isLoading.set(true);
|
|
6924
|
+
try {
|
|
6925
|
+
this.dashboardRef = await this.sharedService.embedDashboardInteractive({ dashboardId, parameters: this.parameters() }, container, {
|
|
6926
|
+
height: this.height() ?? `${window.innerHeight - 50}px`,
|
|
6927
|
+
onMessage: event => {
|
|
6928
|
+
dispatchQuicksightEvent(event, this);
|
|
6929
|
+
if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED || event.eventName === QuicksightEventName.PARAMETERS_CHANGED)
|
|
6930
|
+
this.isLoading.set(false);
|
|
6931
|
+
if (isQuicksightSessionExpiredEvent(event))
|
|
6932
|
+
this.sharedService.handleSessionExpired();
|
|
6933
|
+
},
|
|
6934
|
+
});
|
|
6935
|
+
}
|
|
6936
|
+
catch (error) {
|
|
6937
|
+
console.error('Error embedding dashboard:', error);
|
|
6938
|
+
this.isLoading.set(false);
|
|
6939
|
+
}
|
|
6940
|
+
}
|
|
6941
|
+
ngOnDestroy() {
|
|
6942
|
+
this.sharedService.clearSessionTimer();
|
|
6943
|
+
}
|
|
6944
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsInteractiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6945
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", 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()) {\r\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 93.02' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(4); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '244.87 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 303.7' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(2); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '517.1 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n</div>\r\n}\r\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: PanelModule }, { kind: "component", type: i2$4.Panel, selector: "p-panel", inputs: ["toggleable", "header", "collapsed", "style", "styleClass", "iconPos", "expandIcon", "collapseIcon", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|
|
6946
|
+
}
|
|
6947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsInteractiveComponent, decorators: [{
|
|
6948
|
+
type: Component,
|
|
6949
|
+
args: [{ selector: 'intelica-dashboard-qs-interactive', imports: [SkeletonModule, PanelModule], template: "@if (isLoading()) {\r\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 93.02' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(4); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '244.87 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 303.7' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(2); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '517.1 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n</div>\r\n}\r\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>" }]
|
|
6950
|
+
}], ctorParameters: () => [], propDecorators: { containers: [{
|
|
6951
|
+
type: ViewChildren,
|
|
6952
|
+
args: ['visualContainer']
|
|
6953
|
+
}] } });
|
|
6954
|
+
|
|
6799
6955
|
class CheckboxFilterDirective extends FilterDirective {
|
|
6800
6956
|
constructor() {
|
|
6801
6957
|
super(FilterTypeEnum.Checkbox);
|
|
@@ -10719,5 +10875,5 @@ const IntelicaTheme = definePreset(Aura, {
|
|
|
10719
10875
|
* Generated bundle index. Do not edit.
|
|
10720
10876
|
*/
|
|
10721
10877
|
|
|
10722
|
-
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 };
|
|
10878
|
+
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, CompressService, ConfigService, CookieAttributesGeneral, DashboardQsComponent, DashboardQsInteractiveComponent, 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, QUICKSIGHT_AUTH_ERROR_CODES, QuicksightEventName, 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, dispatchQuicksightEvent, encryptData, getColor, isQuicksightSessionExpiredEvent };
|
|
10723
10879
|
//# sourceMappingURL=intelica-library-ui.mjs.map
|