@luzmo/embed 5.0.10 → 5.0.12

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/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
 
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [5.0.12] - 2024-03-19
5
+
6
+ ### Bugfixes
7
+
8
+ - Fixed getAccessibleDashboards() to correctly work with embed tokens.
9
+
10
+ ## [5.0.11] - 2024-03-18
11
+
12
+ ### Updates
13
+
14
+ - Correct typings are now exposed from @luzmo/embed.
15
+
4
16
  ## [5.0.10] - 2024-03-11
5
17
 
6
18
  ### Bugfixes
package/index.cjs CHANGED
@@ -39,12 +39,14 @@ var __decorateClass = (decorators, target, key, kind) => {
39
39
  // libs/embed-libs/embed/src/index.ts
40
40
  var src_exports = {};
41
41
  __export(src_exports, {
42
- LuzmoDashboard: () => LuzmoDashboard,
43
- LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent
42
+ LuzmoDashboard: () => LuzmoDashboard2
44
43
  });
45
44
  module.exports = __toCommonJS(src_exports);
46
45
 
47
46
  // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
47
+ var import_decorators2 = require("lit/decorators.js");
48
+
49
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
48
50
  var SharedLib2 = __toESM(require("@luzmo/shared-embed"), 1);
49
51
  var import_lit2 = require("lit");
50
52
  var import_decorators = require("lit/decorators.js");
@@ -52,7 +54,7 @@ var import_style_map = require("lit/directives/style-map.js");
52
54
  var import_shared_embed = require("@luzmo/shared-embed");
53
55
 
54
56
  // libs/embed-libs/embed/package.json
55
- var version = "5.0.10";
57
+ var version = "5.0.12";
56
58
 
57
59
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
58
60
  var LuzmoService = class {
@@ -331,7 +333,7 @@ var dashboardStyles = import_lit.css`
331
333
  }
332
334
  `;
333
335
 
334
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
336
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
335
337
  var LuzmoDashboard = class extends import_lit2.LitElement {
336
338
  constructor(inputParameters) {
337
339
  super();
@@ -354,6 +356,8 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
354
356
  this.browserNotSupported = [];
355
357
  this.VERSION = version + "-wc-luzmo";
356
358
  this.isLibraryLoaded = false;
359
+ this.currentAuthKey = null;
360
+ this.currentAuthToken = null;
357
361
  this.attributesMap = {
358
362
  dashboardId: "dashboard-id",
359
363
  dashboardSlug: "dashboard-slug",
@@ -418,7 +422,12 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
418
422
  if (import_shared_embed.remotesMap[appServer]) {
419
423
  return Promise.resolve(import_shared_embed.remotesMap[appServer].module);
420
424
  }
421
- import_shared_embed.remotesMap[appServer] = { url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`, format: "esm", from: "vite", module: void 0 };
425
+ import_shared_embed.remotesMap[appServer] = {
426
+ url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
427
+ format: "esm",
428
+ from: "vite",
429
+ module: void 0
430
+ };
422
431
  return (0, import_shared_embed.__federationMethodGetRemote)(appServer, "./DashboardApp").then((module2) => {
423
432
  const wrappedModule = (0, import_shared_embed.__federationMethodWrapDefault)(module2, true);
424
433
  import_shared_embed.remotesMap[appServer].module = wrappedModule;
@@ -496,11 +505,10 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
496
505
  this.dashboardReference = oldReference.cloneNode(true);
497
506
  oldReference.replaceWith(this.dashboardReference);
498
507
  this.dashboardReference.addEventListener("load", (payload) => {
499
- setTimeout(() => {
500
- this.containerWidth = this.dashboardReference.offsetWidth;
501
- this.dimensions = payload.detail.dimensions;
502
- SharedLib2._setCalculatedDimensions(this);
503
- });
508
+ this.containerWidth = this.dashboardReference.offsetWidth;
509
+ this.dimensions = payload.detail.dimensions;
510
+ SharedLib2._setCalculatedDimensions(this);
511
+ window.dispatchEvent(new Event("resize"));
504
512
  this.dispatchEvent(new CustomEvent("load", payload));
505
513
  });
506
514
  this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
@@ -680,6 +688,8 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
680
688
  this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
681
689
  defaultParameters.apiHost = this.apiHost;
682
690
  }
691
+ this.currentAuthKey = this.authKey;
692
+ this.currentAuthToken = this.authToken;
683
693
  return defaultParameters;
684
694
  }
685
695
  _updateIframeUrl() {
@@ -721,68 +731,70 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
721
731
  return [dashboardStyles];
722
732
  }
723
733
  render() {
724
- let toBeRenderedHTML = import_lit2.html``;
734
+ let toBeRenderedHTML;
725
735
  const loader = import_lit2.html`
726
736
  <div
727
- class="luzmo-container-loader"
728
- id="luzmo-container-loader-${this._containerId}"
729
- style=${(0, import_style_map.styleMap)(
737
+ class="luzmo-container-loader"
738
+ id="luzmo-container-loader-${this._containerId}"
739
+ style=${(0, import_style_map.styleMap)(
730
740
  this._containerLoaderStyle
731
741
  )}
732
- >
733
- <div
734
- class="luzmo-loader"
735
- id="luzmo-loader-${this._containerId}"
736
- style=${(0, import_style_map.styleMap)(this._loaderStyle)}
737
- >
738
- <div
739
- class="luzmo-lc"
740
- style=${(0, import_style_map.styleMap)(this._lcStyle)}
741
- >
742
- <div
743
- class="luzmo-loading-circle"
744
- style=${(0, import_style_map.styleMap)(
742
+ >
743
+ <div
744
+ class="luzmo-loader"
745
+ id="luzmo-loader-${this._containerId}"
746
+ style=${(0, import_style_map.styleMap)(this._loaderStyle)}
747
+ >
748
+ <div
749
+ class="luzmo-lc"
750
+ style=${(0, import_style_map.styleMap)(this._lcStyle)}
751
+ >
752
+ <div
753
+ class="luzmo-loading-circle"
754
+ style=${(0, import_style_map.styleMap)(
745
755
  this._loadingCircleStyle
746
756
  )}
747
- ></div>
748
- ${this._itemEmbedding ? "" : import_lit2.html`
749
- <div
750
- class="luzmo-loading-message"
751
- style=${(0, import_style_map.styleMap)({ color: this.loaderFontColor })}
752
- >
753
- ${this._loaderMsg}
754
- </div>
755
- `}
757
+ ></div>
758
+ ${this._itemEmbedding ? "" : import_lit2.html`
759
+ <div
760
+ class="luzmo-loading-message"
761
+ style=${(0, import_style_map.styleMap)({ color: this.loaderFontColor })}
762
+ >
763
+ ${this._loaderMsg}
756
764
  </div>
757
- </div>
758
- </div>
765
+ `}
766
+ </div>
767
+ </div>
768
+ </div>
759
769
  `;
760
770
  if (this.getIsViewMode()) {
761
771
  toBeRenderedHTML = this.isLibraryLoaded ? import_lit2.html`
762
- ${this.dashboardId || this.dashboardSlug ? import_lit2.html`<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}" api-host="${this.params.apiHost}"></dashboard-component>` : import_lit2.html`
772
+ ${this.dashboardId || this.dashboardSlug ? import_lit2.html`
773
+ <dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
774
+ api-host="${this.params.apiHost}"></dashboard-component>` : import_lit2.html`
763
775
  <div id="luzmo-error-${this._containerId}">
764
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
765
- </div>
776
+ <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
777
+ </div>
766
778
  `}
767
779
  ` : import_lit2.html`${loader}`;
768
780
  } else {
769
781
  toBeRenderedHTML = import_lit2.html`
770
- ${this.dashboardId || this.dashboardSlug ? import_lit2.html`
771
- ${loader}
772
- <iframe
773
- class="luzmo-embed-dashboard"
774
- id="${this._iframeId}"
775
- name="${this._iframeId}"
776
- style=${(0, import_style_map.styleMap)(this.iframeStyle)}
777
- src="${this._iframeUrl}"
778
- frameborder="0"
779
- ></iframe>
780
- ` : import_lit2.html`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
782
+ ${this.dashboardId || this.dashboardSlug ? import_lit2.html`
783
+ ${loader}
784
+ <iframe
785
+ class="luzmo-embed-dashboard"
786
+ id="${this._iframeId}"
787
+ name="${this._iframeId}"
788
+ style=${(0, import_style_map.styleMap)(this.iframeStyle)}
789
+ src="${this._iframeUrl}"
790
+ frameborder="0"
791
+ ></iframe>
792
+ ` : import_lit2.html`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
781
793
  ${this.browserError ? import_lit2.html`
782
- <div id="luzmo-error-${this._containerId}">
783
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
784
- </div>
785
- ` : ""}
794
+ <div id="luzmo-error-${this._containerId}">
795
+ <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
796
+ </div>
797
+ ` : ""}
786
798
  `;
787
799
  }
788
800
  return import_lit2.html`
@@ -834,6 +846,8 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
834
846
  return Promise.reject();
835
847
  }
836
848
  setAuthorization(key, token) {
849
+ this.currentAuthKey = key;
850
+ this.currentAuthToken = token;
837
851
  if (this.getIsViewMode() && this.dashboardReference) {
838
852
  return this.dashboardReference.setAuthorization(key, token);
839
853
  }
@@ -870,13 +884,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
870
884
  return Promise.reject();
871
885
  }
872
886
  getAccessibleDashboards() {
873
- if (!this.getIsViewMode()) {
874
- return SharedLib2.getAccessibleDashboards(this, this.iframe);
875
- }
876
- if (this.getIsViewMode() && this.dashboardReference) {
877
- return this.dashboardReference.getAccessibleDashboards();
878
- }
879
- return Promise.reject();
887
+ return SharedLib2.getAccessibleDashboards(this);
880
888
  }
881
889
  addFilters(itemId, filters) {
882
890
  return this.dashboardReference.addFilters(itemId, filters);
@@ -915,10 +923,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
915
923
  return SharedLib2.setPreview(this, this.iframe, preview);
916
924
  }
917
925
  getIsViewMode() {
918
- if (this.experimental && this.params.editMode === "view" || this.params.editMode === void 0) {
919
- return true;
920
- }
921
- return false;
926
+ return this.experimental && this.params.editMode === "view" || this.params.editMode === void 0;
922
927
  }
923
928
  };
924
929
  __decorateClass([
@@ -1075,16 +1080,20 @@ __decorateClass([
1075
1080
  __decorateClass([
1076
1081
  (0, import_decorators.state)()
1077
1082
  ], LuzmoDashboard.prototype, "dashboardReference", 2);
1078
- LuzmoDashboard = __decorateClass([
1079
- (0, import_decorators.customElement)("luzmo-dashboard")
1080
- ], LuzmoDashboard);
1081
- var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
1083
+ __decorateClass([
1084
+ (0, import_decorators.state)()
1085
+ ], LuzmoDashboard.prototype, "currentAuthKey", 2);
1086
+ __decorateClass([
1087
+ (0, import_decorators.state)()
1088
+ ], LuzmoDashboard.prototype, "currentAuthToken", 2);
1089
+
1090
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
1091
+ var LuzmoDashboard2 = class extends LuzmoDashboard {
1082
1092
  };
1083
- LuzmoDashboardWebComponent = __decorateClass([
1084
- (0, import_decorators.customElement)("luzmo-dashboard-web-component")
1085
- ], LuzmoDashboardWebComponent);
1093
+ LuzmoDashboard2 = __decorateClass([
1094
+ (0, import_decorators2.customElement)("luzmo-dashboard")
1095
+ ], LuzmoDashboard2);
1086
1096
  // Annotate the CommonJS export names for ESM import in node:
1087
1097
  0 && (module.exports = {
1088
- LuzmoDashboard,
1089
- LuzmoDashboardWebComponent
1098
+ LuzmoDashboard
1090
1099
  });
package/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export type { LoadEvent, ChangedFiltersEvent, CustomEvent, ItemsRenderedEvent, ExportedEvent, DashboardActionEvent, Filter, FilterExpression, FilterOrigin, FilterInput, FilterGroup, ExportType, ItemData, ExportDashboard, AccessibleDashboard, SetEditMode } from '@luzmo/shared-embed';
1
2
  export * from './lib/dashboard-component/dashboard-component';
package/index.js CHANGED
@@ -11,13 +11,17 @@ var __decorateClass = (decorators, target, key, kind) => {
11
11
  };
12
12
 
13
13
  // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
14
+ import {
15
+ customElement
16
+ } from "lit/decorators.js";
17
+
18
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
14
19
  import * as SharedLib2 from "@luzmo/shared-embed";
15
20
  import {
16
21
  html,
17
22
  LitElement
18
23
  } from "lit";
19
24
  import {
20
- customElement,
21
25
  property,
22
26
  query,
23
27
  state
@@ -33,7 +37,7 @@ import {
33
37
  } from "@luzmo/shared-embed";
34
38
 
35
39
  // libs/embed-libs/embed/package.json
36
- var version = "5.0.10";
40
+ var version = "5.0.12";
37
41
 
38
42
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
39
43
  var LuzmoService = class {
@@ -312,7 +316,7 @@ var dashboardStyles = css`
312
316
  }
313
317
  `;
314
318
 
315
- // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
319
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
316
320
  var LuzmoDashboard = class extends LitElement {
317
321
  constructor(inputParameters) {
318
322
  super();
@@ -335,6 +339,8 @@ var LuzmoDashboard = class extends LitElement {
335
339
  this.browserNotSupported = [];
336
340
  this.VERSION = version + "-wc-luzmo";
337
341
  this.isLibraryLoaded = false;
342
+ this.currentAuthKey = null;
343
+ this.currentAuthToken = null;
338
344
  this.attributesMap = {
339
345
  dashboardId: "dashboard-id",
340
346
  dashboardSlug: "dashboard-slug",
@@ -399,7 +405,12 @@ var LuzmoDashboard = class extends LitElement {
399
405
  if (remotesMap[appServer]) {
400
406
  return Promise.resolve(remotesMap[appServer].module);
401
407
  }
402
- remotesMap[appServer] = { url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`, format: "esm", from: "vite", module: void 0 };
408
+ remotesMap[appServer] = {
409
+ url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
410
+ format: "esm",
411
+ from: "vite",
412
+ module: void 0
413
+ };
403
414
  return __federationMethodGetRemote(appServer, "./DashboardApp").then((module) => {
404
415
  const wrappedModule = __federationMethodWrapDefault(module, true);
405
416
  remotesMap[appServer].module = wrappedModule;
@@ -477,11 +488,10 @@ var LuzmoDashboard = class extends LitElement {
477
488
  this.dashboardReference = oldReference.cloneNode(true);
478
489
  oldReference.replaceWith(this.dashboardReference);
479
490
  this.dashboardReference.addEventListener("load", (payload) => {
480
- setTimeout(() => {
481
- this.containerWidth = this.dashboardReference.offsetWidth;
482
- this.dimensions = payload.detail.dimensions;
483
- SharedLib2._setCalculatedDimensions(this);
484
- });
491
+ this.containerWidth = this.dashboardReference.offsetWidth;
492
+ this.dimensions = payload.detail.dimensions;
493
+ SharedLib2._setCalculatedDimensions(this);
494
+ window.dispatchEvent(new Event("resize"));
485
495
  this.dispatchEvent(new CustomEvent("load", payload));
486
496
  });
487
497
  this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
@@ -661,6 +671,8 @@ var LuzmoDashboard = class extends LitElement {
661
671
  this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
662
672
  defaultParameters.apiHost = this.apiHost;
663
673
  }
674
+ this.currentAuthKey = this.authKey;
675
+ this.currentAuthToken = this.authToken;
664
676
  return defaultParameters;
665
677
  }
666
678
  _updateIframeUrl() {
@@ -702,68 +714,70 @@ var LuzmoDashboard = class extends LitElement {
702
714
  return [dashboardStyles];
703
715
  }
704
716
  render() {
705
- let toBeRenderedHTML = html``;
717
+ let toBeRenderedHTML;
706
718
  const loader = html`
707
719
  <div
708
- class="luzmo-container-loader"
709
- id="luzmo-container-loader-${this._containerId}"
710
- style=${styleMap(
720
+ class="luzmo-container-loader"
721
+ id="luzmo-container-loader-${this._containerId}"
722
+ style=${styleMap(
711
723
  this._containerLoaderStyle
712
724
  )}
713
- >
714
- <div
715
- class="luzmo-loader"
716
- id="luzmo-loader-${this._containerId}"
717
- style=${styleMap(this._loaderStyle)}
718
- >
719
- <div
720
- class="luzmo-lc"
721
- style=${styleMap(this._lcStyle)}
722
- >
723
- <div
724
- class="luzmo-loading-circle"
725
- style=${styleMap(
725
+ >
726
+ <div
727
+ class="luzmo-loader"
728
+ id="luzmo-loader-${this._containerId}"
729
+ style=${styleMap(this._loaderStyle)}
730
+ >
731
+ <div
732
+ class="luzmo-lc"
733
+ style=${styleMap(this._lcStyle)}
734
+ >
735
+ <div
736
+ class="luzmo-loading-circle"
737
+ style=${styleMap(
726
738
  this._loadingCircleStyle
727
739
  )}
728
- ></div>
729
- ${this._itemEmbedding ? "" : html`
730
- <div
731
- class="luzmo-loading-message"
732
- style=${styleMap({ color: this.loaderFontColor })}
733
- >
734
- ${this._loaderMsg}
735
- </div>
736
- `}
740
+ ></div>
741
+ ${this._itemEmbedding ? "" : html`
742
+ <div
743
+ class="luzmo-loading-message"
744
+ style=${styleMap({ color: this.loaderFontColor })}
745
+ >
746
+ ${this._loaderMsg}
737
747
  </div>
738
- </div>
739
- </div>
748
+ `}
749
+ </div>
750
+ </div>
751
+ </div>
740
752
  `;
741
753
  if (this.getIsViewMode()) {
742
754
  toBeRenderedHTML = this.isLibraryLoaded ? html`
743
- ${this.dashboardId || this.dashboardSlug ? html`<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}" api-host="${this.params.apiHost}"></dashboard-component>` : html`
755
+ ${this.dashboardId || this.dashboardSlug ? html`
756
+ <dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
757
+ api-host="${this.params.apiHost}"></dashboard-component>` : html`
744
758
  <div id="luzmo-error-${this._containerId}">
745
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
746
- </div>
759
+ <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
760
+ </div>
747
761
  `}
748
762
  ` : html`${loader}`;
749
763
  } else {
750
764
  toBeRenderedHTML = html`
751
- ${this.dashboardId || this.dashboardSlug ? html`
752
- ${loader}
753
- <iframe
754
- class="luzmo-embed-dashboard"
755
- id="${this._iframeId}"
756
- name="${this._iframeId}"
757
- style=${styleMap(this.iframeStyle)}
758
- src="${this._iframeUrl}"
759
- frameborder="0"
760
- ></iframe>
761
- ` : html`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
765
+ ${this.dashboardId || this.dashboardSlug ? html`
766
+ ${loader}
767
+ <iframe
768
+ class="luzmo-embed-dashboard"
769
+ id="${this._iframeId}"
770
+ name="${this._iframeId}"
771
+ style=${styleMap(this.iframeStyle)}
772
+ src="${this._iframeUrl}"
773
+ frameborder="0"
774
+ ></iframe>
775
+ ` : html`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
762
776
  ${this.browserError ? html`
763
- <div id="luzmo-error-${this._containerId}">
764
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
765
- </div>
766
- ` : ""}
777
+ <div id="luzmo-error-${this._containerId}">
778
+ <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
779
+ </div>
780
+ ` : ""}
767
781
  `;
768
782
  }
769
783
  return html`
@@ -815,6 +829,8 @@ var LuzmoDashboard = class extends LitElement {
815
829
  return Promise.reject();
816
830
  }
817
831
  setAuthorization(key, token) {
832
+ this.currentAuthKey = key;
833
+ this.currentAuthToken = token;
818
834
  if (this.getIsViewMode() && this.dashboardReference) {
819
835
  return this.dashboardReference.setAuthorization(key, token);
820
836
  }
@@ -851,13 +867,7 @@ var LuzmoDashboard = class extends LitElement {
851
867
  return Promise.reject();
852
868
  }
853
869
  getAccessibleDashboards() {
854
- if (!this.getIsViewMode()) {
855
- return SharedLib2.getAccessibleDashboards(this, this.iframe);
856
- }
857
- if (this.getIsViewMode() && this.dashboardReference) {
858
- return this.dashboardReference.getAccessibleDashboards();
859
- }
860
- return Promise.reject();
870
+ return SharedLib2.getAccessibleDashboards(this);
861
871
  }
862
872
  addFilters(itemId, filters) {
863
873
  return this.dashboardReference.addFilters(itemId, filters);
@@ -896,10 +906,7 @@ var LuzmoDashboard = class extends LitElement {
896
906
  return SharedLib2.setPreview(this, this.iframe, preview);
897
907
  }
898
908
  getIsViewMode() {
899
- if (this.experimental && this.params.editMode === "view" || this.params.editMode === void 0) {
900
- return true;
901
- }
902
- return false;
909
+ return this.experimental && this.params.editMode === "view" || this.params.editMode === void 0;
903
910
  }
904
911
  };
905
912
  __decorateClass([
@@ -1056,15 +1063,19 @@ __decorateClass([
1056
1063
  __decorateClass([
1057
1064
  state()
1058
1065
  ], LuzmoDashboard.prototype, "dashboardReference", 2);
1059
- LuzmoDashboard = __decorateClass([
1060
- customElement("luzmo-dashboard")
1061
- ], LuzmoDashboard);
1062
- var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
1066
+ __decorateClass([
1067
+ state()
1068
+ ], LuzmoDashboard.prototype, "currentAuthKey", 2);
1069
+ __decorateClass([
1070
+ state()
1071
+ ], LuzmoDashboard.prototype, "currentAuthToken", 2);
1072
+
1073
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
1074
+ var LuzmoDashboard2 = class extends LuzmoDashboard {
1063
1075
  };
1064
- LuzmoDashboardWebComponent = __decorateClass([
1065
- customElement("luzmo-dashboard-web-component")
1066
- ], LuzmoDashboardWebComponent);
1076
+ LuzmoDashboard2 = __decorateClass([
1077
+ customElement("luzmo-dashboard")
1078
+ ], LuzmoDashboard2);
1067
1079
  export {
1068
- LuzmoDashboard,
1069
- LuzmoDashboardWebComponent
1080
+ LuzmoDashboard2 as LuzmoDashboard
1070
1081
  };
@@ -0,0 +1 @@
1
+ export * from './lib/dashboard-component/dashboard-web-component';
@@ -0,0 +1,98 @@
1
+ import * as SharedLib from '@luzmo/shared-embed';
2
+ import { LitElement, PropertyValues, TemplateResult } from 'lit';
3
+ import { CombinedFilterInput } from '@luzmo/shared-embed';
4
+ /**
5
+ * Luzmo Dashboard
6
+ * Base component isn't registered in customEvents registry so that it can be reused.
7
+ */
8
+ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6LuzmoDashboard {
9
+ container: HTMLElement;
10
+ luzmoEmbedContainer: HTMLElement;
11
+ iframe: HTMLIFrameElement;
12
+ dashboardId?: SharedLib.DashboardInputs['dashboardId'];
13
+ dashboardSlug?: SharedLib.DashboardInputs['dashboardSlug'];
14
+ itemId?: SharedLib.DashboardInputs['itemId'];
15
+ language: SharedLib.DashboardInputs['language'];
16
+ qeVersion: SharedLib.DashboardInputs['qeVersion'];
17
+ screenMode: SharedLib.DashboardInputs['screenMode'];
18
+ switchScreenModeOnResize: boolean;
19
+ editMode: SharedLib.DashboardInputs['editMode'];
20
+ mainColor?: SharedLib.DashboardInputs['mainColor'];
21
+ accentColor?: SharedLib.DashboardInputs['accentColor'];
22
+ authToken?: SharedLib.DashboardInputs['authToken'];
23
+ authKey?: SharedLib.DashboardInputs['authKey'];
24
+ loaderBackground?: SharedLib.DashboardInputs['loaderBackground'];
25
+ loaderFontColor?: SharedLib.DashboardInputs['loaderFontColor'];
26
+ loaderSpinnerColor?: SharedLib.DashboardInputs['loaderSpinnerColor'];
27
+ loaderSpinnerBackground?: SharedLib.DashboardInputs['loaderSpinnerBackground'];
28
+ appServer?: SharedLib.DashboardInputs['appServer'];
29
+ timezoneId?: SharedLib.DashboardInputs['timezoneId'];
30
+ apiHost?: SharedLib.DashboardInputs['apiHost'];
31
+ itemDimensions: SharedLib.DashboardInputs['itemDimensions'];
32
+ experimental: boolean;
33
+ _containerId: string;
34
+ _iframeId: string;
35
+ params: SharedLib.DashboardContentParams;
36
+ _iframeUrl?: string;
37
+ iframeLoaded: boolean;
38
+ promises: SharedLib.DashboardPromises;
39
+ iframeStyle: SharedLib.IframeStyles;
40
+ _containerStyle: SharedLib.ContainerStyles;
41
+ _loaderStyle: SharedLib.LoaderStyles;
42
+ _lcStyle: SharedLib.LcStyles;
43
+ _loadingCircleStyle: SharedLib.PlStyles;
44
+ _containerLoaderStyle: SharedLib.ContainerLoaderStyles;
45
+ _loaderMsg: string;
46
+ containerWidth?: number;
47
+ dimensions?: SharedLib.DashboardDimensions;
48
+ currentScreenMode?: SharedLib.ScreenMode;
49
+ _itemEmbedding: boolean;
50
+ browserError: boolean;
51
+ browserErrorMsg: string;
52
+ dashboardError: boolean;
53
+ browserNotSupported: any[];
54
+ VERSION: string;
55
+ protected isLibraryLoaded: boolean;
56
+ protected dashboardReference: SharedLib.LuzmoElement;
57
+ currentAuthKey: string;
58
+ currentAuthToken: string;
59
+ private attributesMap;
60
+ _loadTimeoutHandle?: number;
61
+ _onResize: () => void;
62
+ loaderSize: number;
63
+ borderWidth: number;
64
+ minHeight: number;
65
+ iframeHeight?: string;
66
+ iframeWidth?: string;
67
+ _resizeObserver: ResizeObserver;
68
+ constructor(inputParameters?: Record<keyof LuzmoDashboard, any>);
69
+ private loadLibrary;
70
+ private setInputParameters;
71
+ connectedCallback(): void;
72
+ disconnectedCallback(): void;
73
+ firstUpdated(): void;
74
+ initComponent(): void;
75
+ setAllAttributes(): void;
76
+ updated(changedProperties: PropertyValues): void;
77
+ _setOptions(): SharedLib.DashboardContentParams;
78
+ _updateIframeUrl(): void;
79
+ _setupLoader(): void;
80
+ _displayError(): void;
81
+ _calculateDimAfterDashboardLoaded(): void;
82
+ _loaderStyles(): void;
83
+ static get styles(): import("lit").CSSResult[];
84
+ render(): TemplateResult;
85
+ getDashboards(): Promise<LuzmoDashboard[]>;
86
+ getData(itemId: string): Promise<SharedLib.ItemData>;
87
+ getFilters(): Promise<SharedLib.FilterGroup[]>;
88
+ setFilters<K extends CombinedFilterInput>(itemId: string, filters: K): Promise<SharedLib.SetFilters>;
89
+ setAuthorization(key: string, token: string): Promise<void>;
90
+ refreshData(itemId?: string): Promise<void>;
91
+ reloadDashboard(): Promise<void>;
92
+ exportDashboard(format?: SharedLib.ExportType): Promise<SharedLib.ExportDashboard>;
93
+ getAccessibleDashboards(): Promise<SharedLib.AccessibleDashboard[]>;
94
+ addFilters(itemId: string, filters: SharedLib.FilterGroup[]): Promise<SharedLib.AddFilters>;
95
+ setEditMode(editMode?: SharedLib.DashboardEditMode): Promise<SharedLib.SetEditMode>;
96
+ setPreview(preview: boolean): Promise<SharedLib.SetPreview>;
97
+ getIsViewMode(): boolean;
98
+ }