@luzmo/embed 5.0.8 → 5.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +8 -8
- package/index.cjs +99 -1241
- package/index.js +83 -1231
- package/lib/dashboard-component/dashboard-component.d.ts +2 -0
- package/luzmo-embed.min.js +25 -5
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
30
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
@@ -27,1195 +37,22 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
27
37
|
};
|
|
28
38
|
|
|
29
39
|
// libs/embed-libs/embed/src/index.ts
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
32
|
-
LuzmoDashboard: () => LuzmoDashboard
|
|
40
|
+
var src_exports = {};
|
|
41
|
+
__export(src_exports, {
|
|
42
|
+
LuzmoDashboard: () => LuzmoDashboard,
|
|
43
|
+
LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent
|
|
33
44
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
|
|
36
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/error.ts
|
|
37
|
-
var _handleError = (errorMessage, parameters) => {
|
|
38
|
-
let message = "The dashboard component encountered an error";
|
|
39
|
-
if (typeof parameters?.dashboardId === "string") {
|
|
40
|
-
message += ` for dashboard with id ${parameters.dashboardId}`;
|
|
41
|
-
}
|
|
42
|
-
if (typeof parameters?.dashboardSlug === "string") {
|
|
43
|
-
message += ` for dashboard with slug ${parameters.dashboardSlug}`;
|
|
44
|
-
}
|
|
45
|
-
if (typeof parameters?.container === "string") {
|
|
46
|
-
message += ` in container ${parameters.container}`;
|
|
47
|
-
}
|
|
48
|
-
if (errorMessage) {
|
|
49
|
-
message += `:
|
|
50
|
-
${errorMessage}`;
|
|
51
|
-
console.error(message);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/browser-check.ts
|
|
56
|
-
var _browserCheck = (dashboardComponent) => {
|
|
57
|
-
let hasError = false;
|
|
58
|
-
let errorMessage = "";
|
|
59
|
-
const document_ = document.body || document.documentElement;
|
|
60
|
-
const style = document_.style;
|
|
61
|
-
const browserCheck = {
|
|
62
|
-
svg: !!("createElementNS" in document && document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect),
|
|
63
|
-
flexbox: style.webkitFlexWrap === "" || style.flexWrap === "",
|
|
64
|
-
postMessage: !!window.postMessage
|
|
65
|
-
};
|
|
66
|
-
const browserCheckKeys = ["svg", "flexbox", "postMessage"];
|
|
67
|
-
for (const key of browserCheckKeys) {
|
|
68
|
-
if (!browserCheck[key]) {
|
|
69
|
-
hasError = true;
|
|
70
|
-
dashboardComponent.browserNotSupported = dashboardComponent.browserNotSupported || [];
|
|
71
|
-
dashboardComponent.browserNotSupported.push(key);
|
|
72
|
-
errorMessage += `Your browser does not support: ${key}
|
|
73
|
-
`;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
const ua = window.navigator.userAgent;
|
|
77
|
-
const msie = ua.includes("MSIE");
|
|
78
|
-
const trident = ua.includes("Trident/");
|
|
79
|
-
if (msie || trident) {
|
|
80
|
-
hasError = true;
|
|
81
|
-
errorMessage = "IE is not supported.";
|
|
82
|
-
}
|
|
83
|
-
if (hasError) {
|
|
84
|
-
_handleError(errorMessage);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/default-parameters.ts
|
|
89
|
-
var DEFAULT_PARAMETERS = {
|
|
90
|
-
appServer: "https://app.luzmo.com/",
|
|
91
|
-
apiHost: "https://api.luzmo.com/",
|
|
92
|
-
dashboardId: null,
|
|
93
|
-
dashboardSlug: null,
|
|
94
|
-
container: null,
|
|
95
|
-
key: null,
|
|
96
|
-
token: null,
|
|
97
|
-
language: "auto",
|
|
98
|
-
qeVersion: null,
|
|
99
|
-
editMode: null,
|
|
100
|
-
screenMode: null,
|
|
101
|
-
switchScreenModeOnResize: true,
|
|
102
|
-
itemId: null,
|
|
103
|
-
mainColor: "",
|
|
104
|
-
accentColor: "",
|
|
105
|
-
itemDimensions: {
|
|
106
|
-
width: "auto",
|
|
107
|
-
height: "auto"
|
|
108
|
-
},
|
|
109
|
-
loaderBackground: "#f9f9f9",
|
|
110
|
-
loaderFontColor: "#5a5a5a",
|
|
111
|
-
loaderSpinnerColor: "rgba(255, 165, 0, 0.7)",
|
|
112
|
-
loaderSpinnerBackground: "rgba(169, 169, 169, 0.14)",
|
|
113
|
-
timezoneId: null,
|
|
114
|
-
contextId: null
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/extents.ts
|
|
118
|
-
var EXTENTS = [
|
|
119
|
-
{ mode: "mobile", width: [150, 767] },
|
|
120
|
-
{ mode: "tablet", width: [768, 1199] },
|
|
121
|
-
{ mode: "desktop", width: [1200, 1599] },
|
|
122
|
-
{ mode: "largeScreen", width: [1600, 9999] },
|
|
123
|
-
{ mode: "fixed", width: [] }
|
|
124
|
-
];
|
|
125
|
-
|
|
126
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/translations.ts
|
|
127
|
-
var TRANSLATIONS = {
|
|
128
|
-
initializing: { en: "Initializing...", nl: "Laden...", fr: "Chargement..." },
|
|
129
|
-
errorDashboard: {
|
|
130
|
-
en: "Oops, we could not load this dashboard!",
|
|
131
|
-
nl: "Oeps, we konden het dashboard niet laden.",
|
|
132
|
-
fr: "Le chargement a echou\xE9."
|
|
133
|
-
},
|
|
134
|
-
errorItem: {
|
|
135
|
-
en: "Oops, we could not load this item!",
|
|
136
|
-
nl: "Oeps, we konden de grafiek niet laden.",
|
|
137
|
-
fr: "Le chargement a echou\xE9."
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
var translations_default = TRANSLATIONS;
|
|
141
|
-
|
|
142
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/utils.ts
|
|
143
|
-
var addTrailingSlash = (serverUrl) => {
|
|
144
|
-
if (!serverUrl) {
|
|
145
|
-
return "";
|
|
146
|
-
}
|
|
147
|
-
return serverUrl.endsWith("/") ? serverUrl : `${serverUrl}/`;
|
|
148
|
-
};
|
|
149
|
-
var removeTrailingSlash = (serverUrl) => {
|
|
150
|
-
if (!serverUrl) {
|
|
151
|
-
return "";
|
|
152
|
-
}
|
|
153
|
-
return serverUrl.endsWith("/") ? serverUrl.slice(0, -1) : serverUrl;
|
|
154
|
-
};
|
|
155
|
-
var formatDashboardList = (dashboards, integrationId, user, dashboardComponent) => {
|
|
156
|
-
const combineRights = (securable, user2) => {
|
|
157
|
-
const matchingUser = securable.users.find((u) => u.id === user2.id);
|
|
158
|
-
const securableAccessRights = matchingUser && matchingUser.userAccessRight ? {
|
|
159
|
-
flagRead: matchingUser.userAccessRight.flagRead,
|
|
160
|
-
flagUse: matchingUser.userAccessRight.flagUse,
|
|
161
|
-
flagModify: matchingUser.userAccessRight.flagModify,
|
|
162
|
-
flagOwn: matchingUser.userAccessRight.flagOwn
|
|
163
|
-
} : {
|
|
164
|
-
flagRead: false,
|
|
165
|
-
flagUse: false,
|
|
166
|
-
flagModify: false,
|
|
167
|
-
flagOwn: false
|
|
168
|
-
};
|
|
169
|
-
const groups = securable.groups.filter(
|
|
170
|
-
(group) => user2.userGroups.includes(group.id) || group.public === true
|
|
171
|
-
);
|
|
172
|
-
const groupsAccess = groups.map((group) => {
|
|
173
|
-
if (group.groupAccessRight) {
|
|
174
|
-
return group.groupAccessRight;
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
for (const groupAccess of groupsAccess) {
|
|
178
|
-
if (!securableAccessRights.flagRead && groupAccess.flagRead) {
|
|
179
|
-
securableAccessRights.flagRead = groupAccess.flagRead;
|
|
180
|
-
}
|
|
181
|
-
if (!securableAccessRights.flagUse && groupAccess.flagUse) {
|
|
182
|
-
securableAccessRights.flagUse = groupAccess.flagUse;
|
|
183
|
-
}
|
|
184
|
-
if (!securableAccessRights.flagModify && groupAccess.flagModify) {
|
|
185
|
-
securableAccessRights.flagModify = groupAccess.flagModify;
|
|
186
|
-
}
|
|
187
|
-
if (!securableAccessRights.flagOwn && groupAccess.flagOwn) {
|
|
188
|
-
securableAccessRights.flagOwn = groupAccess.flagOwn;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
const integrationsAccess = securable.integrations?.length > 0 ? securable.integrations.map((integration) => {
|
|
192
|
-
if (integration.integrationAccessRight) {
|
|
193
|
-
return integration.integrationAccessRight;
|
|
194
|
-
}
|
|
195
|
-
}) : [];
|
|
196
|
-
for (const integrationAccess of integrationsAccess) {
|
|
197
|
-
if (!securableAccessRights.flagRead && integrationAccess.flagRead) {
|
|
198
|
-
securableAccessRights.flagRead = integrationAccess.flagRead;
|
|
199
|
-
}
|
|
200
|
-
if (!securableAccessRights.flagUse && integrationAccess.flagUse) {
|
|
201
|
-
securableAccessRights.flagUse = integrationAccess.flagUse;
|
|
202
|
-
}
|
|
203
|
-
if (!securableAccessRights.flagModify && integrationAccess.flagModify) {
|
|
204
|
-
securableAccessRights.flagModify = integrationAccess.flagModify;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return securableAccessRights;
|
|
208
|
-
};
|
|
209
|
-
const localize = (item, locale) => {
|
|
210
|
-
if (item === null || item === void 0) {
|
|
211
|
-
return "";
|
|
212
|
-
}
|
|
213
|
-
if (typeof item !== "object" || Object.keys(item).length === 0) {
|
|
214
|
-
if (typeof item === "object" && Object.keys(item).length === 0) {
|
|
215
|
-
return "";
|
|
216
|
-
}
|
|
217
|
-
return item;
|
|
218
|
-
}
|
|
219
|
-
let localizedItem;
|
|
220
|
-
localizedItem = locale && item[locale] ? item[locale] : item[Object.keys(item)[0]];
|
|
221
|
-
if (localizedItem === void 0 || localizedItem === null) {
|
|
222
|
-
localizedItem = "";
|
|
223
|
-
}
|
|
224
|
-
return localizedItem;
|
|
225
|
-
};
|
|
226
|
-
const treatedDashboards = [];
|
|
227
|
-
for (const dashboard of dashboards) {
|
|
228
|
-
const treatedDashboard = {
|
|
229
|
-
accessibleBy: [],
|
|
230
|
-
accessRights: combineRights(dashboard, user),
|
|
231
|
-
id: dashboard.id,
|
|
232
|
-
modifiedAt: dashboard.modified_at,
|
|
233
|
-
name: localize(dashboard.name, dashboardComponent.language),
|
|
234
|
-
slug: null,
|
|
235
|
-
tags: dashboard.tags.map((t) => t.tag).sort((t1, t2) => t1.localeCompare(t2))
|
|
236
|
-
};
|
|
237
|
-
const currentIntegration = dashboard.integrations.find(
|
|
238
|
-
(i) => i.id === integrationId
|
|
239
|
-
);
|
|
240
|
-
if (currentIntegration?.integrationAccessRight?.slug) {
|
|
241
|
-
treatedDashboard.slug = currentIntegration.integrationAccessRight.slug;
|
|
242
|
-
}
|
|
243
|
-
const users = dashboard.users.map((u) => ({
|
|
244
|
-
model: "User",
|
|
245
|
-
id: u.id,
|
|
246
|
-
name: localize(u.name, user.locale_id)
|
|
247
|
-
}));
|
|
248
|
-
const groups = dashboard.groups.map((g) => ({
|
|
249
|
-
model: "Group",
|
|
250
|
-
id: g.id,
|
|
251
|
-
name: localize(g.name, user.locale_id) || {}
|
|
252
|
-
}));
|
|
253
|
-
const integrations = dashboard.integrations.map((i) => ({
|
|
254
|
-
model: "Integration",
|
|
255
|
-
id: i.id,
|
|
256
|
-
name: localize(i.name, user.locale_id) || {}
|
|
257
|
-
}));
|
|
258
|
-
treatedDashboard.accessibleBy = [...users, ...groups, ...integrations];
|
|
259
|
-
treatedDashboards.push(treatedDashboard);
|
|
260
|
-
}
|
|
261
|
-
return treatedDashboards;
|
|
262
|
-
};
|
|
263
|
-
var VERSION = "0.0.0-shared-luzmo";
|
|
264
|
-
var sanitizeUrl = (url) => {
|
|
265
|
-
const invalidPrototcolRegex = /^(%20|\s)*(javascript|data)/im;
|
|
266
|
-
const ctrlCharactersRegex = /[^\u0020-\u007E]/gim;
|
|
267
|
-
const urlSchemeRegex = /^([^:]+):/gm;
|
|
268
|
-
const relativeFirstCharacters = /* @__PURE__ */ new Set([".", "/"]);
|
|
269
|
-
const isRelativeUrlWithoutProtocol = (relativeUrl) => relativeFirstCharacters.has(relativeUrl[0]);
|
|
270
|
-
if (!url) {
|
|
271
|
-
return "about:blank";
|
|
272
|
-
}
|
|
273
|
-
const sanitizedUrl = url.replaceAll(ctrlCharactersRegex, "").trim();
|
|
274
|
-
if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
|
|
275
|
-
return sanitizedUrl;
|
|
276
|
-
}
|
|
277
|
-
const urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);
|
|
278
|
-
if (!urlSchemeParseResults) {
|
|
279
|
-
return sanitizedUrl;
|
|
280
|
-
}
|
|
281
|
-
const urlScheme = urlSchemeParseResults[0];
|
|
282
|
-
if (invalidPrototcolRegex.test(urlScheme)) {
|
|
283
|
-
return "about:blank";
|
|
284
|
-
}
|
|
285
|
-
return sanitizedUrl;
|
|
286
|
-
};
|
|
287
|
-
var cloneDeep = (obj) => JSON.parse(JSON.stringify(obj));
|
|
288
|
-
var isObject = (o) => o && typeof o === "object";
|
|
289
|
-
var defaultsDeep = (target, defaults) => {
|
|
290
|
-
Object.entries(defaults).forEach(([k, v]) => {
|
|
291
|
-
if (k in target) {
|
|
292
|
-
if (target[k] === void 0) {
|
|
293
|
-
target[k] = v;
|
|
294
|
-
} else {
|
|
295
|
-
target[k] = isObject(v) ? defaultsDeep(
|
|
296
|
-
target[k],
|
|
297
|
-
v
|
|
298
|
-
) : target[k];
|
|
299
|
-
}
|
|
300
|
-
} else {
|
|
301
|
-
target[k] = v;
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
return target;
|
|
305
|
-
};
|
|
306
|
-
var uuidv4 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g, function(c) {
|
|
307
|
-
const r = Math.random() * 16 | 0;
|
|
308
|
-
const v = c == "x" ? r : r & 3 | 8;
|
|
309
|
-
return v.toString(16);
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/iframe-url.ts
|
|
313
|
-
var createIframeUrl = (dashboardContent) => {
|
|
314
|
-
const searchString = [];
|
|
315
|
-
const {
|
|
316
|
-
appServer,
|
|
317
|
-
language,
|
|
318
|
-
qeVersion,
|
|
319
|
-
loaderBackground,
|
|
320
|
-
loaderSpinnerColor,
|
|
321
|
-
loaderSpinnerBackground,
|
|
322
|
-
loaderFontColor,
|
|
323
|
-
screenMode,
|
|
324
|
-
key,
|
|
325
|
-
token,
|
|
326
|
-
timezoneId,
|
|
327
|
-
itemEmbedding,
|
|
328
|
-
itemDimensions,
|
|
329
|
-
dashboardId,
|
|
330
|
-
dashboardSlug,
|
|
331
|
-
itemId,
|
|
332
|
-
mainColor,
|
|
333
|
-
accentColor,
|
|
334
|
-
editMode
|
|
335
|
-
} = dashboardContent.params;
|
|
336
|
-
if (language && language !== "auto") {
|
|
337
|
-
searchString.push("language=" + language);
|
|
338
|
-
}
|
|
339
|
-
if (qeVersion) {
|
|
340
|
-
searchString.push(`qe_version=${qeVersion}`);
|
|
341
|
-
}
|
|
342
|
-
if (loaderBackground) {
|
|
343
|
-
searchString.push(`ldrbg=${loaderBackground}`);
|
|
344
|
-
}
|
|
345
|
-
if (loaderFontColor) {
|
|
346
|
-
searchString.push(`ldrftclr=${loaderFontColor}`);
|
|
347
|
-
}
|
|
348
|
-
if (loaderSpinnerColor) {
|
|
349
|
-
searchString.push(`ldrspclr=${loaderSpinnerColor}`);
|
|
350
|
-
}
|
|
351
|
-
if (loaderSpinnerBackground) {
|
|
352
|
-
searchString.push(`ldrspbg=${loaderSpinnerBackground}`);
|
|
353
|
-
}
|
|
354
|
-
if (mainColor) {
|
|
355
|
-
searchString.push(`mainColor=${mainColor}`);
|
|
356
|
-
}
|
|
357
|
-
if (accentColor) {
|
|
358
|
-
searchString.push(`accentColor=${accentColor}`);
|
|
359
|
-
}
|
|
360
|
-
if (screenMode && screenMode !== "auto") {
|
|
361
|
-
searchString.push("screenMode=" + screenMode);
|
|
362
|
-
}
|
|
363
|
-
if (timezoneId) {
|
|
364
|
-
searchString.push("timezoneId=" + timezoneId);
|
|
365
|
-
}
|
|
366
|
-
if (itemEmbedding && itemDimensions && itemDimensions.width) {
|
|
367
|
-
searchString.push("width=" + itemDimensions.width);
|
|
368
|
-
}
|
|
369
|
-
if (itemEmbedding && itemDimensions && itemDimensions.height) {
|
|
370
|
-
searchString.push("height=" + itemDimensions.height);
|
|
371
|
-
}
|
|
372
|
-
if (editMode) {
|
|
373
|
-
searchString.push("editMode=" + editMode);
|
|
374
|
-
}
|
|
375
|
-
const keyTokenUrlAnchor = key && token ? "#" + key + ":" + token : "";
|
|
376
|
-
searchString.push("version=" + (dashboardContent.VERSION || VERSION));
|
|
377
|
-
const iframeUrl = itemEmbedding ? `${appServer}i/${dashboardId || dashboardSlug}/${itemId}?${encodeURIComponent(
|
|
378
|
-
searchString.join("&")
|
|
379
|
-
)}${keyTokenUrlAnchor}` : `${appServer}i/${dashboardId || dashboardSlug}?${encodeURIComponent(
|
|
380
|
-
searchString.join("&")
|
|
381
|
-
)}${keyTokenUrlAnchor}`;
|
|
382
|
-
return sanitizeUrl(iframeUrl);
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/get-loader.ts
|
|
386
|
-
var getLoader = (dashboardComponent) => {
|
|
387
|
-
let errorMsg;
|
|
388
|
-
if (dashboardComponent.params.error || dashboardComponent.browserNotSupported.length > 0) {
|
|
389
|
-
dashboardComponent.params.error = true;
|
|
390
|
-
if (dashboardComponent.browserNotSupported) {
|
|
391
|
-
errorMsg = "Browser is not supported.";
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
const loadingMsg = translations_default.initializing[dashboardComponent.params.language] || translations_default.initializing.en;
|
|
395
|
-
return dashboardComponent.browserNotSupported || dashboardComponent.params.error ? { loadingMsg, errorMsg } : { loadingMsg, errorMsg: "" };
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/promise-dispatch.ts
|
|
399
|
-
function resolvePromise(dashboardComponent, requestId, data) {
|
|
400
|
-
if (dashboardComponent.promises[requestId]) {
|
|
401
|
-
dashboardComponent.promises[requestId].resolve(data);
|
|
402
|
-
delete dashboardComponent.promises[requestId];
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
function rejectPromise(dashboardComponent, requestId, data) {
|
|
406
|
-
if (dashboardComponent.promises[requestId]) {
|
|
407
|
-
dashboardComponent.promises[requestId].reject(data);
|
|
408
|
-
delete dashboardComponent.promises[requestId];
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/styles.ts
|
|
413
|
-
function containerStyles(dashboardComponent) {
|
|
414
|
-
const styles = {};
|
|
415
|
-
if (dashboardComponent.params.loaderBackground && !dashboardComponent.iframeLoaded) {
|
|
416
|
-
styles.background = dashboardComponent.params.loaderBackground;
|
|
417
|
-
}
|
|
418
|
-
return styles;
|
|
419
|
-
}
|
|
420
|
-
function containerLoaderStyles(dashboardComponent) {
|
|
421
|
-
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
422
|
-
const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
|
|
423
|
-
const display = dashboardComponent.iframeLoaded ? "none" : "";
|
|
424
|
-
return {
|
|
425
|
-
display,
|
|
426
|
-
height: `${chartHeightDefined ? height : dashboardComponent.minHeight}px`
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
function loaderStyles(dashboardComponent) {
|
|
430
|
-
const background = dashboardComponent.params.loaderBackground || DEFAULT_PARAMETERS.loaderBackground;
|
|
431
|
-
if (dashboardComponent.params.itemEmbedding) {
|
|
432
|
-
dashboardComponent.loaderSize = 24;
|
|
433
|
-
dashboardComponent.borderWidth = 4;
|
|
434
|
-
dashboardComponent.minHeight = 200;
|
|
435
|
-
const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
|
|
436
|
-
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
437
|
-
const chartWidthDefined = width !== "auto";
|
|
438
|
-
const chartHeightDefined = height !== "auto";
|
|
439
|
-
return {
|
|
440
|
-
background,
|
|
441
|
-
width: chartWidthDefined ? `${width}px` : "100%",
|
|
442
|
-
height: `${chartHeightDefined ? height : "200"}px`,
|
|
443
|
-
"min-height": chartHeightDefined ? "" : "200px"
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
return {
|
|
447
|
-
background
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
function plStyles(dashboardComponent) {
|
|
451
|
-
const {
|
|
452
|
-
loaderSpinnerColor: defaultSpinnerColor,
|
|
453
|
-
loaderSpinnerBackground: defaultSpinnerBackground
|
|
454
|
-
} = DEFAULT_PARAMETERS;
|
|
455
|
-
const spinnerColorBorder = generateBorderStyle(
|
|
456
|
-
dashboardComponent.borderWidth,
|
|
457
|
-
dashboardComponent.params.loaderSpinnerColor || defaultSpinnerColor
|
|
458
|
-
);
|
|
459
|
-
const spinnerBackgroundBorder = generateBorderStyle(
|
|
460
|
-
dashboardComponent.borderWidth,
|
|
461
|
-
dashboardComponent.params.loaderSpinnerBackground || defaultSpinnerBackground
|
|
462
|
-
);
|
|
463
|
-
const size = `${dashboardComponent.loaderSize}px`;
|
|
464
|
-
return {
|
|
465
|
-
"border-top": spinnerColorBorder,
|
|
466
|
-
"border-right": spinnerColorBorder,
|
|
467
|
-
"border-bottom": spinnerBackgroundBorder,
|
|
468
|
-
"border-left": spinnerBackgroundBorder,
|
|
469
|
-
width: size,
|
|
470
|
-
height: size
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
function lcStyles(dashboardComponent) {
|
|
474
|
-
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
475
|
-
const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
|
|
476
|
-
const getPaddingStr = (value) => `${(value - dashboardComponent.loaderSize - 32) / 2}px`;
|
|
477
|
-
const verticalPadding = dashboardComponent.params.itemId ? chartHeightDefined ? getPaddingStr(Number.parseInt(`${height}`, 10)) : getPaddingStr(dashboardComponent.minHeight) : "128px";
|
|
478
|
-
return {
|
|
479
|
-
padding: `${verticalPadding} 16px`
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
function calculateIframeStyles(dashboardComponent) {
|
|
483
|
-
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
484
|
-
const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
|
|
485
|
-
if (dashboardComponent.params.itemEmbedding && height !== "auto") {
|
|
486
|
-
dashboardComponent.iframeHeight = `${height}px`;
|
|
487
|
-
} else if (dashboardComponent.params.itemEmbedding) {
|
|
488
|
-
dashboardComponent.iframeHeight = "200px";
|
|
489
|
-
} else if (["editFull", "editLimited"].includes(dashboardComponent.params.editMode)) {
|
|
490
|
-
dashboardComponent.iframeHeight = "100%";
|
|
491
|
-
} else {
|
|
492
|
-
dashboardComponent.iframeHeight = "400px";
|
|
493
|
-
}
|
|
494
|
-
dashboardComponent.iframeWidth = dashboardComponent.params.itemEmbedding && width !== "auto" ? `${width}px` : "100%";
|
|
495
|
-
const styles = {
|
|
496
|
-
height: dashboardComponent.iframeHeight,
|
|
497
|
-
width: dashboardComponent.iframeWidth
|
|
498
|
-
};
|
|
499
|
-
if (dashboardComponent.iframeLoaded) {
|
|
500
|
-
styles.opacity = 1;
|
|
501
|
-
} else if (dashboardComponent.error) {
|
|
502
|
-
styles.opacity = 1;
|
|
503
|
-
styles.width = "100%";
|
|
504
|
-
styles.height = "400px";
|
|
505
|
-
} else {
|
|
506
|
-
styles.opacity = 0;
|
|
507
|
-
}
|
|
508
|
-
return styles;
|
|
509
|
-
}
|
|
510
|
-
function generateBorderStyle(borderWidth, color) {
|
|
511
|
-
return `${borderWidth}px solid ${color}`;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/update-iframe-url.ts
|
|
515
|
-
var updateIframeUrl = (iframe, iframeUrl) => {
|
|
516
|
-
if (iframe?.contentWindow) {
|
|
517
|
-
iframe.contentWindow.location.replace(iframeUrl);
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
// libs/embed-libs/shared-embed/src/lib/methods/export-dashboard.ts
|
|
522
|
-
var exportDashboard = (dashboardComponent, iframe, format) => {
|
|
523
|
-
const requestId = uuidv4();
|
|
524
|
-
if (iframe?.contentWindow) {
|
|
525
|
-
iframe.contentWindow.postMessage(
|
|
526
|
-
{
|
|
527
|
-
action: "exportDashboard",
|
|
528
|
-
format: format || "png",
|
|
529
|
-
_version: dashboardComponent.VERSION,
|
|
530
|
-
requestId
|
|
531
|
-
},
|
|
532
|
-
"*"
|
|
533
|
-
);
|
|
534
|
-
return new Promise((resolve, reject) => {
|
|
535
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
536
|
-
setTimeout(() => {
|
|
537
|
-
if (dashboardComponent.promises[requestId]) {
|
|
538
|
-
const errorMessage = "exportDashboard request timed out.";
|
|
539
|
-
dashboardComponent.promises[requestId].reject(
|
|
540
|
-
new Error(errorMessage)
|
|
541
|
-
);
|
|
542
|
-
delete dashboardComponent.promises[requestId];
|
|
543
|
-
}
|
|
544
|
-
}, 12e5);
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
548
|
-
};
|
|
549
|
-
|
|
550
|
-
// libs/embed-libs/shared-embed/src/lib/methods/get-accessible-dashboards.ts
|
|
551
|
-
var getAccessibleDashboards = (dashboardComponent, iframe) => {
|
|
552
|
-
if ((dashboardComponent.dashboardId || dashboardComponent.dashboardSlug) && iframe?.contentWindow) {
|
|
553
|
-
const requestId = uuidv4();
|
|
554
|
-
iframe.contentWindow.postMessage(
|
|
555
|
-
{
|
|
556
|
-
action: "getAccessibleDashboards",
|
|
557
|
-
_version: dashboardComponent.VERSION,
|
|
558
|
-
requestId
|
|
559
|
-
},
|
|
560
|
-
"*"
|
|
561
|
-
);
|
|
562
|
-
return new Promise((resolve, reject) => {
|
|
563
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
564
|
-
setTimeout(() => {
|
|
565
|
-
if (dashboardComponent.promises[requestId]) {
|
|
566
|
-
const errorMessage = "getAccessibleDashboards request timed out.";
|
|
567
|
-
dashboardComponent.promises[requestId].reject(
|
|
568
|
-
new Error(errorMessage)
|
|
569
|
-
);
|
|
570
|
-
delete dashboardComponent.promises[requestId];
|
|
571
|
-
}
|
|
572
|
-
}, 2e3);
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
const fetchUser = new Promise((resolve, reject) => {
|
|
576
|
-
void (() => {
|
|
577
|
-
try {
|
|
578
|
-
const responsePromise = window.fetch(
|
|
579
|
-
`${String(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
580
|
-
{
|
|
581
|
-
method: "POST",
|
|
582
|
-
mode: "cors",
|
|
583
|
-
cache: "no-cache",
|
|
584
|
-
headers: { "Content-Type": "application/json" },
|
|
585
|
-
redirect: "follow",
|
|
586
|
-
body: JSON.stringify({
|
|
587
|
-
action: "get",
|
|
588
|
-
version: "0.1.0",
|
|
589
|
-
key: dashboardComponent.authKey,
|
|
590
|
-
token: dashboardComponent.authToken,
|
|
591
|
-
find: {
|
|
592
|
-
where: { id: dashboardComponent.authKey },
|
|
593
|
-
attributes: ["id", "integration_id"],
|
|
594
|
-
include: [
|
|
595
|
-
{
|
|
596
|
-
model: "User",
|
|
597
|
-
attributes: ["id", "name", "locale_id"],
|
|
598
|
-
include: [{ model: "Group" }]
|
|
599
|
-
}
|
|
600
|
-
]
|
|
601
|
-
}
|
|
602
|
-
})
|
|
603
|
-
}
|
|
604
|
-
);
|
|
605
|
-
responsePromise.then((response) => response.json()).then((data) => {
|
|
606
|
-
if (!data || !data.rows || data.rows.length === 0 || !data.rows[0].user || !data.rows[0].integration_id) {
|
|
607
|
-
reject();
|
|
608
|
-
} else {
|
|
609
|
-
data.rows[0].user.userGroups = data.rows[0].user.groups.map(
|
|
610
|
-
(group) => group.id
|
|
611
|
-
);
|
|
612
|
-
delete data.rows[0].user.groups;
|
|
613
|
-
resolve({
|
|
614
|
-
integrationId: data.rows[0].integration_id,
|
|
615
|
-
user: data.rows[0].user
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
} catch (error) {
|
|
620
|
-
reject(error);
|
|
621
|
-
}
|
|
622
|
-
})();
|
|
623
|
-
});
|
|
624
|
-
return new Promise((resolve, reject) => void (() => {
|
|
625
|
-
try {
|
|
626
|
-
fetchUser.then((authorizationData) => {
|
|
627
|
-
const responsePromise = window.fetch(
|
|
628
|
-
`${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
629
|
-
{
|
|
630
|
-
method: "POST",
|
|
631
|
-
mode: "cors",
|
|
632
|
-
cache: "no-cache",
|
|
633
|
-
headers: { "Content-Type": "application/json" },
|
|
634
|
-
redirect: "follow",
|
|
635
|
-
body: JSON.stringify({
|
|
636
|
-
action: "get",
|
|
637
|
-
version: "0.1.0",
|
|
638
|
-
key: dashboardComponent.authKey,
|
|
639
|
-
token: dashboardComponent.authToken,
|
|
640
|
-
find: {
|
|
641
|
-
where: { type: "dashboard", is_variant: false },
|
|
642
|
-
attributes: ["id", "name", "modified_at"],
|
|
643
|
-
order: [["modified_at", "desc"]],
|
|
644
|
-
include: [
|
|
645
|
-
{ model: "Tag", attributes: ["tag"] },
|
|
646
|
-
{ model: "User", attributes: ["id", "name"] },
|
|
647
|
-
{
|
|
648
|
-
model: "Group",
|
|
649
|
-
attributes: ["id", "name", "public"]
|
|
650
|
-
},
|
|
651
|
-
{ model: "Integration", attributes: ["id", "name"] }
|
|
652
|
-
]
|
|
653
|
-
}
|
|
654
|
-
})
|
|
655
|
-
}
|
|
656
|
-
);
|
|
657
|
-
responsePromise.then((response) => response.json()).then((data) => {
|
|
658
|
-
const dashboardList = data.rows.length > 0 ? formatDashboardList(
|
|
659
|
-
data.rows,
|
|
660
|
-
authorizationData.integrationId,
|
|
661
|
-
authorizationData.user,
|
|
662
|
-
dashboardComponent
|
|
663
|
-
) : [];
|
|
664
|
-
resolve(dashboardList);
|
|
665
|
-
});
|
|
666
|
-
}).catch((error) => {
|
|
667
|
-
reject(error);
|
|
668
|
-
});
|
|
669
|
-
} catch (error) {
|
|
670
|
-
reject(error);
|
|
671
|
-
}
|
|
672
|
-
})());
|
|
673
|
-
};
|
|
674
|
-
|
|
675
|
-
// libs/embed-libs/shared-embed/src/lib/methods/get-data.ts
|
|
676
|
-
var getData = (dashboardComponent, iframe, itemId) => {
|
|
677
|
-
if (iframe?.contentWindow) {
|
|
678
|
-
const requestId = uuidv4();
|
|
679
|
-
iframe.contentWindow.postMessage(
|
|
680
|
-
{
|
|
681
|
-
action: "getData",
|
|
682
|
-
id: itemId,
|
|
683
|
-
_version: dashboardComponent.VERSION,
|
|
684
|
-
requestId
|
|
685
|
-
},
|
|
686
|
-
"*"
|
|
687
|
-
);
|
|
688
|
-
return new Promise((resolve, reject) => {
|
|
689
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
690
|
-
setTimeout(() => {
|
|
691
|
-
if (dashboardComponent.promises[requestId]) {
|
|
692
|
-
const errorMessage = "getData request timed out.";
|
|
693
|
-
dashboardComponent.promises[requestId].reject(
|
|
694
|
-
new Error(errorMessage)
|
|
695
|
-
);
|
|
696
|
-
delete dashboardComponent.promises[requestId];
|
|
697
|
-
}
|
|
698
|
-
}, 2e3);
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
702
|
-
};
|
|
703
|
-
|
|
704
|
-
// libs/embed-libs/shared-embed/src/lib/methods/get-filters.ts
|
|
705
|
-
var getFilters = (dashboardComponent, iframe) => {
|
|
706
|
-
if (iframe?.contentWindow) {
|
|
707
|
-
const requestId = uuidv4();
|
|
708
|
-
iframe.contentWindow.postMessage(
|
|
709
|
-
{ action: "getFilters", _version: dashboardComponent.VERSION, requestId },
|
|
710
|
-
"*"
|
|
711
|
-
);
|
|
712
|
-
return new Promise((resolve, reject) => {
|
|
713
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
714
|
-
setTimeout(() => {
|
|
715
|
-
if (dashboardComponent.promises[requestId]) {
|
|
716
|
-
const errorMessage = "getFilters request timed out.";
|
|
717
|
-
dashboardComponent.promises[requestId].reject(
|
|
718
|
-
new Error(errorMessage)
|
|
719
|
-
);
|
|
720
|
-
delete dashboardComponent.promises[requestId];
|
|
721
|
-
}
|
|
722
|
-
}, 2e3);
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
726
|
-
};
|
|
727
|
-
|
|
728
|
-
// libs/embed-libs/shared-embed/src/lib/methods/refresh-data.ts
|
|
729
|
-
var refreshData = (dashboardComponent, iframe, itemId) => {
|
|
730
|
-
if (iframe) {
|
|
731
|
-
iframe.contentWindow.postMessage(
|
|
732
|
-
{
|
|
733
|
-
action: "refreshData",
|
|
734
|
-
id: itemId ?? null,
|
|
735
|
-
_version: dashboardComponent.VERSION
|
|
736
|
-
},
|
|
737
|
-
"*"
|
|
738
|
-
);
|
|
739
|
-
return Promise.resolve();
|
|
740
|
-
}
|
|
741
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
// libs/embed-libs/shared-embed/src/lib/methods/reload-dashboard.ts
|
|
745
|
-
var reloadDashboard = (dashboardComponent, iframe) => {
|
|
746
|
-
if (iframe) {
|
|
747
|
-
iframe.contentWindow.postMessage(
|
|
748
|
-
{ action: "reloadDashboard", _version: dashboardComponent.VERSION },
|
|
749
|
-
"*"
|
|
750
|
-
);
|
|
751
|
-
return Promise.resolve();
|
|
752
|
-
}
|
|
753
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
// libs/embed-libs/shared-embed/src/lib/methods/set-authorization.ts
|
|
757
|
-
var setAuthorization = (dashboardComponent, iframe, key, token) => {
|
|
758
|
-
if (iframe) {
|
|
759
|
-
iframe.contentWindow.postMessage(
|
|
760
|
-
{
|
|
761
|
-
action: "setAuthorization",
|
|
762
|
-
key,
|
|
763
|
-
token,
|
|
764
|
-
_version: dashboardComponent.VERSION
|
|
765
|
-
},
|
|
766
|
-
"*"
|
|
767
|
-
);
|
|
768
|
-
return Promise.resolve();
|
|
769
|
-
}
|
|
770
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
// libs/embed-libs/shared-embed/src/lib/methods/set-edit-mode.ts
|
|
774
|
-
var setEditMode = (dashboardComponent, iframe, editMode) => {
|
|
775
|
-
if (iframe && iframe.contentWindow) {
|
|
776
|
-
const requestId = uuidv4();
|
|
777
|
-
if (dashboardComponent.params.editMode === editMode) {
|
|
778
|
-
return Promise.reject(
|
|
779
|
-
new Error("editMode parameter is currently already set to " + editMode)
|
|
780
|
-
);
|
|
781
|
-
} else if (editMode !== "editFull" && editMode !== "editLimited" && editMode !== "view") {
|
|
782
|
-
return Promise.reject(
|
|
783
|
-
new Error(
|
|
784
|
-
"The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'."
|
|
785
|
-
)
|
|
786
|
-
);
|
|
787
|
-
}
|
|
788
|
-
iframe.contentWindow.postMessage(
|
|
789
|
-
{
|
|
790
|
-
action: "setEditMode",
|
|
791
|
-
editMode,
|
|
792
|
-
_version: dashboardComponent.VERSION,
|
|
793
|
-
requestId
|
|
794
|
-
},
|
|
795
|
-
"*"
|
|
796
|
-
);
|
|
797
|
-
return new Promise((resolve, reject) => {
|
|
798
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
799
|
-
});
|
|
800
|
-
}
|
|
801
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
802
|
-
};
|
|
803
|
-
|
|
804
|
-
// libs/embed-libs/shared-embed/src/lib/methods/set-filters.ts
|
|
805
|
-
var setFilters = (dashboardComponent, iframe, itemId, filters) => {
|
|
806
|
-
if (iframe) {
|
|
807
|
-
const requestId = uuidv4();
|
|
808
|
-
iframe.contentWindow.postMessage(
|
|
809
|
-
{
|
|
810
|
-
action: "setFilters",
|
|
811
|
-
itemId,
|
|
812
|
-
filters,
|
|
813
|
-
_version: dashboardComponent.VERSION,
|
|
814
|
-
requestId
|
|
815
|
-
},
|
|
816
|
-
"*"
|
|
817
|
-
);
|
|
818
|
-
return new Promise((resolve, reject) => {
|
|
819
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
820
|
-
setTimeout(() => {
|
|
821
|
-
if (dashboardComponent.promises[requestId]) {
|
|
822
|
-
const errorMessage = "setFilters request timed out.";
|
|
823
|
-
dashboardComponent.promises[requestId].reject(
|
|
824
|
-
new Error(errorMessage)
|
|
825
|
-
);
|
|
826
|
-
delete dashboardComponent.promises[requestId];
|
|
827
|
-
}
|
|
828
|
-
}, 2e3);
|
|
829
|
-
});
|
|
830
|
-
}
|
|
831
|
-
return Promise.reject();
|
|
832
|
-
};
|
|
833
|
-
|
|
834
|
-
// libs/embed-libs/shared-embed/src/lib/methods/set-preview.ts
|
|
835
|
-
var setPreview = (dashboardComponent, iframe, preview) => {
|
|
836
|
-
if (iframe) {
|
|
837
|
-
const requestId = uuidv4();
|
|
838
|
-
iframe.contentWindow.postMessage(
|
|
839
|
-
{
|
|
840
|
-
action: "setPreview",
|
|
841
|
-
preview,
|
|
842
|
-
requestId,
|
|
843
|
-
_version: dashboardComponent.VERSION
|
|
844
|
-
},
|
|
845
|
-
"*"
|
|
846
|
-
);
|
|
847
|
-
return new Promise((resolve, reject) => {
|
|
848
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
849
|
-
setTimeout(() => {
|
|
850
|
-
if (dashboardComponent.promises[requestId]) {
|
|
851
|
-
const errorMessage = "setPreview request timed out.";
|
|
852
|
-
dashboardComponent.promises[requestId].reject(
|
|
853
|
-
new Error(errorMessage)
|
|
854
|
-
);
|
|
855
|
-
delete dashboardComponent.promises[requestId];
|
|
856
|
-
}
|
|
857
|
-
}, 2e3);
|
|
858
|
-
});
|
|
859
|
-
}
|
|
860
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
861
|
-
};
|
|
862
|
-
|
|
863
|
-
// libs/embed-libs/shared-embed/src/lib/service/calculate-dimensions.ts
|
|
864
|
-
var _setCalculatedDimensions = (dashboardComponent) => {
|
|
865
|
-
if (!dashboardComponent.dimensions) {
|
|
866
|
-
dashboardComponent.params.error = true;
|
|
867
|
-
_handleError("Got no valid dimensions.", dashboardComponent.params);
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
const dashboardDimensionKeys = Object.keys(
|
|
871
|
-
dashboardComponent.dimensions
|
|
872
|
-
);
|
|
873
|
-
const availableScreenModeExtents = [];
|
|
874
|
-
let currentMode;
|
|
875
|
-
let currentWidth = 0;
|
|
876
|
-
let currentHeight = 0;
|
|
877
|
-
if (!dashboardComponent.params.switchScreenModeOnResize && dashboardComponent.currentScreenMode) {
|
|
878
|
-
dashboardComponent.params.screenMode = dashboardComponent.currentScreenMode;
|
|
879
|
-
}
|
|
880
|
-
if (dashboardComponent.dimensions && dashboardDimensionKeys?.[0] === "fixed") {
|
|
881
|
-
currentMode = "fixed";
|
|
882
|
-
currentWidth = dashboardComponent.dimensions.fixed[0];
|
|
883
|
-
currentHeight = dashboardComponent.dimensions.fixed[1];
|
|
884
|
-
} else {
|
|
885
|
-
const screenModes = [
|
|
886
|
-
"mobile",
|
|
887
|
-
"tablet",
|
|
888
|
-
"desktop",
|
|
889
|
-
"largeScreen"
|
|
890
|
-
];
|
|
891
|
-
if (dashboardComponent.params.itemEmbedding) {
|
|
892
|
-
const [firstMatch] = dashboardDimensionKeys;
|
|
893
|
-
let match = cloneDeep(firstMatch);
|
|
894
|
-
for (const screenMode of screenModes) {
|
|
895
|
-
const found = dashboardDimensionKeys.find((key) => key === screenMode);
|
|
896
|
-
if (found) {
|
|
897
|
-
match = cloneDeep(found);
|
|
898
|
-
} else {
|
|
899
|
-
dashboardComponent.dimensions[screenMode] = dashboardComponent.dimensions[match];
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
for (const key of dashboardDimensionKeys) {
|
|
904
|
-
if (screenModes.includes(key)) {
|
|
905
|
-
const screenMode = EXTENTS.find((extent) => extent.mode === key);
|
|
906
|
-
availableScreenModeExtents.push({
|
|
907
|
-
...screenMode,
|
|
908
|
-
height: dashboardComponent.dimensions[key][1] || 50
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
if (!availableScreenModeExtents.map((screenModeExtent) => screenModeExtent.mode).includes(dashboardComponent.params.screenMode)) {
|
|
913
|
-
dashboardComponent.params.screenMode = "auto";
|
|
914
|
-
}
|
|
915
|
-
if (dashboardComponent.params.screenMode === "auto") {
|
|
916
|
-
availableScreenModeExtents.sort(
|
|
917
|
-
(a, b) => screenModes.indexOf(a.mode) - screenModes.indexOf(b.mode)
|
|
918
|
-
);
|
|
919
|
-
for (const screenModeExtent of availableScreenModeExtents) {
|
|
920
|
-
const [screenModeExtentMinWidth, screenModeExtentMaxWidth] = screenModeExtent.width;
|
|
921
|
-
if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
|
|
922
|
-
if (screenModeExtentMinWidth < dashboardComponent.params.itemDimensions.width) {
|
|
923
|
-
currentMode = screenModeExtent.mode;
|
|
924
|
-
currentWidth = Number.parseInt(
|
|
925
|
-
dashboardComponent.params.itemDimensions.width,
|
|
926
|
-
10
|
|
927
|
-
);
|
|
928
|
-
currentHeight = dashboardComponent.dimensions[currentMode][1];
|
|
929
|
-
}
|
|
930
|
-
} else {
|
|
931
|
-
if (screenModeExtentMinWidth < dashboardComponent.containerWidth) {
|
|
932
|
-
currentMode = screenModeExtent.mode;
|
|
933
|
-
if (dashboardComponent.params.itemEmbedding) {
|
|
934
|
-
currentWidth = dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto" ? Number.parseInt(
|
|
935
|
-
dashboardComponent.params.itemDimensions.width,
|
|
936
|
-
10
|
|
937
|
-
) : Math.min(
|
|
938
|
-
dashboardComponent.containerWidth,
|
|
939
|
-
screenModeExtentMaxWidth
|
|
940
|
-
);
|
|
941
|
-
currentHeight = dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto" ? Number.parseInt(
|
|
942
|
-
dashboardComponent.params.itemDimensions.height,
|
|
943
|
-
10
|
|
944
|
-
) : dashboardComponent.dimensions[currentMode][1];
|
|
945
|
-
if (dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
|
|
946
|
-
currentWidth = Number.parseInt(
|
|
947
|
-
dashboardComponent.params.itemDimensions.width,
|
|
948
|
-
10
|
|
949
|
-
);
|
|
950
|
-
currentHeight = dashboardComponent.dimensions[currentMode][1];
|
|
951
|
-
}
|
|
952
|
-
} else {
|
|
953
|
-
currentWidth = Math.max(
|
|
954
|
-
Math.min(
|
|
955
|
-
screenModeExtentMaxWidth,
|
|
956
|
-
dashboardComponent.containerWidth
|
|
957
|
-
),
|
|
958
|
-
screenModeExtentMinWidth
|
|
959
|
-
);
|
|
960
|
-
currentHeight = screenModeExtent.height;
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
} else {
|
|
966
|
-
const {
|
|
967
|
-
height: chosenModeHeight,
|
|
968
|
-
width: [chosenModeMinWidth, chosenModeMaxWidth]
|
|
969
|
-
} = availableScreenModeExtents.find(
|
|
970
|
-
(d) => d.mode === dashboardComponent.params.screenMode
|
|
971
|
-
);
|
|
972
|
-
currentMode = dashboardComponent.params.screenMode;
|
|
973
|
-
currentWidth = Math.max(
|
|
974
|
-
Math.min(chosenModeMaxWidth, dashboardComponent.containerWidth),
|
|
975
|
-
chosenModeMinWidth
|
|
976
|
-
);
|
|
977
|
-
currentHeight = chosenModeHeight;
|
|
978
|
-
if (dashboardComponent.params.itemEmbedding) {
|
|
979
|
-
if (dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto") {
|
|
980
|
-
currentWidth = Number.parseInt(
|
|
981
|
-
dashboardComponent.params.itemDimensions.width,
|
|
982
|
-
10
|
|
983
|
-
);
|
|
984
|
-
}
|
|
985
|
-
if (dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto") {
|
|
986
|
-
currentHeight = Number.parseInt(
|
|
987
|
-
dashboardComponent.params.itemDimensions.height,
|
|
988
|
-
10
|
|
989
|
-
);
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
if (!currentMode && availableScreenModeExtents.length > 0) {
|
|
994
|
-
const [lowestModeExtent] = availableScreenModeExtents;
|
|
995
|
-
currentMode = lowestModeExtent.mode;
|
|
996
|
-
currentWidth = lowestModeExtent.width[0];
|
|
997
|
-
currentHeight = lowestModeExtent.height;
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
dashboardComponent.currentScreenMode = currentMode;
|
|
1001
|
-
const style = {
|
|
1002
|
-
height: currentHeight === 0 ? "100%" : `${String(currentHeight)}px`,
|
|
1003
|
-
width: currentWidth === 0 ? "100%" : `${String(currentWidth)}px`,
|
|
1004
|
-
opacity: 1
|
|
1005
|
-
};
|
|
1006
|
-
const dashboardEditModes = ["editFull", "editLimited"];
|
|
1007
|
-
if (dashboardEditModes.includes(dashboardComponent.params.editMode)) {
|
|
1008
|
-
style.height = "100%";
|
|
1009
|
-
style.width = "100%";
|
|
1010
|
-
} else if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions) {
|
|
1011
|
-
style.height = dashboardComponent.params.itemDimensions.height === "auto" ? style.height : `${String(dashboardComponent.params.itemDimensions.height).replace(
|
|
1012
|
-
"px",
|
|
1013
|
-
""
|
|
1014
|
-
)}px`;
|
|
1015
|
-
style.width = dashboardComponent.params.itemDimensions.width === "auto" ? style.width : `${String(dashboardComponent.params.itemDimensions.width).replace(
|
|
1016
|
-
"px",
|
|
1017
|
-
""
|
|
1018
|
-
)}px`;
|
|
1019
|
-
} else {
|
|
1020
|
-
style.height = currentHeight === 0 ? "100%" : `${String(currentHeight)}px`;
|
|
1021
|
-
style.width = currentWidth === 0 ? "100%" : `${String(currentWidth)}px`;
|
|
1022
|
-
}
|
|
1023
|
-
dashboardComponent.currentScreenMode = currentMode;
|
|
1024
|
-
dashboardComponent.iframeStyle = style;
|
|
1025
|
-
};
|
|
1026
|
-
|
|
1027
|
-
// libs/embed-libs/shared-embed/src/lib/service/extend-and-validate.ts
|
|
1028
|
-
var _extendAndValidate = (dashboardContent) => {
|
|
1029
|
-
const defaultKeys = Object.keys(
|
|
1030
|
-
DEFAULT_PARAMETERS
|
|
1031
|
-
);
|
|
1032
|
-
const errorMessages = [];
|
|
1033
|
-
const requiredStringParams = [
|
|
1034
|
-
"appServer",
|
|
1035
|
-
"language",
|
|
1036
|
-
"apiHost"
|
|
1037
|
-
];
|
|
1038
|
-
const requiredStringOrEmptyParams = [
|
|
1039
|
-
"key",
|
|
1040
|
-
"token",
|
|
1041
|
-
"screenMode",
|
|
1042
|
-
"timezoneId",
|
|
1043
|
-
"itemId",
|
|
1044
|
-
"container",
|
|
1045
|
-
"loaderBackground",
|
|
1046
|
-
"loaderFontColor",
|
|
1047
|
-
"loaderSpinnerColor",
|
|
1048
|
-
"loaderSpinnerBackground"
|
|
1049
|
-
];
|
|
1050
|
-
const objectParams = ["itemDimensions"];
|
|
1051
|
-
const screenModes = [
|
|
1052
|
-
"mobile",
|
|
1053
|
-
"tablet",
|
|
1054
|
-
"desktop",
|
|
1055
|
-
"largeScreen",
|
|
1056
|
-
"fixed",
|
|
1057
|
-
"auto"
|
|
1058
|
-
];
|
|
1059
|
-
for (const key of defaultKeys) {
|
|
1060
|
-
if (dashboardContent.params[key] === null) {
|
|
1061
|
-
delete dashboardContent.params[key];
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
dashboardContent.params = defaultsDeep(
|
|
1065
|
-
dashboardContent.params,
|
|
1066
|
-
DEFAULT_PARAMETERS
|
|
1067
|
-
);
|
|
1068
|
-
if ((!dashboardContent.params.dashboardId || typeof dashboardContent.params.dashboardId !== "string") && (!dashboardContent.params.dashboardSlug || typeof dashboardContent.params.dashboardSlug !== "string")) {
|
|
1069
|
-
delete dashboardContent.params.dashboardId;
|
|
1070
|
-
delete dashboardContent.params.dashboardSlug;
|
|
1071
|
-
}
|
|
1072
|
-
for (const key of requiredStringParams) {
|
|
1073
|
-
if (typeof dashboardContent.params[key] !== "string") {
|
|
1074
|
-
delete dashboardContent.params[key];
|
|
1075
|
-
errorMessages.push(`${key} needs to be of type string.`);
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
for (const key of requiredStringOrEmptyParams) {
|
|
1079
|
-
if (typeof dashboardContent.params[key] !== "string" && dashboardContent.params[key] !== null && dashboardContent.params[key] !== void 0) {
|
|
1080
|
-
delete dashboardContent.params[key];
|
|
1081
|
-
errorMessages.push(`${key} needs to be of type string or empty.`);
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
if (dashboardContent.params.screenMode && !screenModes.includes(dashboardContent.params.screenMode)) {
|
|
1085
|
-
const validTypesString = screenModes.map((mode) => `"${mode}"`).join(", ");
|
|
1086
|
-
errorMessages.push(
|
|
1087
|
-
`"screenMode" needs should be one of these types: ${validTypesString}`
|
|
1088
|
-
);
|
|
1089
|
-
dashboardContent.params.screenMode = "auto";
|
|
1090
|
-
}
|
|
1091
|
-
if (dashboardContent.params.itemId) {
|
|
1092
|
-
dashboardContent.params.itemEmbedding = true;
|
|
1093
|
-
}
|
|
1094
|
-
for (const key of objectParams) {
|
|
1095
|
-
if (typeof dashboardContent.params[key] !== "object" && dashboardContent.params[key] !== null) {
|
|
1096
|
-
delete dashboardContent.params[key];
|
|
1097
|
-
errorMessages.push(`${key} needs to be of type object or empty.`);
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
if (typeof dashboardContent.params.switchScreenModeOnResize !== "boolean") {
|
|
1101
|
-
errorMessages.push("switchScreenModeOnResize needs to be of type boolean.");
|
|
1102
|
-
dashboardContent.params.switchScreenModeOnResize = true;
|
|
1103
|
-
}
|
|
1104
|
-
if (dashboardContent.params.itemDimensions) {
|
|
1105
|
-
const itemDimensionsKeys = [
|
|
1106
|
-
"width",
|
|
1107
|
-
"height"
|
|
1108
|
-
];
|
|
1109
|
-
for (const key of itemDimensionsKeys) {
|
|
1110
|
-
if (!["string", "number"].includes(
|
|
1111
|
-
typeof dashboardContent.params.itemDimensions[key]
|
|
1112
|
-
) && dashboardContent.params.itemDimensions[key] !== null) {
|
|
1113
|
-
errorMessages.push(
|
|
1114
|
-
`itemDimensions ${key} needs to be of type string, number or empty.`
|
|
1115
|
-
);
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
dashboardContent.params = defaultsDeep(
|
|
1120
|
-
dashboardContent.params,
|
|
1121
|
-
DEFAULT_PARAMETERS
|
|
1122
|
-
);
|
|
1123
|
-
if (dashboardContent.params.screenMode && dashboardContent.params.screenMode !== "auto") {
|
|
1124
|
-
dashboardContent.params.switchScreenModeOnResize = false;
|
|
1125
|
-
}
|
|
1126
|
-
if (dashboardContent.params.itemDimensions.width !== "auto") {
|
|
1127
|
-
dashboardContent.params.itemDimensions.width = Number.parseInt(
|
|
1128
|
-
`${dashboardContent.params.itemDimensions.width}`.replace("px", ""),
|
|
1129
|
-
10
|
|
1130
|
-
) || "auto";
|
|
1131
|
-
}
|
|
1132
|
-
if (dashboardContent.params.itemDimensions.height !== "auto") {
|
|
1133
|
-
dashboardContent.params.itemDimensions.height = Number.parseInt(
|
|
1134
|
-
`${dashboardContent.params.itemDimensions.height}`.replace("px", ""),
|
|
1135
|
-
10
|
|
1136
|
-
) || "auto";
|
|
1137
|
-
}
|
|
1138
|
-
dashboardContent.params.itemEmbedding = !!dashboardContent.params.itemId;
|
|
1139
|
-
if (dashboardContent.params.error || errorMessages.length > 0) {
|
|
1140
|
-
_handleError(errorMessages.join("\n"), dashboardContent.params);
|
|
1141
|
-
}
|
|
1142
|
-
};
|
|
1143
|
-
|
|
1144
|
-
// libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
|
|
1145
|
-
var luzmoEmbedContainerClass = "luzmo-embed-container";
|
|
1146
|
-
|
|
1147
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/remote-federation.ts
|
|
1148
|
-
var remotesMap = {
|
|
1149
|
-
// "remote_app": { url: "http://localhost:4201/remoteEntry.mjs", format: "esm", from: "vite" },
|
|
1150
|
-
};
|
|
1151
|
-
var loadJS = async (url, fn) => {
|
|
1152
|
-
const resolvedUrl = typeof url === "function" ? await url() : url;
|
|
1153
|
-
const script = document.createElement("script");
|
|
1154
|
-
script.type = "text/javascript";
|
|
1155
|
-
script.addEventListener("load", fn);
|
|
1156
|
-
script.src = resolvedUrl;
|
|
1157
|
-
document.querySelectorAll("head")[0].append(script);
|
|
1158
|
-
};
|
|
1159
|
-
var wrapShareModule = (remoteFrom) => ({});
|
|
1160
|
-
async function __federationMethodEnsure(remoteId) {
|
|
1161
|
-
const remote = remotesMap[remoteId];
|
|
1162
|
-
if (remote.inited) {
|
|
1163
|
-
return remote.lib;
|
|
1164
|
-
}
|
|
1165
|
-
if (remote.format === "var") {
|
|
1166
|
-
return new Promise((resolve) => {
|
|
1167
|
-
const callback = () => {
|
|
1168
|
-
if (!remote.inited) {
|
|
1169
|
-
remote.lib = window[remoteId];
|
|
1170
|
-
remote.lib.init(wrapShareModule(remote.from));
|
|
1171
|
-
remote.inited = true;
|
|
1172
|
-
}
|
|
1173
|
-
resolve(remote.lib);
|
|
1174
|
-
};
|
|
1175
|
-
return loadJS(remote.url, callback);
|
|
1176
|
-
});
|
|
1177
|
-
} else if (["esm", "systemjs"].includes(remote.format)) {
|
|
1178
|
-
return new Promise((resolve, reject) => {
|
|
1179
|
-
const getUrl = typeof remote.url === "function" ? remote.url : () => Promise.resolve(remote.url);
|
|
1180
|
-
getUrl().then((url) => {
|
|
1181
|
-
import(
|
|
1182
|
-
/* @vite-ignore */
|
|
1183
|
-
/* webpackIgnore: true */
|
|
1184
|
-
url
|
|
1185
|
-
).then((lib) => {
|
|
1186
|
-
if (!remote.inited) {
|
|
1187
|
-
const shareScope = wrapShareModule(remote.from);
|
|
1188
|
-
lib.init(shareScope);
|
|
1189
|
-
remote.lib = lib;
|
|
1190
|
-
remote.lib.init(shareScope);
|
|
1191
|
-
remote.inited = true;
|
|
1192
|
-
}
|
|
1193
|
-
resolve(remote.lib);
|
|
1194
|
-
}).catch(reject);
|
|
1195
|
-
});
|
|
1196
|
-
});
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
function __federationMethodWrapDefault(module2, need) {
|
|
1200
|
-
if (!(module2 == null ? void 0 : module2.default) && need) {
|
|
1201
|
-
const obj = /* @__PURE__ */ Object.create(null);
|
|
1202
|
-
obj.default = module2;
|
|
1203
|
-
obj.__esModule = true;
|
|
1204
|
-
return obj;
|
|
1205
|
-
}
|
|
1206
|
-
return module2;
|
|
1207
|
-
}
|
|
1208
|
-
async function __federationMethodGetRemote(remoteName, componentName) {
|
|
1209
|
-
return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
|
|
1210
|
-
}
|
|
45
|
+
module.exports = __toCommonJS(src_exports);
|
|
1211
46
|
|
|
1212
47
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
|
|
48
|
+
var SharedLib2 = __toESM(require("@luzmo/shared-embed"), 1);
|
|
1213
49
|
var import_lit2 = require("lit");
|
|
1214
50
|
var import_decorators = require("lit/decorators.js");
|
|
1215
51
|
var import_style_map = require("lit/directives/style-map.js");
|
|
52
|
+
var import_shared_embed = require("@luzmo/shared-embed");
|
|
1216
53
|
|
|
1217
54
|
// libs/embed-libs/embed/package.json
|
|
1218
|
-
var version = "5.0.
|
|
55
|
+
var version = "5.0.10";
|
|
1219
56
|
|
|
1220
57
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1221
58
|
var LuzmoService = class {
|
|
@@ -1226,6 +63,7 @@ var LuzmoService = class {
|
|
|
1226
63
|
var luzmo_service_default = new LuzmoService();
|
|
1227
64
|
|
|
1228
65
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
66
|
+
var SharedLib = __toESM(require("@luzmo/shared-embed"), 1);
|
|
1229
67
|
var _setEventHandler = () => {
|
|
1230
68
|
if (typeof window.__luzmoMessageHandler === "function") {
|
|
1231
69
|
return;
|
|
@@ -1262,7 +100,7 @@ var _setEventHandler = () => {
|
|
|
1262
100
|
break;
|
|
1263
101
|
}
|
|
1264
102
|
case "data": {
|
|
1265
|
-
resolvePromise(
|
|
103
|
+
SharedLib.resolvePromise(
|
|
1266
104
|
dashboardComponent,
|
|
1267
105
|
event.data.requestId,
|
|
1268
106
|
event.data.data
|
|
@@ -1270,7 +108,7 @@ var _setEventHandler = () => {
|
|
|
1270
108
|
break;
|
|
1271
109
|
}
|
|
1272
110
|
case "filters": {
|
|
1273
|
-
resolvePromise(
|
|
111
|
+
SharedLib.resolvePromise(
|
|
1274
112
|
dashboardComponent,
|
|
1275
113
|
event.data.requestId,
|
|
1276
114
|
event.data.filters
|
|
@@ -1278,7 +116,7 @@ var _setEventHandler = () => {
|
|
|
1278
116
|
break;
|
|
1279
117
|
}
|
|
1280
118
|
case "getAccessibleDashboards": {
|
|
1281
|
-
resolvePromise(
|
|
119
|
+
SharedLib.resolvePromise(
|
|
1282
120
|
dashboardComponent,
|
|
1283
121
|
event.data.requestId,
|
|
1284
122
|
event.data.accessibleDashboards
|
|
@@ -1293,7 +131,7 @@ var _setEventHandler = () => {
|
|
|
1293
131
|
}
|
|
1294
132
|
case "export": {
|
|
1295
133
|
if (event.data.error) {
|
|
1296
|
-
rejectPromise(
|
|
134
|
+
SharedLib.rejectPromise(
|
|
1297
135
|
dashboardComponent,
|
|
1298
136
|
event.data.requestId,
|
|
1299
137
|
event.data
|
|
@@ -1302,7 +140,7 @@ var _setEventHandler = () => {
|
|
|
1302
140
|
dashboardComponent.dispatchEvent(
|
|
1303
141
|
new CustomEvent("exported", { detail: { data: event.data } })
|
|
1304
142
|
);
|
|
1305
|
-
resolvePromise(
|
|
143
|
+
SharedLib.resolvePromise(
|
|
1306
144
|
dashboardComponent,
|
|
1307
145
|
event.data.requestId,
|
|
1308
146
|
event.data
|
|
@@ -1332,31 +170,31 @@ var _setEventHandler = () => {
|
|
|
1332
170
|
}
|
|
1333
171
|
case "setEditMode": {
|
|
1334
172
|
if (event.data.error) {
|
|
1335
|
-
rejectPromise(
|
|
173
|
+
SharedLib.rejectPromise(
|
|
1336
174
|
dashboardComponent,
|
|
1337
175
|
event.data.requestId,
|
|
1338
176
|
event.data
|
|
1339
177
|
);
|
|
1340
178
|
} else {
|
|
1341
|
-
resolvePromise(
|
|
179
|
+
SharedLib.resolvePromise(
|
|
1342
180
|
dashboardComponent,
|
|
1343
181
|
event.data.requestId,
|
|
1344
182
|
event.data
|
|
1345
183
|
);
|
|
1346
184
|
dashboardComponent.params.editMode = event.data.editMode;
|
|
1347
|
-
dashboardComponent._containerStyle = containerStyles(dashboardComponent);
|
|
185
|
+
dashboardComponent._containerStyle = SharedLib.containerStyles(dashboardComponent);
|
|
1348
186
|
if (dashboardComponent.dimensions) {
|
|
1349
|
-
_setCalculatedDimensions(dashboardComponent);
|
|
187
|
+
SharedLib._setCalculatedDimensions(dashboardComponent);
|
|
1350
188
|
}
|
|
1351
189
|
}
|
|
1352
190
|
break;
|
|
1353
191
|
}
|
|
1354
192
|
case "setFilters": {
|
|
1355
|
-
event.data.error ? rejectPromise(
|
|
193
|
+
event.data.error ? SharedLib.rejectPromise(
|
|
1356
194
|
dashboardComponent,
|
|
1357
195
|
event.data.requestId,
|
|
1358
196
|
event.data
|
|
1359
|
-
) : resolvePromise(
|
|
197
|
+
) : SharedLib.resolvePromise(
|
|
1360
198
|
dashboardComponent,
|
|
1361
199
|
event.data.requestId,
|
|
1362
200
|
event.data
|
|
@@ -1364,11 +202,11 @@ var _setEventHandler = () => {
|
|
|
1364
202
|
break;
|
|
1365
203
|
}
|
|
1366
204
|
case "setPreview": {
|
|
1367
|
-
event.data.error ? rejectPromise(
|
|
205
|
+
event.data.error ? SharedLib.rejectPromise(
|
|
1368
206
|
dashboardComponent,
|
|
1369
207
|
event.data.requestId,
|
|
1370
208
|
event.data
|
|
1371
|
-
) : resolvePromise(
|
|
209
|
+
) : SharedLib.resolvePromise(
|
|
1372
210
|
dashboardComponent,
|
|
1373
211
|
event.data.requestId,
|
|
1374
212
|
event.data
|
|
@@ -1383,6 +221,10 @@ var _setEventHandler = () => {
|
|
|
1383
221
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-styles.ts
|
|
1384
222
|
var import_lit = require("lit");
|
|
1385
223
|
var dashboardStyles = import_lit.css`
|
|
224
|
+
:host {
|
|
225
|
+
display: block;
|
|
226
|
+
}
|
|
227
|
+
|
|
1386
228
|
@-webkit-keyframes spin {
|
|
1387
229
|
0% {
|
|
1388
230
|
-webkit-transform: rotate(0deg);
|
|
@@ -1415,6 +257,11 @@ var dashboardStyles = import_lit.css`
|
|
|
1415
257
|
border: 0;
|
|
1416
258
|
}
|
|
1417
259
|
|
|
260
|
+
.luzmo-embed-container-ede {
|
|
261
|
+
width: 100%;
|
|
262
|
+
height: 100%;
|
|
263
|
+
}
|
|
264
|
+
|
|
1418
265
|
.luzmo-container-loader {
|
|
1419
266
|
width: 100%;
|
|
1420
267
|
position: relative;
|
|
@@ -1532,7 +379,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1532
379
|
this.loaderSize = 32;
|
|
1533
380
|
this.borderWidth = 3;
|
|
1534
381
|
this.minHeight = 400;
|
|
1535
|
-
this._containerId = uuidv4();
|
|
382
|
+
this._containerId = SharedLib2.uuidv4();
|
|
1536
383
|
this._iframeId = `luzmo-dashboard-${this._containerId}`;
|
|
1537
384
|
this.iframeLoaded = false;
|
|
1538
385
|
this.promises = {};
|
|
@@ -1542,7 +389,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1542
389
|
if (this.shadowRoot?.querySelector(".dashboard-container")) {
|
|
1543
390
|
this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
|
|
1544
391
|
if (this.params.switchScreenModeOnResize && this.params.screenMode === "auto") {
|
|
1545
|
-
for (const d of EXTENTS) {
|
|
392
|
+
for (const d of SharedLib2.EXTENTS) {
|
|
1546
393
|
if (d.width[0] <= window.innerWidth && window.innerWidth <= d.width[1]) {
|
|
1547
394
|
this.currentScreenMode = d.mode;
|
|
1548
395
|
}
|
|
@@ -1553,7 +400,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1553
400
|
} else {
|
|
1554
401
|
if (this.dimensions) {
|
|
1555
402
|
this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
|
|
1556
|
-
_setCalculatedDimensions(this);
|
|
403
|
+
SharedLib2._setCalculatedDimensions(this);
|
|
1557
404
|
}
|
|
1558
405
|
}
|
|
1559
406
|
}
|
|
@@ -1568,13 +415,13 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1568
415
|
});
|
|
1569
416
|
}
|
|
1570
417
|
loadLibrary(appServer) {
|
|
1571
|
-
if (remotesMap[appServer]) {
|
|
1572
|
-
return Promise.resolve(remotesMap[appServer].module);
|
|
418
|
+
if (import_shared_embed.remotesMap[appServer]) {
|
|
419
|
+
return Promise.resolve(import_shared_embed.remotesMap[appServer].module);
|
|
1573
420
|
}
|
|
1574
|
-
remotesMap[appServer] = { url: appServer?.startsWith("http://localhost") ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`, format: "esm", from: "vite", module: void 0 };
|
|
1575
|
-
return __federationMethodGetRemote(appServer, "./DashboardApp").then((module2) => {
|
|
1576
|
-
const wrappedModule = __federationMethodWrapDefault(module2, true);
|
|
1577
|
-
remotesMap[appServer].module = wrappedModule;
|
|
421
|
+
import_shared_embed.remotesMap[appServer] = { url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`, format: "esm", from: "vite", module: void 0 };
|
|
422
|
+
return (0, import_shared_embed.__federationMethodGetRemote)(appServer, "./DashboardApp").then((module2) => {
|
|
423
|
+
const wrappedModule = (0, import_shared_embed.__federationMethodWrapDefault)(module2, true);
|
|
424
|
+
import_shared_embed.remotesMap[appServer].module = wrappedModule;
|
|
1578
425
|
return wrappedModule;
|
|
1579
426
|
});
|
|
1580
427
|
}
|
|
@@ -1613,7 +460,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1613
460
|
this.experimental = inputParameters.experimental;
|
|
1614
461
|
}
|
|
1615
462
|
if (inputParameters.appServer) {
|
|
1616
|
-
this.appServer = addTrailingSlash(inputParameters.appServer);
|
|
463
|
+
this.appServer = SharedLib2.addTrailingSlash(inputParameters.appServer);
|
|
1617
464
|
}
|
|
1618
465
|
}
|
|
1619
466
|
// Set resize event listener
|
|
@@ -1631,7 +478,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1631
478
|
}
|
|
1632
479
|
}
|
|
1633
480
|
firstUpdated() {
|
|
1634
|
-
this._loaderMsg = getLoader(this)?.loadingMsg;
|
|
481
|
+
this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
|
|
1635
482
|
this._loaderStyles();
|
|
1636
483
|
luzmo_service_default._components.push(this);
|
|
1637
484
|
this.initComponent();
|
|
@@ -1652,7 +499,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1652
499
|
setTimeout(() => {
|
|
1653
500
|
this.containerWidth = this.dashboardReference.offsetWidth;
|
|
1654
501
|
this.dimensions = payload.detail.dimensions;
|
|
1655
|
-
_setCalculatedDimensions(this);
|
|
502
|
+
SharedLib2._setCalculatedDimensions(this);
|
|
1656
503
|
});
|
|
1657
504
|
this.dispatchEvent(new CustomEvent("load", payload));
|
|
1658
505
|
});
|
|
@@ -1665,15 +512,15 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1665
512
|
});
|
|
1666
513
|
} else {
|
|
1667
514
|
this.containerWidth = this.container?.clientWidth;
|
|
1668
|
-
_extendAndValidate(this);
|
|
1669
|
-
_browserCheck(this);
|
|
515
|
+
SharedLib2._extendAndValidate(this);
|
|
516
|
+
SharedLib2._browserCheck(this);
|
|
1670
517
|
this._setupLoader();
|
|
1671
518
|
if (!this.params.error) {
|
|
1672
519
|
this._loaderStyles();
|
|
1673
520
|
_setEventHandler();
|
|
1674
|
-
this._iframeUrl = createIframeUrl(this);
|
|
521
|
+
this._iframeUrl = SharedLib2.createIframeUrl(this);
|
|
1675
522
|
this.iframe?.setAttribute("src", this._iframeUrl);
|
|
1676
|
-
this.iframeStyle = calculateIframeStyles(this);
|
|
523
|
+
this.iframeStyle = SharedLib2.calculateIframeStyles(this);
|
|
1677
524
|
}
|
|
1678
525
|
}
|
|
1679
526
|
}
|
|
@@ -1687,7 +534,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1687
534
|
this.dashboardReference.setAttribute("item-dimensions", JSON.stringify(this.params.itemDimensions));
|
|
1688
535
|
}
|
|
1689
536
|
if (this.params.apiHost) {
|
|
1690
|
-
this.dashboardReference.setAttribute("api-host", removeTrailingSlash(this.params.apiHost));
|
|
537
|
+
this.dashboardReference.setAttribute("api-host", SharedLib2.removeTrailingSlash(this.params.apiHost));
|
|
1691
538
|
}
|
|
1692
539
|
if (this.params.key) {
|
|
1693
540
|
this.dashboardReference.setAttribute("auth-key", this.params.key);
|
|
@@ -1745,14 +592,14 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1745
592
|
);
|
|
1746
593
|
}, 15 * 1e3);
|
|
1747
594
|
this.params = this._setOptions();
|
|
1748
|
-
_extendAndValidate(this);
|
|
595
|
+
SharedLib2._extendAndValidate(this);
|
|
1749
596
|
this._setupLoader();
|
|
1750
597
|
this._loaderStyles();
|
|
1751
|
-
this._iframeUrl = createIframeUrl(this);
|
|
598
|
+
this._iframeUrl = SharedLib2.createIframeUrl(this);
|
|
1752
599
|
if (this.iframe) {
|
|
1753
600
|
this._updateIframeUrl();
|
|
1754
601
|
}
|
|
1755
|
-
this.iframeStyle = calculateIframeStyles(this);
|
|
602
|
+
this.iframeStyle = SharedLib2.calculateIframeStyles(this);
|
|
1756
603
|
} else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
|
|
1757
604
|
if (this.iframeLoaded) {
|
|
1758
605
|
this.setEditMode(this.editMode);
|
|
@@ -1818,16 +665,16 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1818
665
|
defaultParameters.itemDimensions = this.itemDimensions;
|
|
1819
666
|
}
|
|
1820
667
|
if (this.appServer) {
|
|
1821
|
-
this.appServer = this.getIsViewMode() ? removeTrailingSlash(this.appServer) : addTrailingSlash(this.appServer);
|
|
668
|
+
this.appServer = this.getIsViewMode() ? SharedLib2.removeTrailingSlash(this.appServer) : SharedLib2.addTrailingSlash(this.appServer);
|
|
1822
669
|
defaultParameters.appServer = this.appServer;
|
|
1823
670
|
} else {
|
|
1824
|
-
this.appServer = addTrailingSlash(
|
|
1825
|
-
DEFAULT_PARAMETERS.appServer
|
|
671
|
+
this.appServer = SharedLib2.addTrailingSlash(
|
|
672
|
+
SharedLib2.DEFAULT_PARAMETERS.appServer
|
|
1826
673
|
);
|
|
1827
674
|
defaultParameters.appServer = this.appServer;
|
|
1828
675
|
}
|
|
1829
676
|
if (this.apiHost) {
|
|
1830
|
-
this.apiHost = this.getIsViewMode() ? removeTrailingSlash(this.apiHost) : addTrailingSlash(this.apiHost);
|
|
677
|
+
this.apiHost = this.getIsViewMode() ? SharedLib2.removeTrailingSlash(this.apiHost) : SharedLib2.addTrailingSlash(this.apiHost);
|
|
1831
678
|
defaultParameters.apiHost = this.apiHost;
|
|
1832
679
|
} else {
|
|
1833
680
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
@@ -1836,11 +683,11 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1836
683
|
return defaultParameters;
|
|
1837
684
|
}
|
|
1838
685
|
_updateIframeUrl() {
|
|
1839
|
-
updateIframeUrl(this.iframe, this._iframeUrl);
|
|
686
|
+
SharedLib2.updateIframeUrl(this.iframe, this._iframeUrl);
|
|
1840
687
|
}
|
|
1841
688
|
// Setup loader / browser error
|
|
1842
689
|
_setupLoader() {
|
|
1843
|
-
const data = getLoader(this);
|
|
690
|
+
const data = SharedLib2.getLoader(this);
|
|
1844
691
|
this._loaderMsg = data.loadingMsg;
|
|
1845
692
|
if (data.errorMsg) {
|
|
1846
693
|
this.browserError = true;
|
|
@@ -1860,15 +707,15 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1860
707
|
_calculateDimAfterDashboardLoaded() {
|
|
1861
708
|
this.dashboardError = false;
|
|
1862
709
|
this._loaderStyles();
|
|
1863
|
-
_setCalculatedDimensions(this);
|
|
710
|
+
SharedLib2._setCalculatedDimensions(this);
|
|
1864
711
|
}
|
|
1865
712
|
// Set loader styles
|
|
1866
713
|
_loaderStyles() {
|
|
1867
|
-
this._containerStyle = containerStyles(this);
|
|
1868
|
-
this._loaderStyle = loaderStyles(this);
|
|
1869
|
-
this._loadingCircleStyle = plStyles(this);
|
|
1870
|
-
this._containerLoaderStyle = containerLoaderStyles(this);
|
|
1871
|
-
this._lcStyle = lcStyles(this);
|
|
714
|
+
this._containerStyle = SharedLib2.containerStyles(this);
|
|
715
|
+
this._loaderStyle = SharedLib2.loaderStyles(this);
|
|
716
|
+
this._loadingCircleStyle = SharedLib2.plStyles(this);
|
|
717
|
+
this._containerLoaderStyle = SharedLib2.containerLoaderStyles(this);
|
|
718
|
+
this._lcStyle = SharedLib2.lcStyles(this);
|
|
1872
719
|
}
|
|
1873
720
|
static get styles() {
|
|
1874
721
|
return [dashboardStyles];
|
|
@@ -1939,7 +786,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1939
786
|
`;
|
|
1940
787
|
}
|
|
1941
788
|
return import_lit2.html`
|
|
1942
|
-
<div class="${luzmoEmbedContainerClass}">
|
|
789
|
+
<div class="${import_shared_embed.luzmoEmbedContainerClass} ${!this.getIsViewMode() ? `${import_shared_embed.luzmoEmbedContainerClass}-ede` : ""}">
|
|
1943
790
|
<div
|
|
1944
791
|
class="dashboard-container"
|
|
1945
792
|
style=${(0, import_style_map.styleMap)(Object.assign({}, this._containerStyle, {
|
|
@@ -1964,7 +811,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1964
811
|
return this.dashboardReference.getData(itemId);
|
|
1965
812
|
}
|
|
1966
813
|
if (!this.getIsViewMode()) {
|
|
1967
|
-
return getData(this, this.iframe, itemId);
|
|
814
|
+
return SharedLib2.getData(this, this.iframe, itemId);
|
|
1968
815
|
}
|
|
1969
816
|
return Promise.reject();
|
|
1970
817
|
}
|
|
@@ -1973,7 +820,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1973
820
|
return this.dashboardReference.getFilters();
|
|
1974
821
|
}
|
|
1975
822
|
if (!this.getIsViewMode()) {
|
|
1976
|
-
return getFilters(this, this.iframe);
|
|
823
|
+
return SharedLib2.getFilters(this, this.iframe);
|
|
1977
824
|
}
|
|
1978
825
|
return Promise.reject();
|
|
1979
826
|
}
|
|
@@ -1982,7 +829,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1982
829
|
return this.dashboardReference.setFilters(itemId, filters);
|
|
1983
830
|
}
|
|
1984
831
|
if (!this.getIsViewMode()) {
|
|
1985
|
-
return setFilters(this, this.iframe, itemId, filters);
|
|
832
|
+
return SharedLib2.setFilters(this, this.iframe, itemId, filters);
|
|
1986
833
|
}
|
|
1987
834
|
return Promise.reject();
|
|
1988
835
|
}
|
|
@@ -1991,7 +838,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1991
838
|
return this.dashboardReference.setAuthorization(key, token);
|
|
1992
839
|
}
|
|
1993
840
|
if (!this.getIsViewMode()) {
|
|
1994
|
-
return setAuthorization(this, this.iframe, key, token);
|
|
841
|
+
return SharedLib2.setAuthorization(this, this.iframe, key, token);
|
|
1995
842
|
}
|
|
1996
843
|
return Promise.reject();
|
|
1997
844
|
}
|
|
@@ -2000,7 +847,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
2000
847
|
return this.dashboardReference.refreshData(itemId);
|
|
2001
848
|
}
|
|
2002
849
|
if (!this.getIsViewMode()) {
|
|
2003
|
-
return itemId ? refreshData(this, this.iframe, itemId) : refreshData(this, this.iframe);
|
|
850
|
+
return itemId ? SharedLib2.refreshData(this, this.iframe, itemId) : SharedLib2.refreshData(this, this.iframe);
|
|
2004
851
|
}
|
|
2005
852
|
return Promise.reject();
|
|
2006
853
|
}
|
|
@@ -2009,7 +856,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
2009
856
|
return this.dashboardReference.reloadDashboard();
|
|
2010
857
|
}
|
|
2011
858
|
if (!this.getIsViewMode()) {
|
|
2012
|
-
return reloadDashboard(this, this.iframe);
|
|
859
|
+
return SharedLib2.reloadDashboard(this, this.iframe);
|
|
2013
860
|
}
|
|
2014
861
|
return Promise.reject();
|
|
2015
862
|
}
|
|
@@ -2018,13 +865,13 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
2018
865
|
return this.dashboardReference.exportDashboard(format);
|
|
2019
866
|
}
|
|
2020
867
|
if (!this.getIsViewMode()) {
|
|
2021
|
-
return format ? exportDashboard(this, this.iframe, format) : exportDashboard(this, this.iframe);
|
|
868
|
+
return format ? SharedLib2.exportDashboard(this, this.iframe, format) : SharedLib2.exportDashboard(this, this.iframe);
|
|
2022
869
|
}
|
|
2023
870
|
return Promise.reject();
|
|
2024
871
|
}
|
|
2025
872
|
getAccessibleDashboards() {
|
|
2026
873
|
if (!this.getIsViewMode()) {
|
|
2027
|
-
return getAccessibleDashboards(this, this.iframe);
|
|
874
|
+
return SharedLib2.getAccessibleDashboards(this, this.iframe);
|
|
2028
875
|
}
|
|
2029
876
|
if (this.getIsViewMode() && this.dashboardReference) {
|
|
2030
877
|
return this.dashboardReference.getAccessibleDashboards();
|
|
@@ -2057,7 +904,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
2057
904
|
return this.dashboardReference.setEditMode(editMode);
|
|
2058
905
|
}
|
|
2059
906
|
if (!this.getIsViewMode()) {
|
|
2060
|
-
return setEditMode(this, this.iframe, editMode);
|
|
907
|
+
return SharedLib2.setEditMode(this, this.iframe, editMode);
|
|
2061
908
|
}
|
|
2062
909
|
return Promise.reject();
|
|
2063
910
|
}
|
|
@@ -2065,7 +912,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
2065
912
|
if (this.getIsViewMode() && this.dashboardReference) {
|
|
2066
913
|
return this.dashboardReference.setPreview(preview);
|
|
2067
914
|
}
|
|
2068
|
-
return setPreview(this, this.iframe, preview);
|
|
915
|
+
return SharedLib2.setPreview(this, this.iframe, preview);
|
|
2069
916
|
}
|
|
2070
917
|
getIsViewMode() {
|
|
2071
918
|
if (this.experimental && this.params.editMode === "view" || this.params.editMode === void 0) {
|
|
@@ -2078,7 +925,7 @@ __decorateClass([
|
|
|
2078
925
|
(0, import_decorators.query)(".dashboard-container")
|
|
2079
926
|
], LuzmoDashboard.prototype, "container", 2);
|
|
2080
927
|
__decorateClass([
|
|
2081
|
-
(0, import_decorators.query)(`.${luzmoEmbedContainerClass}`)
|
|
928
|
+
(0, import_decorators.query)(`.${import_shared_embed.luzmoEmbedContainerClass}`)
|
|
2082
929
|
], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
|
|
2083
930
|
__decorateClass([
|
|
2084
931
|
(0, import_decorators.query)("iframe")
|
|
@@ -2149,7 +996,12 @@ __decorateClass([
|
|
|
2149
996
|
(0, import_decorators.property)({ type: Object })
|
|
2150
997
|
], LuzmoDashboard.prototype, "itemDimensions", 2);
|
|
2151
998
|
__decorateClass([
|
|
2152
|
-
(0, import_decorators.property)(
|
|
999
|
+
(0, import_decorators.property)({
|
|
1000
|
+
converter: {
|
|
1001
|
+
fromAttribute: (value) => value === "true",
|
|
1002
|
+
toAttribute: String
|
|
1003
|
+
}
|
|
1004
|
+
})
|
|
2153
1005
|
], LuzmoDashboard.prototype, "experimental", 2);
|
|
2154
1006
|
__decorateClass([
|
|
2155
1007
|
(0, import_decorators.property)({ attribute: false })
|
|
@@ -2215,7 +1067,7 @@ __decorateClass([
|
|
|
2215
1067
|
(0, import_decorators.property)({ attribute: false })
|
|
2216
1068
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
2217
1069
|
__decorateClass([
|
|
2218
|
-
(0, import_decorators.property)(
|
|
1070
|
+
(0, import_decorators.property)()
|
|
2219
1071
|
], LuzmoDashboard.prototype, "VERSION", 2);
|
|
2220
1072
|
__decorateClass([
|
|
2221
1073
|
(0, import_decorators.state)()
|
|
@@ -2226,7 +1078,13 @@ __decorateClass([
|
|
|
2226
1078
|
LuzmoDashboard = __decorateClass([
|
|
2227
1079
|
(0, import_decorators.customElement)("luzmo-dashboard")
|
|
2228
1080
|
], LuzmoDashboard);
|
|
1081
|
+
var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
|
|
1082
|
+
};
|
|
1083
|
+
LuzmoDashboardWebComponent = __decorateClass([
|
|
1084
|
+
(0, import_decorators.customElement)("luzmo-dashboard-web-component")
|
|
1085
|
+
], LuzmoDashboardWebComponent);
|
|
2229
1086
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2230
1087
|
0 && (module.exports = {
|
|
2231
|
-
LuzmoDashboard
|
|
1088
|
+
LuzmoDashboard,
|
|
1089
|
+
LuzmoDashboardWebComponent
|
|
2232
1090
|
});
|