intelica-library-ui 0.1.230 → 0.1.231
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 -17
- package/fesm2022/intelica-library-ui.mjs.map +1 -1
- package/lib/components/dashboard-qs/dashboard-qs.component.d.ts +11 -1
- package/lib/components/dashboard-qs-interactive/dashboard-qs-interactive.component.d.ts +34 -0
- package/lib/constants/quicksight.constants.d.ts +10 -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 +5 -17
- 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,15 @@ 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
|
-
path = `${this.configService.environment?.sharedPath}
|
|
6659
|
+
path = `${this.configService.environment?.sharedPath}`;
|
|
6649
6660
|
getEmbedUrl(command) {
|
|
6650
|
-
return this.http.post(`${this.path}/embed-url`, command);
|
|
6661
|
+
return this.http.post(`${this.path}/quicksight-embed-url`, command);
|
|
6651
6662
|
}
|
|
6652
6663
|
getEmbedVisualUrl(command) {
|
|
6653
|
-
return this.http.post(`${this.path}/embed-visual-url`, command);
|
|
6664
|
+
return this.http.post(`${this.path}/quicksight-embed-visual-url`, command);
|
|
6654
6665
|
}
|
|
6655
6666
|
getEmbedVisualUrlsAnonymous(command) {
|
|
6656
|
-
return this.http.post(`${this.path}/embed-visual-anonymous`, command);
|
|
6667
|
+
return this.http.post(`${this.path}/quicksight-embed-visual-anonymous`, command);
|
|
6657
6668
|
}
|
|
6658
6669
|
async createEmbedContext(embedUrl, container, options) {
|
|
6659
6670
|
const embeddingContext = await createEmbeddingContext();
|
|
@@ -6662,6 +6673,8 @@ class Shared {
|
|
|
6662
6673
|
container,
|
|
6663
6674
|
...(options?.height && { height: options.height }),
|
|
6664
6675
|
...(options?.width && { width: options.width }),
|
|
6676
|
+
}, {
|
|
6677
|
+
...(options?.onMessage && { onMessage: this.toSdkMessageListener(options.onMessage) }),
|
|
6665
6678
|
});
|
|
6666
6679
|
}
|
|
6667
6680
|
async embedDashboard(command, container, options) {
|
|
@@ -6673,15 +6686,26 @@ class Shared {
|
|
|
6673
6686
|
container.replaceChildren();
|
|
6674
6687
|
const embedUrl = await firstValueFrom(this.getEmbedUrl({ ...command, parameters: undefined }));
|
|
6675
6688
|
const embeddingContext = await createEmbeddingContext();
|
|
6676
|
-
const sdkParameters = command.parameters
|
|
6677
|
-
? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values }))
|
|
6678
|
-
: undefined;
|
|
6689
|
+
const sdkParameters = command.parameters ? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values })) : undefined;
|
|
6679
6690
|
return await embeddingContext.embedDashboard({
|
|
6680
6691
|
url: embedUrl,
|
|
6681
6692
|
container,
|
|
6682
6693
|
...(options?.height && { height: options.height }),
|
|
6683
6694
|
...(options?.width && { width: options.width }),
|
|
6684
|
-
},
|
|
6695
|
+
}, {
|
|
6696
|
+
...(sdkParameters ? { parameters: sdkParameters } : {}),
|
|
6697
|
+
...(options?.onMessage && { onMessage: this.toSdkMessageListener(options.onMessage) }),
|
|
6698
|
+
});
|
|
6699
|
+
}
|
|
6700
|
+
toSdkMessageListener(emit) {
|
|
6701
|
+
return (changeEvent) => {
|
|
6702
|
+
emit({
|
|
6703
|
+
eventName: changeEvent?.eventName,
|
|
6704
|
+
eventLevel: changeEvent?.eventLevel,
|
|
6705
|
+
message: changeEvent?.message,
|
|
6706
|
+
data: changeEvent?.data,
|
|
6707
|
+
});
|
|
6708
|
+
};
|
|
6685
6709
|
}
|
|
6686
6710
|
async setDashboardParameters(dashboard, parameters) {
|
|
6687
6711
|
const sdkParameters = Object.entries(parameters).map(([Name, Values]) => ({ Name, Values }));
|
|
@@ -6708,16 +6732,18 @@ class Shared {
|
|
|
6708
6732
|
}
|
|
6709
6733
|
async embedSequentialVisualsInteractive(command, configs, onVisualLoaded) {
|
|
6710
6734
|
const refs = new Map();
|
|
6711
|
-
const sdkParameters = command.parameters
|
|
6712
|
-
? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values }))
|
|
6713
|
-
: undefined;
|
|
6735
|
+
const sdkParameters = command.parameters ? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values })) : undefined;
|
|
6714
6736
|
for (const config of configs) {
|
|
6715
6737
|
config.container?.nativeElement?.replaceChildren();
|
|
6716
6738
|
const { visual } = await firstValueFrom(this.getEmbedVisualUrl({ dashboardId: command.dashboardId, sheetId: command.sheetId, visualId: config.visualId, parameters: {} }));
|
|
6717
6739
|
if (!visual)
|
|
6718
6740
|
continue;
|
|
6719
6741
|
const embeddingContext = await createEmbeddingContext();
|
|
6720
|
-
const visualRef = await embeddingContext.embedVisual({ url: visual.embedUrl, container: config.container.nativeElement }, {
|
|
6742
|
+
const visualRef = await embeddingContext.embedVisual({ url: visual.embedUrl, container: config.container.nativeElement }, {
|
|
6743
|
+
scaleToContainer: true,
|
|
6744
|
+
fitToIframeWidth: false,
|
|
6745
|
+
...(sdkParameters ? { parameters: sdkParameters } : {}),
|
|
6746
|
+
});
|
|
6721
6747
|
refs.set(config.visualId, visualRef);
|
|
6722
6748
|
onVisualLoaded?.(config.visualId, visualRef);
|
|
6723
6749
|
}
|
|
@@ -6741,9 +6767,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6741
6767
|
}]
|
|
6742
6768
|
}] });
|
|
6743
6769
|
|
|
6770
|
+
function isQuicksightSessionExpiredEvent(event) {
|
|
6771
|
+
if (event.eventName !== QuicksightEventName.ERROR_OCCURRED)
|
|
6772
|
+
return false;
|
|
6773
|
+
const code = event.data?.errorCode ?? event.data?.code ?? "";
|
|
6774
|
+
return typeof code === "string" && QUICKSIGHT_AUTH_ERROR_CODES.some(c => code.includes(c));
|
|
6775
|
+
}
|
|
6776
|
+
function dispatchQuicksightEvent(event, outputs) {
|
|
6777
|
+
outputs.sdkEvent.emit(event);
|
|
6778
|
+
if (event.eventName === QuicksightEventName.CONTENT_LOADED)
|
|
6779
|
+
outputs.contentLoaded?.emit(event);
|
|
6780
|
+
if (event.eventName === QuicksightEventName.ERROR_OCCURRED) {
|
|
6781
|
+
outputs.errorOccurred?.emit(event);
|
|
6782
|
+
if (isQuicksightSessionExpiredEvent(event))
|
|
6783
|
+
outputs.sessionExpired?.emit(event);
|
|
6784
|
+
}
|
|
6785
|
+
}
|
|
6786
|
+
|
|
6744
6787
|
class DashboardQsComponent {
|
|
6745
6788
|
sharedService = inject(Shared);
|
|
6789
|
+
sweetAlertService = inject(SweetAlertService);
|
|
6790
|
+
termPipe = inject(TermPipe);
|
|
6791
|
+
GlobalTermService = inject(GlobalTermService);
|
|
6746
6792
|
route = inject(ActivatedRoute);
|
|
6793
|
+
sessionExpiredShown = false;
|
|
6747
6794
|
containers;
|
|
6748
6795
|
dashboardIdInput = input(undefined, { alias: 'dashboardId' });
|
|
6749
6796
|
parametersInput = input(undefined, { alias: 'parameters' });
|
|
@@ -6754,6 +6801,10 @@ class DashboardQsComponent {
|
|
|
6754
6801
|
height = computed(() => this.heightInput() ?? this.routeData()['height']);
|
|
6755
6802
|
isLoading = signal(true);
|
|
6756
6803
|
isLoadingChange = output();
|
|
6804
|
+
sdkEvent = output();
|
|
6805
|
+
contentLoaded = output();
|
|
6806
|
+
errorOccurred = output();
|
|
6807
|
+
sessionExpired = output();
|
|
6757
6808
|
viewReady = signal(false);
|
|
6758
6809
|
constructor() {
|
|
6759
6810
|
effect(() => {
|
|
@@ -6776,17 +6827,34 @@ class DashboardQsComponent {
|
|
|
6776
6827
|
return;
|
|
6777
6828
|
this.isLoading.set(true);
|
|
6778
6829
|
try {
|
|
6779
|
-
await this.sharedService.embedDashboard({ dashboardId, parameters }, container, {
|
|
6830
|
+
await this.sharedService.embedDashboard({ dashboardId, parameters }, container, {
|
|
6831
|
+
height: this.height() ?? `${window.innerHeight - 50}px`,
|
|
6832
|
+
onMessage: event => {
|
|
6833
|
+
dispatchQuicksightEvent(event, this);
|
|
6834
|
+
if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED)
|
|
6835
|
+
this.isLoading.set(false);
|
|
6836
|
+
if (isQuicksightSessionExpiredEvent(event))
|
|
6837
|
+
this.handleSessionExpired();
|
|
6838
|
+
},
|
|
6839
|
+
});
|
|
6780
6840
|
}
|
|
6781
6841
|
catch (error) {
|
|
6782
6842
|
console.error('Error embedding dashboard:', error);
|
|
6783
|
-
}
|
|
6784
|
-
finally {
|
|
6785
6843
|
this.isLoading.set(false);
|
|
6786
6844
|
}
|
|
6787
6845
|
}
|
|
6846
|
+
async handleSessionExpired() {
|
|
6847
|
+
if (this.sessionExpiredShown)
|
|
6848
|
+
return;
|
|
6849
|
+
this.sessionExpiredShown = true;
|
|
6850
|
+
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));
|
|
6851
|
+
if (result.isConfirmed)
|
|
6852
|
+
window.location.reload();
|
|
6853
|
+
else
|
|
6854
|
+
this.sessionExpiredShown = false;
|
|
6855
|
+
}
|
|
6788
6856
|
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"] }] });
|
|
6857
|
+
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
6858
|
}
|
|
6791
6859
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsComponent, decorators: [{
|
|
6792
6860
|
type: Component,
|
|
@@ -6796,6 +6864,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6796
6864
|
args: ['visualContainer']
|
|
6797
6865
|
}] } });
|
|
6798
6866
|
|
|
6867
|
+
class DashboardQsInteractiveComponent {
|
|
6868
|
+
sharedService = inject(Shared);
|
|
6869
|
+
sweetAlertService = inject(SweetAlertService);
|
|
6870
|
+
termPipe = inject(TermPipe);
|
|
6871
|
+
GlobalTermService = inject(GlobalTermService);
|
|
6872
|
+
route = inject(ActivatedRoute);
|
|
6873
|
+
sessionExpiredShown = false;
|
|
6874
|
+
containers;
|
|
6875
|
+
dashboardIdInput = input(undefined, { alias: 'dashboardId' });
|
|
6876
|
+
parametersInput = input(undefined, { alias: 'parameters' });
|
|
6877
|
+
heightInput = input(undefined, { alias: 'height' });
|
|
6878
|
+
routeData = toSignal(this.route.data, { initialValue: this.route.snapshot.data });
|
|
6879
|
+
dashboardId = computed(() => this.dashboardIdInput() ?? this.routeData()['dashboardId']);
|
|
6880
|
+
parameters = computed(() => this.parametersInput() ?? this.routeData()['parameters']);
|
|
6881
|
+
height = computed(() => this.heightInput() ?? this.routeData()['height']);
|
|
6882
|
+
isLoading = signal(true);
|
|
6883
|
+
isLoadingChange = output();
|
|
6884
|
+
sdkEvent = output();
|
|
6885
|
+
contentLoaded = output();
|
|
6886
|
+
errorOccurred = output();
|
|
6887
|
+
sessionExpired = output();
|
|
6888
|
+
viewReady = signal(false);
|
|
6889
|
+
dashboardRef = null;
|
|
6890
|
+
lastEmbeddedId = undefined;
|
|
6891
|
+
constructor() {
|
|
6892
|
+
effect(() => {
|
|
6893
|
+
this.isLoadingChange.emit(this.isLoading());
|
|
6894
|
+
});
|
|
6895
|
+
effect(() => {
|
|
6896
|
+
const id = this.dashboardId();
|
|
6897
|
+
if (!this.viewReady() || !id)
|
|
6898
|
+
return;
|
|
6899
|
+
if (id === this.lastEmbeddedId)
|
|
6900
|
+
return;
|
|
6901
|
+
this.lastEmbeddedId = id;
|
|
6902
|
+
this.firstEmbed(id);
|
|
6903
|
+
});
|
|
6904
|
+
effect(() => {
|
|
6905
|
+
const params = this.parameters();
|
|
6906
|
+
if (!this.dashboardRef || !params)
|
|
6907
|
+
return;
|
|
6908
|
+
this.isLoading.set(true);
|
|
6909
|
+
this.sharedService.setDashboardParameters(this.dashboardRef, params)
|
|
6910
|
+
.catch(() => this.isLoading.set(false));
|
|
6911
|
+
});
|
|
6912
|
+
}
|
|
6913
|
+
ngAfterViewInit() {
|
|
6914
|
+
this.viewReady.set(true);
|
|
6915
|
+
}
|
|
6916
|
+
async firstEmbed(dashboardId) {
|
|
6917
|
+
const container = this.containers.first?.nativeElement;
|
|
6918
|
+
if (!container)
|
|
6919
|
+
return;
|
|
6920
|
+
this.isLoading.set(true);
|
|
6921
|
+
try {
|
|
6922
|
+
this.dashboardRef = await this.sharedService.embedDashboardInteractive({ dashboardId, parameters: this.parameters() }, container, {
|
|
6923
|
+
height: this.height() ?? `${window.innerHeight - 50}px`,
|
|
6924
|
+
onMessage: event => {
|
|
6925
|
+
dispatchQuicksightEvent(event, this);
|
|
6926
|
+
if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED || event.eventName === QuicksightEventName.PARAMETERS_CHANGED)
|
|
6927
|
+
this.isLoading.set(false);
|
|
6928
|
+
if (isQuicksightSessionExpiredEvent(event))
|
|
6929
|
+
this.handleSessionExpired();
|
|
6930
|
+
},
|
|
6931
|
+
});
|
|
6932
|
+
}
|
|
6933
|
+
catch (error) {
|
|
6934
|
+
console.error('Error embedding dashboard:', error);
|
|
6935
|
+
this.isLoading.set(false);
|
|
6936
|
+
}
|
|
6937
|
+
}
|
|
6938
|
+
async handleSessionExpired() {
|
|
6939
|
+
if (this.sessionExpiredShown)
|
|
6940
|
+
return;
|
|
6941
|
+
this.sessionExpiredShown = true;
|
|
6942
|
+
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));
|
|
6943
|
+
if (result.isConfirmed)
|
|
6944
|
+
window.location.reload();
|
|
6945
|
+
else
|
|
6946
|
+
this.sessionExpiredShown = false;
|
|
6947
|
+
}
|
|
6948
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsInteractiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6949
|
+
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"] }] });
|
|
6950
|
+
}
|
|
6951
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsInteractiveComponent, decorators: [{
|
|
6952
|
+
type: Component,
|
|
6953
|
+
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>" }]
|
|
6954
|
+
}], ctorParameters: () => [], propDecorators: { containers: [{
|
|
6955
|
+
type: ViewChildren,
|
|
6956
|
+
args: ['visualContainer']
|
|
6957
|
+
}] } });
|
|
6958
|
+
|
|
6799
6959
|
class CheckboxFilterDirective extends FilterDirective {
|
|
6800
6960
|
constructor() {
|
|
6801
6961
|
super(FilterTypeEnum.Checkbox);
|
|
@@ -10719,5 +10879,5 @@ const IntelicaTheme = definePreset(Aura, {
|
|
|
10719
10879
|
* Generated bundle index. Do not edit.
|
|
10720
10880
|
*/
|
|
10721
10881
|
|
|
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 };
|
|
10882
|
+
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
10883
|
//# sourceMappingURL=intelica-library-ui.mjs.map
|