@luzmo/embed 6.3.6 → 6.3.8
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/README.md +21 -20
- package/index.cjs +39 -35
- package/index.js +39 -35
- package/luzmo-embed.min.js +50 -41
- package/package.json +2 -2
- package/src/lib/dashboard-component/dashboard-base.d.ts +4 -3
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.8] - 2025-03-20
|
|
6
|
+
|
|
7
|
+
### Updates
|
|
8
|
+
|
|
9
|
+
- Added `editorLanguage` input to set the language of the dashboard editor
|
|
10
|
+
|
|
11
|
+
## [6.3.7] - 2025-03-04
|
|
12
|
+
|
|
13
|
+
### Updates
|
|
14
|
+
|
|
15
|
+
- Rename "experimental" input to "embedMode" in dashboard component
|
|
16
|
+
|
|
5
17
|
## [6.3.6] - 2025-02-27
|
|
6
18
|
|
|
7
19
|
### Updates
|
package/README.md
CHANGED
|
@@ -169,26 +169,27 @@ OR
|
|
|
169
169
|
|
|
170
170
|
Below a list of available properties on the dashboard web component
|
|
171
171
|
|
|
172
|
-
| Property | Type | Description
|
|
173
|
-
|
|
174
|
-
| `dashboardId` | string | The id of the Luzmo dashboard you wish to embed
|
|
175
|
-
| `dashboardSlug` | string | The slug of the Luzmo dashboard you wish to embed (if a dashboardId is supplied that one will be used)
|
|
176
|
-
| `itemId` | string | The id of the Luzmo item you wish to embed. The `dashboardId` should be provided as well if you what to embed just a Luzmo item.
|
|
177
|
-
| `itemDimensions` | { width: number/string; height: number/string; } | width and height of item only applies when itemId is provided. Accepts a JSON string.
|
|
178
|
-
| `authKey` | string | Authorization key generated via Luzmo API
|
|
179
|
-
| `authToken` | string | Authorization token generated via Luzmo API
|
|
180
|
-
| `language` | string | The language of the dashboard: eg. 'en' (Default: 'auto')
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
183
|
-
| `
|
|
184
|
-
| `
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
189
|
-
| `
|
|
190
|
-
| `
|
|
191
|
-
| `
|
|
172
|
+
| Property | Type | Description |
|
|
173
|
+
|----------------------------|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
174
|
+
| `dashboardId` | string | The id of the Luzmo dashboard you wish to embed |
|
|
175
|
+
| `dashboardSlug` | string | The slug of the Luzmo dashboard you wish to embed (if a dashboardId is supplied that one will be used) |
|
|
176
|
+
| `itemId` | string | The id of the Luzmo item you wish to embed. The `dashboardId` should be provided as well if you what to embed just a Luzmo item. |
|
|
177
|
+
| `itemDimensions` | { width: number/string; height: number/string; } | width and height of item only applies when itemId is provided. Accepts a JSON string. |
|
|
178
|
+
| `authKey` | string | Authorization key generated via Luzmo API |
|
|
179
|
+
| `authToken` | string | Authorization token generated via Luzmo API |
|
|
180
|
+
| `language` | string | The language of the dashboard: eg. 'en' (Default: 'auto') |
|
|
181
|
+
| `editorLanguage` | string | The language of the dashboard editor: eg. 'en' (Default: 'auto') |
|
|
182
|
+
| `screenMode` | string | The screen mode of your dashboard: 'mobile', 'tablet', 'desktop', 'largeScreen', 'fixed' or 'auto' (Default: 'auto') |
|
|
183
|
+
| `switchScreenModeOnResize` | boolean | true: the embedded dashboard can switch screenModes on resize of the container , false: Dashboard will keep the same screenMode (Default: true) |
|
|
184
|
+
| `loaderBackground` | string | Background color of the loader element (Default: '#f9f9f9') |
|
|
185
|
+
| `loaderFontColor` | string | Font color of the text of the loaders (Default: '#5a5a5a') |
|
|
186
|
+
| `loaderSpinnerColor` | string | Spinner color of the loader (Default: 'rgba(255, 165, 0, 0.7)') |
|
|
187
|
+
| `loaderSpinnerBackground` | string | Background color of the spinner (Default: 'rgba(169, 169, 169, 0.14)') |
|
|
188
|
+
| `appServer` | string | Tenancy of luzmo.com to connect to (Default: 'https://app.luzmo.com/' for US set appServer to 'https://app.us.luzmo.com/') |
|
|
189
|
+
| `timezoneId` | string | The timezone you you wish to use in your dashboard. This timezone id needs to be a valid id that is available in the [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List), for example: Europe/Brussels or America/New_York. |
|
|
190
|
+
| `apiHost` | string | API server to connect to (Default: 'https://api.luzmo.com/' , for US set apiHost to 'https://api.us.luzmo.com/') |
|
|
191
|
+
| `editMode` | string | Specifies if the embedded dashboard should be editable or not. Accepted values: "view" , "editLimited" , "editFull" . Use "view" if you don't want the embedded dashboard to be editable. (Default: "view" ) |
|
|
192
|
+
| `mainColor` | string | Optional override of the main color used in the whitelabeling of the embedded dashboard editor. If not provided, the main color of the whitelabeling colors set on the organization will be used. Should be specified as a string of rgb values (i.e. "rgb(50,50,50)"). |
|
|
192
193
|
| `accentColor` | string | Optional override of the accent color used in the whitelabeling of the embedded dashboard editor. If not provided, the accent color of the whitelabeling colors set on the organization will be used. Should be specified as a string of rgb values (i.e. "rgb(50,50,50)"). |
|
|
193
194
|
|
|
194
195
|
<br/>
|
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.8";
|
|
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);
|
|
@@ -369,10 +369,11 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
369
369
|
constructor() {
|
|
370
370
|
super();
|
|
371
371
|
this.language = "auto";
|
|
372
|
+
this.editorLanguage = "auto";
|
|
372
373
|
this.screenMode = "auto";
|
|
373
374
|
this.switchScreenModeOnResize = true;
|
|
374
375
|
this.editMode = "view";
|
|
375
|
-
this.
|
|
376
|
+
this.embedMode = "iframe";
|
|
376
377
|
this.iframeStyle = {};
|
|
377
378
|
this._containerStyle = {};
|
|
378
379
|
this._loaderStyle = {};
|
|
@@ -395,6 +396,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
395
396
|
dashboardSlug: "dashboard-slug",
|
|
396
397
|
itemId: "item-id",
|
|
397
398
|
language: "language",
|
|
399
|
+
editorLanguage: "editorLanguage",
|
|
398
400
|
qeVersion: "qe-version",
|
|
399
401
|
screenMode: "screen-mode",
|
|
400
402
|
switchScreenModeOnResize: "switch-screen-mode-on-resize",
|
|
@@ -474,7 +476,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
474
476
|
}
|
|
475
477
|
initComponent() {
|
|
476
478
|
this.params = this._setOptions();
|
|
477
|
-
if (this.
|
|
479
|
+
if (this.isWebComponentViewMode()) {
|
|
478
480
|
SharedLib2.loadLibrary(this.params.appServer, dashboardRemote).then(async () => {
|
|
479
481
|
this.isLibraryLoaded = true;
|
|
480
482
|
await this.updateComplete;
|
|
@@ -537,6 +539,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
537
539
|
"dashboardSlug",
|
|
538
540
|
"itemId",
|
|
539
541
|
"language",
|
|
542
|
+
"editorLanguage",
|
|
540
543
|
"qeVersion",
|
|
541
544
|
"theme",
|
|
542
545
|
"editMode",
|
|
@@ -559,7 +562,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
559
562
|
this.isInitCalled = true;
|
|
560
563
|
return;
|
|
561
564
|
}
|
|
562
|
-
if (this.
|
|
565
|
+
if (this.isWebComponentViewMode()) {
|
|
563
566
|
if (this.dashboardReference) {
|
|
564
567
|
for (const [propertyName] of changedProperties.entries()) {
|
|
565
568
|
if (propertyName === "appSever") {
|
|
@@ -621,6 +624,9 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
621
624
|
if (this.language) {
|
|
622
625
|
defaultParameters.language = this.language;
|
|
623
626
|
}
|
|
627
|
+
if (this.editorLanguage) {
|
|
628
|
+
defaultParameters.editorLanguage = this.editorLanguage;
|
|
629
|
+
}
|
|
624
630
|
if (this.qeVersion) {
|
|
625
631
|
defaultParameters.qeVersion = this.qeVersion;
|
|
626
632
|
}
|
|
@@ -665,7 +671,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
665
671
|
defaultParameters.itemDimensions = this.itemDimensions;
|
|
666
672
|
}
|
|
667
673
|
if (this.appServer) {
|
|
668
|
-
this.appServer = this.
|
|
674
|
+
this.appServer = this.isWebComponentViewMode() ? SharedLib2.removeTrailingSlash(this.appServer) : SharedLib2.addTrailingSlash(this.appServer);
|
|
669
675
|
defaultParameters.appServer = this.appServer;
|
|
670
676
|
} else {
|
|
671
677
|
this.appServer = SharedLib2.addTrailingSlash(
|
|
@@ -674,7 +680,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
674
680
|
defaultParameters.appServer = this.appServer;
|
|
675
681
|
}
|
|
676
682
|
if (this.apiHost) {
|
|
677
|
-
this.apiHost = this.
|
|
683
|
+
this.apiHost = this.isWebComponentViewMode() ? SharedLib2.removeTrailingSlash(this.apiHost) : SharedLib2.addTrailingSlash(this.apiHost);
|
|
678
684
|
defaultParameters.apiHost = this.apiHost;
|
|
679
685
|
} else {
|
|
680
686
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
@@ -759,7 +765,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
759
765
|
</div>
|
|
760
766
|
</div>
|
|
761
767
|
`;
|
|
762
|
-
if (this.
|
|
768
|
+
if (this.isWebComponentViewMode()) {
|
|
763
769
|
toBeRenderedHTML = this.isLibraryLoaded ? import_lit2.html`
|
|
764
770
|
${this.dashboardId || this.dashboardSlug ? import_lit2.html`
|
|
765
771
|
<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
|
|
@@ -775,7 +781,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
775
781
|
${this.dashboardId || this.dashboardSlug ? import_lit2.html`
|
|
776
782
|
${loader}
|
|
777
783
|
<iframe
|
|
778
|
-
class="luzmo-embed-dashboard ${this.
|
|
784
|
+
class="luzmo-embed-dashboard ${this.isWebComponentViewMode() ? "" : `luzmo-embed-dashboard-ede`}"
|
|
779
785
|
id="${this._iframeId}"
|
|
780
786
|
name="${this._iframeId}"
|
|
781
787
|
style=${(0, import_style_map.styleMap)(this.iframeStyle)}
|
|
@@ -791,7 +797,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
791
797
|
`;
|
|
792
798
|
}
|
|
793
799
|
return import_lit2.html`
|
|
794
|
-
<div class="${import_shared_embed.luzmoEmbedContainerClass} ${this.
|
|
800
|
+
<div class="${import_shared_embed.luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${import_shared_embed.luzmoEmbedContainerClass}-ede`}">
|
|
795
801
|
<div
|
|
796
802
|
class="dashboard-container"
|
|
797
803
|
style=${(0, import_style_map.styleMap)(Object.assign({}, this._containerStyle, {
|
|
@@ -812,28 +818,28 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
812
818
|
}
|
|
813
819
|
// Public methods
|
|
814
820
|
getData(itemId) {
|
|
815
|
-
if (this.
|
|
821
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
816
822
|
return this.dashboardReference.getData(itemId);
|
|
817
823
|
}
|
|
818
|
-
if (!this.
|
|
824
|
+
if (!this.isWebComponentViewMode()) {
|
|
819
825
|
return SharedLib2.getData(this, this.iframe, itemId);
|
|
820
826
|
}
|
|
821
827
|
return Promise.reject();
|
|
822
828
|
}
|
|
823
829
|
getFilters() {
|
|
824
|
-
if (this.
|
|
830
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
825
831
|
return this.dashboardReference.getFilters();
|
|
826
832
|
}
|
|
827
|
-
if (!this.
|
|
833
|
+
if (!this.isWebComponentViewMode()) {
|
|
828
834
|
return SharedLib2.getFilters(this, this.iframe);
|
|
829
835
|
}
|
|
830
836
|
return Promise.reject();
|
|
831
837
|
}
|
|
832
838
|
setSelectedData(itemId, filters) {
|
|
833
|
-
if (this.
|
|
839
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
834
840
|
return this.dashboardReference.setSelectedData(itemId, filters);
|
|
835
841
|
}
|
|
836
|
-
if (!this.
|
|
842
|
+
if (!this.isWebComponentViewMode()) {
|
|
837
843
|
return SharedLib2.setSelectedData(this, this.iframe, itemId, filters);
|
|
838
844
|
}
|
|
839
845
|
return Promise.reject();
|
|
@@ -841,37 +847,37 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
841
847
|
setAuthorization(key, token) {
|
|
842
848
|
this.currentAuthKey = key;
|
|
843
849
|
this.currentAuthToken = token;
|
|
844
|
-
if (this.
|
|
850
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
845
851
|
return this.dashboardReference.setAuthorization(key, token);
|
|
846
852
|
}
|
|
847
|
-
if (!this.
|
|
853
|
+
if (!this.isWebComponentViewMode()) {
|
|
848
854
|
return SharedLib2.setAuthorization(this, this.iframe, key, token);
|
|
849
855
|
}
|
|
850
856
|
return Promise.reject();
|
|
851
857
|
}
|
|
852
858
|
refreshData(itemId) {
|
|
853
|
-
if (this.
|
|
859
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
854
860
|
return this.dashboardReference.refreshData(itemId);
|
|
855
861
|
}
|
|
856
|
-
if (!this.
|
|
862
|
+
if (!this.isWebComponentViewMode()) {
|
|
857
863
|
return itemId ? SharedLib2.refreshData(this, this.iframe, itemId) : SharedLib2.refreshData(this, this.iframe);
|
|
858
864
|
}
|
|
859
865
|
return Promise.reject();
|
|
860
866
|
}
|
|
861
867
|
reloadDashboard() {
|
|
862
|
-
if (this.
|
|
868
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
863
869
|
return this.dashboardReference.reloadDashboard();
|
|
864
870
|
}
|
|
865
|
-
if (!this.
|
|
871
|
+
if (!this.isWebComponentViewMode()) {
|
|
866
872
|
return SharedLib2.reloadDashboard(this, this.iframe);
|
|
867
873
|
}
|
|
868
874
|
return Promise.reject();
|
|
869
875
|
}
|
|
870
876
|
exportDashboard(format) {
|
|
871
|
-
if (this.
|
|
877
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
872
878
|
return this.dashboardReference.exportDashboard(format);
|
|
873
879
|
}
|
|
874
|
-
if (!this.
|
|
880
|
+
if (!this.isWebComponentViewMode()) {
|
|
875
881
|
return format ? SharedLib2.exportDashboard(this, this.iframe, format) : SharedLib2.exportDashboard(this, this.iframe);
|
|
876
882
|
}
|
|
877
883
|
return Promise.reject();
|
|
@@ -901,22 +907,22 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
901
907
|
editMode
|
|
902
908
|
});
|
|
903
909
|
}
|
|
904
|
-
if (this.
|
|
910
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
905
911
|
return this.dashboardReference.setEditMode(editMode);
|
|
906
912
|
}
|
|
907
|
-
if (!this.
|
|
913
|
+
if (!this.isWebComponentViewMode()) {
|
|
908
914
|
return SharedLib2.setEditMode(this, this.iframe, editMode);
|
|
909
915
|
}
|
|
910
916
|
return Promise.reject();
|
|
911
917
|
}
|
|
912
918
|
setPreview(preview) {
|
|
913
|
-
if (this.
|
|
919
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
914
920
|
return this.dashboardReference.setPreview(preview);
|
|
915
921
|
}
|
|
916
922
|
return SharedLib2.setPreview(this, this.iframe, preview);
|
|
917
923
|
}
|
|
918
|
-
|
|
919
|
-
return this.
|
|
924
|
+
isWebComponentViewMode() {
|
|
925
|
+
return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
|
|
920
926
|
}
|
|
921
927
|
};
|
|
922
928
|
__decorateClass([
|
|
@@ -940,6 +946,9 @@ __decorateClass([
|
|
|
940
946
|
__decorateClass([
|
|
941
947
|
(0, import_decorators.property)()
|
|
942
948
|
], LuzmoDashboard.prototype, "language", 2);
|
|
949
|
+
__decorateClass([
|
|
950
|
+
(0, import_decorators.property)()
|
|
951
|
+
], LuzmoDashboard.prototype, "editorLanguage", 2);
|
|
943
952
|
__decorateClass([
|
|
944
953
|
(0, import_decorators.property)()
|
|
945
954
|
], LuzmoDashboard.prototype, "qeVersion", 2);
|
|
@@ -997,13 +1006,8 @@ __decorateClass([
|
|
|
997
1006
|
(0, import_decorators.property)({ type: Object })
|
|
998
1007
|
], LuzmoDashboard.prototype, "itemDimensions", 2);
|
|
999
1008
|
__decorateClass([
|
|
1000
|
-
(0, import_decorators.property)(
|
|
1001
|
-
|
|
1002
|
-
fromAttribute: (value) => value === "true",
|
|
1003
|
-
toAttribute: String
|
|
1004
|
-
}
|
|
1005
|
-
})
|
|
1006
|
-
], LuzmoDashboard.prototype, "experimental", 2);
|
|
1009
|
+
(0, import_decorators.property)()
|
|
1010
|
+
], LuzmoDashboard.prototype, "embedMode", 2);
|
|
1007
1011
|
__decorateClass([
|
|
1008
1012
|
(0, import_decorators.property)({ attribute: false })
|
|
1009
1013
|
], LuzmoDashboard.prototype, "_containerId", 2);
|
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.8";
|
|
28
28
|
|
|
29
29
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
30
30
|
import * as SharedLib from "@luzmo/shared-embed";
|
|
@@ -330,10 +330,11 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
330
330
|
constructor() {
|
|
331
331
|
super();
|
|
332
332
|
this.language = "auto";
|
|
333
|
+
this.editorLanguage = "auto";
|
|
333
334
|
this.screenMode = "auto";
|
|
334
335
|
this.switchScreenModeOnResize = true;
|
|
335
336
|
this.editMode = "view";
|
|
336
|
-
this.
|
|
337
|
+
this.embedMode = "iframe";
|
|
337
338
|
this.iframeStyle = {};
|
|
338
339
|
this._containerStyle = {};
|
|
339
340
|
this._loaderStyle = {};
|
|
@@ -356,6 +357,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
356
357
|
dashboardSlug: "dashboard-slug",
|
|
357
358
|
itemId: "item-id",
|
|
358
359
|
language: "language",
|
|
360
|
+
editorLanguage: "editorLanguage",
|
|
359
361
|
qeVersion: "qe-version",
|
|
360
362
|
screenMode: "screen-mode",
|
|
361
363
|
switchScreenModeOnResize: "switch-screen-mode-on-resize",
|
|
@@ -435,7 +437,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
435
437
|
}
|
|
436
438
|
initComponent() {
|
|
437
439
|
this.params = this._setOptions();
|
|
438
|
-
if (this.
|
|
440
|
+
if (this.isWebComponentViewMode()) {
|
|
439
441
|
SharedLib2.loadLibrary(this.params.appServer, dashboardRemote).then(async () => {
|
|
440
442
|
this.isLibraryLoaded = true;
|
|
441
443
|
await this.updateComplete;
|
|
@@ -498,6 +500,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
498
500
|
"dashboardSlug",
|
|
499
501
|
"itemId",
|
|
500
502
|
"language",
|
|
503
|
+
"editorLanguage",
|
|
501
504
|
"qeVersion",
|
|
502
505
|
"theme",
|
|
503
506
|
"editMode",
|
|
@@ -520,7 +523,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
520
523
|
this.isInitCalled = true;
|
|
521
524
|
return;
|
|
522
525
|
}
|
|
523
|
-
if (this.
|
|
526
|
+
if (this.isWebComponentViewMode()) {
|
|
524
527
|
if (this.dashboardReference) {
|
|
525
528
|
for (const [propertyName] of changedProperties.entries()) {
|
|
526
529
|
if (propertyName === "appSever") {
|
|
@@ -582,6 +585,9 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
582
585
|
if (this.language) {
|
|
583
586
|
defaultParameters.language = this.language;
|
|
584
587
|
}
|
|
588
|
+
if (this.editorLanguage) {
|
|
589
|
+
defaultParameters.editorLanguage = this.editorLanguage;
|
|
590
|
+
}
|
|
585
591
|
if (this.qeVersion) {
|
|
586
592
|
defaultParameters.qeVersion = this.qeVersion;
|
|
587
593
|
}
|
|
@@ -626,7 +632,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
626
632
|
defaultParameters.itemDimensions = this.itemDimensions;
|
|
627
633
|
}
|
|
628
634
|
if (this.appServer) {
|
|
629
|
-
this.appServer = this.
|
|
635
|
+
this.appServer = this.isWebComponentViewMode() ? SharedLib2.removeTrailingSlash(this.appServer) : SharedLib2.addTrailingSlash(this.appServer);
|
|
630
636
|
defaultParameters.appServer = this.appServer;
|
|
631
637
|
} else {
|
|
632
638
|
this.appServer = SharedLib2.addTrailingSlash(
|
|
@@ -635,7 +641,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
635
641
|
defaultParameters.appServer = this.appServer;
|
|
636
642
|
}
|
|
637
643
|
if (this.apiHost) {
|
|
638
|
-
this.apiHost = this.
|
|
644
|
+
this.apiHost = this.isWebComponentViewMode() ? SharedLib2.removeTrailingSlash(this.apiHost) : SharedLib2.addTrailingSlash(this.apiHost);
|
|
639
645
|
defaultParameters.apiHost = this.apiHost;
|
|
640
646
|
} else {
|
|
641
647
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
@@ -720,7 +726,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
720
726
|
</div>
|
|
721
727
|
</div>
|
|
722
728
|
`;
|
|
723
|
-
if (this.
|
|
729
|
+
if (this.isWebComponentViewMode()) {
|
|
724
730
|
toBeRenderedHTML = this.isLibraryLoaded ? html`
|
|
725
731
|
${this.dashboardId || this.dashboardSlug ? html`
|
|
726
732
|
<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
|
|
@@ -736,7 +742,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
736
742
|
${this.dashboardId || this.dashboardSlug ? html`
|
|
737
743
|
${loader}
|
|
738
744
|
<iframe
|
|
739
|
-
class="luzmo-embed-dashboard ${this.
|
|
745
|
+
class="luzmo-embed-dashboard ${this.isWebComponentViewMode() ? "" : `luzmo-embed-dashboard-ede`}"
|
|
740
746
|
id="${this._iframeId}"
|
|
741
747
|
name="${this._iframeId}"
|
|
742
748
|
style=${styleMap(this.iframeStyle)}
|
|
@@ -752,7 +758,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
752
758
|
`;
|
|
753
759
|
}
|
|
754
760
|
return html`
|
|
755
|
-
<div class="${luzmoEmbedContainerClass} ${this.
|
|
761
|
+
<div class="${luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${luzmoEmbedContainerClass}-ede`}">
|
|
756
762
|
<div
|
|
757
763
|
class="dashboard-container"
|
|
758
764
|
style=${styleMap(Object.assign({}, this._containerStyle, {
|
|
@@ -773,28 +779,28 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
773
779
|
}
|
|
774
780
|
// Public methods
|
|
775
781
|
getData(itemId) {
|
|
776
|
-
if (this.
|
|
782
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
777
783
|
return this.dashboardReference.getData(itemId);
|
|
778
784
|
}
|
|
779
|
-
if (!this.
|
|
785
|
+
if (!this.isWebComponentViewMode()) {
|
|
780
786
|
return SharedLib2.getData(this, this.iframe, itemId);
|
|
781
787
|
}
|
|
782
788
|
return Promise.reject();
|
|
783
789
|
}
|
|
784
790
|
getFilters() {
|
|
785
|
-
if (this.
|
|
791
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
786
792
|
return this.dashboardReference.getFilters();
|
|
787
793
|
}
|
|
788
|
-
if (!this.
|
|
794
|
+
if (!this.isWebComponentViewMode()) {
|
|
789
795
|
return SharedLib2.getFilters(this, this.iframe);
|
|
790
796
|
}
|
|
791
797
|
return Promise.reject();
|
|
792
798
|
}
|
|
793
799
|
setSelectedData(itemId, filters) {
|
|
794
|
-
if (this.
|
|
800
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
795
801
|
return this.dashboardReference.setSelectedData(itemId, filters);
|
|
796
802
|
}
|
|
797
|
-
if (!this.
|
|
803
|
+
if (!this.isWebComponentViewMode()) {
|
|
798
804
|
return SharedLib2.setSelectedData(this, this.iframe, itemId, filters);
|
|
799
805
|
}
|
|
800
806
|
return Promise.reject();
|
|
@@ -802,37 +808,37 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
802
808
|
setAuthorization(key, token) {
|
|
803
809
|
this.currentAuthKey = key;
|
|
804
810
|
this.currentAuthToken = token;
|
|
805
|
-
if (this.
|
|
811
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
806
812
|
return this.dashboardReference.setAuthorization(key, token);
|
|
807
813
|
}
|
|
808
|
-
if (!this.
|
|
814
|
+
if (!this.isWebComponentViewMode()) {
|
|
809
815
|
return SharedLib2.setAuthorization(this, this.iframe, key, token);
|
|
810
816
|
}
|
|
811
817
|
return Promise.reject();
|
|
812
818
|
}
|
|
813
819
|
refreshData(itemId) {
|
|
814
|
-
if (this.
|
|
820
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
815
821
|
return this.dashboardReference.refreshData(itemId);
|
|
816
822
|
}
|
|
817
|
-
if (!this.
|
|
823
|
+
if (!this.isWebComponentViewMode()) {
|
|
818
824
|
return itemId ? SharedLib2.refreshData(this, this.iframe, itemId) : SharedLib2.refreshData(this, this.iframe);
|
|
819
825
|
}
|
|
820
826
|
return Promise.reject();
|
|
821
827
|
}
|
|
822
828
|
reloadDashboard() {
|
|
823
|
-
if (this.
|
|
829
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
824
830
|
return this.dashboardReference.reloadDashboard();
|
|
825
831
|
}
|
|
826
|
-
if (!this.
|
|
832
|
+
if (!this.isWebComponentViewMode()) {
|
|
827
833
|
return SharedLib2.reloadDashboard(this, this.iframe);
|
|
828
834
|
}
|
|
829
835
|
return Promise.reject();
|
|
830
836
|
}
|
|
831
837
|
exportDashboard(format) {
|
|
832
|
-
if (this.
|
|
838
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
833
839
|
return this.dashboardReference.exportDashboard(format);
|
|
834
840
|
}
|
|
835
|
-
if (!this.
|
|
841
|
+
if (!this.isWebComponentViewMode()) {
|
|
836
842
|
return format ? SharedLib2.exportDashboard(this, this.iframe, format) : SharedLib2.exportDashboard(this, this.iframe);
|
|
837
843
|
}
|
|
838
844
|
return Promise.reject();
|
|
@@ -862,22 +868,22 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
862
868
|
editMode
|
|
863
869
|
});
|
|
864
870
|
}
|
|
865
|
-
if (this.
|
|
871
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
866
872
|
return this.dashboardReference.setEditMode(editMode);
|
|
867
873
|
}
|
|
868
|
-
if (!this.
|
|
874
|
+
if (!this.isWebComponentViewMode()) {
|
|
869
875
|
return SharedLib2.setEditMode(this, this.iframe, editMode);
|
|
870
876
|
}
|
|
871
877
|
return Promise.reject();
|
|
872
878
|
}
|
|
873
879
|
setPreview(preview) {
|
|
874
|
-
if (this.
|
|
880
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
875
881
|
return this.dashboardReference.setPreview(preview);
|
|
876
882
|
}
|
|
877
883
|
return SharedLib2.setPreview(this, this.iframe, preview);
|
|
878
884
|
}
|
|
879
|
-
|
|
880
|
-
return this.
|
|
885
|
+
isWebComponentViewMode() {
|
|
886
|
+
return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
|
|
881
887
|
}
|
|
882
888
|
};
|
|
883
889
|
__decorateClass([
|
|
@@ -901,6 +907,9 @@ __decorateClass([
|
|
|
901
907
|
__decorateClass([
|
|
902
908
|
property()
|
|
903
909
|
], LuzmoDashboard.prototype, "language", 2);
|
|
910
|
+
__decorateClass([
|
|
911
|
+
property()
|
|
912
|
+
], LuzmoDashboard.prototype, "editorLanguage", 2);
|
|
904
913
|
__decorateClass([
|
|
905
914
|
property()
|
|
906
915
|
], LuzmoDashboard.prototype, "qeVersion", 2);
|
|
@@ -958,13 +967,8 @@ __decorateClass([
|
|
|
958
967
|
property({ type: Object })
|
|
959
968
|
], LuzmoDashboard.prototype, "itemDimensions", 2);
|
|
960
969
|
__decorateClass([
|
|
961
|
-
property(
|
|
962
|
-
|
|
963
|
-
fromAttribute: (value) => value === "true",
|
|
964
|
-
toAttribute: String
|
|
965
|
-
}
|
|
966
|
-
})
|
|
967
|
-
], LuzmoDashboard.prototype, "experimental", 2);
|
|
970
|
+
property()
|
|
971
|
+
], LuzmoDashboard.prototype, "embedMode", 2);
|
|
968
972
|
__decorateClass([
|
|
969
973
|
property({ attribute: false })
|
|
970
974
|
], LuzmoDashboard.prototype, "_containerId", 2);
|
package/luzmo-embed.min.js
CHANGED
|
@@ -106,6 +106,7 @@ var DEFAULT_PARAMETERS = {
|
|
|
106
106
|
key: null,
|
|
107
107
|
token: null,
|
|
108
108
|
language: "auto",
|
|
109
|
+
editorLanguage: "auto",
|
|
109
110
|
qeVersion: null,
|
|
110
111
|
editMode: null,
|
|
111
112
|
screenMode: null,
|
|
@@ -337,6 +338,7 @@ var createIframeUrl = (dashboardContent) => {
|
|
|
337
338
|
const {
|
|
338
339
|
appServer,
|
|
339
340
|
language,
|
|
341
|
+
editorLanguage,
|
|
340
342
|
qeVersion,
|
|
341
343
|
loaderBackground,
|
|
342
344
|
loaderSpinnerColor,
|
|
@@ -357,7 +359,10 @@ var createIframeUrl = (dashboardContent) => {
|
|
|
357
359
|
editMode
|
|
358
360
|
} = dashboardContent.params;
|
|
359
361
|
if (language && language !== "auto") {
|
|
360
|
-
searchString.push(
|
|
362
|
+
searchString.push(`language=${language}`);
|
|
363
|
+
}
|
|
364
|
+
if (editorLanguage && editorLanguage !== "auto") {
|
|
365
|
+
searchString.push(`editorLanguage=${editorLanguage}`);
|
|
361
366
|
}
|
|
362
367
|
if (qeVersion) {
|
|
363
368
|
searchString.push(`qe_version=${qeVersion}`);
|
|
@@ -384,7 +389,7 @@ var createIframeUrl = (dashboardContent) => {
|
|
|
384
389
|
searchString.push(`accentColor=${accentColor}`);
|
|
385
390
|
}
|
|
386
391
|
if (screenMode && screenMode !== "auto") {
|
|
387
|
-
searchString.push(
|
|
392
|
+
searchString.push(`screenMode=&{screenMode}`);
|
|
388
393
|
}
|
|
389
394
|
if (timezoneId) {
|
|
390
395
|
searchString.push("timezoneId=" + timezoneId);
|
|
@@ -645,8 +650,8 @@ var getAccessibleDashboards = async (dashboardComponent) => {
|
|
|
645
650
|
void (() => {
|
|
646
651
|
try {
|
|
647
652
|
const responsePromise = window.fetch(
|
|
648
|
-
// With
|
|
649
|
-
// Fixes incorrect url with
|
|
653
|
+
// With embedMode="webComponent" URLs remove the trailing slash, since the web component expects them to not have it.
|
|
654
|
+
// Fixes incorrect url with embedMode="webComponent"
|
|
650
655
|
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
651
656
|
{
|
|
652
657
|
method: "POST",
|
|
@@ -696,8 +701,8 @@ var getAccessibleDashboards = async (dashboardComponent) => {
|
|
|
696
701
|
try {
|
|
697
702
|
fetchUser.then((authorizationData) => {
|
|
698
703
|
const responsePromise = window.fetch(
|
|
699
|
-
// With
|
|
700
|
-
// Fixes incorrect url with
|
|
704
|
+
// With embedMode="webComponent" URLs remove the trailing slash, since the web component expects them to not have it.
|
|
705
|
+
// Fixes incorrect url with embedMode="webComponent"
|
|
701
706
|
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
702
707
|
{
|
|
703
708
|
method: "POST",
|
|
@@ -2026,7 +2031,7 @@ var se = e5(class extends i3 {
|
|
|
2026
2031
|
});
|
|
2027
2032
|
|
|
2028
2033
|
// libs/embed-libs/embed/package.json
|
|
2029
|
-
var version = "6.3.
|
|
2034
|
+
var version = "6.3.8";
|
|
2030
2035
|
|
|
2031
2036
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
2032
2037
|
var LuzmoService = class {
|
|
@@ -2328,10 +2333,11 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2328
2333
|
constructor() {
|
|
2329
2334
|
super();
|
|
2330
2335
|
this.language = "auto";
|
|
2336
|
+
this.editorLanguage = "auto";
|
|
2331
2337
|
this.screenMode = "auto";
|
|
2332
2338
|
this.switchScreenModeOnResize = true;
|
|
2333
2339
|
this.editMode = "view";
|
|
2334
|
-
this.
|
|
2340
|
+
this.embedMode = "iframe";
|
|
2335
2341
|
this.iframeStyle = {};
|
|
2336
2342
|
this._containerStyle = {};
|
|
2337
2343
|
this._loaderStyle = {};
|
|
@@ -2354,6 +2360,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2354
2360
|
dashboardSlug: "dashboard-slug",
|
|
2355
2361
|
itemId: "item-id",
|
|
2356
2362
|
language: "language",
|
|
2363
|
+
editorLanguage: "editorLanguage",
|
|
2357
2364
|
qeVersion: "qe-version",
|
|
2358
2365
|
screenMode: "screen-mode",
|
|
2359
2366
|
switchScreenModeOnResize: "switch-screen-mode-on-resize",
|
|
@@ -2433,7 +2440,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2433
2440
|
}
|
|
2434
2441
|
initComponent() {
|
|
2435
2442
|
this.params = this._setOptions();
|
|
2436
|
-
if (this.
|
|
2443
|
+
if (this.isWebComponentViewMode()) {
|
|
2437
2444
|
loadLibrary(this.params.appServer, dashboardRemote).then(async () => {
|
|
2438
2445
|
this.isLibraryLoaded = true;
|
|
2439
2446
|
await this.updateComplete;
|
|
@@ -2496,6 +2503,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2496
2503
|
"dashboardSlug",
|
|
2497
2504
|
"itemId",
|
|
2498
2505
|
"language",
|
|
2506
|
+
"editorLanguage",
|
|
2499
2507
|
"qeVersion",
|
|
2500
2508
|
"theme",
|
|
2501
2509
|
"editMode",
|
|
@@ -2518,7 +2526,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2518
2526
|
this.isInitCalled = true;
|
|
2519
2527
|
return;
|
|
2520
2528
|
}
|
|
2521
|
-
if (this.
|
|
2529
|
+
if (this.isWebComponentViewMode()) {
|
|
2522
2530
|
if (this.dashboardReference) {
|
|
2523
2531
|
for (const [propertyName] of changedProperties.entries()) {
|
|
2524
2532
|
if (propertyName === "appSever") {
|
|
@@ -2580,6 +2588,9 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2580
2588
|
if (this.language) {
|
|
2581
2589
|
defaultParameters.language = this.language;
|
|
2582
2590
|
}
|
|
2591
|
+
if (this.editorLanguage) {
|
|
2592
|
+
defaultParameters.editorLanguage = this.editorLanguage;
|
|
2593
|
+
}
|
|
2583
2594
|
if (this.qeVersion) {
|
|
2584
2595
|
defaultParameters.qeVersion = this.qeVersion;
|
|
2585
2596
|
}
|
|
@@ -2624,7 +2635,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2624
2635
|
defaultParameters.itemDimensions = this.itemDimensions;
|
|
2625
2636
|
}
|
|
2626
2637
|
if (this.appServer) {
|
|
2627
|
-
this.appServer = this.
|
|
2638
|
+
this.appServer = this.isWebComponentViewMode() ? removeTrailingSlash(this.appServer) : addTrailingSlash(this.appServer);
|
|
2628
2639
|
defaultParameters.appServer = this.appServer;
|
|
2629
2640
|
} else {
|
|
2630
2641
|
this.appServer = addTrailingSlash(
|
|
@@ -2633,7 +2644,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2633
2644
|
defaultParameters.appServer = this.appServer;
|
|
2634
2645
|
}
|
|
2635
2646
|
if (this.apiHost) {
|
|
2636
|
-
this.apiHost = this.
|
|
2647
|
+
this.apiHost = this.isWebComponentViewMode() ? removeTrailingSlash(this.apiHost) : addTrailingSlash(this.apiHost);
|
|
2637
2648
|
defaultParameters.apiHost = this.apiHost;
|
|
2638
2649
|
} else {
|
|
2639
2650
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
@@ -2718,7 +2729,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2718
2729
|
</div>
|
|
2719
2730
|
</div>
|
|
2720
2731
|
`;
|
|
2721
|
-
if (this.
|
|
2732
|
+
if (this.isWebComponentViewMode()) {
|
|
2722
2733
|
toBeRenderedHTML = this.isLibraryLoaded ? ke`
|
|
2723
2734
|
${this.dashboardId || this.dashboardSlug ? ke`
|
|
2724
2735
|
<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
|
|
@@ -2734,7 +2745,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2734
2745
|
${this.dashboardId || this.dashboardSlug ? ke`
|
|
2735
2746
|
${loader}
|
|
2736
2747
|
<iframe
|
|
2737
|
-
class="luzmo-embed-dashboard ${this.
|
|
2748
|
+
class="luzmo-embed-dashboard ${this.isWebComponentViewMode() ? "" : `luzmo-embed-dashboard-ede`}"
|
|
2738
2749
|
id="${this._iframeId}"
|
|
2739
2750
|
name="${this._iframeId}"
|
|
2740
2751
|
style=${se(this.iframeStyle)}
|
|
@@ -2750,7 +2761,7 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2750
2761
|
`;
|
|
2751
2762
|
}
|
|
2752
2763
|
return ke`
|
|
2753
|
-
<div class="${luzmoEmbedContainerClass} ${this.
|
|
2764
|
+
<div class="${luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${luzmoEmbedContainerClass}-ede`}">
|
|
2754
2765
|
<div
|
|
2755
2766
|
class="dashboard-container"
|
|
2756
2767
|
style=${se(Object.assign({}, this._containerStyle, {
|
|
@@ -2771,28 +2782,28 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2771
2782
|
}
|
|
2772
2783
|
// Public methods
|
|
2773
2784
|
getData(itemId) {
|
|
2774
|
-
if (this.
|
|
2785
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2775
2786
|
return this.dashboardReference.getData(itemId);
|
|
2776
2787
|
}
|
|
2777
|
-
if (!this.
|
|
2788
|
+
if (!this.isWebComponentViewMode()) {
|
|
2778
2789
|
return getData(this, this.iframe, itemId);
|
|
2779
2790
|
}
|
|
2780
2791
|
return Promise.reject();
|
|
2781
2792
|
}
|
|
2782
2793
|
getFilters() {
|
|
2783
|
-
if (this.
|
|
2794
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2784
2795
|
return this.dashboardReference.getFilters();
|
|
2785
2796
|
}
|
|
2786
|
-
if (!this.
|
|
2797
|
+
if (!this.isWebComponentViewMode()) {
|
|
2787
2798
|
return getFilters(this, this.iframe);
|
|
2788
2799
|
}
|
|
2789
2800
|
return Promise.reject();
|
|
2790
2801
|
}
|
|
2791
2802
|
setSelectedData(itemId, filters) {
|
|
2792
|
-
if (this.
|
|
2803
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2793
2804
|
return this.dashboardReference.setSelectedData(itemId, filters);
|
|
2794
2805
|
}
|
|
2795
|
-
if (!this.
|
|
2806
|
+
if (!this.isWebComponentViewMode()) {
|
|
2796
2807
|
return setSelectedData(this, this.iframe, itemId, filters);
|
|
2797
2808
|
}
|
|
2798
2809
|
return Promise.reject();
|
|
@@ -2800,37 +2811,37 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2800
2811
|
setAuthorization(key, token) {
|
|
2801
2812
|
this.currentAuthKey = key;
|
|
2802
2813
|
this.currentAuthToken = token;
|
|
2803
|
-
if (this.
|
|
2814
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2804
2815
|
return this.dashboardReference.setAuthorization(key, token);
|
|
2805
2816
|
}
|
|
2806
|
-
if (!this.
|
|
2817
|
+
if (!this.isWebComponentViewMode()) {
|
|
2807
2818
|
return setAuthorization(this, this.iframe, key, token);
|
|
2808
2819
|
}
|
|
2809
2820
|
return Promise.reject();
|
|
2810
2821
|
}
|
|
2811
2822
|
refreshData(itemId) {
|
|
2812
|
-
if (this.
|
|
2823
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2813
2824
|
return this.dashboardReference.refreshData(itemId);
|
|
2814
2825
|
}
|
|
2815
|
-
if (!this.
|
|
2826
|
+
if (!this.isWebComponentViewMode()) {
|
|
2816
2827
|
return itemId ? refreshData(this, this.iframe, itemId) : refreshData(this, this.iframe);
|
|
2817
2828
|
}
|
|
2818
2829
|
return Promise.reject();
|
|
2819
2830
|
}
|
|
2820
2831
|
reloadDashboard() {
|
|
2821
|
-
if (this.
|
|
2832
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2822
2833
|
return this.dashboardReference.reloadDashboard();
|
|
2823
2834
|
}
|
|
2824
|
-
if (!this.
|
|
2835
|
+
if (!this.isWebComponentViewMode()) {
|
|
2825
2836
|
return reloadDashboard(this, this.iframe);
|
|
2826
2837
|
}
|
|
2827
2838
|
return Promise.reject();
|
|
2828
2839
|
}
|
|
2829
2840
|
exportDashboard(format) {
|
|
2830
|
-
if (this.
|
|
2841
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2831
2842
|
return this.dashboardReference.exportDashboard(format);
|
|
2832
2843
|
}
|
|
2833
|
-
if (!this.
|
|
2844
|
+
if (!this.isWebComponentViewMode()) {
|
|
2834
2845
|
return format ? exportDashboard(this, this.iframe, format) : exportDashboard(this, this.iframe);
|
|
2835
2846
|
}
|
|
2836
2847
|
return Promise.reject();
|
|
@@ -2860,22 +2871,22 @@ var LuzmoDashboard = class extends h3 {
|
|
|
2860
2871
|
editMode
|
|
2861
2872
|
});
|
|
2862
2873
|
}
|
|
2863
|
-
if (this.
|
|
2874
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2864
2875
|
return this.dashboardReference.setEditMode(editMode);
|
|
2865
2876
|
}
|
|
2866
|
-
if (!this.
|
|
2877
|
+
if (!this.isWebComponentViewMode()) {
|
|
2867
2878
|
return setEditMode(this, this.iframe, editMode);
|
|
2868
2879
|
}
|
|
2869
2880
|
return Promise.reject();
|
|
2870
2881
|
}
|
|
2871
2882
|
setPreview(preview) {
|
|
2872
|
-
if (this.
|
|
2883
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
2873
2884
|
return this.dashboardReference.setPreview(preview);
|
|
2874
2885
|
}
|
|
2875
2886
|
return setPreview(this, this.iframe, preview);
|
|
2876
2887
|
}
|
|
2877
|
-
|
|
2878
|
-
return this.
|
|
2888
|
+
isWebComponentViewMode() {
|
|
2889
|
+
return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
|
|
2879
2890
|
}
|
|
2880
2891
|
};
|
|
2881
2892
|
__decorateClass([
|
|
@@ -2899,6 +2910,9 @@ __decorateClass([
|
|
|
2899
2910
|
__decorateClass([
|
|
2900
2911
|
n4()
|
|
2901
2912
|
], LuzmoDashboard.prototype, "language", 2);
|
|
2913
|
+
__decorateClass([
|
|
2914
|
+
n4()
|
|
2915
|
+
], LuzmoDashboard.prototype, "editorLanguage", 2);
|
|
2902
2916
|
__decorateClass([
|
|
2903
2917
|
n4()
|
|
2904
2918
|
], LuzmoDashboard.prototype, "qeVersion", 2);
|
|
@@ -2956,13 +2970,8 @@ __decorateClass([
|
|
|
2956
2970
|
n4({ type: Object })
|
|
2957
2971
|
], LuzmoDashboard.prototype, "itemDimensions", 2);
|
|
2958
2972
|
__decorateClass([
|
|
2959
|
-
n4(
|
|
2960
|
-
|
|
2961
|
-
fromAttribute: (value) => value === "true",
|
|
2962
|
-
toAttribute: String
|
|
2963
|
-
}
|
|
2964
|
-
})
|
|
2965
|
-
], LuzmoDashboard.prototype, "experimental", 2);
|
|
2973
|
+
n4()
|
|
2974
|
+
], LuzmoDashboard.prototype, "embedMode", 2);
|
|
2966
2975
|
__decorateClass([
|
|
2967
2976
|
n4({ attribute: false })
|
|
2968
2977
|
], LuzmoDashboard.prototype, "_containerId", 2);
|
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;
|
|
@@ -10,6 +10,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
10
10
|
dashboardSlug?: SharedLib.DashboardInputs['dashboardSlug'];
|
|
11
11
|
itemId?: SharedLib.DashboardInputs['itemId'];
|
|
12
12
|
language: SharedLib.DashboardInputs['language'];
|
|
13
|
+
editorLanguage: SharedLib.DashboardInputs['editorLanguage'];
|
|
13
14
|
qeVersion: SharedLib.DashboardInputs['qeVersion'];
|
|
14
15
|
screenMode: SharedLib.DashboardInputs['screenMode'];
|
|
15
16
|
switchScreenModeOnResize: boolean;
|
|
@@ -27,7 +28,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
27
28
|
timezoneId?: SharedLib.DashboardInputs['timezoneId'];
|
|
28
29
|
apiHost?: SharedLib.DashboardInputs['apiHost'];
|
|
29
30
|
itemDimensions: SharedLib.DashboardInputs['itemDimensions'];
|
|
30
|
-
|
|
31
|
+
embedMode: DashboardInputs['embedMode'];
|
|
31
32
|
_containerId: string;
|
|
32
33
|
_iframeId: string;
|
|
33
34
|
params: SharedLib.DashboardContentParams;
|
|
@@ -91,5 +92,5 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
91
92
|
addFilters(itemId: string, filters: FilterGroup[]): Promise<SharedLib.AddFilters>;
|
|
92
93
|
setEditMode(editMode?: SharedLib.DashboardEditMode): Promise<SharedLib.SetEditMode>;
|
|
93
94
|
setPreview(preview: boolean): Promise<SharedLib.SetPreview>;
|
|
94
|
-
|
|
95
|
+
isWebComponentViewMode(): boolean;
|
|
95
96
|
}
|