@luzmo/embed 5.1.0-beta.2 → 5.1.0-beta.4
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 +16 -0
- package/README.md +7 -7
- package/index.cjs +17 -24
- package/index.js +16 -27
- package/index.libs.cjs +10 -24
- package/index.libs.js +10 -27
- package/lib/dashboard-component/dashboard-base.d.ts +1 -2
- package/lib/dashboard-component/dashboard-component.d.ts +13 -0
- package/lib/luzmo-service.d.ts +1 -1
- package/lib/viz-item/viz-item.base.d.ts +1 -1
- package/luzmo-embed.libs.js +18 -28
- package/luzmo-embed.min.js +24 -28
- package/package.json +2 -2
- package/lib/models/filters.model.d.ts +0 -6
- package/src/index.d.ts +0 -3
- package/src/lib/dashboard-component/dashboard-base.d.ts +0 -98
- package/src/lib/dashboard-component/dashboard-component.d.ts +0 -3
- package/src/lib/dashboard-component/dashboard-styles.d.ts +0 -1
- package/src/lib/helper/event-bus-handler.d.ts +0 -1
- package/src/lib/luzmo-service.d.ts +0 -6
- package/src/lib/viz-item/viz-item-component.d.ts +0 -3
- package/src/lib/viz-item/viz-item.base.d.ts +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [5.1.1] - 2024-04-24
|
|
5
|
+
|
|
6
|
+
- Show actual error messages from luzmo application
|
|
7
|
+
|
|
8
|
+
## [5.1.0] - 2024-04-17
|
|
9
|
+
|
|
10
|
+
### Updates
|
|
11
|
+
|
|
12
|
+
- Deprecated `luzmo-dashboard`, `luzmo-embed-dashboard` is the new element, `luzmo-dashboard` will be removed in next major release (`6.0.0`).
|
|
13
|
+
|
|
14
|
+
## [5.0.14] - 2024-03-28
|
|
15
|
+
|
|
16
|
+
### Bugfixes
|
|
17
|
+
|
|
18
|
+
- Shared embed lib updated with bugfixes.
|
|
19
|
+
|
|
4
20
|
## [5.0.13] - 2024-03-26
|
|
5
21
|
|
|
6
22
|
### Updates
|
package/README.md
CHANGED
|
@@ -33,14 +33,14 @@ OR In an HTML page:
|
|
|
33
33
|
|
|
34
34
|
```html
|
|
35
35
|
<script type="module">
|
|
36
|
-
import './node_modules/@luzmo/embed/index.
|
|
36
|
+
import './node_modules/@luzmo/embed/index.js';
|
|
37
37
|
</script>
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
OR
|
|
41
41
|
|
|
42
42
|
```html
|
|
43
|
-
<script type="module" src="./node_modules/@luzmo/embed/index.
|
|
43
|
+
<script type="module" src="./node_modules/@luzmo/embed/index.js"></script>
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
## Usage
|
|
@@ -49,12 +49,12 @@ Use the dashboard components as if they were native HTML tags. Use the id of the
|
|
|
49
49
|
**In your HTML template.**
|
|
50
50
|
|
|
51
51
|
```html
|
|
52
|
-
<luzmo-dashboard dashboardId="55cfb99c-d602-492b-b192-6c15277fdb9a" language="en"> </luzmo-dashboard>
|
|
52
|
+
<luzmo-embed-dashboard dashboardId="55cfb99c-d602-492b-b192-6c15277fdb9a" language="en"> </luzmo-embed-dashboard>
|
|
53
53
|
|
|
54
54
|
OR
|
|
55
55
|
|
|
56
56
|
<!-- Embed a item by passing the item id as well -->
|
|
57
|
-
<luzmo-dashboard dashboardId="55cfb99c-d602-492b-b192-6c15277fdb9a" itemId="59fe5bd7-5070-42f5-98f4-da7f931e316c"> </luzmo-dashboard>
|
|
57
|
+
<luzmo-embed-dashboard dashboardId="55cfb99c-d602-492b-b192-6c15277fdb9a" itemId="59fe5bd7-5070-42f5-98f4-da7f931e316c"> </luzmo-embed-dashboard>
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
**Properties:**
|
|
@@ -135,19 +135,19 @@ setEditMode(editMode: DashboardEditMode): Promise<SetEditMode>
|
|
|
135
135
|
A dashboard with a gray loader background
|
|
136
136
|
|
|
137
137
|
```html
|
|
138
|
-
<luzmo-dashboard dashboardId="035c0304-0bfe-4b7c-8c10-a4acb8eb9d76" loaderBackground="rgb(238,243,246)"> </luzmo-dashboard>
|
|
138
|
+
<luzmo-embed-dashboard dashboardId="035c0304-0bfe-4b7c-8c10-a4acb8eb9d76" loaderBackground="rgb(238,243,246)"> </luzmo-embed-dashboard>
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
A secured dashboard using an [authorization key & token](https://developer.luzmo.com/#quickstart)
|
|
142
142
|
|
|
143
143
|
```html
|
|
144
|
-
<luzmo-dashboard dashboardId="035c0304-0bfe-4b7c-8c10-a4acb8eb9d76" authKey="<!-- your generated authKey-->" authToken="<!-- your generated authToken -->"> </luzmo-dashboard>
|
|
144
|
+
<luzmo-embed-dashboard dashboardId="035c0304-0bfe-4b7c-8c10-a4acb8eb9d76" authKey="<!-- your generated authKey-->" authToken="<!-- your generated authToken -->"> </luzmo-embed-dashboard>
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
A dashboard with a purple spinner color of the loader with screenMode="mobile" and switchScreenModeOnResize=false, so that the dashboard will stay in mobile mode
|
|
148
148
|
|
|
149
149
|
```html
|
|
150
|
-
<luzmo-dashboard id="dashboard" dashboardId="55cfb99c-d602-492b-b192-6c15277fdb9a" loaderSpinnerColor="purple" screenMode="mobile" switchScreenModeOnResize="false"> </luzmo-dashboard>
|
|
150
|
+
<luzmo-embed-dashboard id="dashboard" dashboardId="55cfb99c-d602-492b-b192-6c15277fdb9a" loaderSpinnerColor="purple" screenMode="mobile" switchScreenModeOnResize="false"> </luzmo-embed-dashboard>
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
Add an event listener when all items are rendered
|
package/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
40
40
|
var src_exports = {};
|
|
41
41
|
__export(src_exports, {
|
|
42
42
|
LuzmoDashboard: () => LuzmoDashboard2,
|
|
43
|
+
LuzmoEmbedDashboard: () => LuzmoEmbedDashboard,
|
|
43
44
|
LuzmoVizItem: () => LuzmoVizItem
|
|
44
45
|
});
|
|
45
46
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -55,7 +56,7 @@ var import_style_map = require("lit/directives/style-map.js");
|
|
|
55
56
|
var import_shared_embed = require("@luzmo/shared-embed");
|
|
56
57
|
|
|
57
58
|
// libs/embed-libs/embed/package.json
|
|
58
|
-
var version = "5.1.0-beta.
|
|
59
|
+
var version = "5.1.0-beta.4";
|
|
59
60
|
|
|
60
61
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
61
62
|
var LuzmoService = class {
|
|
@@ -100,6 +101,7 @@ var _setEventHandler = () => {
|
|
|
100
101
|
}
|
|
101
102
|
dashboardComponent.iframeLoaded = true;
|
|
102
103
|
dashboardComponent._displayError();
|
|
104
|
+
console.error("Dashboard error: ", event.data.errorMsg);
|
|
103
105
|
break;
|
|
104
106
|
}
|
|
105
107
|
case "data": {
|
|
@@ -355,7 +357,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
355
357
|
this.browserErrorMsg = "";
|
|
356
358
|
this.dashboardError = false;
|
|
357
359
|
this.browserNotSupported = [];
|
|
358
|
-
this.
|
|
360
|
+
this.version = version + "-wc-luzmo";
|
|
359
361
|
this.isLibraryLoaded = false;
|
|
360
362
|
this.currentAuthKey = null;
|
|
361
363
|
this.currentAuthToken = null;
|
|
@@ -419,22 +421,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
419
421
|
});
|
|
420
422
|
});
|
|
421
423
|
}
|
|
422
|
-
loadLibrary(appServer) {
|
|
423
|
-
if (import_shared_embed.remotesMap[appServer]) {
|
|
424
|
-
return Promise.resolve(import_shared_embed.remotesMap[appServer].module);
|
|
425
|
-
}
|
|
426
|
-
import_shared_embed.remotesMap[appServer] = {
|
|
427
|
-
url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
428
|
-
format: "esm",
|
|
429
|
-
from: "vite",
|
|
430
|
-
module: void 0
|
|
431
|
-
};
|
|
432
|
-
return (0, import_shared_embed.__federationMethodGetRemote)(appServer, "./DashboardApp").then((module2) => {
|
|
433
|
-
const wrappedModule = (0, import_shared_embed.__federationMethodWrapDefault)(module2, true);
|
|
434
|
-
import_shared_embed.remotesMap[appServer].module = wrappedModule;
|
|
435
|
-
return wrappedModule;
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
424
|
setInputParameters(inputParameters) {
|
|
439
425
|
if (!inputParameters) {
|
|
440
426
|
return;
|
|
@@ -499,7 +485,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
499
485
|
initComponent() {
|
|
500
486
|
this.params = this._setOptions();
|
|
501
487
|
if (this.getIsViewMode()) {
|
|
502
|
-
|
|
488
|
+
SharedLib2.loadLibrary(this.params.appServer).then(async () => {
|
|
503
489
|
this.isLibraryLoaded = true;
|
|
504
490
|
await this.updateComplete;
|
|
505
491
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -575,7 +561,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
575
561
|
if (this.dashboardReference) {
|
|
576
562
|
for (const [propertyName] of changedProperties.entries()) {
|
|
577
563
|
if (propertyName === "appSever") {
|
|
578
|
-
|
|
564
|
+
SharedLib2.loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
579
565
|
this.isLibraryLoaded = true;
|
|
580
566
|
await this.updateComplete;
|
|
581
567
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -596,7 +582,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
596
582
|
clearTimeout(this._loadTimeoutHandle);
|
|
597
583
|
}
|
|
598
584
|
this._loadTimeoutHandle = setTimeout(() => {
|
|
599
|
-
console.
|
|
585
|
+
console.warn(
|
|
600
586
|
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
601
587
|
);
|
|
602
588
|
}, 15 * 1e3);
|
|
@@ -1074,7 +1060,7 @@ __decorateClass([
|
|
|
1074
1060
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
1075
1061
|
__decorateClass([
|
|
1076
1062
|
(0, import_decorators.property)()
|
|
1077
|
-
], LuzmoDashboard.prototype, "
|
|
1063
|
+
], LuzmoDashboard.prototype, "version", 2);
|
|
1078
1064
|
__decorateClass([
|
|
1079
1065
|
(0, import_decorators.state)()
|
|
1080
1066
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -1094,6 +1080,11 @@ var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
|
1094
1080
|
LuzmoDashboard2 = __decorateClass([
|
|
1095
1081
|
(0, import_decorators2.customElement)("luzmo-dashboard")
|
|
1096
1082
|
], LuzmoDashboard2);
|
|
1083
|
+
var LuzmoEmbedDashboard = class extends LuzmoDashboard {
|
|
1084
|
+
};
|
|
1085
|
+
LuzmoEmbedDashboard = __decorateClass([
|
|
1086
|
+
(0, import_decorators2.customElement)("luzmo-embed-dashboard")
|
|
1087
|
+
], LuzmoEmbedDashboard);
|
|
1097
1088
|
|
|
1098
1089
|
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1099
1090
|
var import_decorators4 = require("lit/decorators.js");
|
|
@@ -1128,8 +1119,8 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1128
1119
|
}
|
|
1129
1120
|
async firstUpdated(_changedProperties) {
|
|
1130
1121
|
super.firstUpdated(_changedProperties);
|
|
1131
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1132
1122
|
if (this.type) {
|
|
1123
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1133
1124
|
this.createAndAppendElement();
|
|
1134
1125
|
}
|
|
1135
1126
|
}
|
|
@@ -1155,7 +1146,7 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1155
1146
|
}
|
|
1156
1147
|
}
|
|
1157
1148
|
}
|
|
1158
|
-
updated(changedProperties) {
|
|
1149
|
+
async updated(changedProperties) {
|
|
1159
1150
|
if (this.chartElement) {
|
|
1160
1151
|
for (const [propertyName] of changedProperties.entries()) {
|
|
1161
1152
|
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
@@ -1164,6 +1155,7 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1164
1155
|
}
|
|
1165
1156
|
} else {
|
|
1166
1157
|
if (this.type) {
|
|
1158
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1167
1159
|
this.createAndAppendElement();
|
|
1168
1160
|
}
|
|
1169
1161
|
}
|
|
@@ -1223,5 +1215,6 @@ LuzmoVizItem = __decorateClass([
|
|
|
1223
1215
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1224
1216
|
0 && (module.exports = {
|
|
1225
1217
|
LuzmoDashboard,
|
|
1218
|
+
LuzmoEmbedDashboard,
|
|
1226
1219
|
LuzmoVizItem
|
|
1227
1220
|
});
|
package/index.js
CHANGED
|
@@ -30,14 +30,11 @@ import {
|
|
|
30
30
|
styleMap
|
|
31
31
|
} from "lit/directives/style-map.js";
|
|
32
32
|
import {
|
|
33
|
-
__federationMethodGetRemote,
|
|
34
|
-
__federationMethodWrapDefault,
|
|
35
|
-
remotesMap,
|
|
36
33
|
luzmoEmbedContainerClass
|
|
37
34
|
} from "@luzmo/shared-embed";
|
|
38
35
|
|
|
39
36
|
// libs/embed-libs/embed/package.json
|
|
40
|
-
var version = "5.1.0-beta.
|
|
37
|
+
var version = "5.1.0-beta.4";
|
|
41
38
|
|
|
42
39
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
43
40
|
var LuzmoService = class {
|
|
@@ -82,6 +79,7 @@ var _setEventHandler = () => {
|
|
|
82
79
|
}
|
|
83
80
|
dashboardComponent.iframeLoaded = true;
|
|
84
81
|
dashboardComponent._displayError();
|
|
82
|
+
console.error("Dashboard error: ", event.data.errorMsg);
|
|
85
83
|
break;
|
|
86
84
|
}
|
|
87
85
|
case "data": {
|
|
@@ -337,7 +335,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
337
335
|
this.browserErrorMsg = "";
|
|
338
336
|
this.dashboardError = false;
|
|
339
337
|
this.browserNotSupported = [];
|
|
340
|
-
this.
|
|
338
|
+
this.version = version + "-wc-luzmo";
|
|
341
339
|
this.isLibraryLoaded = false;
|
|
342
340
|
this.currentAuthKey = null;
|
|
343
341
|
this.currentAuthToken = null;
|
|
@@ -401,22 +399,6 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
401
399
|
});
|
|
402
400
|
});
|
|
403
401
|
}
|
|
404
|
-
loadLibrary(appServer) {
|
|
405
|
-
if (remotesMap[appServer]) {
|
|
406
|
-
return Promise.resolve(remotesMap[appServer].module);
|
|
407
|
-
}
|
|
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
|
-
};
|
|
414
|
-
return __federationMethodGetRemote(appServer, "./DashboardApp").then((module) => {
|
|
415
|
-
const wrappedModule = __federationMethodWrapDefault(module, true);
|
|
416
|
-
remotesMap[appServer].module = wrappedModule;
|
|
417
|
-
return wrappedModule;
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
402
|
setInputParameters(inputParameters) {
|
|
421
403
|
if (!inputParameters) {
|
|
422
404
|
return;
|
|
@@ -481,7 +463,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
481
463
|
initComponent() {
|
|
482
464
|
this.params = this._setOptions();
|
|
483
465
|
if (this.getIsViewMode()) {
|
|
484
|
-
|
|
466
|
+
SharedLib2.loadLibrary(this.params.appServer).then(async () => {
|
|
485
467
|
this.isLibraryLoaded = true;
|
|
486
468
|
await this.updateComplete;
|
|
487
469
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -557,7 +539,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
557
539
|
if (this.dashboardReference) {
|
|
558
540
|
for (const [propertyName] of changedProperties.entries()) {
|
|
559
541
|
if (propertyName === "appSever") {
|
|
560
|
-
|
|
542
|
+
SharedLib2.loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
561
543
|
this.isLibraryLoaded = true;
|
|
562
544
|
await this.updateComplete;
|
|
563
545
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -578,7 +560,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
578
560
|
clearTimeout(this._loadTimeoutHandle);
|
|
579
561
|
}
|
|
580
562
|
this._loadTimeoutHandle = setTimeout(() => {
|
|
581
|
-
console.
|
|
563
|
+
console.warn(
|
|
582
564
|
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
583
565
|
);
|
|
584
566
|
}, 15 * 1e3);
|
|
@@ -1056,7 +1038,7 @@ __decorateClass([
|
|
|
1056
1038
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
1057
1039
|
__decorateClass([
|
|
1058
1040
|
property()
|
|
1059
|
-
], LuzmoDashboard.prototype, "
|
|
1041
|
+
], LuzmoDashboard.prototype, "version", 2);
|
|
1060
1042
|
__decorateClass([
|
|
1061
1043
|
state()
|
|
1062
1044
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -1076,6 +1058,11 @@ var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
|
1076
1058
|
LuzmoDashboard2 = __decorateClass([
|
|
1077
1059
|
customElement("luzmo-dashboard")
|
|
1078
1060
|
], LuzmoDashboard2);
|
|
1061
|
+
var LuzmoEmbedDashboard = class extends LuzmoDashboard {
|
|
1062
|
+
};
|
|
1063
|
+
LuzmoEmbedDashboard = __decorateClass([
|
|
1064
|
+
customElement("luzmo-embed-dashboard")
|
|
1065
|
+
], LuzmoEmbedDashboard);
|
|
1079
1066
|
|
|
1080
1067
|
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1081
1068
|
import { customElement as customElement3 } from "lit/decorators.js";
|
|
@@ -1110,8 +1097,8 @@ var LuzmoBaseVizItem = class extends LitElement2 {
|
|
|
1110
1097
|
}
|
|
1111
1098
|
async firstUpdated(_changedProperties) {
|
|
1112
1099
|
super.firstUpdated(_changedProperties);
|
|
1113
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1114
1100
|
if (this.type) {
|
|
1101
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1115
1102
|
this.createAndAppendElement();
|
|
1116
1103
|
}
|
|
1117
1104
|
}
|
|
@@ -1137,7 +1124,7 @@ var LuzmoBaseVizItem = class extends LitElement2 {
|
|
|
1137
1124
|
}
|
|
1138
1125
|
}
|
|
1139
1126
|
}
|
|
1140
|
-
updated(changedProperties) {
|
|
1127
|
+
async updated(changedProperties) {
|
|
1141
1128
|
if (this.chartElement) {
|
|
1142
1129
|
for (const [propertyName] of changedProperties.entries()) {
|
|
1143
1130
|
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
@@ -1146,6 +1133,7 @@ var LuzmoBaseVizItem = class extends LitElement2 {
|
|
|
1146
1133
|
}
|
|
1147
1134
|
} else {
|
|
1148
1135
|
if (this.type) {
|
|
1136
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1149
1137
|
this.createAndAppendElement();
|
|
1150
1138
|
}
|
|
1151
1139
|
}
|
|
@@ -1204,5 +1192,6 @@ LuzmoVizItem = __decorateClass([
|
|
|
1204
1192
|
], LuzmoVizItem);
|
|
1205
1193
|
export {
|
|
1206
1194
|
LuzmoDashboard2 as LuzmoDashboard,
|
|
1195
|
+
LuzmoEmbedDashboard,
|
|
1207
1196
|
LuzmoVizItem
|
|
1208
1197
|
};
|
package/index.libs.cjs
CHANGED
|
@@ -55,7 +55,7 @@ var import_style_map = require("lit/directives/style-map.js");
|
|
|
55
55
|
var import_shared_embed = require("@luzmo/shared-embed");
|
|
56
56
|
|
|
57
57
|
// libs/embed-libs/embed/package.json
|
|
58
|
-
var version = "5.1.0-beta.
|
|
58
|
+
var version = "5.1.0-beta.4";
|
|
59
59
|
|
|
60
60
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
61
61
|
var LuzmoService = class {
|
|
@@ -100,6 +100,7 @@ var _setEventHandler = () => {
|
|
|
100
100
|
}
|
|
101
101
|
dashboardComponent.iframeLoaded = true;
|
|
102
102
|
dashboardComponent._displayError();
|
|
103
|
+
console.error("Dashboard error: ", event.data.errorMsg);
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
105
106
|
case "data": {
|
|
@@ -355,7 +356,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
355
356
|
this.browserErrorMsg = "";
|
|
356
357
|
this.dashboardError = false;
|
|
357
358
|
this.browserNotSupported = [];
|
|
358
|
-
this.
|
|
359
|
+
this.version = version + "-wc-luzmo";
|
|
359
360
|
this.isLibraryLoaded = false;
|
|
360
361
|
this.currentAuthKey = null;
|
|
361
362
|
this.currentAuthToken = null;
|
|
@@ -419,22 +420,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
419
420
|
});
|
|
420
421
|
});
|
|
421
422
|
}
|
|
422
|
-
loadLibrary(appServer) {
|
|
423
|
-
if (import_shared_embed.remotesMap[appServer]) {
|
|
424
|
-
return Promise.resolve(import_shared_embed.remotesMap[appServer].module);
|
|
425
|
-
}
|
|
426
|
-
import_shared_embed.remotesMap[appServer] = {
|
|
427
|
-
url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
428
|
-
format: "esm",
|
|
429
|
-
from: "vite",
|
|
430
|
-
module: void 0
|
|
431
|
-
};
|
|
432
|
-
return (0, import_shared_embed.__federationMethodGetRemote)(appServer, "./DashboardApp").then((module2) => {
|
|
433
|
-
const wrappedModule = (0, import_shared_embed.__federationMethodWrapDefault)(module2, true);
|
|
434
|
-
import_shared_embed.remotesMap[appServer].module = wrappedModule;
|
|
435
|
-
return wrappedModule;
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
423
|
setInputParameters(inputParameters) {
|
|
439
424
|
if (!inputParameters) {
|
|
440
425
|
return;
|
|
@@ -499,7 +484,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
499
484
|
initComponent() {
|
|
500
485
|
this.params = this._setOptions();
|
|
501
486
|
if (this.getIsViewMode()) {
|
|
502
|
-
|
|
487
|
+
SharedLib2.loadLibrary(this.params.appServer).then(async () => {
|
|
503
488
|
this.isLibraryLoaded = true;
|
|
504
489
|
await this.updateComplete;
|
|
505
490
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -575,7 +560,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
575
560
|
if (this.dashboardReference) {
|
|
576
561
|
for (const [propertyName] of changedProperties.entries()) {
|
|
577
562
|
if (propertyName === "appSever") {
|
|
578
|
-
|
|
563
|
+
SharedLib2.loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
579
564
|
this.isLibraryLoaded = true;
|
|
580
565
|
await this.updateComplete;
|
|
581
566
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -596,7 +581,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
596
581
|
clearTimeout(this._loadTimeoutHandle);
|
|
597
582
|
}
|
|
598
583
|
this._loadTimeoutHandle = setTimeout(() => {
|
|
599
|
-
console.
|
|
584
|
+
console.warn(
|
|
600
585
|
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
601
586
|
);
|
|
602
587
|
}, 15 * 1e3);
|
|
@@ -1074,7 +1059,7 @@ __decorateClass([
|
|
|
1074
1059
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
1075
1060
|
__decorateClass([
|
|
1076
1061
|
(0, import_decorators.property)()
|
|
1077
|
-
], LuzmoDashboard.prototype, "
|
|
1062
|
+
], LuzmoDashboard.prototype, "version", 2);
|
|
1078
1063
|
__decorateClass([
|
|
1079
1064
|
(0, import_decorators.state)()
|
|
1080
1065
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -1128,8 +1113,8 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1128
1113
|
}
|
|
1129
1114
|
async firstUpdated(_changedProperties) {
|
|
1130
1115
|
super.firstUpdated(_changedProperties);
|
|
1131
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1132
1116
|
if (this.type) {
|
|
1117
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1133
1118
|
this.createAndAppendElement();
|
|
1134
1119
|
}
|
|
1135
1120
|
}
|
|
@@ -1155,7 +1140,7 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1155
1140
|
}
|
|
1156
1141
|
}
|
|
1157
1142
|
}
|
|
1158
|
-
updated(changedProperties) {
|
|
1143
|
+
async updated(changedProperties) {
|
|
1159
1144
|
if (this.chartElement) {
|
|
1160
1145
|
for (const [propertyName] of changedProperties.entries()) {
|
|
1161
1146
|
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
@@ -1164,6 +1149,7 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1164
1149
|
}
|
|
1165
1150
|
} else {
|
|
1166
1151
|
if (this.type) {
|
|
1152
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1167
1153
|
this.createAndAppendElement();
|
|
1168
1154
|
}
|
|
1169
1155
|
}
|
package/index.libs.js
CHANGED
|
@@ -28,14 +28,11 @@ import {
|
|
|
28
28
|
styleMap
|
|
29
29
|
} from "lit/directives/style-map.js";
|
|
30
30
|
import {
|
|
31
|
-
__federationMethodGetRemote,
|
|
32
|
-
__federationMethodWrapDefault,
|
|
33
|
-
remotesMap,
|
|
34
31
|
luzmoEmbedContainerClass
|
|
35
32
|
} from "@luzmo/shared-embed";
|
|
36
33
|
|
|
37
34
|
// libs/embed-libs/embed/package.json
|
|
38
|
-
var version = "5.1.0-beta.
|
|
35
|
+
var version = "5.1.0-beta.4";
|
|
39
36
|
|
|
40
37
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
41
38
|
var LuzmoService = class {
|
|
@@ -80,6 +77,7 @@ var _setEventHandler = () => {
|
|
|
80
77
|
}
|
|
81
78
|
dashboardComponent.iframeLoaded = true;
|
|
82
79
|
dashboardComponent._displayError();
|
|
80
|
+
console.error("Dashboard error: ", event.data.errorMsg);
|
|
83
81
|
break;
|
|
84
82
|
}
|
|
85
83
|
case "data": {
|
|
@@ -335,7 +333,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
335
333
|
this.browserErrorMsg = "";
|
|
336
334
|
this.dashboardError = false;
|
|
337
335
|
this.browserNotSupported = [];
|
|
338
|
-
this.
|
|
336
|
+
this.version = version + "-wc-luzmo";
|
|
339
337
|
this.isLibraryLoaded = false;
|
|
340
338
|
this.currentAuthKey = null;
|
|
341
339
|
this.currentAuthToken = null;
|
|
@@ -399,22 +397,6 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
399
397
|
});
|
|
400
398
|
});
|
|
401
399
|
}
|
|
402
|
-
loadLibrary(appServer) {
|
|
403
|
-
if (remotesMap[appServer]) {
|
|
404
|
-
return Promise.resolve(remotesMap[appServer].module);
|
|
405
|
-
}
|
|
406
|
-
remotesMap[appServer] = {
|
|
407
|
-
url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
408
|
-
format: "esm",
|
|
409
|
-
from: "vite",
|
|
410
|
-
module: void 0
|
|
411
|
-
};
|
|
412
|
-
return __federationMethodGetRemote(appServer, "./DashboardApp").then((module) => {
|
|
413
|
-
const wrappedModule = __federationMethodWrapDefault(module, true);
|
|
414
|
-
remotesMap[appServer].module = wrappedModule;
|
|
415
|
-
return wrappedModule;
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
400
|
setInputParameters(inputParameters) {
|
|
419
401
|
if (!inputParameters) {
|
|
420
402
|
return;
|
|
@@ -479,7 +461,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
479
461
|
initComponent() {
|
|
480
462
|
this.params = this._setOptions();
|
|
481
463
|
if (this.getIsViewMode()) {
|
|
482
|
-
|
|
464
|
+
SharedLib2.loadLibrary(this.params.appServer).then(async () => {
|
|
483
465
|
this.isLibraryLoaded = true;
|
|
484
466
|
await this.updateComplete;
|
|
485
467
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -555,7 +537,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
555
537
|
if (this.dashboardReference) {
|
|
556
538
|
for (const [propertyName] of changedProperties.entries()) {
|
|
557
539
|
if (propertyName === "appSever") {
|
|
558
|
-
|
|
540
|
+
SharedLib2.loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
559
541
|
this.isLibraryLoaded = true;
|
|
560
542
|
await this.updateComplete;
|
|
561
543
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -576,7 +558,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
576
558
|
clearTimeout(this._loadTimeoutHandle);
|
|
577
559
|
}
|
|
578
560
|
this._loadTimeoutHandle = setTimeout(() => {
|
|
579
|
-
console.
|
|
561
|
+
console.warn(
|
|
580
562
|
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
581
563
|
);
|
|
582
564
|
}, 15 * 1e3);
|
|
@@ -1054,7 +1036,7 @@ __decorateClass([
|
|
|
1054
1036
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
1055
1037
|
__decorateClass([
|
|
1056
1038
|
property()
|
|
1057
|
-
], LuzmoDashboard.prototype, "
|
|
1039
|
+
], LuzmoDashboard.prototype, "version", 2);
|
|
1058
1040
|
__decorateClass([
|
|
1059
1041
|
state()
|
|
1060
1042
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -1108,8 +1090,8 @@ var LuzmoBaseVizItem = class extends LitElement2 {
|
|
|
1108
1090
|
}
|
|
1109
1091
|
async firstUpdated(_changedProperties) {
|
|
1110
1092
|
super.firstUpdated(_changedProperties);
|
|
1111
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1112
1093
|
if (this.type) {
|
|
1094
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1113
1095
|
this.createAndAppendElement();
|
|
1114
1096
|
}
|
|
1115
1097
|
}
|
|
@@ -1135,7 +1117,7 @@ var LuzmoBaseVizItem = class extends LitElement2 {
|
|
|
1135
1117
|
}
|
|
1136
1118
|
}
|
|
1137
1119
|
}
|
|
1138
|
-
updated(changedProperties) {
|
|
1120
|
+
async updated(changedProperties) {
|
|
1139
1121
|
if (this.chartElement) {
|
|
1140
1122
|
for (const [propertyName] of changedProperties.entries()) {
|
|
1141
1123
|
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
@@ -1144,6 +1126,7 @@ var LuzmoBaseVizItem = class extends LitElement2 {
|
|
|
1144
1126
|
}
|
|
1145
1127
|
} else {
|
|
1146
1128
|
if (this.type) {
|
|
1129
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1147
1130
|
this.createAndAppendElement();
|
|
1148
1131
|
}
|
|
1149
1132
|
}
|
|
@@ -51,7 +51,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
51
51
|
browserErrorMsg: string;
|
|
52
52
|
dashboardError: boolean;
|
|
53
53
|
browserNotSupported: any[];
|
|
54
|
-
|
|
54
|
+
version: string;
|
|
55
55
|
protected isLibraryLoaded: boolean;
|
|
56
56
|
protected dashboardReference: SharedLib.LuzmoElement;
|
|
57
57
|
currentAuthKey: string;
|
|
@@ -66,7 +66,6 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
66
66
|
iframeWidth?: string;
|
|
67
67
|
_resizeObserver: ResizeObserver;
|
|
68
68
|
constructor(inputParameters?: Record<keyof LuzmoDashboard, any>);
|
|
69
|
-
private loadLibrary;
|
|
70
69
|
private setInputParameters;
|
|
71
70
|
connectedCallback(): void;
|
|
72
71
|
disconnectedCallback(): void;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
import { LuzmoDashboard as LuzmoBaseDashboard } from './dashboard-base';
|
|
2
|
+
/**!
|
|
3
|
+
* @element luzmo-dashboard
|
|
4
|
+
* @description Exposed by @luzmo/embed lib to everyone.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Will be removed in next major release. Switch to <luzmo-embed-dashboard> instead.
|
|
7
|
+
*/
|
|
2
8
|
export declare class LuzmoDashboard extends LuzmoBaseDashboard {
|
|
3
9
|
}
|
|
10
|
+
/**!
|
|
11
|
+
* @element luzmo-embed-dashboard
|
|
12
|
+
* @description Exposed by @luzmo/embed lib to everyone.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare class LuzmoEmbedDashboard extends LuzmoBaseDashboard {
|
|
16
|
+
}
|
package/lib/luzmo-service.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export declare class LuzmoBaseVizItem extends LitElement {
|
|
|
18
18
|
protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
|
|
19
19
|
private createAndAppendElement;
|
|
20
20
|
private updateVizItemProperties;
|
|
21
|
-
updated(changedProperties: PropertyValues): void
|
|
21
|
+
updated(changedProperties: PropertyValues): Promise<void>;
|
|
22
22
|
protected render(): unknown;
|
|
23
23
|
}
|
package/luzmo-embed.libs.js
CHANGED
|
@@ -413,7 +413,7 @@ var _handleError = (errorMessage, parameters) => {
|
|
|
413
413
|
if (errorMessage) {
|
|
414
414
|
message += `:
|
|
415
415
|
${errorMessage}`;
|
|
416
|
-
console.
|
|
416
|
+
console.warn(message);
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
419
|
|
|
@@ -919,7 +919,9 @@ var getAccessibleDashboards = (dashboardComponent) => {
|
|
|
919
919
|
void (() => {
|
|
920
920
|
try {
|
|
921
921
|
const responsePromise = window.fetch(
|
|
922
|
-
|
|
922
|
+
// With experimental=true URLs remove the trailing slash, since the web component expects them to not have it.
|
|
923
|
+
// Fixes incorrect url with experimental=true
|
|
924
|
+
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
923
925
|
{
|
|
924
926
|
method: "POST",
|
|
925
927
|
mode: "cors",
|
|
@@ -968,7 +970,9 @@ var getAccessibleDashboards = (dashboardComponent) => {
|
|
|
968
970
|
try {
|
|
969
971
|
fetchUser.then((authorizationData) => {
|
|
970
972
|
const responsePromise = window.fetch(
|
|
971
|
-
|
|
973
|
+
// With experimental=true URLs remove the trailing slash, since the web component expects them to not have it.
|
|
974
|
+
// Fixes incorrect url with experimental=true
|
|
975
|
+
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
972
976
|
{
|
|
973
977
|
method: "POST",
|
|
974
978
|
mode: "cors",
|
|
@@ -1568,7 +1572,7 @@ function __federationMethodWrapDefault(module2, need) {
|
|
|
1568
1572
|
async function __federationMethodGetRemote(remoteName, componentName) {
|
|
1569
1573
|
return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
|
|
1570
1574
|
}
|
|
1571
|
-
async function loadLibrary(appServer, componentName) {
|
|
1575
|
+
async function loadLibrary(appServer, componentName = "DashboardApp") {
|
|
1572
1576
|
if (remotesMap[appServer]) {
|
|
1573
1577
|
return remotesMap[appServer].module;
|
|
1574
1578
|
}
|
|
@@ -1933,7 +1937,7 @@ var o5 = e6(class extends i4 {
|
|
|
1933
1937
|
});
|
|
1934
1938
|
|
|
1935
1939
|
// libs/embed-libs/embed/package.json
|
|
1936
|
-
var version = "5.1.0-beta.
|
|
1940
|
+
var version = "5.1.0-beta.4";
|
|
1937
1941
|
|
|
1938
1942
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1939
1943
|
var LuzmoService = class {
|
|
@@ -1977,6 +1981,7 @@ var _setEventHandler = () => {
|
|
|
1977
1981
|
}
|
|
1978
1982
|
dashboardComponent.iframeLoaded = true;
|
|
1979
1983
|
dashboardComponent._displayError();
|
|
1984
|
+
console.error("Dashboard error: ", event.data.errorMsg);
|
|
1980
1985
|
break;
|
|
1981
1986
|
}
|
|
1982
1987
|
case "data": {
|
|
@@ -2231,7 +2236,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2231
2236
|
this.browserErrorMsg = "";
|
|
2232
2237
|
this.dashboardError = false;
|
|
2233
2238
|
this.browserNotSupported = [];
|
|
2234
|
-
this.
|
|
2239
|
+
this.version = version + "-wc-luzmo";
|
|
2235
2240
|
this.isLibraryLoaded = false;
|
|
2236
2241
|
this.currentAuthKey = null;
|
|
2237
2242
|
this.currentAuthToken = null;
|
|
@@ -2295,22 +2300,6 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2295
2300
|
});
|
|
2296
2301
|
});
|
|
2297
2302
|
}
|
|
2298
|
-
loadLibrary(appServer) {
|
|
2299
|
-
if (remotesMap[appServer]) {
|
|
2300
|
-
return Promise.resolve(remotesMap[appServer].module);
|
|
2301
|
-
}
|
|
2302
|
-
remotesMap[appServer] = {
|
|
2303
|
-
url: appServer?.startsWith("http://localhost") ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
2304
|
-
format: "esm",
|
|
2305
|
-
from: "vite",
|
|
2306
|
-
module: void 0
|
|
2307
|
-
};
|
|
2308
|
-
return __federationMethodGetRemote(appServer, "./DashboardApp").then((module2) => {
|
|
2309
|
-
const wrappedModule = __federationMethodWrapDefault(module2, true);
|
|
2310
|
-
remotesMap[appServer].module = wrappedModule;
|
|
2311
|
-
return wrappedModule;
|
|
2312
|
-
});
|
|
2313
|
-
}
|
|
2314
2303
|
setInputParameters(inputParameters) {
|
|
2315
2304
|
if (!inputParameters) {
|
|
2316
2305
|
return;
|
|
@@ -2375,7 +2364,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2375
2364
|
initComponent() {
|
|
2376
2365
|
this.params = this._setOptions();
|
|
2377
2366
|
if (this.getIsViewMode()) {
|
|
2378
|
-
|
|
2367
|
+
loadLibrary(this.params.appServer).then(async () => {
|
|
2379
2368
|
this.isLibraryLoaded = true;
|
|
2380
2369
|
await this.updateComplete;
|
|
2381
2370
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -2451,7 +2440,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2451
2440
|
if (this.dashboardReference) {
|
|
2452
2441
|
for (const [propertyName] of changedProperties.entries()) {
|
|
2453
2442
|
if (propertyName === "appSever") {
|
|
2454
|
-
|
|
2443
|
+
loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
2455
2444
|
this.isLibraryLoaded = true;
|
|
2456
2445
|
await this.updateComplete;
|
|
2457
2446
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -2472,7 +2461,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2472
2461
|
clearTimeout(this._loadTimeoutHandle);
|
|
2473
2462
|
}
|
|
2474
2463
|
this._loadTimeoutHandle = setTimeout(() => {
|
|
2475
|
-
console.
|
|
2464
|
+
console.warn(
|
|
2476
2465
|
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
2477
2466
|
);
|
|
2478
2467
|
}, 15 * 1e3);
|
|
@@ -2950,7 +2939,7 @@ __decorateClass([
|
|
|
2950
2939
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
2951
2940
|
__decorateClass([
|
|
2952
2941
|
n3()
|
|
2953
|
-
], LuzmoDashboard.prototype, "
|
|
2942
|
+
], LuzmoDashboard.prototype, "version", 2);
|
|
2954
2943
|
__decorateClass([
|
|
2955
2944
|
r4()
|
|
2956
2945
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -2998,8 +2987,8 @@ var LuzmoBaseVizItem = class extends s3 {
|
|
|
2998
2987
|
}
|
|
2999
2988
|
async firstUpdated(_changedProperties) {
|
|
3000
2989
|
super.firstUpdated(_changedProperties);
|
|
3001
|
-
await loadLibrary(this.appServer, "DashboardApp");
|
|
3002
2990
|
if (this.type) {
|
|
2991
|
+
await loadLibrary(this.appServer, "DashboardApp");
|
|
3003
2992
|
this.createAndAppendElement();
|
|
3004
2993
|
}
|
|
3005
2994
|
}
|
|
@@ -3025,7 +3014,7 @@ var LuzmoBaseVizItem = class extends s3 {
|
|
|
3025
3014
|
}
|
|
3026
3015
|
}
|
|
3027
3016
|
}
|
|
3028
|
-
updated(changedProperties) {
|
|
3017
|
+
async updated(changedProperties) {
|
|
3029
3018
|
if (this.chartElement) {
|
|
3030
3019
|
for (const [propertyName] of changedProperties.entries()) {
|
|
3031
3020
|
const mappedAttributeName = libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
@@ -3034,6 +3023,7 @@ var LuzmoBaseVizItem = class extends s3 {
|
|
|
3034
3023
|
}
|
|
3035
3024
|
} else {
|
|
3036
3025
|
if (this.type) {
|
|
3026
|
+
await loadLibrary(this.appServer, "DashboardApp");
|
|
3037
3027
|
this.createAndAppendElement();
|
|
3038
3028
|
}
|
|
3039
3029
|
}
|
package/luzmo-embed.min.js
CHANGED
|
@@ -43,6 +43,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
43
43
|
var src_exports2 = {};
|
|
44
44
|
__export(src_exports2, {
|
|
45
45
|
LuzmoDashboard: () => LuzmoDashboard2,
|
|
46
|
+
LuzmoEmbedDashboard: () => LuzmoEmbedDashboard,
|
|
46
47
|
LuzmoVizItem: () => LuzmoVizItem
|
|
47
48
|
});
|
|
48
49
|
module.exports = __toCommonJS(src_exports2);
|
|
@@ -413,7 +414,7 @@ var _handleError = (errorMessage, parameters) => {
|
|
|
413
414
|
if (errorMessage) {
|
|
414
415
|
message += `:
|
|
415
416
|
${errorMessage}`;
|
|
416
|
-
console.
|
|
417
|
+
console.warn(message);
|
|
417
418
|
}
|
|
418
419
|
};
|
|
419
420
|
|
|
@@ -919,7 +920,9 @@ var getAccessibleDashboards = (dashboardComponent) => {
|
|
|
919
920
|
void (() => {
|
|
920
921
|
try {
|
|
921
922
|
const responsePromise = window.fetch(
|
|
922
|
-
|
|
923
|
+
// With experimental=true URLs remove the trailing slash, since the web component expects them to not have it.
|
|
924
|
+
// Fixes incorrect url with experimental=true
|
|
925
|
+
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
923
926
|
{
|
|
924
927
|
method: "POST",
|
|
925
928
|
mode: "cors",
|
|
@@ -968,7 +971,9 @@ var getAccessibleDashboards = (dashboardComponent) => {
|
|
|
968
971
|
try {
|
|
969
972
|
fetchUser.then((authorizationData) => {
|
|
970
973
|
const responsePromise = window.fetch(
|
|
971
|
-
|
|
974
|
+
// With experimental=true URLs remove the trailing slash, since the web component expects them to not have it.
|
|
975
|
+
// Fixes incorrect url with experimental=true
|
|
976
|
+
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
972
977
|
{
|
|
973
978
|
method: "POST",
|
|
974
979
|
mode: "cors",
|
|
@@ -1568,7 +1573,7 @@ function __federationMethodWrapDefault(module2, need) {
|
|
|
1568
1573
|
async function __federationMethodGetRemote(remoteName, componentName) {
|
|
1569
1574
|
return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
|
|
1570
1575
|
}
|
|
1571
|
-
async function loadLibrary(appServer, componentName) {
|
|
1576
|
+
async function loadLibrary(appServer, componentName = "DashboardApp") {
|
|
1572
1577
|
if (remotesMap[appServer]) {
|
|
1573
1578
|
return remotesMap[appServer].module;
|
|
1574
1579
|
}
|
|
@@ -1933,7 +1938,7 @@ var o5 = e6(class extends i4 {
|
|
|
1933
1938
|
});
|
|
1934
1939
|
|
|
1935
1940
|
// libs/embed-libs/embed/package.json
|
|
1936
|
-
var version = "5.1.0-beta.
|
|
1941
|
+
var version = "5.1.0-beta.4";
|
|
1937
1942
|
|
|
1938
1943
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1939
1944
|
var LuzmoService = class {
|
|
@@ -1977,6 +1982,7 @@ var _setEventHandler = () => {
|
|
|
1977
1982
|
}
|
|
1978
1983
|
dashboardComponent.iframeLoaded = true;
|
|
1979
1984
|
dashboardComponent._displayError();
|
|
1985
|
+
console.error("Dashboard error: ", event.data.errorMsg);
|
|
1980
1986
|
break;
|
|
1981
1987
|
}
|
|
1982
1988
|
case "data": {
|
|
@@ -2231,7 +2237,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2231
2237
|
this.browserErrorMsg = "";
|
|
2232
2238
|
this.dashboardError = false;
|
|
2233
2239
|
this.browserNotSupported = [];
|
|
2234
|
-
this.
|
|
2240
|
+
this.version = version + "-wc-luzmo";
|
|
2235
2241
|
this.isLibraryLoaded = false;
|
|
2236
2242
|
this.currentAuthKey = null;
|
|
2237
2243
|
this.currentAuthToken = null;
|
|
@@ -2295,22 +2301,6 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2295
2301
|
});
|
|
2296
2302
|
});
|
|
2297
2303
|
}
|
|
2298
|
-
loadLibrary(appServer) {
|
|
2299
|
-
if (remotesMap[appServer]) {
|
|
2300
|
-
return Promise.resolve(remotesMap[appServer].module);
|
|
2301
|
-
}
|
|
2302
|
-
remotesMap[appServer] = {
|
|
2303
|
-
url: appServer?.startsWith("http://localhost") ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
2304
|
-
format: "esm",
|
|
2305
|
-
from: "vite",
|
|
2306
|
-
module: void 0
|
|
2307
|
-
};
|
|
2308
|
-
return __federationMethodGetRemote(appServer, "./DashboardApp").then((module2) => {
|
|
2309
|
-
const wrappedModule = __federationMethodWrapDefault(module2, true);
|
|
2310
|
-
remotesMap[appServer].module = wrappedModule;
|
|
2311
|
-
return wrappedModule;
|
|
2312
|
-
});
|
|
2313
|
-
}
|
|
2314
2304
|
setInputParameters(inputParameters) {
|
|
2315
2305
|
if (!inputParameters) {
|
|
2316
2306
|
return;
|
|
@@ -2375,7 +2365,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2375
2365
|
initComponent() {
|
|
2376
2366
|
this.params = this._setOptions();
|
|
2377
2367
|
if (this.getIsViewMode()) {
|
|
2378
|
-
|
|
2368
|
+
loadLibrary(this.params.appServer).then(async () => {
|
|
2379
2369
|
this.isLibraryLoaded = true;
|
|
2380
2370
|
await this.updateComplete;
|
|
2381
2371
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -2451,7 +2441,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2451
2441
|
if (this.dashboardReference) {
|
|
2452
2442
|
for (const [propertyName] of changedProperties.entries()) {
|
|
2453
2443
|
if (propertyName === "appSever") {
|
|
2454
|
-
|
|
2444
|
+
loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
2455
2445
|
this.isLibraryLoaded = true;
|
|
2456
2446
|
await this.updateComplete;
|
|
2457
2447
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -2472,7 +2462,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2472
2462
|
clearTimeout(this._loadTimeoutHandle);
|
|
2473
2463
|
}
|
|
2474
2464
|
this._loadTimeoutHandle = setTimeout(() => {
|
|
2475
|
-
console.
|
|
2465
|
+
console.warn(
|
|
2476
2466
|
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
2477
2467
|
);
|
|
2478
2468
|
}, 15 * 1e3);
|
|
@@ -2950,7 +2940,7 @@ __decorateClass([
|
|
|
2950
2940
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
2951
2941
|
__decorateClass([
|
|
2952
2942
|
n3()
|
|
2953
|
-
], LuzmoDashboard.prototype, "
|
|
2943
|
+
], LuzmoDashboard.prototype, "version", 2);
|
|
2954
2944
|
__decorateClass([
|
|
2955
2945
|
r4()
|
|
2956
2946
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -2970,6 +2960,11 @@ var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
|
2970
2960
|
LuzmoDashboard2 = __decorateClass([
|
|
2971
2961
|
t("luzmo-dashboard")
|
|
2972
2962
|
], LuzmoDashboard2);
|
|
2963
|
+
var LuzmoEmbedDashboard = class extends LuzmoDashboard {
|
|
2964
|
+
};
|
|
2965
|
+
LuzmoEmbedDashboard = __decorateClass([
|
|
2966
|
+
t("luzmo-embed-dashboard")
|
|
2967
|
+
], LuzmoEmbedDashboard);
|
|
2973
2968
|
|
|
2974
2969
|
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
2975
2970
|
var LuzmoBaseVizItem = class extends s3 {
|
|
@@ -2998,8 +2993,8 @@ var LuzmoBaseVizItem = class extends s3 {
|
|
|
2998
2993
|
}
|
|
2999
2994
|
async firstUpdated(_changedProperties) {
|
|
3000
2995
|
super.firstUpdated(_changedProperties);
|
|
3001
|
-
await loadLibrary(this.appServer, "DashboardApp");
|
|
3002
2996
|
if (this.type) {
|
|
2997
|
+
await loadLibrary(this.appServer, "DashboardApp");
|
|
3003
2998
|
this.createAndAppendElement();
|
|
3004
2999
|
}
|
|
3005
3000
|
}
|
|
@@ -3025,7 +3020,7 @@ var LuzmoBaseVizItem = class extends s3 {
|
|
|
3025
3020
|
}
|
|
3026
3021
|
}
|
|
3027
3022
|
}
|
|
3028
|
-
updated(changedProperties) {
|
|
3023
|
+
async updated(changedProperties) {
|
|
3029
3024
|
if (this.chartElement) {
|
|
3030
3025
|
for (const [propertyName] of changedProperties.entries()) {
|
|
3031
3026
|
const mappedAttributeName = libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
@@ -3034,6 +3029,7 @@ var LuzmoBaseVizItem = class extends s3 {
|
|
|
3034
3029
|
}
|
|
3035
3030
|
} else {
|
|
3036
3031
|
if (this.type) {
|
|
3032
|
+
await loadLibrary(this.appServer, "DashboardApp");
|
|
3037
3033
|
this.createAndAppendElement();
|
|
3038
3034
|
}
|
|
3039
3035
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type FilterExpressionType = '? = ?' | '? != ?' | '? in ?' | '? not in ?' | '? like ?' | '? not like ?' | '? < ?' | '? <= ?' | '? > ?' | '? >= ?' | '? starts with ?' | '? not starts with ?' | '? ends with ?' | '? not ends with ?' | 'last_now' | 'last_available' | 'last_completed' | 'to_date' | 'WTD' | 'MTD' | 'QTD' | 'YTD' | '? within ?' | '? is null' | '? is not null';
|
|
2
|
-
export interface FilterInterface {
|
|
3
|
-
expression: FilterExpressionType;
|
|
4
|
-
parameters?: any;
|
|
5
|
-
properties?: any;
|
|
6
|
-
}
|
package/src/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type { LoadEvent, ChangedFiltersEvent, CustomEvent, ItemsRenderedEvent, ExportedEvent, DashboardActionEvent, Filter, FilterExpression, FilterOrigin, FilterInput, FilterGroup, ExportType, ItemData, ExportDashboard, AccessibleDashboard, SetEditMode } from '@luzmo/shared-embed';
|
|
2
|
-
export * from './lib/dashboard-component/dashboard-component';
|
|
3
|
-
export * from './lib/viz-item/viz-item-component';
|
|
@@ -1,98 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const dashboardStyles: import("lit").CSSResult;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const _setEventHandler: () => void;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
import * as SharedLib from '@luzmo/shared-embed';
|
|
3
|
-
export declare class LuzmoBaseVizItem extends LitElement {
|
|
4
|
-
appServer: string;
|
|
5
|
-
apiHost: string;
|
|
6
|
-
slots: SharedLib.Slots;
|
|
7
|
-
options: SharedLib.VizItemOptions;
|
|
8
|
-
type?: SharedLib.ItemType;
|
|
9
|
-
authKey?: string;
|
|
10
|
-
authToken?: string;
|
|
11
|
-
version?: string;
|
|
12
|
-
contextId?: string;
|
|
13
|
-
canFilter?: SharedLib.CanFilter;
|
|
14
|
-
filters?: SharedLib.FilterGroup[];
|
|
15
|
-
chartElement: HTMLElement;
|
|
16
|
-
static styles: import("lit").CSSResult;
|
|
17
|
-
constructor();
|
|
18
|
-
protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
|
|
19
|
-
private createAndAppendElement;
|
|
20
|
-
private updateVizItemProperties;
|
|
21
|
-
updated(changedProperties: PropertyValues): void;
|
|
22
|
-
protected render(): unknown;
|
|
23
|
-
}
|