@luzmo/embed 5.1.3-beta.0 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.libs.cjs CHANGED
@@ -39,8 +39,7 @@ var __decorateClass = (decorators, target, key, kind) => {
39
39
  // libs/embed-libs/embed/src/index.libs.ts
40
40
  var index_libs_exports = {};
41
41
  __export(index_libs_exports, {
42
- LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent,
43
- LuzmoVizItemWebComponent: () => LuzmoVizItemWebComponent
42
+ LuzmoDashboardWebComponent: () => LuzmoDashboardWebComponent
44
43
  });
45
44
  module.exports = __toCommonJS(index_libs_exports);
46
45
 
@@ -55,7 +54,7 @@ var import_style_map = require("lit/directives/style-map.js");
55
54
  var import_shared_embed = require("@luzmo/shared-embed");
56
55
 
57
56
  // libs/embed-libs/embed/package.json
58
- var version = "5.1.3-beta.0";
57
+ var version = "5.1.3";
59
58
 
60
59
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
61
60
  var LuzmoService = class {
@@ -227,6 +226,7 @@ var import_lit = require("lit");
227
226
  var dashboardStyles = import_lit.css`
228
227
  :host {
229
228
  display: block;
229
+ height: 100%;
230
230
  }
231
231
 
232
232
  @-webkit-keyframes spin {
@@ -261,6 +261,9 @@ var dashboardStyles = import_lit.css`
261
261
  border: 0;
262
262
  }
263
263
 
264
+ .luzmo-embed-dashboard-ede {
265
+ }
266
+
264
267
  .luzmo-embed-container-ede {
265
268
  width: 100%;
266
269
  height: 100%;
@@ -337,7 +340,7 @@ var dashboardStyles = import_lit.css`
337
340
 
338
341
  // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
339
342
  var LuzmoDashboard = class extends import_lit2.LitElement {
340
- constructor() {
343
+ constructor(inputParameters) {
341
344
  super();
342
345
  this.language = "auto";
343
346
  this.screenMode = "auto";
@@ -356,11 +359,10 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
356
359
  this.browserErrorMsg = "";
357
360
  this.dashboardError = false;
358
361
  this.browserNotSupported = [];
359
- this.version = version + "-wc-luzmo";
362
+ this.VERSION = version + "-wc-luzmo";
360
363
  this.isLibraryLoaded = false;
361
364
  this.currentAuthKey = null;
362
365
  this.currentAuthToken = null;
363
- this.isInitCalled = false;
364
366
  this.attributesMap = {
365
367
  dashboardId: "dashboard-id",
366
368
  dashboardSlug: "dashboard-slug",
@@ -390,6 +392,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
390
392
  this._iframeId = `luzmo-dashboard-${this._containerId}`;
391
393
  this.iframeLoaded = false;
392
394
  this.promises = {};
395
+ this.setInputParameters(inputParameters);
393
396
  this.params = this._setOptions();
394
397
  this._onResize = () => {
395
398
  if (this.shadowRoot?.querySelector(".dashboard-container")) {
@@ -420,6 +423,60 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
420
423
  });
421
424
  });
422
425
  }
426
+ loadLibrary(appServer) {
427
+ if (import_shared_embed.remotesMap[appServer]) {
428
+ return Promise.resolve(import_shared_embed.remotesMap[appServer].module);
429
+ }
430
+ import_shared_embed.remotesMap[appServer] = {
431
+ url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
432
+ format: "esm",
433
+ from: "vite",
434
+ module: void 0
435
+ };
436
+ return (0, import_shared_embed.__federationMethodGetRemote)(appServer, "./DashboardApp").then((module2) => {
437
+ const wrappedModule = (0, import_shared_embed.__federationMethodWrapDefault)(module2, true);
438
+ import_shared_embed.remotesMap[appServer].module = wrappedModule;
439
+ return wrappedModule;
440
+ });
441
+ }
442
+ setInputParameters(inputParameters) {
443
+ if (!inputParameters) {
444
+ return;
445
+ }
446
+ const params = [
447
+ "dashboardId",
448
+ "dashboardSlug",
449
+ "itemId",
450
+ "language",
451
+ "qeVersion",
452
+ "screenMode",
453
+ "switchScreenModeOnResize",
454
+ "accentColor",
455
+ "mainColor",
456
+ "authToken",
457
+ "authKey",
458
+ "editMode",
459
+ "loaderBackground",
460
+ "loaderFontColor",
461
+ "loaderSpinnerColor",
462
+ "loaderSpinnerBackground",
463
+ "timezoneId",
464
+ "itemDimensions",
465
+ "apiHost"
466
+ ];
467
+ for (const key of params) {
468
+ const value = inputParameters[key];
469
+ if (value) {
470
+ this[key] = value;
471
+ }
472
+ }
473
+ if (inputParameters.experimental) {
474
+ this.experimental = inputParameters.experimental;
475
+ }
476
+ if (inputParameters.appServer) {
477
+ this.appServer = SharedLib2.addTrailingSlash(inputParameters.appServer);
478
+ }
479
+ }
423
480
  // Set resize event listener
424
481
  connectedCallback() {
425
482
  super.connectedCallback();
@@ -438,6 +495,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
438
495
  this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
439
496
  this._loaderStyles();
440
497
  luzmo_service_default._components.push(this);
498
+ this.initComponent();
441
499
  if (this.luzmoEmbedContainer) {
442
500
  this._resizeObserver.observe(this.luzmoEmbedContainer);
443
501
  }
@@ -445,7 +503,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
445
503
  initComponent() {
446
504
  this.params = this._setOptions();
447
505
  if (this.getIsViewMode()) {
448
- SharedLib2.loadLibrary(this.params.appServer).then(async () => {
506
+ this.loadLibrary(this.params.appServer).then(async () => {
449
507
  this.isLibraryLoaded = true;
450
508
  await this.updateComplete;
451
509
  const oldReference = this.renderRoot.querySelector("dashboard-component");
@@ -517,21 +575,11 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
517
575
  "timezoneId",
518
576
  "itemDimensions"
519
577
  ]);
520
- const conditionsToCheck = ["dashboardId", "dashboardSlug", "itemId"];
521
- let callInitComponent = false;
522
- for (const condition of conditionsToCheck) {
523
- callInitComponent = callInitComponent || changedProperties.get(condition) === void 0 && this[condition];
524
- }
525
- if (callInitComponent && !this.isInitCalled) {
526
- this.initComponent();
527
- this.isInitCalled = true;
528
- return;
529
- }
530
578
  if (this.getIsViewMode()) {
531
579
  if (this.dashboardReference) {
532
580
  for (const [propertyName] of changedProperties.entries()) {
533
581
  if (propertyName === "appSever") {
534
- SharedLib2.loadLibrary(changedProperties[propertyName]).then(async () => {
582
+ this.loadLibrary(changedProperties[propertyName]).then(async () => {
535
583
  this.isLibraryLoaded = true;
536
584
  await this.updateComplete;
537
585
  this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
@@ -739,7 +787,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
739
787
  ${this.dashboardId || this.dashboardSlug ? import_lit2.html`
740
788
  ${loader}
741
789
  <iframe
742
- class="luzmo-embed-dashboard"
790
+ class="luzmo-embed-dashboard ${!this.getIsViewMode() ? `luzmo-embed-dashboard-ede` : ""}"
743
791
  id="${this._iframeId}"
744
792
  name="${this._iframeId}"
745
793
  style=${(0, import_style_map.styleMap)(this.iframeStyle)}
@@ -1030,7 +1078,7 @@ __decorateClass([
1030
1078
  ], LuzmoDashboard.prototype, "browserNotSupported", 2);
1031
1079
  __decorateClass([
1032
1080
  (0, import_decorators.property)()
1033
- ], LuzmoDashboard.prototype, "version", 2);
1081
+ ], LuzmoDashboard.prototype, "VERSION", 2);
1034
1082
  __decorateClass([
1035
1083
  (0, import_decorators.state)()
1036
1084
  ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
@@ -1043,9 +1091,6 @@ __decorateClass([
1043
1091
  __decorateClass([
1044
1092
  (0, import_decorators.state)()
1045
1093
  ], LuzmoDashboard.prototype, "currentAuthToken", 2);
1046
- __decorateClass([
1047
- (0, import_decorators.state)()
1048
- ], LuzmoDashboard.prototype, "isInitCalled", 2);
1049
1094
 
1050
1095
  // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-web-component.ts
1051
1096
  var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
@@ -1053,135 +1098,7 @@ var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
1053
1098
  LuzmoDashboardWebComponent = __decorateClass([
1054
1099
  (0, import_decorators2.customElement)("luzmo-dashboard-web-component")
1055
1100
  ], LuzmoDashboardWebComponent);
1056
-
1057
- // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1058
- var import_decorators4 = require("lit/decorators.js");
1059
-
1060
- // libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
1061
- var import_decorators3 = require("lit/decorators.js");
1062
- var import_lit3 = require("lit");
1063
- var SharedLib3 = __toESM(require("@luzmo/shared-embed"), 1);
1064
- var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1065
- constructor() {
1066
- super();
1067
- this.appServer = "https://app.luzmo.com";
1068
- this.apiHost = "https://api.luzmo.com";
1069
- this.slots = [];
1070
- this.options = {
1071
- title: {
1072
- en: ""
1073
- },
1074
- theme: "default"
1075
- };
1076
- this.version = version + "-wc-luzmo";
1077
- }
1078
- static {
1079
- // Static styles to set host display to block, else it is not shown at all for some reason.
1080
- this.styles = import_lit3.css`
1081
- :host {
1082
- display: block;
1083
- width: 100%;
1084
- height: 100%;
1085
- }
1086
- `;
1087
- }
1088
- async firstUpdated(_changedProperties) {
1089
- super.firstUpdated(_changedProperties);
1090
- if (this.type) {
1091
- await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1092
- this.createAndAppendElement();
1093
- }
1094
- }
1095
- createAndAppendElement() {
1096
- if (!this.chartElement) {
1097
- this.chartElement = document.createElement("chart-component");
1098
- this.chartElement.setAttribute("embedding-mode", "chart");
1099
- this.updateVizItemProperties();
1100
- this.renderRoot.append(this.chartElement);
1101
- }
1102
- }
1103
- updateVizItemProperties() {
1104
- if (this.chartElement) {
1105
- for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
1106
- const value = this[key];
1107
- if (value) {
1108
- const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
1109
- this.chartElement.setAttribute(
1110
- SharedLib3.libraryTypeToWebComponentTypeMapping[key],
1111
- typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
1112
- );
1113
- }
1114
- }
1115
- }
1116
- }
1117
- async updated(changedProperties) {
1118
- if (this.chartElement) {
1119
- for (const [propertyName] of changedProperties.entries()) {
1120
- const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1121
- const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1122
- this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1123
- }
1124
- } else {
1125
- if (this.type) {
1126
- await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1127
- this.createAndAppendElement();
1128
- }
1129
- }
1130
- }
1131
- render() {
1132
- return import_lit3.html` `;
1133
- }
1134
- };
1135
- __decorateClass([
1136
- (0, import_decorators3.property)()
1137
- ], LuzmoBaseVizItem.prototype, "appServer", 2);
1138
- __decorateClass([
1139
- (0, import_decorators3.property)()
1140
- ], LuzmoBaseVizItem.prototype, "apiHost", 2);
1141
- __decorateClass([
1142
- (0, import_decorators3.property)({ type: Array })
1143
- ], LuzmoBaseVizItem.prototype, "slots", 2);
1144
- __decorateClass([
1145
- (0, import_decorators3.property)({ type: Object })
1146
- ], LuzmoBaseVizItem.prototype, "options", 2);
1147
- __decorateClass([
1148
- (0, import_decorators3.property)()
1149
- ], LuzmoBaseVizItem.prototype, "type", 2);
1150
- __decorateClass([
1151
- (0, import_decorators3.property)()
1152
- ], LuzmoBaseVizItem.prototype, "authKey", 2);
1153
- __decorateClass([
1154
- (0, import_decorators3.property)()
1155
- ], LuzmoBaseVizItem.prototype, "authToken", 2);
1156
- __decorateClass([
1157
- (0, import_decorators3.property)()
1158
- ], LuzmoBaseVizItem.prototype, "version", 2);
1159
- __decorateClass([
1160
- (0, import_decorators3.property)()
1161
- ], LuzmoBaseVizItem.prototype, "contextId", 2);
1162
- __decorateClass([
1163
- (0, import_decorators3.property)({
1164
- converter: (value) => {
1165
- try {
1166
- return JSON.parse(value);
1167
- } catch (exc) {
1168
- return value;
1169
- }
1170
- }
1171
- })
1172
- ], LuzmoBaseVizItem.prototype, "canFilter", 2);
1173
- __decorateClass([
1174
- (0, import_decorators3.property)({ type: Array })
1175
- ], LuzmoBaseVizItem.prototype, "filters", 2);
1176
-
1177
- // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1178
- var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
1179
- };
1180
- LuzmoVizItemWebComponent = __decorateClass([
1181
- (0, import_decorators4.customElement)("luzmo-viz-item-web-component")
1182
- ], LuzmoVizItemWebComponent);
1183
1101
  // Annotate the CommonJS export names for ESM import in node:
1184
1102
  0 && (module.exports = {
1185
- LuzmoDashboardWebComponent,
1186
- LuzmoVizItemWebComponent
1103
+ LuzmoDashboardWebComponent
1187
1104
  });
package/index.libs.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export * from './lib/dashboard-component/dashboard-web-component';
2
- export * from './lib/viz-item/viz-item-web-component';
package/index.libs.js CHANGED
@@ -28,11 +28,14 @@ import {
28
28
  styleMap
29
29
  } from "lit/directives/style-map.js";
30
30
  import {
31
+ __federationMethodGetRemote,
32
+ __federationMethodWrapDefault,
33
+ remotesMap,
31
34
  luzmoEmbedContainerClass
32
35
  } from "@luzmo/shared-embed";
33
36
 
34
37
  // libs/embed-libs/embed/package.json
35
- var version = "5.1.3-beta.0";
38
+ var version = "5.1.3";
36
39
 
37
40
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
38
41
  var LuzmoService = class {
@@ -204,6 +207,7 @@ import { css } from "lit";
204
207
  var dashboardStyles = css`
205
208
  :host {
206
209
  display: block;
210
+ height: 100%;
207
211
  }
208
212
 
209
213
  @-webkit-keyframes spin {
@@ -238,6 +242,9 @@ var dashboardStyles = css`
238
242
  border: 0;
239
243
  }
240
244
 
245
+ .luzmo-embed-dashboard-ede {
246
+ }
247
+
241
248
  .luzmo-embed-container-ede {
242
249
  width: 100%;
243
250
  height: 100%;
@@ -314,7 +321,7 @@ var dashboardStyles = css`
314
321
 
315
322
  // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
316
323
  var LuzmoDashboard = class extends LitElement {
317
- constructor() {
324
+ constructor(inputParameters) {
318
325
  super();
319
326
  this.language = "auto";
320
327
  this.screenMode = "auto";
@@ -333,11 +340,10 @@ var LuzmoDashboard = class extends LitElement {
333
340
  this.browserErrorMsg = "";
334
341
  this.dashboardError = false;
335
342
  this.browserNotSupported = [];
336
- this.version = version + "-wc-luzmo";
343
+ this.VERSION = version + "-wc-luzmo";
337
344
  this.isLibraryLoaded = false;
338
345
  this.currentAuthKey = null;
339
346
  this.currentAuthToken = null;
340
- this.isInitCalled = false;
341
347
  this.attributesMap = {
342
348
  dashboardId: "dashboard-id",
343
349
  dashboardSlug: "dashboard-slug",
@@ -367,6 +373,7 @@ var LuzmoDashboard = class extends LitElement {
367
373
  this._iframeId = `luzmo-dashboard-${this._containerId}`;
368
374
  this.iframeLoaded = false;
369
375
  this.promises = {};
376
+ this.setInputParameters(inputParameters);
370
377
  this.params = this._setOptions();
371
378
  this._onResize = () => {
372
379
  if (this.shadowRoot?.querySelector(".dashboard-container")) {
@@ -397,6 +404,60 @@ var LuzmoDashboard = class extends LitElement {
397
404
  });
398
405
  });
399
406
  }
407
+ loadLibrary(appServer) {
408
+ if (remotesMap[appServer]) {
409
+ return Promise.resolve(remotesMap[appServer].module);
410
+ }
411
+ remotesMap[appServer] = {
412
+ url: appServer?.startsWith("http://localhost") ? `${SharedLib2.removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${SharedLib2.removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
413
+ format: "esm",
414
+ from: "vite",
415
+ module: void 0
416
+ };
417
+ return __federationMethodGetRemote(appServer, "./DashboardApp").then((module) => {
418
+ const wrappedModule = __federationMethodWrapDefault(module, true);
419
+ remotesMap[appServer].module = wrappedModule;
420
+ return wrappedModule;
421
+ });
422
+ }
423
+ setInputParameters(inputParameters) {
424
+ if (!inputParameters) {
425
+ return;
426
+ }
427
+ const params = [
428
+ "dashboardId",
429
+ "dashboardSlug",
430
+ "itemId",
431
+ "language",
432
+ "qeVersion",
433
+ "screenMode",
434
+ "switchScreenModeOnResize",
435
+ "accentColor",
436
+ "mainColor",
437
+ "authToken",
438
+ "authKey",
439
+ "editMode",
440
+ "loaderBackground",
441
+ "loaderFontColor",
442
+ "loaderSpinnerColor",
443
+ "loaderSpinnerBackground",
444
+ "timezoneId",
445
+ "itemDimensions",
446
+ "apiHost"
447
+ ];
448
+ for (const key of params) {
449
+ const value = inputParameters[key];
450
+ if (value) {
451
+ this[key] = value;
452
+ }
453
+ }
454
+ if (inputParameters.experimental) {
455
+ this.experimental = inputParameters.experimental;
456
+ }
457
+ if (inputParameters.appServer) {
458
+ this.appServer = SharedLib2.addTrailingSlash(inputParameters.appServer);
459
+ }
460
+ }
400
461
  // Set resize event listener
401
462
  connectedCallback() {
402
463
  super.connectedCallback();
@@ -415,6 +476,7 @@ var LuzmoDashboard = class extends LitElement {
415
476
  this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
416
477
  this._loaderStyles();
417
478
  luzmo_service_default._components.push(this);
479
+ this.initComponent();
418
480
  if (this.luzmoEmbedContainer) {
419
481
  this._resizeObserver.observe(this.luzmoEmbedContainer);
420
482
  }
@@ -422,7 +484,7 @@ var LuzmoDashboard = class extends LitElement {
422
484
  initComponent() {
423
485
  this.params = this._setOptions();
424
486
  if (this.getIsViewMode()) {
425
- SharedLib2.loadLibrary(this.params.appServer).then(async () => {
487
+ this.loadLibrary(this.params.appServer).then(async () => {
426
488
  this.isLibraryLoaded = true;
427
489
  await this.updateComplete;
428
490
  const oldReference = this.renderRoot.querySelector("dashboard-component");
@@ -494,21 +556,11 @@ var LuzmoDashboard = class extends LitElement {
494
556
  "timezoneId",
495
557
  "itemDimensions"
496
558
  ]);
497
- const conditionsToCheck = ["dashboardId", "dashboardSlug", "itemId"];
498
- let callInitComponent = false;
499
- for (const condition of conditionsToCheck) {
500
- callInitComponent = callInitComponent || changedProperties.get(condition) === void 0 && this[condition];
501
- }
502
- if (callInitComponent && !this.isInitCalled) {
503
- this.initComponent();
504
- this.isInitCalled = true;
505
- return;
506
- }
507
559
  if (this.getIsViewMode()) {
508
560
  if (this.dashboardReference) {
509
561
  for (const [propertyName] of changedProperties.entries()) {
510
562
  if (propertyName === "appSever") {
511
- SharedLib2.loadLibrary(changedProperties[propertyName]).then(async () => {
563
+ this.loadLibrary(changedProperties[propertyName]).then(async () => {
512
564
  this.isLibraryLoaded = true;
513
565
  await this.updateComplete;
514
566
  this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
@@ -716,7 +768,7 @@ var LuzmoDashboard = class extends LitElement {
716
768
  ${this.dashboardId || this.dashboardSlug ? html`
717
769
  ${loader}
718
770
  <iframe
719
- class="luzmo-embed-dashboard"
771
+ class="luzmo-embed-dashboard ${!this.getIsViewMode() ? `luzmo-embed-dashboard-ede` : ""}"
720
772
  id="${this._iframeId}"
721
773
  name="${this._iframeId}"
722
774
  style=${styleMap(this.iframeStyle)}
@@ -1007,7 +1059,7 @@ __decorateClass([
1007
1059
  ], LuzmoDashboard.prototype, "browserNotSupported", 2);
1008
1060
  __decorateClass([
1009
1061
  property()
1010
- ], LuzmoDashboard.prototype, "version", 2);
1062
+ ], LuzmoDashboard.prototype, "VERSION", 2);
1011
1063
  __decorateClass([
1012
1064
  state()
1013
1065
  ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
@@ -1020,9 +1072,6 @@ __decorateClass([
1020
1072
  __decorateClass([
1021
1073
  state()
1022
1074
  ], LuzmoDashboard.prototype, "currentAuthToken", 2);
1023
- __decorateClass([
1024
- state()
1025
- ], LuzmoDashboard.prototype, "isInitCalled", 2);
1026
1075
 
1027
1076
  // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-web-component.ts
1028
1077
  var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
@@ -1030,134 +1079,6 @@ var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
1030
1079
  LuzmoDashboardWebComponent = __decorateClass([
1031
1080
  customElement("luzmo-dashboard-web-component")
1032
1081
  ], LuzmoDashboardWebComponent);
1033
-
1034
- // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1035
- import { customElement as customElement3 } from "lit/decorators.js";
1036
-
1037
- // libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
1038
- import { property as property2 } from "lit/decorators.js";
1039
- import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
1040
- import * as SharedLib3 from "@luzmo/shared-embed";
1041
- var LuzmoBaseVizItem = class extends LitElement2 {
1042
- constructor() {
1043
- super();
1044
- this.appServer = "https://app.luzmo.com";
1045
- this.apiHost = "https://api.luzmo.com";
1046
- this.slots = [];
1047
- this.options = {
1048
- title: {
1049
- en: ""
1050
- },
1051
- theme: "default"
1052
- };
1053
- this.version = version + "-wc-luzmo";
1054
- }
1055
- static {
1056
- // Static styles to set host display to block, else it is not shown at all for some reason.
1057
- this.styles = css2`
1058
- :host {
1059
- display: block;
1060
- width: 100%;
1061
- height: 100%;
1062
- }
1063
- `;
1064
- }
1065
- async firstUpdated(_changedProperties) {
1066
- super.firstUpdated(_changedProperties);
1067
- if (this.type) {
1068
- await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1069
- this.createAndAppendElement();
1070
- }
1071
- }
1072
- createAndAppendElement() {
1073
- if (!this.chartElement) {
1074
- this.chartElement = document.createElement("chart-component");
1075
- this.chartElement.setAttribute("embedding-mode", "chart");
1076
- this.updateVizItemProperties();
1077
- this.renderRoot.append(this.chartElement);
1078
- }
1079
- }
1080
- updateVizItemProperties() {
1081
- if (this.chartElement) {
1082
- for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
1083
- const value = this[key];
1084
- if (value) {
1085
- const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
1086
- this.chartElement.setAttribute(
1087
- SharedLib3.libraryTypeToWebComponentTypeMapping[key],
1088
- typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
1089
- );
1090
- }
1091
- }
1092
- }
1093
- }
1094
- async updated(changedProperties) {
1095
- if (this.chartElement) {
1096
- for (const [propertyName] of changedProperties.entries()) {
1097
- const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1098
- const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1099
- this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1100
- }
1101
- } else {
1102
- if (this.type) {
1103
- await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1104
- this.createAndAppendElement();
1105
- }
1106
- }
1107
- }
1108
- render() {
1109
- return html2` `;
1110
- }
1111
- };
1112
- __decorateClass([
1113
- property2()
1114
- ], LuzmoBaseVizItem.prototype, "appServer", 2);
1115
- __decorateClass([
1116
- property2()
1117
- ], LuzmoBaseVizItem.prototype, "apiHost", 2);
1118
- __decorateClass([
1119
- property2({ type: Array })
1120
- ], LuzmoBaseVizItem.prototype, "slots", 2);
1121
- __decorateClass([
1122
- property2({ type: Object })
1123
- ], LuzmoBaseVizItem.prototype, "options", 2);
1124
- __decorateClass([
1125
- property2()
1126
- ], LuzmoBaseVizItem.prototype, "type", 2);
1127
- __decorateClass([
1128
- property2()
1129
- ], LuzmoBaseVizItem.prototype, "authKey", 2);
1130
- __decorateClass([
1131
- property2()
1132
- ], LuzmoBaseVizItem.prototype, "authToken", 2);
1133
- __decorateClass([
1134
- property2()
1135
- ], LuzmoBaseVizItem.prototype, "version", 2);
1136
- __decorateClass([
1137
- property2()
1138
- ], LuzmoBaseVizItem.prototype, "contextId", 2);
1139
- __decorateClass([
1140
- property2({
1141
- converter: (value) => {
1142
- try {
1143
- return JSON.parse(value);
1144
- } catch (exc) {
1145
- return value;
1146
- }
1147
- }
1148
- })
1149
- ], LuzmoBaseVizItem.prototype, "canFilter", 2);
1150
- __decorateClass([
1151
- property2({ type: Array })
1152
- ], LuzmoBaseVizItem.prototype, "filters", 2);
1153
-
1154
- // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1155
- var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
1156
- };
1157
- LuzmoVizItemWebComponent = __decorateClass([
1158
- customElement3("luzmo-viz-item-web-component")
1159
- ], LuzmoVizItemWebComponent);
1160
1082
  export {
1161
- LuzmoDashboardWebComponent,
1162
- LuzmoVizItemWebComponent
1083
+ LuzmoDashboardWebComponent
1163
1084
  };
@@ -51,12 +51,11 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
51
51
  browserErrorMsg: string;
52
52
  dashboardError: boolean;
53
53
  browserNotSupported: any[];
54
- version: string;
54
+ VERSION: string;
55
55
  protected isLibraryLoaded: boolean;
56
56
  protected dashboardReference: SharedLib.LuzmoElement;
57
57
  currentAuthKey: string;
58
58
  currentAuthToken: string;
59
- isInitCalled: boolean;
60
59
  private attributesMap;
61
60
  _loadTimeoutHandle?: number;
62
61
  _onResize: () => void;
@@ -66,7 +65,9 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
66
65
  iframeHeight?: string;
67
66
  iframeWidth?: string;
68
67
  _resizeObserver: ResizeObserver;
69
- constructor();
68
+ constructor(inputParameters?: Record<keyof LuzmoDashboard, any>);
69
+ private loadLibrary;
70
+ private setInputParameters;
70
71
  connectedCallback(): void;
71
72
  disconnectedCallback(): void;
72
73
  firstUpdated(): void;