@luzmo/embed 5.1.0-beta.4 → 5.1.1
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/index.cjs +23 -136
- package/index.d.ts +0 -1
- package/index.js +25 -134
- package/index.libs.cjs +23 -136
- package/index.libs.d.ts +0 -1
- package/index.libs.js +25 -134
- package/lib/dashboard-component/dashboard-base.d.ts +2 -1
- package/luzmo-embed.libs.js +22 -158
- package/luzmo-embed.min.js +22 -158
- package/package.json +2 -2
- package/src/index.d.ts +2 -0
- package/src/lib/dashboard-component/dashboard-base.d.ts +98 -0
- package/src/lib/dashboard-component/dashboard-component.d.ts +16 -0
- package/src/lib/dashboard-component/dashboard-styles.d.ts +1 -0
- package/src/lib/helper/event-bus-handler.d.ts +1 -0
- package/src/lib/luzmo-service.d.ts +6 -0
- package/lib/viz-item/viz-item-component.d.ts +0 -3
- package/lib/viz-item/viz-item-web-component.d.ts +0 -3
- package/lib/viz-item/viz-item.base.d.ts +0 -23
package/index.cjs
CHANGED
|
@@ -40,8 +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
|
|
44
|
-
LuzmoVizItem: () => LuzmoVizItem
|
|
43
|
+
LuzmoEmbedDashboard: () => LuzmoEmbedDashboard
|
|
45
44
|
});
|
|
46
45
|
module.exports = __toCommonJS(src_exports);
|
|
47
46
|
|
|
@@ -56,7 +55,7 @@ var import_style_map = require("lit/directives/style-map.js");
|
|
|
56
55
|
var import_shared_embed = require("@luzmo/shared-embed");
|
|
57
56
|
|
|
58
57
|
// libs/embed-libs/embed/package.json
|
|
59
|
-
var version = "5.1.
|
|
58
|
+
var version = "5.1.1";
|
|
60
59
|
|
|
61
60
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
62
61
|
var LuzmoService = class {
|
|
@@ -357,7 +356,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
357
356
|
this.browserErrorMsg = "";
|
|
358
357
|
this.dashboardError = false;
|
|
359
358
|
this.browserNotSupported = [];
|
|
360
|
-
this.
|
|
359
|
+
this.VERSION = version + "-wc-luzmo";
|
|
361
360
|
this.isLibraryLoaded = false;
|
|
362
361
|
this.currentAuthKey = null;
|
|
363
362
|
this.currentAuthToken = null;
|
|
@@ -421,6 +420,22 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
421
420
|
});
|
|
422
421
|
});
|
|
423
422
|
}
|
|
423
|
+
loadLibrary(appServer) {
|
|
424
|
+
if (import_shared_embed.remotesMap[appServer]) {
|
|
425
|
+
return Promise.resolve(import_shared_embed.remotesMap[appServer].module);
|
|
426
|
+
}
|
|
427
|
+
import_shared_embed.remotesMap[appServer] = {
|
|
428
|
+
url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
429
|
+
format: "esm",
|
|
430
|
+
from: "vite",
|
|
431
|
+
module: void 0
|
|
432
|
+
};
|
|
433
|
+
return (0, import_shared_embed.__federationMethodGetRemote)(appServer, "./DashboardApp").then((module2) => {
|
|
434
|
+
const wrappedModule = (0, import_shared_embed.__federationMethodWrapDefault)(module2, true);
|
|
435
|
+
import_shared_embed.remotesMap[appServer].module = wrappedModule;
|
|
436
|
+
return wrappedModule;
|
|
437
|
+
});
|
|
438
|
+
}
|
|
424
439
|
setInputParameters(inputParameters) {
|
|
425
440
|
if (!inputParameters) {
|
|
426
441
|
return;
|
|
@@ -485,7 +500,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
485
500
|
initComponent() {
|
|
486
501
|
this.params = this._setOptions();
|
|
487
502
|
if (this.getIsViewMode()) {
|
|
488
|
-
|
|
503
|
+
this.loadLibrary(this.params.appServer).then(async () => {
|
|
489
504
|
this.isLibraryLoaded = true;
|
|
490
505
|
await this.updateComplete;
|
|
491
506
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -561,7 +576,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
561
576
|
if (this.dashboardReference) {
|
|
562
577
|
for (const [propertyName] of changedProperties.entries()) {
|
|
563
578
|
if (propertyName === "appSever") {
|
|
564
|
-
|
|
579
|
+
this.loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
565
580
|
this.isLibraryLoaded = true;
|
|
566
581
|
await this.updateComplete;
|
|
567
582
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -1060,7 +1075,7 @@ __decorateClass([
|
|
|
1060
1075
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
1061
1076
|
__decorateClass([
|
|
1062
1077
|
(0, import_decorators.property)()
|
|
1063
|
-
], LuzmoDashboard.prototype, "
|
|
1078
|
+
], LuzmoDashboard.prototype, "VERSION", 2);
|
|
1064
1079
|
__decorateClass([
|
|
1065
1080
|
(0, import_decorators.state)()
|
|
1066
1081
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -1085,136 +1100,8 @@ var LuzmoEmbedDashboard = class extends LuzmoDashboard {
|
|
|
1085
1100
|
LuzmoEmbedDashboard = __decorateClass([
|
|
1086
1101
|
(0, import_decorators2.customElement)("luzmo-embed-dashboard")
|
|
1087
1102
|
], LuzmoEmbedDashboard);
|
|
1088
|
-
|
|
1089
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1090
|
-
var import_decorators4 = require("lit/decorators.js");
|
|
1091
|
-
|
|
1092
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1093
|
-
var import_decorators3 = require("lit/decorators.js");
|
|
1094
|
-
var import_lit3 = require("lit");
|
|
1095
|
-
var SharedLib3 = __toESM(require("@luzmo/shared-embed"), 1);
|
|
1096
|
-
var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
1097
|
-
constructor() {
|
|
1098
|
-
super();
|
|
1099
|
-
this.appServer = "https://app.luzmo.com";
|
|
1100
|
-
this.apiHost = "https://api.luzmo.com";
|
|
1101
|
-
this.slots = [];
|
|
1102
|
-
this.options = {
|
|
1103
|
-
title: {
|
|
1104
|
-
en: ""
|
|
1105
|
-
},
|
|
1106
|
-
theme: "default"
|
|
1107
|
-
};
|
|
1108
|
-
this.version = version + "-wc-luzmo";
|
|
1109
|
-
}
|
|
1110
|
-
static {
|
|
1111
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1112
|
-
this.styles = import_lit3.css`
|
|
1113
|
-
:host {
|
|
1114
|
-
display: block;
|
|
1115
|
-
width: 100%;
|
|
1116
|
-
height: 100%;
|
|
1117
|
-
}
|
|
1118
|
-
`;
|
|
1119
|
-
}
|
|
1120
|
-
async firstUpdated(_changedProperties) {
|
|
1121
|
-
super.firstUpdated(_changedProperties);
|
|
1122
|
-
if (this.type) {
|
|
1123
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1124
|
-
this.createAndAppendElement();
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
createAndAppendElement() {
|
|
1128
|
-
if (!this.chartElement) {
|
|
1129
|
-
this.chartElement = document.createElement("chart-component");
|
|
1130
|
-
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
1131
|
-
this.updateVizItemProperties();
|
|
1132
|
-
this.renderRoot.append(this.chartElement);
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
updateVizItemProperties() {
|
|
1136
|
-
if (this.chartElement) {
|
|
1137
|
-
for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
|
|
1138
|
-
const value = this[key];
|
|
1139
|
-
if (value) {
|
|
1140
|
-
const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
|
|
1141
|
-
this.chartElement.setAttribute(
|
|
1142
|
-
SharedLib3.libraryTypeToWebComponentTypeMapping[key],
|
|
1143
|
-
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
1144
|
-
);
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
async updated(changedProperties) {
|
|
1150
|
-
if (this.chartElement) {
|
|
1151
|
-
for (const [propertyName] of changedProperties.entries()) {
|
|
1152
|
-
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
1153
|
-
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
1154
|
-
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1155
|
-
}
|
|
1156
|
-
} else {
|
|
1157
|
-
if (this.type) {
|
|
1158
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1159
|
-
this.createAndAppendElement();
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
render() {
|
|
1164
|
-
return import_lit3.html` `;
|
|
1165
|
-
}
|
|
1166
|
-
};
|
|
1167
|
-
__decorateClass([
|
|
1168
|
-
(0, import_decorators3.property)()
|
|
1169
|
-
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
1170
|
-
__decorateClass([
|
|
1171
|
-
(0, import_decorators3.property)()
|
|
1172
|
-
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
1173
|
-
__decorateClass([
|
|
1174
|
-
(0, import_decorators3.property)({ type: Array })
|
|
1175
|
-
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
1176
|
-
__decorateClass([
|
|
1177
|
-
(0, import_decorators3.property)({ type: Object })
|
|
1178
|
-
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
1179
|
-
__decorateClass([
|
|
1180
|
-
(0, import_decorators3.property)()
|
|
1181
|
-
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
1182
|
-
__decorateClass([
|
|
1183
|
-
(0, import_decorators3.property)()
|
|
1184
|
-
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
1185
|
-
__decorateClass([
|
|
1186
|
-
(0, import_decorators3.property)()
|
|
1187
|
-
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
1188
|
-
__decorateClass([
|
|
1189
|
-
(0, import_decorators3.property)()
|
|
1190
|
-
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
1191
|
-
__decorateClass([
|
|
1192
|
-
(0, import_decorators3.property)()
|
|
1193
|
-
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
1194
|
-
__decorateClass([
|
|
1195
|
-
(0, import_decorators3.property)({
|
|
1196
|
-
converter: (value) => {
|
|
1197
|
-
try {
|
|
1198
|
-
return JSON.parse(value);
|
|
1199
|
-
} catch (exc) {
|
|
1200
|
-
return value;
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
})
|
|
1204
|
-
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
1205
|
-
__decorateClass([
|
|
1206
|
-
(0, import_decorators3.property)({ type: Array })
|
|
1207
|
-
], LuzmoBaseVizItem.prototype, "filters", 2);
|
|
1208
|
-
|
|
1209
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1210
|
-
var LuzmoVizItem = class extends LuzmoBaseVizItem {
|
|
1211
|
-
};
|
|
1212
|
-
LuzmoVizItem = __decorateClass([
|
|
1213
|
-
(0, import_decorators4.customElement)("luzmo-viz-item")
|
|
1214
|
-
], LuzmoVizItem);
|
|
1215
1103
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1216
1104
|
0 && (module.exports = {
|
|
1217
1105
|
LuzmoDashboard,
|
|
1218
|
-
LuzmoEmbedDashboard
|
|
1219
|
-
LuzmoVizItem
|
|
1106
|
+
LuzmoEmbedDashboard
|
|
1220
1107
|
});
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export type { LoadEvent, ChangedFiltersEvent, CustomEvent, ItemsRenderedEvent, ExportedEvent, DashboardActionEvent, Filter, FilterExpression, FilterOrigin, FilterInput, FilterGroup, ExportType, ItemData, ExportDashboard, AccessibleDashboard, SetEditMode } from '@luzmo/shared-embed';
|
|
2
2
|
export * from './lib/dashboard-component/dashboard-component';
|
|
3
|
-
export * from './lib/viz-item/viz-item-component';
|
package/index.js
CHANGED
|
@@ -30,11 +30,14 @@ import {
|
|
|
30
30
|
styleMap
|
|
31
31
|
} from "lit/directives/style-map.js";
|
|
32
32
|
import {
|
|
33
|
+
__federationMethodGetRemote,
|
|
34
|
+
__federationMethodWrapDefault,
|
|
35
|
+
remotesMap,
|
|
33
36
|
luzmoEmbedContainerClass
|
|
34
37
|
} from "@luzmo/shared-embed";
|
|
35
38
|
|
|
36
39
|
// libs/embed-libs/embed/package.json
|
|
37
|
-
var version = "5.1.
|
|
40
|
+
var version = "5.1.1";
|
|
38
41
|
|
|
39
42
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
40
43
|
var LuzmoService = class {
|
|
@@ -335,7 +338,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
335
338
|
this.browserErrorMsg = "";
|
|
336
339
|
this.dashboardError = false;
|
|
337
340
|
this.browserNotSupported = [];
|
|
338
|
-
this.
|
|
341
|
+
this.VERSION = version + "-wc-luzmo";
|
|
339
342
|
this.isLibraryLoaded = false;
|
|
340
343
|
this.currentAuthKey = null;
|
|
341
344
|
this.currentAuthToken = null;
|
|
@@ -399,6 +402,22 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
399
402
|
});
|
|
400
403
|
});
|
|
401
404
|
}
|
|
405
|
+
loadLibrary(appServer) {
|
|
406
|
+
if (remotesMap[appServer]) {
|
|
407
|
+
return Promise.resolve(remotesMap[appServer].module);
|
|
408
|
+
}
|
|
409
|
+
remotesMap[appServer] = {
|
|
410
|
+
url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
411
|
+
format: "esm",
|
|
412
|
+
from: "vite",
|
|
413
|
+
module: void 0
|
|
414
|
+
};
|
|
415
|
+
return __federationMethodGetRemote(appServer, "./DashboardApp").then((module) => {
|
|
416
|
+
const wrappedModule = __federationMethodWrapDefault(module, true);
|
|
417
|
+
remotesMap[appServer].module = wrappedModule;
|
|
418
|
+
return wrappedModule;
|
|
419
|
+
});
|
|
420
|
+
}
|
|
402
421
|
setInputParameters(inputParameters) {
|
|
403
422
|
if (!inputParameters) {
|
|
404
423
|
return;
|
|
@@ -463,7 +482,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
463
482
|
initComponent() {
|
|
464
483
|
this.params = this._setOptions();
|
|
465
484
|
if (this.getIsViewMode()) {
|
|
466
|
-
|
|
485
|
+
this.loadLibrary(this.params.appServer).then(async () => {
|
|
467
486
|
this.isLibraryLoaded = true;
|
|
468
487
|
await this.updateComplete;
|
|
469
488
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -539,7 +558,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
539
558
|
if (this.dashboardReference) {
|
|
540
559
|
for (const [propertyName] of changedProperties.entries()) {
|
|
541
560
|
if (propertyName === "appSever") {
|
|
542
|
-
|
|
561
|
+
this.loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
543
562
|
this.isLibraryLoaded = true;
|
|
544
563
|
await this.updateComplete;
|
|
545
564
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -1038,7 +1057,7 @@ __decorateClass([
|
|
|
1038
1057
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
1039
1058
|
__decorateClass([
|
|
1040
1059
|
property()
|
|
1041
|
-
], LuzmoDashboard.prototype, "
|
|
1060
|
+
], LuzmoDashboard.prototype, "VERSION", 2);
|
|
1042
1061
|
__decorateClass([
|
|
1043
1062
|
state()
|
|
1044
1063
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -1063,135 +1082,7 @@ var LuzmoEmbedDashboard = class extends LuzmoDashboard {
|
|
|
1063
1082
|
LuzmoEmbedDashboard = __decorateClass([
|
|
1064
1083
|
customElement("luzmo-embed-dashboard")
|
|
1065
1084
|
], LuzmoEmbedDashboard);
|
|
1066
|
-
|
|
1067
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1068
|
-
import { customElement as customElement3 } from "lit/decorators.js";
|
|
1069
|
-
|
|
1070
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1071
|
-
import { property as property2 } from "lit/decorators.js";
|
|
1072
|
-
import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
|
|
1073
|
-
import * as SharedLib3 from "@luzmo/shared-embed";
|
|
1074
|
-
var LuzmoBaseVizItem = class extends LitElement2 {
|
|
1075
|
-
constructor() {
|
|
1076
|
-
super();
|
|
1077
|
-
this.appServer = "https://app.luzmo.com";
|
|
1078
|
-
this.apiHost = "https://api.luzmo.com";
|
|
1079
|
-
this.slots = [];
|
|
1080
|
-
this.options = {
|
|
1081
|
-
title: {
|
|
1082
|
-
en: ""
|
|
1083
|
-
},
|
|
1084
|
-
theme: "default"
|
|
1085
|
-
};
|
|
1086
|
-
this.version = version + "-wc-luzmo";
|
|
1087
|
-
}
|
|
1088
|
-
static {
|
|
1089
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1090
|
-
this.styles = css2`
|
|
1091
|
-
:host {
|
|
1092
|
-
display: block;
|
|
1093
|
-
width: 100%;
|
|
1094
|
-
height: 100%;
|
|
1095
|
-
}
|
|
1096
|
-
`;
|
|
1097
|
-
}
|
|
1098
|
-
async firstUpdated(_changedProperties) {
|
|
1099
|
-
super.firstUpdated(_changedProperties);
|
|
1100
|
-
if (this.type) {
|
|
1101
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1102
|
-
this.createAndAppendElement();
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
createAndAppendElement() {
|
|
1106
|
-
if (!this.chartElement) {
|
|
1107
|
-
this.chartElement = document.createElement("chart-component");
|
|
1108
|
-
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
1109
|
-
this.updateVizItemProperties();
|
|
1110
|
-
this.renderRoot.append(this.chartElement);
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
updateVizItemProperties() {
|
|
1114
|
-
if (this.chartElement) {
|
|
1115
|
-
for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
|
|
1116
|
-
const value = this[key];
|
|
1117
|
-
if (value) {
|
|
1118
|
-
const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
|
|
1119
|
-
this.chartElement.setAttribute(
|
|
1120
|
-
SharedLib3.libraryTypeToWebComponentTypeMapping[key],
|
|
1121
|
-
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
1122
|
-
);
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
async updated(changedProperties) {
|
|
1128
|
-
if (this.chartElement) {
|
|
1129
|
-
for (const [propertyName] of changedProperties.entries()) {
|
|
1130
|
-
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
1131
|
-
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
1132
|
-
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1133
|
-
}
|
|
1134
|
-
} else {
|
|
1135
|
-
if (this.type) {
|
|
1136
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1137
|
-
this.createAndAppendElement();
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
render() {
|
|
1142
|
-
return html2` `;
|
|
1143
|
-
}
|
|
1144
|
-
};
|
|
1145
|
-
__decorateClass([
|
|
1146
|
-
property2()
|
|
1147
|
-
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
1148
|
-
__decorateClass([
|
|
1149
|
-
property2()
|
|
1150
|
-
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
1151
|
-
__decorateClass([
|
|
1152
|
-
property2({ type: Array })
|
|
1153
|
-
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
1154
|
-
__decorateClass([
|
|
1155
|
-
property2({ type: Object })
|
|
1156
|
-
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
1157
|
-
__decorateClass([
|
|
1158
|
-
property2()
|
|
1159
|
-
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
1160
|
-
__decorateClass([
|
|
1161
|
-
property2()
|
|
1162
|
-
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
1163
|
-
__decorateClass([
|
|
1164
|
-
property2()
|
|
1165
|
-
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
1166
|
-
__decorateClass([
|
|
1167
|
-
property2()
|
|
1168
|
-
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
1169
|
-
__decorateClass([
|
|
1170
|
-
property2()
|
|
1171
|
-
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
1172
|
-
__decorateClass([
|
|
1173
|
-
property2({
|
|
1174
|
-
converter: (value) => {
|
|
1175
|
-
try {
|
|
1176
|
-
return JSON.parse(value);
|
|
1177
|
-
} catch (exc) {
|
|
1178
|
-
return value;
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
})
|
|
1182
|
-
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
1183
|
-
__decorateClass([
|
|
1184
|
-
property2({ type: Array })
|
|
1185
|
-
], LuzmoBaseVizItem.prototype, "filters", 2);
|
|
1186
|
-
|
|
1187
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1188
|
-
var LuzmoVizItem = class extends LuzmoBaseVizItem {
|
|
1189
|
-
};
|
|
1190
|
-
LuzmoVizItem = __decorateClass([
|
|
1191
|
-
customElement3("luzmo-viz-item")
|
|
1192
|
-
], LuzmoVizItem);
|
|
1193
1085
|
export {
|
|
1194
1086
|
LuzmoDashboard2 as LuzmoDashboard,
|
|
1195
|
-
LuzmoEmbedDashboard
|
|
1196
|
-
LuzmoVizItem
|
|
1087
|
+
LuzmoEmbedDashboard
|
|
1197
1088
|
};
|
package/index.libs.cjs
CHANGED
|
@@ -39,8 +39,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
39
39
|
// libs/embed-libs/embed/src/index.libs.ts
|
|
40
40
|
var index_libs_exports = {};
|
|
41
41
|
__export(index_libs_exports, {
|
|
42
|
-
LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent
|
|
43
|
-
LuzmoVizItemWebComponent: () => LuzmoVizItemWebComponent
|
|
42
|
+
LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent
|
|
44
43
|
});
|
|
45
44
|
module.exports = __toCommonJS(index_libs_exports);
|
|
46
45
|
|
|
@@ -55,7 +54,7 @@ var import_style_map = require("lit/directives/style-map.js");
|
|
|
55
54
|
var import_shared_embed = require("@luzmo/shared-embed");
|
|
56
55
|
|
|
57
56
|
// libs/embed-libs/embed/package.json
|
|
58
|
-
var version = "5.1.
|
|
57
|
+
var version = "5.1.1";
|
|
59
58
|
|
|
60
59
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
61
60
|
var LuzmoService = class {
|
|
@@ -356,7 +355,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
356
355
|
this.browserErrorMsg = "";
|
|
357
356
|
this.dashboardError = false;
|
|
358
357
|
this.browserNotSupported = [];
|
|
359
|
-
this.
|
|
358
|
+
this.VERSION = version + "-wc-luzmo";
|
|
360
359
|
this.isLibraryLoaded = false;
|
|
361
360
|
this.currentAuthKey = null;
|
|
362
361
|
this.currentAuthToken = null;
|
|
@@ -420,6 +419,22 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
420
419
|
});
|
|
421
420
|
});
|
|
422
421
|
}
|
|
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
|
+
}
|
|
423
438
|
setInputParameters(inputParameters) {
|
|
424
439
|
if (!inputParameters) {
|
|
425
440
|
return;
|
|
@@ -484,7 +499,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
484
499
|
initComponent() {
|
|
485
500
|
this.params = this._setOptions();
|
|
486
501
|
if (this.getIsViewMode()) {
|
|
487
|
-
|
|
502
|
+
this.loadLibrary(this.params.appServer).then(async () => {
|
|
488
503
|
this.isLibraryLoaded = true;
|
|
489
504
|
await this.updateComplete;
|
|
490
505
|
const oldReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -560,7 +575,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
560
575
|
if (this.dashboardReference) {
|
|
561
576
|
for (const [propertyName] of changedProperties.entries()) {
|
|
562
577
|
if (propertyName === "appSever") {
|
|
563
|
-
|
|
578
|
+
this.loadLibrary(changedProperties[propertyName]).then(async () => {
|
|
564
579
|
this.isLibraryLoaded = true;
|
|
565
580
|
await this.updateComplete;
|
|
566
581
|
this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
|
|
@@ -1059,7 +1074,7 @@ __decorateClass([
|
|
|
1059
1074
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
1060
1075
|
__decorateClass([
|
|
1061
1076
|
(0, import_decorators.property)()
|
|
1062
|
-
], LuzmoDashboard.prototype, "
|
|
1077
|
+
], LuzmoDashboard.prototype, "VERSION", 2);
|
|
1063
1078
|
__decorateClass([
|
|
1064
1079
|
(0, import_decorators.state)()
|
|
1065
1080
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
@@ -1079,135 +1094,7 @@ var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
|
|
|
1079
1094
|
LuzmoDashboardWebComponent = __decorateClass([
|
|
1080
1095
|
(0, import_decorators2.customElement)("luzmo-dashboard-web-component")
|
|
1081
1096
|
], LuzmoDashboardWebComponent);
|
|
1082
|
-
|
|
1083
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
|
|
1084
|
-
var import_decorators4 = require("lit/decorators.js");
|
|
1085
|
-
|
|
1086
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1087
|
-
var import_decorators3 = require("lit/decorators.js");
|
|
1088
|
-
var import_lit3 = require("lit");
|
|
1089
|
-
var SharedLib3 = __toESM(require("@luzmo/shared-embed"), 1);
|
|
1090
|
-
var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
1091
|
-
constructor() {
|
|
1092
|
-
super();
|
|
1093
|
-
this.appServer = "https://app.luzmo.com";
|
|
1094
|
-
this.apiHost = "https://api.luzmo.com";
|
|
1095
|
-
this.slots = [];
|
|
1096
|
-
this.options = {
|
|
1097
|
-
title: {
|
|
1098
|
-
en: ""
|
|
1099
|
-
},
|
|
1100
|
-
theme: "default"
|
|
1101
|
-
};
|
|
1102
|
-
this.version = version + "-wc-luzmo";
|
|
1103
|
-
}
|
|
1104
|
-
static {
|
|
1105
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1106
|
-
this.styles = import_lit3.css`
|
|
1107
|
-
:host {
|
|
1108
|
-
display: block;
|
|
1109
|
-
width: 100%;
|
|
1110
|
-
height: 100%;
|
|
1111
|
-
}
|
|
1112
|
-
`;
|
|
1113
|
-
}
|
|
1114
|
-
async firstUpdated(_changedProperties) {
|
|
1115
|
-
super.firstUpdated(_changedProperties);
|
|
1116
|
-
if (this.type) {
|
|
1117
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1118
|
-
this.createAndAppendElement();
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
createAndAppendElement() {
|
|
1122
|
-
if (!this.chartElement) {
|
|
1123
|
-
this.chartElement = document.createElement("chart-component");
|
|
1124
|
-
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
1125
|
-
this.updateVizItemProperties();
|
|
1126
|
-
this.renderRoot.append(this.chartElement);
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
updateVizItemProperties() {
|
|
1130
|
-
if (this.chartElement) {
|
|
1131
|
-
for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
|
|
1132
|
-
const value = this[key];
|
|
1133
|
-
if (value) {
|
|
1134
|
-
const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
|
|
1135
|
-
this.chartElement.setAttribute(
|
|
1136
|
-
SharedLib3.libraryTypeToWebComponentTypeMapping[key],
|
|
1137
|
-
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
1138
|
-
);
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
async updated(changedProperties) {
|
|
1144
|
-
if (this.chartElement) {
|
|
1145
|
-
for (const [propertyName] of changedProperties.entries()) {
|
|
1146
|
-
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
1147
|
-
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
1148
|
-
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1149
|
-
}
|
|
1150
|
-
} else {
|
|
1151
|
-
if (this.type) {
|
|
1152
|
-
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1153
|
-
this.createAndAppendElement();
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
render() {
|
|
1158
|
-
return import_lit3.html` `;
|
|
1159
|
-
}
|
|
1160
|
-
};
|
|
1161
|
-
__decorateClass([
|
|
1162
|
-
(0, import_decorators3.property)()
|
|
1163
|
-
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
1164
|
-
__decorateClass([
|
|
1165
|
-
(0, import_decorators3.property)()
|
|
1166
|
-
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
1167
|
-
__decorateClass([
|
|
1168
|
-
(0, import_decorators3.property)({ type: Array })
|
|
1169
|
-
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
1170
|
-
__decorateClass([
|
|
1171
|
-
(0, import_decorators3.property)({ type: Object })
|
|
1172
|
-
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
1173
|
-
__decorateClass([
|
|
1174
|
-
(0, import_decorators3.property)()
|
|
1175
|
-
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
1176
|
-
__decorateClass([
|
|
1177
|
-
(0, import_decorators3.property)()
|
|
1178
|
-
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
1179
|
-
__decorateClass([
|
|
1180
|
-
(0, import_decorators3.property)()
|
|
1181
|
-
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
1182
|
-
__decorateClass([
|
|
1183
|
-
(0, import_decorators3.property)()
|
|
1184
|
-
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
1185
|
-
__decorateClass([
|
|
1186
|
-
(0, import_decorators3.property)()
|
|
1187
|
-
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
1188
|
-
__decorateClass([
|
|
1189
|
-
(0, import_decorators3.property)({
|
|
1190
|
-
converter: (value) => {
|
|
1191
|
-
try {
|
|
1192
|
-
return JSON.parse(value);
|
|
1193
|
-
} catch (exc) {
|
|
1194
|
-
return value;
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
})
|
|
1198
|
-
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
1199
|
-
__decorateClass([
|
|
1200
|
-
(0, import_decorators3.property)({ type: Array })
|
|
1201
|
-
], LuzmoBaseVizItem.prototype, "filters", 2);
|
|
1202
|
-
|
|
1203
|
-
// libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
|
|
1204
|
-
var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
|
|
1205
|
-
};
|
|
1206
|
-
LuzmoVizItemWebComponent = __decorateClass([
|
|
1207
|
-
(0, import_decorators4.customElement)("luzmo-viz-item-web-component")
|
|
1208
|
-
], LuzmoVizItemWebComponent);
|
|
1209
1097
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1210
1098
|
0 && (module.exports = {
|
|
1211
|
-
LuzmoDashboardWebComponent
|
|
1212
|
-
LuzmoVizItemWebComponent
|
|
1099
|
+
LuzmoDashboardWebComponent
|
|
1213
1100
|
});
|
package/index.libs.d.ts
CHANGED