@luzmo/embed 6.3.5 → 6.3.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.
- package/CHANGELOG.md +12 -0
- package/index.cjs +36 -36
- package/index.js +36 -36
- package/luzmo-embed.min.js +40 -40
- package/package.json +2 -2
- package/src/lib/dashboard-component/dashboard-base.d.ts +3 -3
- package/src/lib/luzmo-iq-components/luzmo-iq-chat.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [6.3.7] - 2025-03-04
|
|
6
|
+
|
|
7
|
+
### Updates
|
|
8
|
+
|
|
9
|
+
- Rename "experimental" input to "embedMode" in dashboard component
|
|
10
|
+
|
|
11
|
+
## [6.3.6] - 2025-02-27
|
|
12
|
+
|
|
13
|
+
### Updates
|
|
14
|
+
|
|
15
|
+
- Added availableDatasets as input to luzmo-iq-embed-chat component
|
|
16
|
+
|
|
5
17
|
## [6.3.5] - 2025-02-24
|
|
6
18
|
|
|
7
19
|
### Updates
|
package/index.cjs
CHANGED
|
@@ -63,7 +63,7 @@ var import_decorators = require("lit/decorators.js");
|
|
|
63
63
|
var import_style_map = require("lit/directives/style-map.js");
|
|
64
64
|
|
|
65
65
|
// libs/embed-libs/embed/package.json
|
|
66
|
-
var version = "6.3.
|
|
66
|
+
var version = "6.3.7";
|
|
67
67
|
|
|
68
68
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
69
69
|
var SharedLib = __toESM(require("@luzmo/shared-embed"), 1);
|
|
@@ -372,7 +372,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
372
372
|
this.screenMode = "auto";
|
|
373
373
|
this.switchScreenModeOnResize = true;
|
|
374
374
|
this.editMode = "view";
|
|
375
|
-
this.
|
|
375
|
+
this.embedMode = "iframe";
|
|
376
376
|
this.iframeStyle = {};
|
|
377
377
|
this._containerStyle = {};
|
|
378
378
|
this._loaderStyle = {};
|
|
@@ -474,7 +474,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
474
474
|
}
|
|
475
475
|
initComponent() {
|
|
476
476
|
this.params = this._setOptions();
|
|
477
|
-
if (this.
|
|
477
|
+
if (this.isWebComponentViewMode()) {
|
|
478
478
|
SharedLib2.loadLibrary(this.params.appServer, dashboardRemote).then(async () => {
|
|
479
479
|
this.isLibraryLoaded = true;
|
|
480
480
|
await this.updateComplete;
|
|
@@ -559,7 +559,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
559
559
|
this.isInitCalled = true;
|
|
560
560
|
return;
|
|
561
561
|
}
|
|
562
|
-
if (this.
|
|
562
|
+
if (this.isWebComponentViewMode()) {
|
|
563
563
|
if (this.dashboardReference) {
|
|
564
564
|
for (const [propertyName] of changedProperties.entries()) {
|
|
565
565
|
if (propertyName === "appSever") {
|
|
@@ -665,7 +665,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
665
665
|
defaultParameters.itemDimensions = this.itemDimensions;
|
|
666
666
|
}
|
|
667
667
|
if (this.appServer) {
|
|
668
|
-
this.appServer = this.
|
|
668
|
+
this.appServer = this.isWebComponentViewMode() ? SharedLib2.removeTrailingSlash(this.appServer) : SharedLib2.addTrailingSlash(this.appServer);
|
|
669
669
|
defaultParameters.appServer = this.appServer;
|
|
670
670
|
} else {
|
|
671
671
|
this.appServer = SharedLib2.addTrailingSlash(
|
|
@@ -674,7 +674,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
674
674
|
defaultParameters.appServer = this.appServer;
|
|
675
675
|
}
|
|
676
676
|
if (this.apiHost) {
|
|
677
|
-
this.apiHost = this.
|
|
677
|
+
this.apiHost = this.isWebComponentViewMode() ? SharedLib2.removeTrailingSlash(this.apiHost) : SharedLib2.addTrailingSlash(this.apiHost);
|
|
678
678
|
defaultParameters.apiHost = this.apiHost;
|
|
679
679
|
} else {
|
|
680
680
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
@@ -759,7 +759,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
759
759
|
</div>
|
|
760
760
|
</div>
|
|
761
761
|
`;
|
|
762
|
-
if (this.
|
|
762
|
+
if (this.isWebComponentViewMode()) {
|
|
763
763
|
toBeRenderedHTML = this.isLibraryLoaded ? import_lit2.html`
|
|
764
764
|
${this.dashboardId || this.dashboardSlug ? import_lit2.html`
|
|
765
765
|
<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
|
|
@@ -775,7 +775,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
775
775
|
${this.dashboardId || this.dashboardSlug ? import_lit2.html`
|
|
776
776
|
${loader}
|
|
777
777
|
<iframe
|
|
778
|
-
class="luzmo-embed-dashboard ${this.
|
|
778
|
+
class="luzmo-embed-dashboard ${this.isWebComponentViewMode() ? "" : `luzmo-embed-dashboard-ede`}"
|
|
779
779
|
id="${this._iframeId}"
|
|
780
780
|
name="${this._iframeId}"
|
|
781
781
|
style=${(0, import_style_map.styleMap)(this.iframeStyle)}
|
|
@@ -791,7 +791,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
791
791
|
`;
|
|
792
792
|
}
|
|
793
793
|
return import_lit2.html`
|
|
794
|
-
<div class="${import_shared_embed.luzmoEmbedContainerClass} ${this.
|
|
794
|
+
<div class="${import_shared_embed.luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${import_shared_embed.luzmoEmbedContainerClass}-ede`}">
|
|
795
795
|
<div
|
|
796
796
|
class="dashboard-container"
|
|
797
797
|
style=${(0, import_style_map.styleMap)(Object.assign({}, this._containerStyle, {
|
|
@@ -812,28 +812,28 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
812
812
|
}
|
|
813
813
|
// Public methods
|
|
814
814
|
getData(itemId) {
|
|
815
|
-
if (this.
|
|
815
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
816
816
|
return this.dashboardReference.getData(itemId);
|
|
817
817
|
}
|
|
818
|
-
if (!this.
|
|
818
|
+
if (!this.isWebComponentViewMode()) {
|
|
819
819
|
return SharedLib2.getData(this, this.iframe, itemId);
|
|
820
820
|
}
|
|
821
821
|
return Promise.reject();
|
|
822
822
|
}
|
|
823
823
|
getFilters() {
|
|
824
|
-
if (this.
|
|
824
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
825
825
|
return this.dashboardReference.getFilters();
|
|
826
826
|
}
|
|
827
|
-
if (!this.
|
|
827
|
+
if (!this.isWebComponentViewMode()) {
|
|
828
828
|
return SharedLib2.getFilters(this, this.iframe);
|
|
829
829
|
}
|
|
830
830
|
return Promise.reject();
|
|
831
831
|
}
|
|
832
832
|
setSelectedData(itemId, filters) {
|
|
833
|
-
if (this.
|
|
833
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
834
834
|
return this.dashboardReference.setSelectedData(itemId, filters);
|
|
835
835
|
}
|
|
836
|
-
if (!this.
|
|
836
|
+
if (!this.isWebComponentViewMode()) {
|
|
837
837
|
return SharedLib2.setSelectedData(this, this.iframe, itemId, filters);
|
|
838
838
|
}
|
|
839
839
|
return Promise.reject();
|
|
@@ -841,37 +841,37 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
841
841
|
setAuthorization(key, token) {
|
|
842
842
|
this.currentAuthKey = key;
|
|
843
843
|
this.currentAuthToken = token;
|
|
844
|
-
if (this.
|
|
844
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
845
845
|
return this.dashboardReference.setAuthorization(key, token);
|
|
846
846
|
}
|
|
847
|
-
if (!this.
|
|
847
|
+
if (!this.isWebComponentViewMode()) {
|
|
848
848
|
return SharedLib2.setAuthorization(this, this.iframe, key, token);
|
|
849
849
|
}
|
|
850
850
|
return Promise.reject();
|
|
851
851
|
}
|
|
852
852
|
refreshData(itemId) {
|
|
853
|
-
if (this.
|
|
853
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
854
854
|
return this.dashboardReference.refreshData(itemId);
|
|
855
855
|
}
|
|
856
|
-
if (!this.
|
|
856
|
+
if (!this.isWebComponentViewMode()) {
|
|
857
857
|
return itemId ? SharedLib2.refreshData(this, this.iframe, itemId) : SharedLib2.refreshData(this, this.iframe);
|
|
858
858
|
}
|
|
859
859
|
return Promise.reject();
|
|
860
860
|
}
|
|
861
861
|
reloadDashboard() {
|
|
862
|
-
if (this.
|
|
862
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
863
863
|
return this.dashboardReference.reloadDashboard();
|
|
864
864
|
}
|
|
865
|
-
if (!this.
|
|
865
|
+
if (!this.isWebComponentViewMode()) {
|
|
866
866
|
return SharedLib2.reloadDashboard(this, this.iframe);
|
|
867
867
|
}
|
|
868
868
|
return Promise.reject();
|
|
869
869
|
}
|
|
870
870
|
exportDashboard(format) {
|
|
871
|
-
if (this.
|
|
871
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
872
872
|
return this.dashboardReference.exportDashboard(format);
|
|
873
873
|
}
|
|
874
|
-
if (!this.
|
|
874
|
+
if (!this.isWebComponentViewMode()) {
|
|
875
875
|
return format ? SharedLib2.exportDashboard(this, this.iframe, format) : SharedLib2.exportDashboard(this, this.iframe);
|
|
876
876
|
}
|
|
877
877
|
return Promise.reject();
|
|
@@ -901,22 +901,22 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
901
901
|
editMode
|
|
902
902
|
});
|
|
903
903
|
}
|
|
904
|
-
if (this.
|
|
904
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
905
905
|
return this.dashboardReference.setEditMode(editMode);
|
|
906
906
|
}
|
|
907
|
-
if (!this.
|
|
907
|
+
if (!this.isWebComponentViewMode()) {
|
|
908
908
|
return SharedLib2.setEditMode(this, this.iframe, editMode);
|
|
909
909
|
}
|
|
910
910
|
return Promise.reject();
|
|
911
911
|
}
|
|
912
912
|
setPreview(preview) {
|
|
913
|
-
if (this.
|
|
913
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
914
914
|
return this.dashboardReference.setPreview(preview);
|
|
915
915
|
}
|
|
916
916
|
return SharedLib2.setPreview(this, this.iframe, preview);
|
|
917
917
|
}
|
|
918
|
-
|
|
919
|
-
return this.
|
|
918
|
+
isWebComponentViewMode() {
|
|
919
|
+
return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
|
|
920
920
|
}
|
|
921
921
|
};
|
|
922
922
|
__decorateClass([
|
|
@@ -997,13 +997,8 @@ __decorateClass([
|
|
|
997
997
|
(0, import_decorators.property)({ type: Object })
|
|
998
998
|
], LuzmoDashboard.prototype, "itemDimensions", 2);
|
|
999
999
|
__decorateClass([
|
|
1000
|
-
(0, import_decorators.property)(
|
|
1001
|
-
|
|
1002
|
-
fromAttribute: (value) => value === "true",
|
|
1003
|
-
toAttribute: String
|
|
1004
|
-
}
|
|
1005
|
-
})
|
|
1006
|
-
], LuzmoDashboard.prototype, "experimental", 2);
|
|
1000
|
+
(0, import_decorators.property)()
|
|
1001
|
+
], LuzmoDashboard.prototype, "embedMode", 2);
|
|
1007
1002
|
__decorateClass([
|
|
1008
1003
|
(0, import_decorators.property)({ attribute: false })
|
|
1009
1004
|
], LuzmoDashboard.prototype, "_containerId", 2);
|
|
@@ -1313,7 +1308,8 @@ var inputMap = {
|
|
|
1313
1308
|
authToken: "auth-token",
|
|
1314
1309
|
version: "version",
|
|
1315
1310
|
libVersion: "lib-version",
|
|
1316
|
-
aydHost: "ayd-host"
|
|
1311
|
+
aydHost: "ayd-host",
|
|
1312
|
+
availableDatasets: "available-datasets"
|
|
1317
1313
|
};
|
|
1318
1314
|
var embedChatTag = "luzmo-iq-embed-chat";
|
|
1319
1315
|
var chatComponentTag = "luzmo-iq-chat-component";
|
|
@@ -1326,6 +1322,7 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
|
|
|
1326
1322
|
this.libVersion = version + "-wc-luzmo";
|
|
1327
1323
|
this.remoteEntryServer = "http://localhost:4202/";
|
|
1328
1324
|
this.aydHost = "https://ayd.luzmo.com/";
|
|
1325
|
+
this.availableDatasets = [];
|
|
1329
1326
|
}
|
|
1330
1327
|
static {
|
|
1331
1328
|
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
@@ -1438,6 +1435,9 @@ __decorateClass([
|
|
|
1438
1435
|
__decorateClass([
|
|
1439
1436
|
(0, import_decorators3.property)()
|
|
1440
1437
|
], LuzmoIQEmbedChatComponent.prototype, "aydHost", 2);
|
|
1438
|
+
__decorateClass([
|
|
1439
|
+
(0, import_decorators3.property)({ type: Array })
|
|
1440
|
+
], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
|
|
1441
1441
|
if (!customElements.get(embedChatTag)) {
|
|
1442
1442
|
customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
|
|
1443
1443
|
}
|
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { property, query, state } from "lit/decorators.js";
|
|
|
24
24
|
import { styleMap } from "lit/directives/style-map.js";
|
|
25
25
|
|
|
26
26
|
// libs/embed-libs/embed/package.json
|
|
27
|
-
var version = "6.3.
|
|
27
|
+
var version = "6.3.7";
|
|
28
28
|
|
|
29
29
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
30
30
|
import * as SharedLib from "@luzmo/shared-embed";
|
|
@@ -333,7 +333,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
333
333
|
this.screenMode = "auto";
|
|
334
334
|
this.switchScreenModeOnResize = true;
|
|
335
335
|
this.editMode = "view";
|
|
336
|
-
this.
|
|
336
|
+
this.embedMode = "iframe";
|
|
337
337
|
this.iframeStyle = {};
|
|
338
338
|
this._containerStyle = {};
|
|
339
339
|
this._loaderStyle = {};
|
|
@@ -435,7 +435,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
435
435
|
}
|
|
436
436
|
initComponent() {
|
|
437
437
|
this.params = this._setOptions();
|
|
438
|
-
if (this.
|
|
438
|
+
if (this.isWebComponentViewMode()) {
|
|
439
439
|
SharedLib2.loadLibrary(this.params.appServer, dashboardRemote).then(async () => {
|
|
440
440
|
this.isLibraryLoaded = true;
|
|
441
441
|
await this.updateComplete;
|
|
@@ -520,7 +520,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
520
520
|
this.isInitCalled = true;
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
if (this.
|
|
523
|
+
if (this.isWebComponentViewMode()) {
|
|
524
524
|
if (this.dashboardReference) {
|
|
525
525
|
for (const [propertyName] of changedProperties.entries()) {
|
|
526
526
|
if (propertyName === "appSever") {
|
|
@@ -626,7 +626,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
626
626
|
defaultParameters.itemDimensions = this.itemDimensions;
|
|
627
627
|
}
|
|
628
628
|
if (this.appServer) {
|
|
629
|
-
this.appServer = this.
|
|
629
|
+
this.appServer = this.isWebComponentViewMode() ? SharedLib2.removeTrailingSlash(this.appServer) : SharedLib2.addTrailingSlash(this.appServer);
|
|
630
630
|
defaultParameters.appServer = this.appServer;
|
|
631
631
|
} else {
|
|
632
632
|
this.appServer = SharedLib2.addTrailingSlash(
|
|
@@ -635,7 +635,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
635
635
|
defaultParameters.appServer = this.appServer;
|
|
636
636
|
}
|
|
637
637
|
if (this.apiHost) {
|
|
638
|
-
this.apiHost = this.
|
|
638
|
+
this.apiHost = this.isWebComponentViewMode() ? SharedLib2.removeTrailingSlash(this.apiHost) : SharedLib2.addTrailingSlash(this.apiHost);
|
|
639
639
|
defaultParameters.apiHost = this.apiHost;
|
|
640
640
|
} else {
|
|
641
641
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
@@ -720,7 +720,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
720
720
|
</div>
|
|
721
721
|
</div>
|
|
722
722
|
`;
|
|
723
|
-
if (this.
|
|
723
|
+
if (this.isWebComponentViewMode()) {
|
|
724
724
|
toBeRenderedHTML = this.isLibraryLoaded ? html`
|
|
725
725
|
${this.dashboardId || this.dashboardSlug ? html`
|
|
726
726
|
<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
|
|
@@ -736,7 +736,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
736
736
|
${this.dashboardId || this.dashboardSlug ? html`
|
|
737
737
|
${loader}
|
|
738
738
|
<iframe
|
|
739
|
-
class="luzmo-embed-dashboard ${this.
|
|
739
|
+
class="luzmo-embed-dashboard ${this.isWebComponentViewMode() ? "" : `luzmo-embed-dashboard-ede`}"
|
|
740
740
|
id="${this._iframeId}"
|
|
741
741
|
name="${this._iframeId}"
|
|
742
742
|
style=${styleMap(this.iframeStyle)}
|
|
@@ -752,7 +752,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
752
752
|
`;
|
|
753
753
|
}
|
|
754
754
|
return html`
|
|
755
|
-
<div class="${luzmoEmbedContainerClass} ${this.
|
|
755
|
+
<div class="${luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${luzmoEmbedContainerClass}-ede`}">
|
|
756
756
|
<div
|
|
757
757
|
class="dashboard-container"
|
|
758
758
|
style=${styleMap(Object.assign({}, this._containerStyle, {
|
|
@@ -773,28 +773,28 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
773
773
|
}
|
|
774
774
|
// Public methods
|
|
775
775
|
getData(itemId) {
|
|
776
|
-
if (this.
|
|
776
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
777
777
|
return this.dashboardReference.getData(itemId);
|
|
778
778
|
}
|
|
779
|
-
if (!this.
|
|
779
|
+
if (!this.isWebComponentViewMode()) {
|
|
780
780
|
return SharedLib2.getData(this, this.iframe, itemId);
|
|
781
781
|
}
|
|
782
782
|
return Promise.reject();
|
|
783
783
|
}
|
|
784
784
|
getFilters() {
|
|
785
|
-
if (this.
|
|
785
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
786
786
|
return this.dashboardReference.getFilters();
|
|
787
787
|
}
|
|
788
|
-
if (!this.
|
|
788
|
+
if (!this.isWebComponentViewMode()) {
|
|
789
789
|
return SharedLib2.getFilters(this, this.iframe);
|
|
790
790
|
}
|
|
791
791
|
return Promise.reject();
|
|
792
792
|
}
|
|
793
793
|
setSelectedData(itemId, filters) {
|
|
794
|
-
if (this.
|
|
794
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
795
795
|
return this.dashboardReference.setSelectedData(itemId, filters);
|
|
796
796
|
}
|
|
797
|
-
if (!this.
|
|
797
|
+
if (!this.isWebComponentViewMode()) {
|
|
798
798
|
return SharedLib2.setSelectedData(this, this.iframe, itemId, filters);
|
|
799
799
|
}
|
|
800
800
|
return Promise.reject();
|
|
@@ -802,37 +802,37 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
802
802
|
setAuthorization(key, token) {
|
|
803
803
|
this.currentAuthKey = key;
|
|
804
804
|
this.currentAuthToken = token;
|
|
805
|
-
if (this.
|
|
805
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
806
806
|
return this.dashboardReference.setAuthorization(key, token);
|
|
807
807
|
}
|
|
808
|
-
if (!this.
|
|
808
|
+
if (!this.isWebComponentViewMode()) {
|
|
809
809
|
return SharedLib2.setAuthorization(this, this.iframe, key, token);
|
|
810
810
|
}
|
|
811
811
|
return Promise.reject();
|
|
812
812
|
}
|
|
813
813
|
refreshData(itemId) {
|
|
814
|
-
if (this.
|
|
814
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
815
815
|
return this.dashboardReference.refreshData(itemId);
|
|
816
816
|
}
|
|
817
|
-
if (!this.
|
|
817
|
+
if (!this.isWebComponentViewMode()) {
|
|
818
818
|
return itemId ? SharedLib2.refreshData(this, this.iframe, itemId) : SharedLib2.refreshData(this, this.iframe);
|
|
819
819
|
}
|
|
820
820
|
return Promise.reject();
|
|
821
821
|
}
|
|
822
822
|
reloadDashboard() {
|
|
823
|
-
if (this.
|
|
823
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
824
824
|
return this.dashboardReference.reloadDashboard();
|
|
825
825
|
}
|
|
826
|
-
if (!this.
|
|
826
|
+
if (!this.isWebComponentViewMode()) {
|
|
827
827
|
return SharedLib2.reloadDashboard(this, this.iframe);
|
|
828
828
|
}
|
|
829
829
|
return Promise.reject();
|
|
830
830
|
}
|
|
831
831
|
exportDashboard(format) {
|
|
832
|
-
if (this.
|
|
832
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
833
833
|
return this.dashboardReference.exportDashboard(format);
|
|
834
834
|
}
|
|
835
|
-
if (!this.
|
|
835
|
+
if (!this.isWebComponentViewMode()) {
|
|
836
836
|
return format ? SharedLib2.exportDashboard(this, this.iframe, format) : SharedLib2.exportDashboard(this, this.iframe);
|
|
837
837
|
}
|
|
838
838
|
return Promise.reject();
|
|
@@ -862,22 +862,22 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
862
862
|
editMode
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
if (this.
|
|
865
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
866
866
|
return this.dashboardReference.setEditMode(editMode);
|
|
867
867
|
}
|
|
868
|
-
if (!this.
|
|
868
|
+
if (!this.isWebComponentViewMode()) {
|
|
869
869
|
return SharedLib2.setEditMode(this, this.iframe, editMode);
|
|
870
870
|
}
|
|
871
871
|
return Promise.reject();
|
|
872
872
|
}
|
|
873
873
|
setPreview(preview) {
|
|
874
|
-
if (this.
|
|
874
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
875
875
|
return this.dashboardReference.setPreview(preview);
|
|
876
876
|
}
|
|
877
877
|
return SharedLib2.setPreview(this, this.iframe, preview);
|
|
878
878
|
}
|
|
879
|
-
|
|
880
|
-
return this.
|
|
879
|
+
isWebComponentViewMode() {
|
|
880
|
+
return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
|
|
881
881
|
}
|
|
882
882
|
};
|
|
883
883
|
__decorateClass([
|
|
@@ -958,13 +958,8 @@ __decorateClass([
|
|
|
958
958
|
property({ type: Object })
|
|
959
959
|
], LuzmoDashboard.prototype, "itemDimensions", 2);
|
|
960
960
|
__decorateClass([
|
|
961
|
-
property(
|
|
962
|
-
|
|
963
|
-
fromAttribute: (value) => value === "true",
|
|
964
|
-
toAttribute: String
|
|
965
|
-
}
|
|
966
|
-
})
|
|
967
|
-
], LuzmoDashboard.prototype, "experimental", 2);
|
|
961
|
+
property()
|
|
962
|
+
], LuzmoDashboard.prototype, "embedMode", 2);
|
|
968
963
|
__decorateClass([
|
|
969
964
|
property({ attribute: false })
|
|
970
965
|
], LuzmoDashboard.prototype, "_containerId", 2);
|
|
@@ -1274,7 +1269,8 @@ var inputMap = {
|
|
|
1274
1269
|
authToken: "auth-token",
|
|
1275
1270
|
version: "version",
|
|
1276
1271
|
libVersion: "lib-version",
|
|
1277
|
-
aydHost: "ayd-host"
|
|
1272
|
+
aydHost: "ayd-host",
|
|
1273
|
+
availableDatasets: "available-datasets"
|
|
1278
1274
|
};
|
|
1279
1275
|
var embedChatTag = "luzmo-iq-embed-chat";
|
|
1280
1276
|
var chatComponentTag = "luzmo-iq-chat-component";
|
|
@@ -1287,6 +1283,7 @@ var LuzmoIQEmbedChatComponent = class extends LitElement3 {
|
|
|
1287
1283
|
this.libVersion = version + "-wc-luzmo";
|
|
1288
1284
|
this.remoteEntryServer = "http://localhost:4202/";
|
|
1289
1285
|
this.aydHost = "https://ayd.luzmo.com/";
|
|
1286
|
+
this.availableDatasets = [];
|
|
1290
1287
|
}
|
|
1291
1288
|
static {
|
|
1292
1289
|
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
@@ -1399,6 +1396,9 @@ __decorateClass([
|
|
|
1399
1396
|
__decorateClass([
|
|
1400
1397
|
property3()
|
|
1401
1398
|
], LuzmoIQEmbedChatComponent.prototype, "aydHost", 2);
|
|
1399
|
+
__decorateClass([
|
|
1400
|
+
property3({ type: Array })
|
|
1401
|
+
], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
|
|
1402
1402
|
if (!customElements.get(embedChatTag)) {
|
|
1403
1403
|
customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
|
|
1404
1404
|
}
|
package/luzmo-embed.min.js
CHANGED
|
@@ -645,8 +645,8 @@ var getAccessibleDashboards = async (dashboardComponent) => {
|
|
|
645
645
|
void (() => {
|
|
646
646
|
try {
|
|
647
647
|
const responsePromise = window.fetch(
|
|
648
|
-
// With
|
|
649
|
-
// Fixes incorrect url with
|
|
648
|
+
// With embedMode="webComponent" URLs remove the trailing slash, since the web component expects them to not have it.
|
|
649
|
+
// Fixes incorrect url with embedMode="webComponent"
|
|
650
650
|
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
651
651
|
{
|
|
652
652
|
method: "POST",
|
|
@@ -696,8 +696,8 @@ var getAccessibleDashboards = async (dashboardComponent) => {
|
|
|
696
696
|
try {
|
|
697
697
|
fetchUser.then((authorizationData) => {
|
|
698
698
|
const responsePromise = window.fetch(
|
|
699
|
-
// With
|
|
700
|
-
// Fixes incorrect url with
|
|
699
|
+
// With embedMode="webComponent" URLs remove the trailing slash, since the web component expects them to not have it.
|
|
700
|
+
// Fixes incorrect url with embedMode="webComponent"
|
|
701
701
|
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
702
702
|
{
|
|
703
703
|
method: "POST",
|
|
@@ -2026,7 +2026,7 @@ var se = e5(class extends i3 {
|
|
|
2026
2026
|
});
|
|
2027
2027
|
|
|
2028
2028
|
// libs/embed-libs/embed/package.json
|
|
2029
|
-
var version = "6.3.
|
|
2029
|
+
var version = "6.3.7";
|
|
2030
2030
|
|
|
2031
2031
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
2032
2032
|
var LuzmoService = class {
|
|
@@ -2331,7 +2331,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2331
2331
|
this.screenMode = "auto";
|
|
2332
2332
|
this.switchScreenModeOnResize = true;
|
|
2333
2333
|
this.editMode = "view";
|
|
2334
|
-
this.
|
|
2334
|
+
this.embedMode = "iframe";
|
|
2335
2335
|
this.iframeStyle = {};
|
|
2336
2336
|
this._containerStyle = {};
|
|
2337
2337
|
this._loaderStyle = {};
|
|
@@ -2433,7 +2433,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2433
2433
|
}
|
|
2434
2434
|
initComponent() {
|
|
2435
2435
|
this.params = this._setOptions();
|
|
2436
|
-
if (this.
|
|
2436
|
+
if (this.isWebComponentViewMode()) {
|
|
2437
2437
|
loadLibrary(this.params.appServer, dashboardRemote).then(async () => {
|
|
2438
2438
|
this.isLibraryLoaded = true;
|
|
2439
2439
|
await this.updateComplete;
|
|
@@ -2518,7 +2518,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2518
2518
|
this.isInitCalled = true;
|
|
2519
2519
|
return;
|
|
2520
2520
|
}
|
|
2521
|
-
if (this.
|
|
2521
|
+
if (this.isWebComponentViewMode()) {
|
|
2522
2522
|
if (this.dashboardReference) {
|
|
2523
2523
|
for (const [propertyName] of changedProperties.entries()) {
|
|
2524
2524
|
if (propertyName === "appSever") {
|
|
@@ -2624,7 +2624,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2624
2624
|
defaultParameters.itemDimensions = this.itemDimensions;
|
|
2625
2625
|
}
|
|
2626
2626
|
if (this.appServer) {
|
|
2627
|
-
this.appServer = this.
|
|
2627
|
+
this.appServer = this.isWebComponentViewMode() ? removeTrailingSlash(this.appServer) : addTrailingSlash(this.appServer);
|
|
2628
2628
|
defaultParameters.appServer = this.appServer;
|
|
2629
2629
|
} else {
|
|
2630
2630
|
this.appServer = addTrailingSlash(
|
|
@@ -2633,7 +2633,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2633
2633
|
defaultParameters.appServer = this.appServer;
|
|
2634
2634
|
}
|
|
2635
2635
|
if (this.apiHost) {
|
|
2636
|
-
this.apiHost = this.
|
|
2636
|
+
this.apiHost = this.isWebComponentViewMode() ? removeTrailingSlash(this.apiHost) : addTrailingSlash(this.apiHost);
|
|
2637
2637
|
defaultParameters.apiHost = this.apiHost;
|
|
2638
2638
|
} else {
|
|
2639
2639
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
@@ -2718,7 +2718,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2718
2718
|
</div>
|
|
2719
2719
|
</div>
|
|
2720
2720
|
`;
|
|
2721
|
-
if (this.
|
|
2721
|
+
if (this.isWebComponentViewMode()) {
|
|
2722
2722
|
toBeRenderedHTML = this.isLibraryLoaded ? ke`
|
|
2723
2723
|
${this.dashboardId || this.dashboardSlug ? ke`
|
|
2724
2724
|
<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
|
|
@@ -2734,7 +2734,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2734
2734
|
${this.dashboardId || this.dashboardSlug ? ke`
|
|
2735
2735
|
${loader}
|
|
2736
2736
|
<iframe
|
|
2737
|
-
class="luzmo-embed-dashboard ${this.
|
|
2737
|
+
class="luzmo-embed-dashboard ${this.isWebComponentViewMode() ? "" : `luzmo-embed-dashboard-ede`}"
|
|
2738
2738
|
id="${this._iframeId}"
|
|
2739
2739
|
name="${this._iframeId}"
|
|
2740
2740
|
style=${se(this.iframeStyle)}
|
|
@@ -2750,7 +2750,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2750
2750
|
`;
|
|
2751
2751
|
}
|
|
2752
2752
|
return ke`
|
|
2753
|
-
<div class="${luzmoEmbedContainerClass} ${this.
|
|
2753
|
+
<div class="${luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${luzmoEmbedContainerClass}-ede`}">
|
|
2754
2754
|
<div
|
|
2755
2755
|
class="dashboard-container"
|
|
2756
2756
|
style=${se(Object.assign({}, this._containerStyle, {
|
|
@@ -2771,28 +2771,28 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2771
2771
|
}
|
|
2772
2772
|
// Public methods
|
|
2773
2773
|
getData(itemId) {
|
|
2774
|
-
if (this.
|
|
2774
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2775
2775
|
return this.dashboardReference.getData(itemId);
|
|
2776
2776
|
}
|
|
2777
|
-
if (!this.
|
|
2777
|
+
if (!this.isWebComponentViewMode()) {
|
|
2778
2778
|
return getData(this, this.iframe, itemId);
|
|
2779
2779
|
}
|
|
2780
2780
|
return Promise.reject();
|
|
2781
2781
|
}
|
|
2782
2782
|
getFilters() {
|
|
2783
|
-
if (this.
|
|
2783
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2784
2784
|
return this.dashboardReference.getFilters();
|
|
2785
2785
|
}
|
|
2786
|
-
if (!this.
|
|
2786
|
+
if (!this.isWebComponentViewMode()) {
|
|
2787
2787
|
return getFilters(this, this.iframe);
|
|
2788
2788
|
}
|
|
2789
2789
|
return Promise.reject();
|
|
2790
2790
|
}
|
|
2791
2791
|
setSelectedData(itemId, filters) {
|
|
2792
|
-
if (this.
|
|
2792
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2793
2793
|
return this.dashboardReference.setSelectedData(itemId, filters);
|
|
2794
2794
|
}
|
|
2795
|
-
if (!this.
|
|
2795
|
+
if (!this.isWebComponentViewMode()) {
|
|
2796
2796
|
return setSelectedData(this, this.iframe, itemId, filters);
|
|
2797
2797
|
}
|
|
2798
2798
|
return Promise.reject();
|
|
@@ -2800,37 +2800,37 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2800
2800
|
setAuthorization(key, token) {
|
|
2801
2801
|
this.currentAuthKey = key;
|
|
2802
2802
|
this.currentAuthToken = token;
|
|
2803
|
-
if (this.
|
|
2803
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2804
2804
|
return this.dashboardReference.setAuthorization(key, token);
|
|
2805
2805
|
}
|
|
2806
|
-
if (!this.
|
|
2806
|
+
if (!this.isWebComponentViewMode()) {
|
|
2807
2807
|
return setAuthorization(this, this.iframe, key, token);
|
|
2808
2808
|
}
|
|
2809
2809
|
return Promise.reject();
|
|
2810
2810
|
}
|
|
2811
2811
|
refreshData(itemId) {
|
|
2812
|
-
if (this.
|
|
2812
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2813
2813
|
return this.dashboardReference.refreshData(itemId);
|
|
2814
2814
|
}
|
|
2815
|
-
if (!this.
|
|
2815
|
+
if (!this.isWebComponentViewMode()) {
|
|
2816
2816
|
return itemId ? refreshData(this, this.iframe, itemId) : refreshData(this, this.iframe);
|
|
2817
2817
|
}
|
|
2818
2818
|
return Promise.reject();
|
|
2819
2819
|
}
|
|
2820
2820
|
reloadDashboard() {
|
|
2821
|
-
if (this.
|
|
2821
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2822
2822
|
return this.dashboardReference.reloadDashboard();
|
|
2823
2823
|
}
|
|
2824
|
-
if (!this.
|
|
2824
|
+
if (!this.isWebComponentViewMode()) {
|
|
2825
2825
|
return reloadDashboard(this, this.iframe);
|
|
2826
2826
|
}
|
|
2827
2827
|
return Promise.reject();
|
|
2828
2828
|
}
|
|
2829
2829
|
exportDashboard(format) {
|
|
2830
|
-
if (this.
|
|
2830
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2831
2831
|
return this.dashboardReference.exportDashboard(format);
|
|
2832
2832
|
}
|
|
2833
|
-
if (!this.
|
|
2833
|
+
if (!this.isWebComponentViewMode()) {
|
|
2834
2834
|
return format ? exportDashboard(this, this.iframe, format) : exportDashboard(this, this.iframe);
|
|
2835
2835
|
}
|
|
2836
2836
|
return Promise.reject();
|
|
@@ -2860,22 +2860,22 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2860
2860
|
editMode
|
|
2861
2861
|
});
|
|
2862
2862
|
}
|
|
2863
|
-
if (this.
|
|
2863
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2864
2864
|
return this.dashboardReference.setEditMode(editMode);
|
|
2865
2865
|
}
|
|
2866
|
-
if (!this.
|
|
2866
|
+
if (!this.isWebComponentViewMode()) {
|
|
2867
2867
|
return setEditMode(this, this.iframe, editMode);
|
|
2868
2868
|
}
|
|
2869
2869
|
return Promise.reject();
|
|
2870
2870
|
}
|
|
2871
2871
|
setPreview(preview) {
|
|
2872
|
-
if (this.
|
|
2872
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2873
2873
|
return this.dashboardReference.setPreview(preview);
|
|
2874
2874
|
}
|
|
2875
2875
|
return setPreview(this, this.iframe, preview);
|
|
2876
2876
|
}
|
|
2877
|
-
|
|
2878
|
-
return this.
|
|
2877
|
+
isWebComponentViewMode() {
|
|
2878
|
+
return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
|
|
2879
2879
|
}
|
|
2880
2880
|
};
|
|
2881
2881
|
__decorateClass([
|
|
@@ -2956,13 +2956,8 @@ __decorateClass([
|
|
|
2956
2956
|
n4({ type: Object })
|
|
2957
2957
|
], LuzmoDashboard.prototype, "itemDimensions", 2);
|
|
2958
2958
|
__decorateClass([
|
|
2959
|
-
n4(
|
|
2960
|
-
|
|
2961
|
-
fromAttribute: (value) => value === "true",
|
|
2962
|
-
toAttribute: String
|
|
2963
|
-
}
|
|
2964
|
-
})
|
|
2965
|
-
], LuzmoDashboard.prototype, "experimental", 2);
|
|
2959
|
+
n4()
|
|
2960
|
+
], LuzmoDashboard.prototype, "embedMode", 2);
|
|
2966
2961
|
__decorateClass([
|
|
2967
2962
|
n4({ attribute: false })
|
|
2968
2963
|
], LuzmoDashboard.prototype, "_containerId", 2);
|
|
@@ -3266,7 +3261,8 @@ var inputMap = {
|
|
|
3266
3261
|
authToken: "auth-token",
|
|
3267
3262
|
version: "version",
|
|
3268
3263
|
libVersion: "lib-version",
|
|
3269
|
-
aydHost: "ayd-host"
|
|
3264
|
+
aydHost: "ayd-host",
|
|
3265
|
+
availableDatasets: "available-datasets"
|
|
3270
3266
|
};
|
|
3271
3267
|
var embedChatTag = "luzmo-iq-embed-chat";
|
|
3272
3268
|
var chatComponentTag = "luzmo-iq-chat-component";
|
|
@@ -3279,6 +3275,7 @@ var LuzmoIQEmbedChatComponent = class extends h3 {
|
|
|
3279
3275
|
this.libVersion = version + "-wc-luzmo";
|
|
3280
3276
|
this.remoteEntryServer = "http://localhost:4202/";
|
|
3281
3277
|
this.aydHost = "https://ayd.luzmo.com/";
|
|
3278
|
+
this.availableDatasets = [];
|
|
3282
3279
|
}
|
|
3283
3280
|
static {
|
|
3284
3281
|
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
@@ -3391,6 +3388,9 @@ __decorateClass([
|
|
|
3391
3388
|
__decorateClass([
|
|
3392
3389
|
n4()
|
|
3393
3390
|
], LuzmoIQEmbedChatComponent.prototype, "aydHost", 2);
|
|
3391
|
+
__decorateClass([
|
|
3392
|
+
n4({ type: Array })
|
|
3393
|
+
], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
|
|
3394
3394
|
if (!customElements.get(embedChatTag)) {
|
|
3395
3395
|
customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
|
|
3396
3396
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FilterGroup } from '@luzmo/dashboard-contents-types';
|
|
2
2
|
import * as SharedLib from '@luzmo/shared-embed';
|
|
3
|
-
import { CombinedSelectedDataInput, LuzmoElement } from '@luzmo/shared-embed';
|
|
3
|
+
import { CombinedSelectedDataInput, DashboardInputs, LuzmoElement } from '@luzmo/shared-embed';
|
|
4
4
|
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
5
5
|
export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6LuzmoDashboard {
|
|
6
6
|
container: HTMLElement;
|
|
@@ -27,7 +27,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
27
27
|
timezoneId?: SharedLib.DashboardInputs['timezoneId'];
|
|
28
28
|
apiHost?: SharedLib.DashboardInputs['apiHost'];
|
|
29
29
|
itemDimensions: SharedLib.DashboardInputs['itemDimensions'];
|
|
30
|
-
|
|
30
|
+
embedMode: DashboardInputs['embedMode'];
|
|
31
31
|
_containerId: string;
|
|
32
32
|
_iframeId: string;
|
|
33
33
|
params: SharedLib.DashboardContentParams;
|
|
@@ -91,5 +91,5 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
91
91
|
addFilters(itemId: string, filters: FilterGroup[]): Promise<SharedLib.AddFilters>;
|
|
92
92
|
setEditMode(editMode?: SharedLib.DashboardEditMode): Promise<SharedLib.SetEditMode>;
|
|
93
93
|
setPreview(preview: boolean): Promise<SharedLib.SetPreview>;
|
|
94
|
-
|
|
94
|
+
isWebComponentViewMode(): boolean;
|
|
95
95
|
}
|
|
@@ -12,6 +12,7 @@ export declare class LuzmoIQEmbedChatComponent extends LitElement {
|
|
|
12
12
|
libVersion?: string;
|
|
13
13
|
remoteEntryServer: string;
|
|
14
14
|
aydHost: string;
|
|
15
|
+
availableDatasets: string[];
|
|
15
16
|
chartElement: HTMLElement;
|
|
16
17
|
static styles: import("lit").CSSResult;
|
|
17
18
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|