@luzmo/embed 5.0.14 → 5.1.0-beta.0
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 +0 -6
- package/index.cjs +123 -3
- package/index.d.ts +1 -0
- package/index.js +121 -2
- package/index.libs.cjs +123 -3
- package/index.libs.d.ts +1 -0
- package/index.libs.js +121 -2
- package/lib/viz-item/viz-item-component.d.ts +3 -0
- package/lib/viz-item/viz-item-web-component.d.ts +3 -0
- package/lib/viz-item/viz-item.base.d.ts +23 -0
- package/luzmo-embed.libs.js +147 -8
- package/luzmo-embed.min.js +147 -8
- package/package.json +2 -2
- package/src/index.d.ts +3 -0
- package/src/lib/dashboard-component/dashboard-base.d.ts +98 -0
- package/src/lib/dashboard-component/dashboard-component.d.ts +3 -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/src/lib/viz-item/viz-item-component.d.ts +3 -0
- package/src/lib/viz-item/viz-item.base.d.ts +23 -0
package/CHANGELOG.md
CHANGED
package/index.cjs
CHANGED
|
@@ -39,7 +39,8 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
39
39
|
// libs/embed-libs/embed/src/index.ts
|
|
40
40
|
var src_exports = {};
|
|
41
41
|
__export(src_exports, {
|
|
42
|
-
LuzmoDashboard: () => LuzmoDashboard2
|
|
42
|
+
LuzmoDashboard: () => LuzmoDashboard2,
|
|
43
|
+
LuzmoVizItem: () => LuzmoVizItem
|
|
43
44
|
});
|
|
44
45
|
module.exports = __toCommonJS(src_exports);
|
|
45
46
|
|
|
@@ -54,7 +55,7 @@ var import_style_map = require("lit/directives/style-map.js");
|
|
|
54
55
|
var import_shared_embed = require("@luzmo/shared-embed");
|
|
55
56
|
|
|
56
57
|
// libs/embed-libs/embed/package.json
|
|
57
|
-
var version = "5.0.
|
|
58
|
+
var version = "5.1.0-beta.0";
|
|
58
59
|
|
|
59
60
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
60
61
|
var LuzmoService = class {
|
|
@@ -1093,7 +1094,126 @@ var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
|
1093
1094
|
LuzmoDashboard2 = __decorateClass([
|
|
1094
1095
|
(0, import_decorators2.customElement)("luzmo-dashboard")
|
|
1095
1096
|
], LuzmoDashboard2);
|
|
1097
|
+
|
|
1098
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1099
|
+
var import_decorators4 = require("lit/decorators.js");
|
|
1100
|
+
|
|
1101
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1102
|
+
var import_decorators3 = require("lit/decorators.js");
|
|
1103
|
+
var import_lit3 = require("lit");
|
|
1104
|
+
var SharedLib3 = __toESM(require("@luzmo/shared-embed"), 1);
|
|
1105
|
+
var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
1106
|
+
constructor() {
|
|
1107
|
+
super();
|
|
1108
|
+
this.appServer = "https://app.luzmo.com";
|
|
1109
|
+
this.apiHost = "https://api.luzmo.com";
|
|
1110
|
+
this.slots = [];
|
|
1111
|
+
this.options = {
|
|
1112
|
+
title: {
|
|
1113
|
+
en: ""
|
|
1114
|
+
},
|
|
1115
|
+
theme: "default"
|
|
1116
|
+
};
|
|
1117
|
+
this.version = version + "-wc-luzmo";
|
|
1118
|
+
}
|
|
1119
|
+
static {
|
|
1120
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1121
|
+
this.styles = import_lit3.css`
|
|
1122
|
+
:host {
|
|
1123
|
+
display: block;
|
|
1124
|
+
width: 100%;
|
|
1125
|
+
height: 100%;
|
|
1126
|
+
}
|
|
1127
|
+
`;
|
|
1128
|
+
}
|
|
1129
|
+
async firstUpdated(_changedProperties) {
|
|
1130
|
+
super.firstUpdated(_changedProperties);
|
|
1131
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1132
|
+
if (this.type) {
|
|
1133
|
+
this.createAndAppendElement();
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
createAndAppendElement() {
|
|
1137
|
+
if (!this.chartElement) {
|
|
1138
|
+
this.chartElement = document.createElement("chart-component");
|
|
1139
|
+
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
1140
|
+
this.updateVizItemProperties();
|
|
1141
|
+
this.renderRoot.append(this.chartElement);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
updateVizItemProperties() {
|
|
1145
|
+
if (this.chartElement) {
|
|
1146
|
+
for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
|
|
1147
|
+
const value = this[key];
|
|
1148
|
+
if (value) {
|
|
1149
|
+
const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
|
|
1150
|
+
this.chartElement.setAttribute(
|
|
1151
|
+
SharedLib3.libraryTypeToWebComponentTypeMapping[key],
|
|
1152
|
+
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
updated(changedProperties) {
|
|
1159
|
+
if (this.chartElement) {
|
|
1160
|
+
for (const [propertyName] of changedProperties.entries()) {
|
|
1161
|
+
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
1162
|
+
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
1163
|
+
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1164
|
+
}
|
|
1165
|
+
} else {
|
|
1166
|
+
if (this.type) {
|
|
1167
|
+
this.createAndAppendElement();
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
render() {
|
|
1172
|
+
return import_lit3.html` `;
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
__decorateClass([
|
|
1176
|
+
(0, import_decorators3.property)()
|
|
1177
|
+
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
1178
|
+
__decorateClass([
|
|
1179
|
+
(0, import_decorators3.property)()
|
|
1180
|
+
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
1181
|
+
__decorateClass([
|
|
1182
|
+
(0, import_decorators3.property)({ type: Array })
|
|
1183
|
+
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
1184
|
+
__decorateClass([
|
|
1185
|
+
(0, import_decorators3.property)({ type: Object })
|
|
1186
|
+
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
1187
|
+
__decorateClass([
|
|
1188
|
+
(0, import_decorators3.property)()
|
|
1189
|
+
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
1190
|
+
__decorateClass([
|
|
1191
|
+
(0, import_decorators3.property)()
|
|
1192
|
+
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
1193
|
+
__decorateClass([
|
|
1194
|
+
(0, import_decorators3.property)()
|
|
1195
|
+
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
1196
|
+
__decorateClass([
|
|
1197
|
+
(0, import_decorators3.property)()
|
|
1198
|
+
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
1199
|
+
__decorateClass([
|
|
1200
|
+
(0, import_decorators3.property)()
|
|
1201
|
+
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
1202
|
+
__decorateClass([
|
|
1203
|
+
(0, import_decorators3.property)()
|
|
1204
|
+
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
1205
|
+
__decorateClass([
|
|
1206
|
+
(0, import_decorators3.property)()
|
|
1207
|
+
], LuzmoBaseVizItem.prototype, "filtlers", 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);
|
|
1096
1215
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1097
1216
|
0 && (module.exports = {
|
|
1098
|
-
LuzmoDashboard
|
|
1217
|
+
LuzmoDashboard,
|
|
1218
|
+
LuzmoVizItem
|
|
1099
1219
|
});
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
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
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
} from "@luzmo/shared-embed";
|
|
38
38
|
|
|
39
39
|
// libs/embed-libs/embed/package.json
|
|
40
|
-
var version = "5.0.
|
|
40
|
+
var version = "5.1.0-beta.0";
|
|
41
41
|
|
|
42
42
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
43
43
|
var LuzmoService = class {
|
|
@@ -1076,6 +1076,125 @@ var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
|
1076
1076
|
LuzmoDashboard2 = __decorateClass([
|
|
1077
1077
|
customElement("luzmo-dashboard")
|
|
1078
1078
|
], LuzmoDashboard2);
|
|
1079
|
+
|
|
1080
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1081
|
+
import { customElement as customElement3 } from "lit/decorators.js";
|
|
1082
|
+
|
|
1083
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1084
|
+
import { property as property2 } from "lit/decorators.js";
|
|
1085
|
+
import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
|
|
1086
|
+
import * as SharedLib3 from "@luzmo/shared-embed";
|
|
1087
|
+
var LuzmoBaseVizItem = class extends LitElement2 {
|
|
1088
|
+
constructor() {
|
|
1089
|
+
super();
|
|
1090
|
+
this.appServer = "https://app.luzmo.com";
|
|
1091
|
+
this.apiHost = "https://api.luzmo.com";
|
|
1092
|
+
this.slots = [];
|
|
1093
|
+
this.options = {
|
|
1094
|
+
title: {
|
|
1095
|
+
en: ""
|
|
1096
|
+
},
|
|
1097
|
+
theme: "default"
|
|
1098
|
+
};
|
|
1099
|
+
this.version = version + "-wc-luzmo";
|
|
1100
|
+
}
|
|
1101
|
+
static {
|
|
1102
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1103
|
+
this.styles = css2`
|
|
1104
|
+
:host {
|
|
1105
|
+
display: block;
|
|
1106
|
+
width: 100%;
|
|
1107
|
+
height: 100%;
|
|
1108
|
+
}
|
|
1109
|
+
`;
|
|
1110
|
+
}
|
|
1111
|
+
async firstUpdated(_changedProperties) {
|
|
1112
|
+
super.firstUpdated(_changedProperties);
|
|
1113
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1114
|
+
if (this.type) {
|
|
1115
|
+
this.createAndAppendElement();
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
createAndAppendElement() {
|
|
1119
|
+
if (!this.chartElement) {
|
|
1120
|
+
this.chartElement = document.createElement("chart-component");
|
|
1121
|
+
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
1122
|
+
this.updateVizItemProperties();
|
|
1123
|
+
this.renderRoot.append(this.chartElement);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
updateVizItemProperties() {
|
|
1127
|
+
if (this.chartElement) {
|
|
1128
|
+
for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
|
|
1129
|
+
const value = this[key];
|
|
1130
|
+
if (value) {
|
|
1131
|
+
const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
|
|
1132
|
+
this.chartElement.setAttribute(
|
|
1133
|
+
SharedLib3.libraryTypeToWebComponentTypeMapping[key],
|
|
1134
|
+
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
1135
|
+
);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
updated(changedProperties) {
|
|
1141
|
+
if (this.chartElement) {
|
|
1142
|
+
for (const [propertyName] of changedProperties.entries()) {
|
|
1143
|
+
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
1144
|
+
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
1145
|
+
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1146
|
+
}
|
|
1147
|
+
} else {
|
|
1148
|
+
if (this.type) {
|
|
1149
|
+
this.createAndAppendElement();
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
render() {
|
|
1154
|
+
return html2` `;
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
__decorateClass([
|
|
1158
|
+
property2()
|
|
1159
|
+
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
1160
|
+
__decorateClass([
|
|
1161
|
+
property2()
|
|
1162
|
+
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
1163
|
+
__decorateClass([
|
|
1164
|
+
property2({ type: Array })
|
|
1165
|
+
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
1166
|
+
__decorateClass([
|
|
1167
|
+
property2({ type: Object })
|
|
1168
|
+
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
1169
|
+
__decorateClass([
|
|
1170
|
+
property2()
|
|
1171
|
+
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
1172
|
+
__decorateClass([
|
|
1173
|
+
property2()
|
|
1174
|
+
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
1175
|
+
__decorateClass([
|
|
1176
|
+
property2()
|
|
1177
|
+
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
1178
|
+
__decorateClass([
|
|
1179
|
+
property2()
|
|
1180
|
+
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
1181
|
+
__decorateClass([
|
|
1182
|
+
property2()
|
|
1183
|
+
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
1184
|
+
__decorateClass([
|
|
1185
|
+
property2()
|
|
1186
|
+
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
1187
|
+
__decorateClass([
|
|
1188
|
+
property2()
|
|
1189
|
+
], LuzmoBaseVizItem.prototype, "filtlers", 2);
|
|
1190
|
+
|
|
1191
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
1192
|
+
var LuzmoVizItem = class extends LuzmoBaseVizItem {
|
|
1193
|
+
};
|
|
1194
|
+
LuzmoVizItem = __decorateClass([
|
|
1195
|
+
customElement3("luzmo-viz-item")
|
|
1196
|
+
], LuzmoVizItem);
|
|
1079
1197
|
export {
|
|
1080
|
-
LuzmoDashboard2 as LuzmoDashboard
|
|
1198
|
+
LuzmoDashboard2 as LuzmoDashboard,
|
|
1199
|
+
LuzmoVizItem
|
|
1081
1200
|
};
|
package/index.libs.cjs
CHANGED
|
@@ -39,7 +39,8 @@ 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
|
|
42
|
+
LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent,
|
|
43
|
+
LuzmoVizItemWebComponent: () => LuzmoVizItemWebComponent
|
|
43
44
|
});
|
|
44
45
|
module.exports = __toCommonJS(index_libs_exports);
|
|
45
46
|
|
|
@@ -54,7 +55,7 @@ var import_style_map = require("lit/directives/style-map.js");
|
|
|
54
55
|
var import_shared_embed = require("@luzmo/shared-embed");
|
|
55
56
|
|
|
56
57
|
// libs/embed-libs/embed/package.json
|
|
57
|
-
var version = "5.0.
|
|
58
|
+
var version = "5.1.0-beta.0";
|
|
58
59
|
|
|
59
60
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
60
61
|
var LuzmoService = class {
|
|
@@ -1093,7 +1094,126 @@ var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
|
|
|
1093
1094
|
LuzmoDashboardWebComponent = __decorateClass([
|
|
1094
1095
|
(0, import_decorators2.customElement)("luzmo-dashboard-web-component")
|
|
1095
1096
|
], LuzmoDashboardWebComponent);
|
|
1097
|
+
|
|
1098
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
|
|
1099
|
+
var import_decorators4 = require("lit/decorators.js");
|
|
1100
|
+
|
|
1101
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1102
|
+
var import_decorators3 = require("lit/decorators.js");
|
|
1103
|
+
var import_lit3 = require("lit");
|
|
1104
|
+
var SharedLib3 = __toESM(require("@luzmo/shared-embed"), 1);
|
|
1105
|
+
var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
1106
|
+
constructor() {
|
|
1107
|
+
super();
|
|
1108
|
+
this.appServer = "https://app.luzmo.com";
|
|
1109
|
+
this.apiHost = "https://api.luzmo.com";
|
|
1110
|
+
this.slots = [];
|
|
1111
|
+
this.options = {
|
|
1112
|
+
title: {
|
|
1113
|
+
en: ""
|
|
1114
|
+
},
|
|
1115
|
+
theme: "default"
|
|
1116
|
+
};
|
|
1117
|
+
this.version = version + "-wc-luzmo";
|
|
1118
|
+
}
|
|
1119
|
+
static {
|
|
1120
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1121
|
+
this.styles = import_lit3.css`
|
|
1122
|
+
:host {
|
|
1123
|
+
display: block;
|
|
1124
|
+
width: 100%;
|
|
1125
|
+
height: 100%;
|
|
1126
|
+
}
|
|
1127
|
+
`;
|
|
1128
|
+
}
|
|
1129
|
+
async firstUpdated(_changedProperties) {
|
|
1130
|
+
super.firstUpdated(_changedProperties);
|
|
1131
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1132
|
+
if (this.type) {
|
|
1133
|
+
this.createAndAppendElement();
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
createAndAppendElement() {
|
|
1137
|
+
if (!this.chartElement) {
|
|
1138
|
+
this.chartElement = document.createElement("chart-component");
|
|
1139
|
+
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
1140
|
+
this.updateVizItemProperties();
|
|
1141
|
+
this.renderRoot.append(this.chartElement);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
updateVizItemProperties() {
|
|
1145
|
+
if (this.chartElement) {
|
|
1146
|
+
for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
|
|
1147
|
+
const value = this[key];
|
|
1148
|
+
if (value) {
|
|
1149
|
+
const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
|
|
1150
|
+
this.chartElement.setAttribute(
|
|
1151
|
+
SharedLib3.libraryTypeToWebComponentTypeMapping[key],
|
|
1152
|
+
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
updated(changedProperties) {
|
|
1159
|
+
if (this.chartElement) {
|
|
1160
|
+
for (const [propertyName] of changedProperties.entries()) {
|
|
1161
|
+
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
1162
|
+
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
1163
|
+
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1164
|
+
}
|
|
1165
|
+
} else {
|
|
1166
|
+
if (this.type) {
|
|
1167
|
+
this.createAndAppendElement();
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
render() {
|
|
1172
|
+
return import_lit3.html` `;
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
__decorateClass([
|
|
1176
|
+
(0, import_decorators3.property)()
|
|
1177
|
+
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
1178
|
+
__decorateClass([
|
|
1179
|
+
(0, import_decorators3.property)()
|
|
1180
|
+
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
1181
|
+
__decorateClass([
|
|
1182
|
+
(0, import_decorators3.property)({ type: Array })
|
|
1183
|
+
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
1184
|
+
__decorateClass([
|
|
1185
|
+
(0, import_decorators3.property)({ type: Object })
|
|
1186
|
+
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
1187
|
+
__decorateClass([
|
|
1188
|
+
(0, import_decorators3.property)()
|
|
1189
|
+
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
1190
|
+
__decorateClass([
|
|
1191
|
+
(0, import_decorators3.property)()
|
|
1192
|
+
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
1193
|
+
__decorateClass([
|
|
1194
|
+
(0, import_decorators3.property)()
|
|
1195
|
+
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
1196
|
+
__decorateClass([
|
|
1197
|
+
(0, import_decorators3.property)()
|
|
1198
|
+
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
1199
|
+
__decorateClass([
|
|
1200
|
+
(0, import_decorators3.property)()
|
|
1201
|
+
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
1202
|
+
__decorateClass([
|
|
1203
|
+
(0, import_decorators3.property)()
|
|
1204
|
+
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
1205
|
+
__decorateClass([
|
|
1206
|
+
(0, import_decorators3.property)()
|
|
1207
|
+
], LuzmoBaseVizItem.prototype, "filtlers", 2);
|
|
1208
|
+
|
|
1209
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
|
|
1210
|
+
var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
|
|
1211
|
+
};
|
|
1212
|
+
LuzmoVizItemWebComponent = __decorateClass([
|
|
1213
|
+
(0, import_decorators4.customElement)("luzmo-viz-item-web-component")
|
|
1214
|
+
], LuzmoVizItemWebComponent);
|
|
1096
1215
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1097
1216
|
0 && (module.exports = {
|
|
1098
|
-
LuzmoDashboardWebComponent
|
|
1217
|
+
LuzmoDashboardWebComponent,
|
|
1218
|
+
LuzmoVizItemWebComponent
|
|
1099
1219
|
});
|
package/index.libs.d.ts
CHANGED
package/index.libs.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from "@luzmo/shared-embed";
|
|
36
36
|
|
|
37
37
|
// libs/embed-libs/embed/package.json
|
|
38
|
-
var version = "5.0.
|
|
38
|
+
var version = "5.1.0-beta.0";
|
|
39
39
|
|
|
40
40
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
41
41
|
var LuzmoService = class {
|
|
@@ -1074,6 +1074,125 @@ var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
|
|
|
1074
1074
|
LuzmoDashboardWebComponent = __decorateClass([
|
|
1075
1075
|
customElement("luzmo-dashboard-web-component")
|
|
1076
1076
|
], LuzmoDashboardWebComponent);
|
|
1077
|
+
|
|
1078
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
|
|
1079
|
+
import { customElement as customElement3 } from "lit/decorators.js";
|
|
1080
|
+
|
|
1081
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
1082
|
+
import { property as property2 } from "lit/decorators.js";
|
|
1083
|
+
import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
|
|
1084
|
+
import * as SharedLib3 from "@luzmo/shared-embed";
|
|
1085
|
+
var LuzmoBaseVizItem = class extends LitElement2 {
|
|
1086
|
+
constructor() {
|
|
1087
|
+
super();
|
|
1088
|
+
this.appServer = "https://app.luzmo.com";
|
|
1089
|
+
this.apiHost = "https://api.luzmo.com";
|
|
1090
|
+
this.slots = [];
|
|
1091
|
+
this.options = {
|
|
1092
|
+
title: {
|
|
1093
|
+
en: ""
|
|
1094
|
+
},
|
|
1095
|
+
theme: "default"
|
|
1096
|
+
};
|
|
1097
|
+
this.version = version + "-wc-luzmo";
|
|
1098
|
+
}
|
|
1099
|
+
static {
|
|
1100
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
1101
|
+
this.styles = css2`
|
|
1102
|
+
:host {
|
|
1103
|
+
display: block;
|
|
1104
|
+
width: 100%;
|
|
1105
|
+
height: 100%;
|
|
1106
|
+
}
|
|
1107
|
+
`;
|
|
1108
|
+
}
|
|
1109
|
+
async firstUpdated(_changedProperties) {
|
|
1110
|
+
super.firstUpdated(_changedProperties);
|
|
1111
|
+
await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
|
|
1112
|
+
if (this.type) {
|
|
1113
|
+
this.createAndAppendElement();
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
createAndAppendElement() {
|
|
1117
|
+
if (!this.chartElement) {
|
|
1118
|
+
this.chartElement = document.createElement("chart-component");
|
|
1119
|
+
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
1120
|
+
this.updateVizItemProperties();
|
|
1121
|
+
this.renderRoot.append(this.chartElement);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
updateVizItemProperties() {
|
|
1125
|
+
if (this.chartElement) {
|
|
1126
|
+
for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
|
|
1127
|
+
const value = this[key];
|
|
1128
|
+
if (value) {
|
|
1129
|
+
const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
|
|
1130
|
+
this.chartElement.setAttribute(
|
|
1131
|
+
SharedLib3.libraryTypeToWebComponentTypeMapping[key],
|
|
1132
|
+
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
updated(changedProperties) {
|
|
1139
|
+
if (this.chartElement) {
|
|
1140
|
+
for (const [propertyName] of changedProperties.entries()) {
|
|
1141
|
+
const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
1142
|
+
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
1143
|
+
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1144
|
+
}
|
|
1145
|
+
} else {
|
|
1146
|
+
if (this.type) {
|
|
1147
|
+
this.createAndAppendElement();
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
render() {
|
|
1152
|
+
return html2` `;
|
|
1153
|
+
}
|
|
1154
|
+
};
|
|
1155
|
+
__decorateClass([
|
|
1156
|
+
property2()
|
|
1157
|
+
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
1158
|
+
__decorateClass([
|
|
1159
|
+
property2()
|
|
1160
|
+
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
1161
|
+
__decorateClass([
|
|
1162
|
+
property2({ type: Array })
|
|
1163
|
+
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
1164
|
+
__decorateClass([
|
|
1165
|
+
property2({ type: Object })
|
|
1166
|
+
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
1167
|
+
__decorateClass([
|
|
1168
|
+
property2()
|
|
1169
|
+
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
1170
|
+
__decorateClass([
|
|
1171
|
+
property2()
|
|
1172
|
+
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
1173
|
+
__decorateClass([
|
|
1174
|
+
property2()
|
|
1175
|
+
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
1176
|
+
__decorateClass([
|
|
1177
|
+
property2()
|
|
1178
|
+
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
1179
|
+
__decorateClass([
|
|
1180
|
+
property2()
|
|
1181
|
+
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
1182
|
+
__decorateClass([
|
|
1183
|
+
property2()
|
|
1184
|
+
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
1185
|
+
__decorateClass([
|
|
1186
|
+
property2()
|
|
1187
|
+
], LuzmoBaseVizItem.prototype, "filtlers", 2);
|
|
1188
|
+
|
|
1189
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
|
|
1190
|
+
var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
|
|
1191
|
+
};
|
|
1192
|
+
LuzmoVizItemWebComponent = __decorateClass([
|
|
1193
|
+
customElement3("luzmo-viz-item-web-component")
|
|
1194
|
+
], LuzmoVizItemWebComponent);
|
|
1077
1195
|
export {
|
|
1078
|
-
LuzmoDashboardWebComponent
|
|
1196
|
+
LuzmoDashboardWebComponent,
|
|
1197
|
+
LuzmoVizItemWebComponent
|
|
1079
1198
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
filtlers?: 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
|
+
}
|
package/luzmo-embed.libs.js
CHANGED
|
@@ -42,7 +42,8 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
42
42
|
// libs/embed-libs/embed/src/index.libs.ts
|
|
43
43
|
var index_libs_exports = {};
|
|
44
44
|
__export(index_libs_exports, {
|
|
45
|
-
LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent
|
|
45
|
+
LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent,
|
|
46
|
+
LuzmoVizItemWebComponent: () => LuzmoVizItemWebComponent
|
|
46
47
|
});
|
|
47
48
|
module.exports = __toCommonJS(index_libs_exports);
|
|
48
49
|
|
|
@@ -918,9 +919,7 @@ var getAccessibleDashboards = (dashboardComponent) => {
|
|
|
918
919
|
void (() => {
|
|
919
920
|
try {
|
|
920
921
|
const responsePromise = window.fetch(
|
|
921
|
-
|
|
922
|
-
// Fixes incorrect url with experimental=true
|
|
923
|
-
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
922
|
+
`${String(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
924
923
|
{
|
|
925
924
|
method: "POST",
|
|
926
925
|
mode: "cors",
|
|
@@ -969,9 +968,7 @@ var getAccessibleDashboards = (dashboardComponent) => {
|
|
|
969
968
|
try {
|
|
970
969
|
fetchUser.then((authorizationData) => {
|
|
971
970
|
const responsePromise = window.fetch(
|
|
972
|
-
|
|
973
|
-
// Fixes incorrect url with experimental=true
|
|
974
|
-
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
971
|
+
`${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
975
972
|
{
|
|
976
973
|
method: "POST",
|
|
977
974
|
mode: "cors",
|
|
@@ -1489,6 +1486,21 @@ var _extendAndValidate = (dashboardContent) => {
|
|
|
1489
1486
|
}
|
|
1490
1487
|
};
|
|
1491
1488
|
|
|
1489
|
+
// libs/embed-libs/shared-embed/src/lib/models/viz-item.model.ts
|
|
1490
|
+
var libraryTypeToWebComponentTypeMapping = {
|
|
1491
|
+
type: "type",
|
|
1492
|
+
theme: "theme",
|
|
1493
|
+
slots: "slots",
|
|
1494
|
+
options: "options",
|
|
1495
|
+
appServer: "app-server",
|
|
1496
|
+
apiHost: "api-host",
|
|
1497
|
+
authKey: "auth-key",
|
|
1498
|
+
authToken: "auth-token",
|
|
1499
|
+
contextId: "context-id",
|
|
1500
|
+
canFilter: "can-filter",
|
|
1501
|
+
filters: "filters"
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1492
1504
|
// libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
|
|
1493
1505
|
var luzmoEmbedContainerClass = "luzmo-embed-container";
|
|
1494
1506
|
|
|
@@ -1556,6 +1568,21 @@ function __federationMethodWrapDefault(module2, need) {
|
|
|
1556
1568
|
async function __federationMethodGetRemote(remoteName, componentName) {
|
|
1557
1569
|
return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
|
|
1558
1570
|
}
|
|
1571
|
+
async function loadLibrary(appServer, componentName) {
|
|
1572
|
+
if (remotesMap[appServer]) {
|
|
1573
|
+
return remotesMap[appServer].module;
|
|
1574
|
+
}
|
|
1575
|
+
remotesMap[appServer] = {
|
|
1576
|
+
url: appServer?.startsWith("http://localhost") ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
1577
|
+
format: "esm",
|
|
1578
|
+
from: "vite",
|
|
1579
|
+
module: void 0
|
|
1580
|
+
};
|
|
1581
|
+
const module2 = await __federationMethodGetRemote(appServer, `./${componentName}`);
|
|
1582
|
+
const wrappedModule = __federationMethodWrapDefault(module2, true);
|
|
1583
|
+
remotesMap[appServer].module = wrappedModule;
|
|
1584
|
+
return wrappedModule;
|
|
1585
|
+
}
|
|
1559
1586
|
|
|
1560
1587
|
// node_modules/lit-html/lit-html.js
|
|
1561
1588
|
var t3 = globalThis;
|
|
@@ -1906,7 +1933,7 @@ var o5 = e6(class extends i4 {
|
|
|
1906
1933
|
});
|
|
1907
1934
|
|
|
1908
1935
|
// libs/embed-libs/embed/package.json
|
|
1909
|
-
var version = "5.0.
|
|
1936
|
+
var version = "5.1.0-beta.0";
|
|
1910
1937
|
|
|
1911
1938
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1912
1939
|
var LuzmoService = class {
|
|
@@ -2943,6 +2970,118 @@ var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
|
|
|
2943
2970
|
LuzmoDashboardWebComponent = __decorateClass([
|
|
2944
2971
|
t("luzmo-dashboard-web-component")
|
|
2945
2972
|
], LuzmoDashboardWebComponent);
|
|
2973
|
+
|
|
2974
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
2975
|
+
var LuzmoBaseVizItem = class extends s3 {
|
|
2976
|
+
constructor() {
|
|
2977
|
+
super();
|
|
2978
|
+
this.appServer = "https://app.luzmo.com";
|
|
2979
|
+
this.apiHost = "https://api.luzmo.com";
|
|
2980
|
+
this.slots = [];
|
|
2981
|
+
this.options = {
|
|
2982
|
+
title: {
|
|
2983
|
+
en: ""
|
|
2984
|
+
},
|
|
2985
|
+
theme: "default"
|
|
2986
|
+
};
|
|
2987
|
+
this.version = version + "-wc-luzmo";
|
|
2988
|
+
}
|
|
2989
|
+
static {
|
|
2990
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
2991
|
+
this.styles = i`
|
|
2992
|
+
:host {
|
|
2993
|
+
display: block;
|
|
2994
|
+
width: 100%;
|
|
2995
|
+
height: 100%;
|
|
2996
|
+
}
|
|
2997
|
+
`;
|
|
2998
|
+
}
|
|
2999
|
+
async firstUpdated(_changedProperties) {
|
|
3000
|
+
super.firstUpdated(_changedProperties);
|
|
3001
|
+
await loadLibrary(this.appServer, "DashboardApp");
|
|
3002
|
+
if (this.type) {
|
|
3003
|
+
this.createAndAppendElement();
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
createAndAppendElement() {
|
|
3007
|
+
if (!this.chartElement) {
|
|
3008
|
+
this.chartElement = document.createElement("chart-component");
|
|
3009
|
+
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
3010
|
+
this.updateVizItemProperties();
|
|
3011
|
+
this.renderRoot.append(this.chartElement);
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
updateVizItemProperties() {
|
|
3015
|
+
if (this.chartElement) {
|
|
3016
|
+
for (const key in libraryTypeToWebComponentTypeMapping) {
|
|
3017
|
+
const value = this[key];
|
|
3018
|
+
if (value) {
|
|
3019
|
+
const attributeValue = ["appServer", "apiHost"].includes(key) ? removeTrailingSlash(value) : value;
|
|
3020
|
+
this.chartElement.setAttribute(
|
|
3021
|
+
libraryTypeToWebComponentTypeMapping[key],
|
|
3022
|
+
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
3023
|
+
);
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
updated(changedProperties) {
|
|
3029
|
+
if (this.chartElement) {
|
|
3030
|
+
for (const [propertyName] of changedProperties.entries()) {
|
|
3031
|
+
const mappedAttributeName = libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
3032
|
+
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
3033
|
+
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
3034
|
+
}
|
|
3035
|
+
} else {
|
|
3036
|
+
if (this.type) {
|
|
3037
|
+
this.createAndAppendElement();
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
render() {
|
|
3042
|
+
return x` `;
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
__decorateClass([
|
|
3046
|
+
n3()
|
|
3047
|
+
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
3048
|
+
__decorateClass([
|
|
3049
|
+
n3()
|
|
3050
|
+
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
3051
|
+
__decorateClass([
|
|
3052
|
+
n3({ type: Array })
|
|
3053
|
+
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
3054
|
+
__decorateClass([
|
|
3055
|
+
n3({ type: Object })
|
|
3056
|
+
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
3057
|
+
__decorateClass([
|
|
3058
|
+
n3()
|
|
3059
|
+
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
3060
|
+
__decorateClass([
|
|
3061
|
+
n3()
|
|
3062
|
+
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
3063
|
+
__decorateClass([
|
|
3064
|
+
n3()
|
|
3065
|
+
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
3066
|
+
__decorateClass([
|
|
3067
|
+
n3()
|
|
3068
|
+
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
3069
|
+
__decorateClass([
|
|
3070
|
+
n3()
|
|
3071
|
+
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
3072
|
+
__decorateClass([
|
|
3073
|
+
n3()
|
|
3074
|
+
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
3075
|
+
__decorateClass([
|
|
3076
|
+
n3()
|
|
3077
|
+
], LuzmoBaseVizItem.prototype, "filtlers", 2);
|
|
3078
|
+
|
|
3079
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
|
|
3080
|
+
var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
|
|
3081
|
+
};
|
|
3082
|
+
LuzmoVizItemWebComponent = __decorateClass([
|
|
3083
|
+
t("luzmo-viz-item-web-component")
|
|
3084
|
+
], LuzmoVizItemWebComponent);
|
|
2946
3085
|
/*! Bundled license information:
|
|
2947
3086
|
|
|
2948
3087
|
@lit/reactive-element/decorators/custom-element.js:
|
package/luzmo-embed.min.js
CHANGED
|
@@ -42,7 +42,8 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
42
42
|
// libs/embed-libs/embed/src/index.ts
|
|
43
43
|
var src_exports2 = {};
|
|
44
44
|
__export(src_exports2, {
|
|
45
|
-
LuzmoDashboard: () => LuzmoDashboard2
|
|
45
|
+
LuzmoDashboard: () => LuzmoDashboard2,
|
|
46
|
+
LuzmoVizItem: () => LuzmoVizItem
|
|
46
47
|
});
|
|
47
48
|
module.exports = __toCommonJS(src_exports2);
|
|
48
49
|
|
|
@@ -918,9 +919,7 @@ var getAccessibleDashboards = (dashboardComponent) => {
|
|
|
918
919
|
void (() => {
|
|
919
920
|
try {
|
|
920
921
|
const responsePromise = window.fetch(
|
|
921
|
-
|
|
922
|
-
// Fixes incorrect url with experimental=true
|
|
923
|
-
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
922
|
+
`${String(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
924
923
|
{
|
|
925
924
|
method: "POST",
|
|
926
925
|
mode: "cors",
|
|
@@ -969,9 +968,7 @@ var getAccessibleDashboards = (dashboardComponent) => {
|
|
|
969
968
|
try {
|
|
970
969
|
fetchUser.then((authorizationData) => {
|
|
971
970
|
const responsePromise = window.fetch(
|
|
972
|
-
|
|
973
|
-
// Fixes incorrect url with experimental=true
|
|
974
|
-
`${addTrailingSlash(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
971
|
+
`${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
975
972
|
{
|
|
976
973
|
method: "POST",
|
|
977
974
|
mode: "cors",
|
|
@@ -1489,6 +1486,21 @@ var _extendAndValidate = (dashboardContent) => {
|
|
|
1489
1486
|
}
|
|
1490
1487
|
};
|
|
1491
1488
|
|
|
1489
|
+
// libs/embed-libs/shared-embed/src/lib/models/viz-item.model.ts
|
|
1490
|
+
var libraryTypeToWebComponentTypeMapping = {
|
|
1491
|
+
type: "type",
|
|
1492
|
+
theme: "theme",
|
|
1493
|
+
slots: "slots",
|
|
1494
|
+
options: "options",
|
|
1495
|
+
appServer: "app-server",
|
|
1496
|
+
apiHost: "api-host",
|
|
1497
|
+
authKey: "auth-key",
|
|
1498
|
+
authToken: "auth-token",
|
|
1499
|
+
contextId: "context-id",
|
|
1500
|
+
canFilter: "can-filter",
|
|
1501
|
+
filters: "filters"
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1492
1504
|
// libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
|
|
1493
1505
|
var luzmoEmbedContainerClass = "luzmo-embed-container";
|
|
1494
1506
|
|
|
@@ -1556,6 +1568,21 @@ function __federationMethodWrapDefault(module2, need) {
|
|
|
1556
1568
|
async function __federationMethodGetRemote(remoteName, componentName) {
|
|
1557
1569
|
return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
|
|
1558
1570
|
}
|
|
1571
|
+
async function loadLibrary(appServer, componentName) {
|
|
1572
|
+
if (remotesMap[appServer]) {
|
|
1573
|
+
return remotesMap[appServer].module;
|
|
1574
|
+
}
|
|
1575
|
+
remotesMap[appServer] = {
|
|
1576
|
+
url: appServer?.startsWith("http://localhost") ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
1577
|
+
format: "esm",
|
|
1578
|
+
from: "vite",
|
|
1579
|
+
module: void 0
|
|
1580
|
+
};
|
|
1581
|
+
const module2 = await __federationMethodGetRemote(appServer, `./${componentName}`);
|
|
1582
|
+
const wrappedModule = __federationMethodWrapDefault(module2, true);
|
|
1583
|
+
remotesMap[appServer].module = wrappedModule;
|
|
1584
|
+
return wrappedModule;
|
|
1585
|
+
}
|
|
1559
1586
|
|
|
1560
1587
|
// node_modules/lit-html/lit-html.js
|
|
1561
1588
|
var t3 = globalThis;
|
|
@@ -1906,7 +1933,7 @@ var o5 = e6(class extends i4 {
|
|
|
1906
1933
|
});
|
|
1907
1934
|
|
|
1908
1935
|
// libs/embed-libs/embed/package.json
|
|
1909
|
-
var version = "5.0.
|
|
1936
|
+
var version = "5.1.0-beta.0";
|
|
1910
1937
|
|
|
1911
1938
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1912
1939
|
var LuzmoService = class {
|
|
@@ -2943,6 +2970,118 @@ var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
|
2943
2970
|
LuzmoDashboard2 = __decorateClass([
|
|
2944
2971
|
t("luzmo-dashboard")
|
|
2945
2972
|
], LuzmoDashboard2);
|
|
2973
|
+
|
|
2974
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
2975
|
+
var LuzmoBaseVizItem = class extends s3 {
|
|
2976
|
+
constructor() {
|
|
2977
|
+
super();
|
|
2978
|
+
this.appServer = "https://app.luzmo.com";
|
|
2979
|
+
this.apiHost = "https://api.luzmo.com";
|
|
2980
|
+
this.slots = [];
|
|
2981
|
+
this.options = {
|
|
2982
|
+
title: {
|
|
2983
|
+
en: ""
|
|
2984
|
+
},
|
|
2985
|
+
theme: "default"
|
|
2986
|
+
};
|
|
2987
|
+
this.version = version + "-wc-luzmo";
|
|
2988
|
+
}
|
|
2989
|
+
static {
|
|
2990
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
2991
|
+
this.styles = i`
|
|
2992
|
+
:host {
|
|
2993
|
+
display: block;
|
|
2994
|
+
width: 100%;
|
|
2995
|
+
height: 100%;
|
|
2996
|
+
}
|
|
2997
|
+
`;
|
|
2998
|
+
}
|
|
2999
|
+
async firstUpdated(_changedProperties) {
|
|
3000
|
+
super.firstUpdated(_changedProperties);
|
|
3001
|
+
await loadLibrary(this.appServer, "DashboardApp");
|
|
3002
|
+
if (this.type) {
|
|
3003
|
+
this.createAndAppendElement();
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
createAndAppendElement() {
|
|
3007
|
+
if (!this.chartElement) {
|
|
3008
|
+
this.chartElement = document.createElement("chart-component");
|
|
3009
|
+
this.chartElement.setAttribute("embedding-mode", "chart");
|
|
3010
|
+
this.updateVizItemProperties();
|
|
3011
|
+
this.renderRoot.append(this.chartElement);
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
updateVizItemProperties() {
|
|
3015
|
+
if (this.chartElement) {
|
|
3016
|
+
for (const key in libraryTypeToWebComponentTypeMapping) {
|
|
3017
|
+
const value = this[key];
|
|
3018
|
+
if (value) {
|
|
3019
|
+
const attributeValue = ["appServer", "apiHost"].includes(key) ? removeTrailingSlash(value) : value;
|
|
3020
|
+
this.chartElement.setAttribute(
|
|
3021
|
+
libraryTypeToWebComponentTypeMapping[key],
|
|
3022
|
+
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
3023
|
+
);
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
updated(changedProperties) {
|
|
3029
|
+
if (this.chartElement) {
|
|
3030
|
+
for (const [propertyName] of changedProperties.entries()) {
|
|
3031
|
+
const mappedAttributeName = libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
|
|
3032
|
+
const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
|
|
3033
|
+
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
3034
|
+
}
|
|
3035
|
+
} else {
|
|
3036
|
+
if (this.type) {
|
|
3037
|
+
this.createAndAppendElement();
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
render() {
|
|
3042
|
+
return x` `;
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
__decorateClass([
|
|
3046
|
+
n3()
|
|
3047
|
+
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
3048
|
+
__decorateClass([
|
|
3049
|
+
n3()
|
|
3050
|
+
], LuzmoBaseVizItem.prototype, "apiHost", 2);
|
|
3051
|
+
__decorateClass([
|
|
3052
|
+
n3({ type: Array })
|
|
3053
|
+
], LuzmoBaseVizItem.prototype, "slots", 2);
|
|
3054
|
+
__decorateClass([
|
|
3055
|
+
n3({ type: Object })
|
|
3056
|
+
], LuzmoBaseVizItem.prototype, "options", 2);
|
|
3057
|
+
__decorateClass([
|
|
3058
|
+
n3()
|
|
3059
|
+
], LuzmoBaseVizItem.prototype, "type", 2);
|
|
3060
|
+
__decorateClass([
|
|
3061
|
+
n3()
|
|
3062
|
+
], LuzmoBaseVizItem.prototype, "authKey", 2);
|
|
3063
|
+
__decorateClass([
|
|
3064
|
+
n3()
|
|
3065
|
+
], LuzmoBaseVizItem.prototype, "authToken", 2);
|
|
3066
|
+
__decorateClass([
|
|
3067
|
+
n3()
|
|
3068
|
+
], LuzmoBaseVizItem.prototype, "version", 2);
|
|
3069
|
+
__decorateClass([
|
|
3070
|
+
n3()
|
|
3071
|
+
], LuzmoBaseVizItem.prototype, "contextId", 2);
|
|
3072
|
+
__decorateClass([
|
|
3073
|
+
n3()
|
|
3074
|
+
], LuzmoBaseVizItem.prototype, "canFilter", 2);
|
|
3075
|
+
__decorateClass([
|
|
3076
|
+
n3()
|
|
3077
|
+
], LuzmoBaseVizItem.prototype, "filtlers", 2);
|
|
3078
|
+
|
|
3079
|
+
// libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
|
|
3080
|
+
var LuzmoVizItem = class extends LuzmoBaseVizItem {
|
|
3081
|
+
};
|
|
3082
|
+
LuzmoVizItem = __decorateClass([
|
|
3083
|
+
t("luzmo-viz-item")
|
|
3084
|
+
], LuzmoVizItem);
|
|
2946
3085
|
/*! Bundled license information:
|
|
2947
3086
|
|
|
2948
3087
|
@lit/reactive-element/decorators/custom-element.js:
|
package/package.json
CHANGED
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
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';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as SharedLib from '@luzmo/shared-embed';
|
|
2
|
+
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
3
|
+
import { CombinedFilterInput } from '@luzmo/shared-embed';
|
|
4
|
+
/**
|
|
5
|
+
* Luzmo Dashboard
|
|
6
|
+
* Base component isn't registered in customEvents registry so that it can be reused.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6LuzmoDashboard {
|
|
9
|
+
container: HTMLElement;
|
|
10
|
+
luzmoEmbedContainer: HTMLElement;
|
|
11
|
+
iframe: HTMLIFrameElement;
|
|
12
|
+
dashboardId?: SharedLib.DashboardInputs['dashboardId'];
|
|
13
|
+
dashboardSlug?: SharedLib.DashboardInputs['dashboardSlug'];
|
|
14
|
+
itemId?: SharedLib.DashboardInputs['itemId'];
|
|
15
|
+
language: SharedLib.DashboardInputs['language'];
|
|
16
|
+
qeVersion: SharedLib.DashboardInputs['qeVersion'];
|
|
17
|
+
screenMode: SharedLib.DashboardInputs['screenMode'];
|
|
18
|
+
switchScreenModeOnResize: boolean;
|
|
19
|
+
editMode: SharedLib.DashboardInputs['editMode'];
|
|
20
|
+
mainColor?: SharedLib.DashboardInputs['mainColor'];
|
|
21
|
+
accentColor?: SharedLib.DashboardInputs['accentColor'];
|
|
22
|
+
authToken?: SharedLib.DashboardInputs['authToken'];
|
|
23
|
+
authKey?: SharedLib.DashboardInputs['authKey'];
|
|
24
|
+
loaderBackground?: SharedLib.DashboardInputs['loaderBackground'];
|
|
25
|
+
loaderFontColor?: SharedLib.DashboardInputs['loaderFontColor'];
|
|
26
|
+
loaderSpinnerColor?: SharedLib.DashboardInputs['loaderSpinnerColor'];
|
|
27
|
+
loaderSpinnerBackground?: SharedLib.DashboardInputs['loaderSpinnerBackground'];
|
|
28
|
+
appServer?: SharedLib.DashboardInputs['appServer'];
|
|
29
|
+
timezoneId?: SharedLib.DashboardInputs['timezoneId'];
|
|
30
|
+
apiHost?: SharedLib.DashboardInputs['apiHost'];
|
|
31
|
+
itemDimensions: SharedLib.DashboardInputs['itemDimensions'];
|
|
32
|
+
experimental: boolean;
|
|
33
|
+
_containerId: string;
|
|
34
|
+
_iframeId: string;
|
|
35
|
+
params: SharedLib.DashboardContentParams;
|
|
36
|
+
_iframeUrl?: string;
|
|
37
|
+
iframeLoaded: boolean;
|
|
38
|
+
promises: SharedLib.DashboardPromises;
|
|
39
|
+
iframeStyle: SharedLib.IframeStyles;
|
|
40
|
+
_containerStyle: SharedLib.ContainerStyles;
|
|
41
|
+
_loaderStyle: SharedLib.LoaderStyles;
|
|
42
|
+
_lcStyle: SharedLib.LcStyles;
|
|
43
|
+
_loadingCircleStyle: SharedLib.PlStyles;
|
|
44
|
+
_containerLoaderStyle: SharedLib.ContainerLoaderStyles;
|
|
45
|
+
_loaderMsg: string;
|
|
46
|
+
containerWidth?: number;
|
|
47
|
+
dimensions?: SharedLib.DashboardDimensions;
|
|
48
|
+
currentScreenMode?: SharedLib.ScreenMode;
|
|
49
|
+
_itemEmbedding: boolean;
|
|
50
|
+
browserError: boolean;
|
|
51
|
+
browserErrorMsg: string;
|
|
52
|
+
dashboardError: boolean;
|
|
53
|
+
browserNotSupported: any[];
|
|
54
|
+
VERSION: string;
|
|
55
|
+
protected isLibraryLoaded: boolean;
|
|
56
|
+
protected dashboardReference: SharedLib.LuzmoElement;
|
|
57
|
+
currentAuthKey: string;
|
|
58
|
+
currentAuthToken: string;
|
|
59
|
+
private attributesMap;
|
|
60
|
+
_loadTimeoutHandle?: number;
|
|
61
|
+
_onResize: () => void;
|
|
62
|
+
loaderSize: number;
|
|
63
|
+
borderWidth: number;
|
|
64
|
+
minHeight: number;
|
|
65
|
+
iframeHeight?: string;
|
|
66
|
+
iframeWidth?: string;
|
|
67
|
+
_resizeObserver: ResizeObserver;
|
|
68
|
+
constructor(inputParameters?: Record<keyof LuzmoDashboard, any>);
|
|
69
|
+
private loadLibrary;
|
|
70
|
+
private setInputParameters;
|
|
71
|
+
connectedCallback(): void;
|
|
72
|
+
disconnectedCallback(): void;
|
|
73
|
+
firstUpdated(): void;
|
|
74
|
+
initComponent(): void;
|
|
75
|
+
setAllAttributes(): void;
|
|
76
|
+
updated(changedProperties: PropertyValues): void;
|
|
77
|
+
_setOptions(): SharedLib.DashboardContentParams;
|
|
78
|
+
_updateIframeUrl(): void;
|
|
79
|
+
_setupLoader(): void;
|
|
80
|
+
_displayError(): void;
|
|
81
|
+
_calculateDimAfterDashboardLoaded(): void;
|
|
82
|
+
_loaderStyles(): void;
|
|
83
|
+
static get styles(): import("lit").CSSResult[];
|
|
84
|
+
render(): TemplateResult;
|
|
85
|
+
getDashboards(): Promise<LuzmoDashboard[]>;
|
|
86
|
+
getData(itemId: string): Promise<SharedLib.ItemData>;
|
|
87
|
+
getFilters(): Promise<SharedLib.FilterGroup[]>;
|
|
88
|
+
setFilters<K extends CombinedFilterInput>(itemId: string, filters: K): Promise<SharedLib.SetFilters>;
|
|
89
|
+
setAuthorization(key: string, token: string): Promise<void>;
|
|
90
|
+
refreshData(itemId?: string): Promise<void>;
|
|
91
|
+
reloadDashboard(): Promise<void>;
|
|
92
|
+
exportDashboard(format?: SharedLib.ExportType): Promise<SharedLib.ExportDashboard>;
|
|
93
|
+
getAccessibleDashboards(): Promise<SharedLib.AccessibleDashboard[]>;
|
|
94
|
+
addFilters(itemId: string, filters: SharedLib.FilterGroup[]): Promise<SharedLib.AddFilters>;
|
|
95
|
+
setEditMode(editMode?: SharedLib.DashboardEditMode): Promise<SharedLib.SetEditMode>;
|
|
96
|
+
setPreview(preview: boolean): Promise<SharedLib.SetPreview>;
|
|
97
|
+
getIsViewMode(): boolean;
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dashboardStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const _setEventHandler: () => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
filtlers?: 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
|
+
}
|