@luzmo/embed 5.1.3-beta.5 → 5.1.3-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -56,7 +56,7 @@ var import_style_map = require("lit/directives/style-map.js");
56
56
  var import_shared_embed = require("@luzmo/shared-embed");
57
57
 
58
58
  // libs/embed-libs/embed/package.json
59
- var version = "5.1.3-beta.5";
59
+ var version = "5.1.3-beta.8";
60
60
 
61
61
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
62
62
  var LuzmoService = class {
@@ -1074,13 +1074,9 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1074
1074
  this.appServer = "https://app.luzmo.com";
1075
1075
  this.apiHost = "https://api.luzmo.com";
1076
1076
  this.slots = [];
1077
- this.options = {
1078
- title: {
1079
- en: ""
1080
- },
1081
- theme: "default"
1082
- };
1083
1077
  this.version = version + "-wc-luzmo";
1078
+ this.libVersion = version + "-wc-luzmo";
1079
+ this.postInitCallQueue = [];
1084
1080
  }
1085
1081
  static {
1086
1082
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -1095,6 +1091,32 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1095
1091
  canInitializeVizItem() {
1096
1092
  return !!(this.type || this.dashboardId && this.itemId);
1097
1093
  }
1094
+ getFilters() {
1095
+ return this.chartElement.getFilters();
1096
+ }
1097
+ export() {
1098
+ return this.chartElement.export();
1099
+ }
1100
+ getData() {
1101
+ return this.chartElement.getData();
1102
+ }
1103
+ refreshData() {
1104
+ return this.chartElement.refreshData();
1105
+ }
1106
+ setFilters(filterInput) {
1107
+ return this.chartElement.setFilters(void 0, filterInput);
1108
+ }
1109
+ attributeChangedCallback(name, _old, value) {
1110
+ super.attributeChangedCallback(name, _old, value);
1111
+ console.log(name, value);
1112
+ if (name === "selecteddata") {
1113
+ if (this.chartElement) {
1114
+ this.setFilters(JSON.parse(value ?? "{}"));
1115
+ } else {
1116
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
1117
+ }
1118
+ }
1119
+ }
1098
1120
  async firstUpdated(_changedProperties) {
1099
1121
  super.firstUpdated(_changedProperties);
1100
1122
  if (this.canInitializeVizItem()) {
@@ -1106,6 +1128,15 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1106
1128
  if (!this.chartElement) {
1107
1129
  this.chartElement = document.createElement("chart-component");
1108
1130
  this.chartElement.setAttribute("embedding-mode", "chart");
1131
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
1132
+ this.chartElement.addEventListener("rendered", (payload) => {
1133
+ for (const functionToCall of this.postInitCallQueue) {
1134
+ functionToCall[0].bind(this)(...functionToCall[1]);
1135
+ }
1136
+ this.dispatchEvent(new CustomEvent("rendered", payload));
1137
+ });
1138
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
1139
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
1109
1140
  this.updateVizItemProperties();
1110
1141
  this.renderRoot.append(this.chartElement);
1111
1142
  }
@@ -1211,6 +1242,12 @@ __decorateClass([
1211
1242
  __decorateClass([
1212
1243
  (0, import_decorators3.property)()
1213
1244
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1245
+ __decorateClass([
1246
+ (0, import_decorators3.property)({ type: Object })
1247
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
1248
+ __decorateClass([
1249
+ (0, import_decorators3.property)()
1250
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
1214
1251
 
1215
1252
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
1216
1253
  var LuzmoVizItem = class extends LuzmoBaseVizItem {
package/index.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  } from "@luzmo/shared-embed";
35
35
 
36
36
  // libs/embed-libs/embed/package.json
37
- var version = "5.1.3-beta.5";
37
+ var version = "5.1.3-beta.8";
38
38
 
39
39
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
40
40
  var LuzmoService = class {
@@ -1052,13 +1052,9 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1052
1052
  this.appServer = "https://app.luzmo.com";
1053
1053
  this.apiHost = "https://api.luzmo.com";
1054
1054
  this.slots = [];
1055
- this.options = {
1056
- title: {
1057
- en: ""
1058
- },
1059
- theme: "default"
1060
- };
1061
1055
  this.version = version + "-wc-luzmo";
1056
+ this.libVersion = version + "-wc-luzmo";
1057
+ this.postInitCallQueue = [];
1062
1058
  }
1063
1059
  static {
1064
1060
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -1073,6 +1069,32 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1073
1069
  canInitializeVizItem() {
1074
1070
  return !!(this.type || this.dashboardId && this.itemId);
1075
1071
  }
1072
+ getFilters() {
1073
+ return this.chartElement.getFilters();
1074
+ }
1075
+ export() {
1076
+ return this.chartElement.export();
1077
+ }
1078
+ getData() {
1079
+ return this.chartElement.getData();
1080
+ }
1081
+ refreshData() {
1082
+ return this.chartElement.refreshData();
1083
+ }
1084
+ setFilters(filterInput) {
1085
+ return this.chartElement.setFilters(void 0, filterInput);
1086
+ }
1087
+ attributeChangedCallback(name, _old, value) {
1088
+ super.attributeChangedCallback(name, _old, value);
1089
+ console.log(name, value);
1090
+ if (name === "selecteddata") {
1091
+ if (this.chartElement) {
1092
+ this.setFilters(JSON.parse(value ?? "{}"));
1093
+ } else {
1094
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
1095
+ }
1096
+ }
1097
+ }
1076
1098
  async firstUpdated(_changedProperties) {
1077
1099
  super.firstUpdated(_changedProperties);
1078
1100
  if (this.canInitializeVizItem()) {
@@ -1084,6 +1106,15 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1084
1106
  if (!this.chartElement) {
1085
1107
  this.chartElement = document.createElement("chart-component");
1086
1108
  this.chartElement.setAttribute("embedding-mode", "chart");
1109
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
1110
+ this.chartElement.addEventListener("rendered", (payload) => {
1111
+ for (const functionToCall of this.postInitCallQueue) {
1112
+ functionToCall[0].bind(this)(...functionToCall[1]);
1113
+ }
1114
+ this.dispatchEvent(new CustomEvent("rendered", payload));
1115
+ });
1116
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
1117
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
1087
1118
  this.updateVizItemProperties();
1088
1119
  this.renderRoot.append(this.chartElement);
1089
1120
  }
@@ -1189,6 +1220,12 @@ __decorateClass([
1189
1220
  __decorateClass([
1190
1221
  property2()
1191
1222
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1223
+ __decorateClass([
1224
+ property2({ type: Object })
1225
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
1226
+ __decorateClass([
1227
+ property2()
1228
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
1192
1229
 
1193
1230
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
1194
1231
  var LuzmoVizItem = class extends LuzmoBaseVizItem {
package/index.libs.cjs CHANGED
@@ -55,7 +55,7 @@ var import_style_map = require("lit/directives/style-map.js");
55
55
  var import_shared_embed = require("@luzmo/shared-embed");
56
56
 
57
57
  // libs/embed-libs/embed/package.json
58
- var version = "5.1.3-beta.5";
58
+ var version = "5.1.3-beta.8";
59
59
 
60
60
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
61
61
  var LuzmoService = class {
@@ -1068,13 +1068,9 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1068
1068
  this.appServer = "https://app.luzmo.com";
1069
1069
  this.apiHost = "https://api.luzmo.com";
1070
1070
  this.slots = [];
1071
- this.options = {
1072
- title: {
1073
- en: ""
1074
- },
1075
- theme: "default"
1076
- };
1077
1071
  this.version = version + "-wc-luzmo";
1072
+ this.libVersion = version + "-wc-luzmo";
1073
+ this.postInitCallQueue = [];
1078
1074
  }
1079
1075
  static {
1080
1076
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -1089,6 +1085,32 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1089
1085
  canInitializeVizItem() {
1090
1086
  return !!(this.type || this.dashboardId && this.itemId);
1091
1087
  }
1088
+ getFilters() {
1089
+ return this.chartElement.getFilters();
1090
+ }
1091
+ export() {
1092
+ return this.chartElement.export();
1093
+ }
1094
+ getData() {
1095
+ return this.chartElement.getData();
1096
+ }
1097
+ refreshData() {
1098
+ return this.chartElement.refreshData();
1099
+ }
1100
+ setFilters(filterInput) {
1101
+ return this.chartElement.setFilters(void 0, filterInput);
1102
+ }
1103
+ attributeChangedCallback(name, _old, value) {
1104
+ super.attributeChangedCallback(name, _old, value);
1105
+ console.log(name, value);
1106
+ if (name === "selecteddata") {
1107
+ if (this.chartElement) {
1108
+ this.setFilters(JSON.parse(value ?? "{}"));
1109
+ } else {
1110
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
1111
+ }
1112
+ }
1113
+ }
1092
1114
  async firstUpdated(_changedProperties) {
1093
1115
  super.firstUpdated(_changedProperties);
1094
1116
  if (this.canInitializeVizItem()) {
@@ -1100,6 +1122,15 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1100
1122
  if (!this.chartElement) {
1101
1123
  this.chartElement = document.createElement("chart-component");
1102
1124
  this.chartElement.setAttribute("embedding-mode", "chart");
1125
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
1126
+ this.chartElement.addEventListener("rendered", (payload) => {
1127
+ for (const functionToCall of this.postInitCallQueue) {
1128
+ functionToCall[0].bind(this)(...functionToCall[1]);
1129
+ }
1130
+ this.dispatchEvent(new CustomEvent("rendered", payload));
1131
+ });
1132
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
1133
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
1103
1134
  this.updateVizItemProperties();
1104
1135
  this.renderRoot.append(this.chartElement);
1105
1136
  }
@@ -1205,6 +1236,12 @@ __decorateClass([
1205
1236
  __decorateClass([
1206
1237
  (0, import_decorators3.property)()
1207
1238
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1239
+ __decorateClass([
1240
+ (0, import_decorators3.property)({ type: Object })
1241
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
1242
+ __decorateClass([
1243
+ (0, import_decorators3.property)()
1244
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
1208
1245
 
1209
1246
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1210
1247
  var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
package/index.libs.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  } from "@luzmo/shared-embed";
33
33
 
34
34
  // libs/embed-libs/embed/package.json
35
- var version = "5.1.3-beta.5";
35
+ var version = "5.1.3-beta.8";
36
36
 
37
37
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
38
38
  var LuzmoService = class {
@@ -1045,13 +1045,9 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1045
1045
  this.appServer = "https://app.luzmo.com";
1046
1046
  this.apiHost = "https://api.luzmo.com";
1047
1047
  this.slots = [];
1048
- this.options = {
1049
- title: {
1050
- en: ""
1051
- },
1052
- theme: "default"
1053
- };
1054
1048
  this.version = version + "-wc-luzmo";
1049
+ this.libVersion = version + "-wc-luzmo";
1050
+ this.postInitCallQueue = [];
1055
1051
  }
1056
1052
  static {
1057
1053
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -1066,6 +1062,32 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1066
1062
  canInitializeVizItem() {
1067
1063
  return !!(this.type || this.dashboardId && this.itemId);
1068
1064
  }
1065
+ getFilters() {
1066
+ return this.chartElement.getFilters();
1067
+ }
1068
+ export() {
1069
+ return this.chartElement.export();
1070
+ }
1071
+ getData() {
1072
+ return this.chartElement.getData();
1073
+ }
1074
+ refreshData() {
1075
+ return this.chartElement.refreshData();
1076
+ }
1077
+ setFilters(filterInput) {
1078
+ return this.chartElement.setFilters(void 0, filterInput);
1079
+ }
1080
+ attributeChangedCallback(name, _old, value) {
1081
+ super.attributeChangedCallback(name, _old, value);
1082
+ console.log(name, value);
1083
+ if (name === "selecteddata") {
1084
+ if (this.chartElement) {
1085
+ this.setFilters(JSON.parse(value ?? "{}"));
1086
+ } else {
1087
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
1088
+ }
1089
+ }
1090
+ }
1069
1091
  async firstUpdated(_changedProperties) {
1070
1092
  super.firstUpdated(_changedProperties);
1071
1093
  if (this.canInitializeVizItem()) {
@@ -1077,6 +1099,15 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1077
1099
  if (!this.chartElement) {
1078
1100
  this.chartElement = document.createElement("chart-component");
1079
1101
  this.chartElement.setAttribute("embedding-mode", "chart");
1102
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
1103
+ this.chartElement.addEventListener("rendered", (payload) => {
1104
+ for (const functionToCall of this.postInitCallQueue) {
1105
+ functionToCall[0].bind(this)(...functionToCall[1]);
1106
+ }
1107
+ this.dispatchEvent(new CustomEvent("rendered", payload));
1108
+ });
1109
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
1110
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
1080
1111
  this.updateVizItemProperties();
1081
1112
  this.renderRoot.append(this.chartElement);
1082
1113
  }
@@ -1182,6 +1213,12 @@ __decorateClass([
1182
1213
  __decorateClass([
1183
1214
  property2()
1184
1215
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1216
+ __decorateClass([
1217
+ property2({ type: Object })
1218
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
1219
+ __decorateClass([
1220
+ property2()
1221
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
1185
1222
 
1186
1223
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1187
1224
  var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
@@ -1,10 +1,11 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import * as SharedLib from '@luzmo/shared-embed';
3
+ type FunctionCall = [(...args: any) => any, any[]];
3
4
  export declare class LuzmoBaseVizItem extends LitElement implements SharedLib.LuzmoVizItemComponentInterface {
4
- appServer: string;
5
- apiHost: string;
6
- slots: SharedLib.Slots;
7
- options: SharedLib.VizItemOptions;
5
+ appServer?: string;
6
+ apiHost?: string;
7
+ slots?: SharedLib.Slots;
8
+ options?: SharedLib.VizItemOptions;
8
9
  type?: SharedLib.ItemType;
9
10
  authKey?: string;
10
11
  authToken?: string;
@@ -14,14 +15,26 @@ export declare class LuzmoBaseVizItem extends LitElement implements SharedLib.Lu
14
15
  filters?: SharedLib.FilterGroup[];
15
16
  dashboardId?: string;
16
17
  itemId?: string;
17
- chartElement: HTMLElement;
18
+ selectedData: SharedLib.FilterInput;
19
+ libVersion?: string;
20
+ chartElement: HTMLElement & Partial<SharedLib.LuzmoVizItemComponentInterface> & {
21
+ setFilters?: (itemId?: string, filters?: SharedLib.FilterInput) => SharedLib.SetFilters;
22
+ };
23
+ postInitCallQueue: FunctionCall[];
18
24
  static styles: import("lit").CSSResult;
19
25
  constructor();
20
26
  canInitializeVizItem(): boolean;
27
+ getFilters(): SharedLib.FilterGroup[];
28
+ export(): void;
29
+ getData(): any;
30
+ refreshData(): void;
31
+ setFilters(filterInput: SharedLib.FilterInput): SharedLib.SetFilters;
32
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
21
33
  protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
22
34
  private createAndAppendElement;
23
35
  private updateVizItemProperties;
24
36
  updated(changedProperties: PropertyValues): Promise<void>;
25
- parseAndValidate(key: keyof this): void;
37
+ private parseAndValidate;
26
38
  protected render(): unknown;
27
39
  }
40
+ export {};
@@ -5462,46 +5462,53 @@ var slotParser = z.object({
5462
5462
  )
5463
5463
  });
5464
5464
  var itemTypeParser = z.enum([
5465
+ "area-chart",
5465
5466
  "bar-chart",
5467
+ "bubble-chart",
5468
+ "box-plot",
5469
+ "bullet-chart",
5470
+ "choropleth-map",
5471
+ "circular-gauge",
5472
+ "circle-pack-chart",
5466
5473
  "column-chart",
5467
- "area-chart",
5468
- "one-number",
5474
+ "combination-chart",
5475
+ "date-filter",
5476
+ "donut-chart",
5477
+ "dropdown-filter",
5478
+ "dynamic-imageobject",
5479
+ "evolution-number",
5480
+ "funnel-chart",
5481
+ "heat-map",
5482
+ "heat-table",
5483
+ "hexbin-map",
5484
+ "iframeobject",
5485
+ "image",
5486
+ "line-chart",
5487
+ "line-chart-forecast",
5488
+ "marker-map",
5489
+ "conditional-number",
5490
+ "ohlc-chart",
5491
+ "parallel-coordinates-plot",
5469
5492
  "pivot-table",
5470
- "textobject",
5493
+ "pyramid-chart",
5494
+ "radar-chart",
5471
5495
  "regular-table",
5472
- "donut",
5473
- "line-chart",
5474
- "imageobject",
5475
- "number-conditional",
5476
- "combination-chart",
5477
- "spacer",
5478
- "boxplot",
5479
- "circle-gauge",
5480
- "treemap",
5481
- "choropleth",
5482
- "symbolmap",
5483
- "routemap",
5484
- "markermap",
5485
- "hexbinmap",
5486
- "heatmap",
5487
- "spikemap",
5488
- "heattable",
5489
- "bullet",
5490
- "funnel",
5491
- "sunburst",
5492
- "bubble-chart",
5493
- "sankey",
5496
+ "route-map",
5497
+ "sankey-diagram",
5494
5498
  "scatter-plot",
5495
- "speedometer",
5496
- "circle-pack",
5497
- "radar-chart",
5498
- "pyramid",
5499
- "parallel-coord",
5500
- "ohlc",
5499
+ "slicer-filter",
5500
+ "slider-filter",
5501
+ "spacer",
5502
+ "speedometer-chart",
5503
+ "spike-map",
5501
5504
  "strip-plot",
5502
- "wordcloud",
5503
- "videoobject",
5504
- "venn-diagram"
5505
+ "sunburst-chart",
5506
+ "symbol-map",
5507
+ "text",
5508
+ "treemap-chart",
5509
+ "venn-diagram",
5510
+ "video",
5511
+ "wordcloud-chart"
5505
5512
  ]);
5506
5513
  var slotsParser = z.array(slotParser);
5507
5514
  var vizItemOptionsParser = z.object({
@@ -5535,7 +5542,8 @@ var libraryTypeToWebComponentTypeMapping = {
5535
5542
  canFilter: "can-filter",
5536
5543
  filters: "filters",
5537
5544
  dashboardId: "dashboard-id",
5538
- itemId: "item-id"
5545
+ itemId: "item-id",
5546
+ libVersion: "lib-version"
5539
5547
  };
5540
5548
 
5541
5549
  // libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
@@ -5970,7 +5978,7 @@ var o5 = e6(class extends i4 {
5970
5978
  });
5971
5979
 
5972
5980
  // libs/embed-libs/embed/package.json
5973
- var version = "5.1.3-beta.5";
5981
+ var version = "5.1.3-beta.8";
5974
5982
 
5975
5983
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
5976
5984
  var LuzmoService = class {
@@ -7132,13 +7140,9 @@ var LuzmoBaseVizItem = class extends s3 {
7132
7140
  this.appServer = "https://app.luzmo.com";
7133
7141
  this.apiHost = "https://api.luzmo.com";
7134
7142
  this.slots = [];
7135
- this.options = {
7136
- title: {
7137
- en: ""
7138
- },
7139
- theme: "default"
7140
- };
7141
7143
  this.version = version + "-wc-luzmo";
7144
+ this.libVersion = version + "-wc-luzmo";
7145
+ this.postInitCallQueue = [];
7142
7146
  }
7143
7147
  static {
7144
7148
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -7153,6 +7157,32 @@ var LuzmoBaseVizItem = class extends s3 {
7153
7157
  canInitializeVizItem() {
7154
7158
  return !!(this.type || this.dashboardId && this.itemId);
7155
7159
  }
7160
+ getFilters() {
7161
+ return this.chartElement.getFilters();
7162
+ }
7163
+ export() {
7164
+ return this.chartElement.export();
7165
+ }
7166
+ getData() {
7167
+ return this.chartElement.getData();
7168
+ }
7169
+ refreshData() {
7170
+ return this.chartElement.refreshData();
7171
+ }
7172
+ setFilters(filterInput) {
7173
+ return this.chartElement.setFilters(void 0, filterInput);
7174
+ }
7175
+ attributeChangedCallback(name, _old, value) {
7176
+ super.attributeChangedCallback(name, _old, value);
7177
+ console.log(name, value);
7178
+ if (name === "selecteddata") {
7179
+ if (this.chartElement) {
7180
+ this.setFilters(JSON.parse(value ?? "{}"));
7181
+ } else {
7182
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
7183
+ }
7184
+ }
7185
+ }
7156
7186
  async firstUpdated(_changedProperties) {
7157
7187
  super.firstUpdated(_changedProperties);
7158
7188
  if (this.canInitializeVizItem()) {
@@ -7164,6 +7194,15 @@ var LuzmoBaseVizItem = class extends s3 {
7164
7194
  if (!this.chartElement) {
7165
7195
  this.chartElement = document.createElement("chart-component");
7166
7196
  this.chartElement.setAttribute("embedding-mode", "chart");
7197
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
7198
+ this.chartElement.addEventListener("rendered", (payload) => {
7199
+ for (const functionToCall of this.postInitCallQueue) {
7200
+ functionToCall[0].bind(this)(...functionToCall[1]);
7201
+ }
7202
+ this.dispatchEvent(new CustomEvent("rendered", payload));
7203
+ });
7204
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
7205
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
7167
7206
  this.updateVizItemProperties();
7168
7207
  this.renderRoot.append(this.chartElement);
7169
7208
  }
@@ -7269,6 +7308,12 @@ __decorateClass([
7269
7308
  __decorateClass([
7270
7309
  n3()
7271
7310
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
7311
+ __decorateClass([
7312
+ n3({ type: Object })
7313
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
7314
+ __decorateClass([
7315
+ n3()
7316
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
7272
7317
 
7273
7318
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
7274
7319
  var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
@@ -5463,46 +5463,53 @@ var slotParser = z.object({
5463
5463
  )
5464
5464
  });
5465
5465
  var itemTypeParser = z.enum([
5466
+ "area-chart",
5466
5467
  "bar-chart",
5468
+ "bubble-chart",
5469
+ "box-plot",
5470
+ "bullet-chart",
5471
+ "choropleth-map",
5472
+ "circular-gauge",
5473
+ "circle-pack-chart",
5467
5474
  "column-chart",
5468
- "area-chart",
5469
- "one-number",
5475
+ "combination-chart",
5476
+ "date-filter",
5477
+ "donut-chart",
5478
+ "dropdown-filter",
5479
+ "dynamic-imageobject",
5480
+ "evolution-number",
5481
+ "funnel-chart",
5482
+ "heat-map",
5483
+ "heat-table",
5484
+ "hexbin-map",
5485
+ "iframeobject",
5486
+ "image",
5487
+ "line-chart",
5488
+ "line-chart-forecast",
5489
+ "marker-map",
5490
+ "conditional-number",
5491
+ "ohlc-chart",
5492
+ "parallel-coordinates-plot",
5470
5493
  "pivot-table",
5471
- "textobject",
5494
+ "pyramid-chart",
5495
+ "radar-chart",
5472
5496
  "regular-table",
5473
- "donut",
5474
- "line-chart",
5475
- "imageobject",
5476
- "number-conditional",
5477
- "combination-chart",
5478
- "spacer",
5479
- "boxplot",
5480
- "circle-gauge",
5481
- "treemap",
5482
- "choropleth",
5483
- "symbolmap",
5484
- "routemap",
5485
- "markermap",
5486
- "hexbinmap",
5487
- "heatmap",
5488
- "spikemap",
5489
- "heattable",
5490
- "bullet",
5491
- "funnel",
5492
- "sunburst",
5493
- "bubble-chart",
5494
- "sankey",
5497
+ "route-map",
5498
+ "sankey-diagram",
5495
5499
  "scatter-plot",
5496
- "speedometer",
5497
- "circle-pack",
5498
- "radar-chart",
5499
- "pyramid",
5500
- "parallel-coord",
5501
- "ohlc",
5500
+ "slicer-filter",
5501
+ "slider-filter",
5502
+ "spacer",
5503
+ "speedometer-chart",
5504
+ "spike-map",
5502
5505
  "strip-plot",
5503
- "wordcloud",
5504
- "videoobject",
5505
- "venn-diagram"
5506
+ "sunburst-chart",
5507
+ "symbol-map",
5508
+ "text",
5509
+ "treemap-chart",
5510
+ "venn-diagram",
5511
+ "video",
5512
+ "wordcloud-chart"
5506
5513
  ]);
5507
5514
  var slotsParser = z.array(slotParser);
5508
5515
  var vizItemOptionsParser = z.object({
@@ -5536,7 +5543,8 @@ var libraryTypeToWebComponentTypeMapping = {
5536
5543
  canFilter: "can-filter",
5537
5544
  filters: "filters",
5538
5545
  dashboardId: "dashboard-id",
5539
- itemId: "item-id"
5546
+ itemId: "item-id",
5547
+ libVersion: "lib-version"
5540
5548
  };
5541
5549
 
5542
5550
  // libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
@@ -5971,7 +5979,7 @@ var o5 = e6(class extends i4 {
5971
5979
  });
5972
5980
 
5973
5981
  // libs/embed-libs/embed/package.json
5974
- var version = "5.1.3-beta.5";
5982
+ var version = "5.1.3-beta.8";
5975
5983
 
5976
5984
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
5977
5985
  var LuzmoService = class {
@@ -7138,13 +7146,9 @@ var LuzmoBaseVizItem = class extends s3 {
7138
7146
  this.appServer = "https://app.luzmo.com";
7139
7147
  this.apiHost = "https://api.luzmo.com";
7140
7148
  this.slots = [];
7141
- this.options = {
7142
- title: {
7143
- en: ""
7144
- },
7145
- theme: "default"
7146
- };
7147
7149
  this.version = version + "-wc-luzmo";
7150
+ this.libVersion = version + "-wc-luzmo";
7151
+ this.postInitCallQueue = [];
7148
7152
  }
7149
7153
  static {
7150
7154
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -7159,6 +7163,32 @@ var LuzmoBaseVizItem = class extends s3 {
7159
7163
  canInitializeVizItem() {
7160
7164
  return !!(this.type || this.dashboardId && this.itemId);
7161
7165
  }
7166
+ getFilters() {
7167
+ return this.chartElement.getFilters();
7168
+ }
7169
+ export() {
7170
+ return this.chartElement.export();
7171
+ }
7172
+ getData() {
7173
+ return this.chartElement.getData();
7174
+ }
7175
+ refreshData() {
7176
+ return this.chartElement.refreshData();
7177
+ }
7178
+ setFilters(filterInput) {
7179
+ return this.chartElement.setFilters(void 0, filterInput);
7180
+ }
7181
+ attributeChangedCallback(name, _old, value) {
7182
+ super.attributeChangedCallback(name, _old, value);
7183
+ console.log(name, value);
7184
+ if (name === "selecteddata") {
7185
+ if (this.chartElement) {
7186
+ this.setFilters(JSON.parse(value ?? "{}"));
7187
+ } else {
7188
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
7189
+ }
7190
+ }
7191
+ }
7162
7192
  async firstUpdated(_changedProperties) {
7163
7193
  super.firstUpdated(_changedProperties);
7164
7194
  if (this.canInitializeVizItem()) {
@@ -7170,6 +7200,15 @@ var LuzmoBaseVizItem = class extends s3 {
7170
7200
  if (!this.chartElement) {
7171
7201
  this.chartElement = document.createElement("chart-component");
7172
7202
  this.chartElement.setAttribute("embedding-mode", "chart");
7203
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
7204
+ this.chartElement.addEventListener("rendered", (payload) => {
7205
+ for (const functionToCall of this.postInitCallQueue) {
7206
+ functionToCall[0].bind(this)(...functionToCall[1]);
7207
+ }
7208
+ this.dispatchEvent(new CustomEvent("rendered", payload));
7209
+ });
7210
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
7211
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
7173
7212
  this.updateVizItemProperties();
7174
7213
  this.renderRoot.append(this.chartElement);
7175
7214
  }
@@ -7275,6 +7314,12 @@ __decorateClass([
7275
7314
  __decorateClass([
7276
7315
  n3()
7277
7316
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
7317
+ __decorateClass([
7318
+ n3({ type: Object })
7319
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
7320
+ __decorateClass([
7321
+ n3()
7322
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
7278
7323
 
7279
7324
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
7280
7325
  var LuzmoVizItem = class extends LuzmoBaseVizItem {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@luzmo/embed",
3
- "version": "5.1.3-beta.5",
3
+ "version": "5.1.3-beta.8",
4
4
  "dependencies": {
5
5
  "lit": "3.1.2",
6
- "@luzmo/shared-embed": "5.0.8-beta.5",
6
+ "@luzmo/shared-embed": "5.0.8-beta.7",
7
7
  "zod-validation-error": "3.2.0"
8
8
  },
9
9
  "type": "module",
@@ -1,10 +1,11 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import * as SharedLib from '@luzmo/shared-embed';
3
+ type FunctionCall = [(...args: any) => any, any[]];
3
4
  export declare class LuzmoBaseVizItem extends LitElement implements SharedLib.LuzmoVizItemComponentInterface {
4
- appServer: string;
5
- apiHost: string;
6
- slots: SharedLib.Slots;
7
- options: SharedLib.VizItemOptions;
5
+ appServer?: string;
6
+ apiHost?: string;
7
+ slots?: SharedLib.Slots;
8
+ options?: SharedLib.VizItemOptions;
8
9
  type?: SharedLib.ItemType;
9
10
  authKey?: string;
10
11
  authToken?: string;
@@ -14,14 +15,26 @@ export declare class LuzmoBaseVizItem extends LitElement implements SharedLib.Lu
14
15
  filters?: SharedLib.FilterGroup[];
15
16
  dashboardId?: string;
16
17
  itemId?: string;
17
- chartElement: HTMLElement;
18
+ selectedData: SharedLib.FilterInput;
19
+ libVersion?: string;
20
+ chartElement: HTMLElement & Partial<SharedLib.LuzmoVizItemComponentInterface> & {
21
+ setFilters?: (itemId?: string, filters?: SharedLib.FilterInput) => SharedLib.SetFilters;
22
+ };
23
+ postInitCallQueue: FunctionCall[];
18
24
  static styles: import("lit").CSSResult;
19
25
  constructor();
20
26
  canInitializeVizItem(): boolean;
27
+ getFilters(): SharedLib.FilterGroup[];
28
+ export(): void;
29
+ getData(): any;
30
+ refreshData(): void;
31
+ setFilters(filterInput: SharedLib.FilterInput): SharedLib.SetFilters;
32
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
21
33
  protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
22
34
  private createAndAppendElement;
23
35
  private updateVizItemProperties;
24
36
  updated(changedProperties: PropertyValues): Promise<void>;
25
- parseAndValidate(key: keyof this): void;
37
+ private parseAndValidate;
26
38
  protected render(): unknown;
27
39
  }
40
+ export {};