intelica-library-project 20.0.5 → 20.0.7

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.
@@ -2180,7 +2180,7 @@ class Shared {
2180
2180
  container,
2181
2181
  ...(options?.height && { height: options.height }),
2182
2182
  ...(options?.width && { width: options.width }),
2183
- ...(options?.onChange && { onChange: this.toSdkChangeListener(options.onChange) }),
2183
+ ...(options?.onMessage && { onMessage: this.toSdkMessageListener(options.onMessage) }),
2184
2184
  });
2185
2185
  }
2186
2186
  async embedDashboard(command, container, options) {
@@ -2198,10 +2198,10 @@ class Shared {
2198
2198
  container,
2199
2199
  ...(options?.height && { height: options.height }),
2200
2200
  ...(options?.width && { width: options.width }),
2201
- ...(options?.onChange && { onChange: this.toSdkChangeListener(options.onChange) }),
2201
+ ...(options?.onMessage && { onMessage: this.toSdkMessageListener(options.onMessage) }),
2202
2202
  }, sdkParameters ? { parameters: sdkParameters } : undefined);
2203
2203
  }
2204
- toSdkChangeListener(emit) {
2204
+ toSdkMessageListener(emit) {
2205
2205
  return (changeEvent) => {
2206
2206
  emit({
2207
2207
  eventName: changeEvent?.eventName,
@@ -2340,14 +2340,16 @@ class DashboardQsComponent {
2340
2340
  try {
2341
2341
  await this.sharedService.embedDashboard({ dashboardId, parameters }, container, {
2342
2342
  height: this.height() ?? `${window.innerHeight - 50}px`,
2343
- onChange: event => dispatchQuicksightEvent(event, this),
2343
+ onMessage: event => {
2344
+ dispatchQuicksightEvent(event, this);
2345
+ if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED)
2346
+ this.isLoading.set(false);
2347
+ },
2344
2348
  });
2345
2349
  }
2346
2350
  catch (error) {
2347
2351
  console.error('Error embedding dashboard:', error);
2348
- }
2349
- finally {
2350
- setTimeout(() => this.isLoading.set(false), 2000);
2352
+ this.isLoading.set(false);
2351
2353
  }
2352
2354
  }
2353
2355
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -2414,14 +2416,16 @@ class DashboardQsInteractiveComponent {
2414
2416
  try {
2415
2417
  this.dashboardRef = await this.sharedService.embedDashboardInteractive({ dashboardId, parameters: this.parameters() }, container, {
2416
2418
  height: this.height() ?? `${window.innerHeight - 50}px`,
2417
- onChange: event => dispatchQuicksightEvent(event, this),
2419
+ onMessage: event => {
2420
+ dispatchQuicksightEvent(event, this);
2421
+ if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED)
2422
+ this.isLoading.set(false);
2423
+ },
2418
2424
  });
2419
2425
  }
2420
2426
  catch (error) {
2421
2427
  console.error('Error embedding dashboard:', error);
2422
- }
2423
- finally {
2424
- setTimeout(() => this.isLoading.set(false), 2000);
2428
+ this.isLoading.set(false);
2425
2429
  }
2426
2430
  }
2427
2431
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsInteractiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });