@luzmo/embed 5.1.3-beta.6 → 5.1.3-beta.9

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.6";
59
+ var version = "5.1.3-beta.9";
60
60
 
61
61
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
62
62
  var LuzmoService = class {
@@ -1075,6 +1075,8 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1075
1075
  this.apiHost = "https://api.luzmo.com";
1076
1076
  this.slots = [];
1077
1077
  this.version = version + "-wc-luzmo";
1078
+ this.libVersion = version + "-wc-luzmo";
1079
+ this.postInitCallQueue = [];
1078
1080
  }
1079
1081
  static {
1080
1082
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -1089,6 +1091,32 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1089
1091
  canInitializeVizItem() {
1090
1092
  return !!(this.type || this.dashboardId && this.itemId);
1091
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
+ }
1092
1120
  async firstUpdated(_changedProperties) {
1093
1121
  super.firstUpdated(_changedProperties);
1094
1122
  if (this.canInitializeVizItem()) {
@@ -1100,6 +1128,16 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1100
1128
  if (!this.chartElement) {
1101
1129
  this.chartElement = document.createElement("chart-component");
1102
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)));
1140
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
1103
1141
  this.updateVizItemProperties();
1104
1142
  this.renderRoot.append(this.chartElement);
1105
1143
  }
@@ -1205,6 +1243,12 @@ __decorateClass([
1205
1243
  __decorateClass([
1206
1244
  (0, import_decorators3.property)()
1207
1245
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1246
+ __decorateClass([
1247
+ (0, import_decorators3.property)({ type: Object })
1248
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
1249
+ __decorateClass([
1250
+ (0, import_decorators3.property)()
1251
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
1208
1252
 
1209
1253
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
1210
1254
  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.6";
37
+ var version = "5.1.3-beta.9";
38
38
 
39
39
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
40
40
  var LuzmoService = class {
@@ -1053,6 +1053,8 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1053
1053
  this.apiHost = "https://api.luzmo.com";
1054
1054
  this.slots = [];
1055
1055
  this.version = version + "-wc-luzmo";
1056
+ this.libVersion = version + "-wc-luzmo";
1057
+ this.postInitCallQueue = [];
1056
1058
  }
1057
1059
  static {
1058
1060
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -1067,6 +1069,32 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1067
1069
  canInitializeVizItem() {
1068
1070
  return !!(this.type || this.dashboardId && this.itemId);
1069
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
+ }
1070
1098
  async firstUpdated(_changedProperties) {
1071
1099
  super.firstUpdated(_changedProperties);
1072
1100
  if (this.canInitializeVizItem()) {
@@ -1078,6 +1106,16 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1078
1106
  if (!this.chartElement) {
1079
1107
  this.chartElement = document.createElement("chart-component");
1080
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)));
1118
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
1081
1119
  this.updateVizItemProperties();
1082
1120
  this.renderRoot.append(this.chartElement);
1083
1121
  }
@@ -1183,6 +1221,12 @@ __decorateClass([
1183
1221
  __decorateClass([
1184
1222
  property2()
1185
1223
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1224
+ __decorateClass([
1225
+ property2({ type: Object })
1226
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
1227
+ __decorateClass([
1228
+ property2()
1229
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
1186
1230
 
1187
1231
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
1188
1232
  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.6";
58
+ var version = "5.1.3-beta.9";
59
59
 
60
60
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
61
61
  var LuzmoService = class {
@@ -1069,6 +1069,8 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1069
1069
  this.apiHost = "https://api.luzmo.com";
1070
1070
  this.slots = [];
1071
1071
  this.version = version + "-wc-luzmo";
1072
+ this.libVersion = version + "-wc-luzmo";
1073
+ this.postInitCallQueue = [];
1072
1074
  }
1073
1075
  static {
1074
1076
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -1083,6 +1085,32 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1083
1085
  canInitializeVizItem() {
1084
1086
  return !!(this.type || this.dashboardId && this.itemId);
1085
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
+ }
1086
1114
  async firstUpdated(_changedProperties) {
1087
1115
  super.firstUpdated(_changedProperties);
1088
1116
  if (this.canInitializeVizItem()) {
@@ -1094,6 +1122,16 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1094
1122
  if (!this.chartElement) {
1095
1123
  this.chartElement = document.createElement("chart-component");
1096
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)));
1134
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
1097
1135
  this.updateVizItemProperties();
1098
1136
  this.renderRoot.append(this.chartElement);
1099
1137
  }
@@ -1199,6 +1237,12 @@ __decorateClass([
1199
1237
  __decorateClass([
1200
1238
  (0, import_decorators3.property)()
1201
1239
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1240
+ __decorateClass([
1241
+ (0, import_decorators3.property)({ type: Object })
1242
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
1243
+ __decorateClass([
1244
+ (0, import_decorators3.property)()
1245
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
1202
1246
 
1203
1247
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1204
1248
  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.6";
35
+ var version = "5.1.3-beta.9";
36
36
 
37
37
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
38
38
  var LuzmoService = class {
@@ -1046,6 +1046,8 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1046
1046
  this.apiHost = "https://api.luzmo.com";
1047
1047
  this.slots = [];
1048
1048
  this.version = version + "-wc-luzmo";
1049
+ this.libVersion = version + "-wc-luzmo";
1050
+ this.postInitCallQueue = [];
1049
1051
  }
1050
1052
  static {
1051
1053
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -1060,6 +1062,32 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1060
1062
  canInitializeVizItem() {
1061
1063
  return !!(this.type || this.dashboardId && this.itemId);
1062
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
+ }
1063
1091
  async firstUpdated(_changedProperties) {
1064
1092
  super.firstUpdated(_changedProperties);
1065
1093
  if (this.canInitializeVizItem()) {
@@ -1071,6 +1099,16 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1071
1099
  if (!this.chartElement) {
1072
1100
  this.chartElement = document.createElement("chart-component");
1073
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)));
1111
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
1074
1112
  this.updateVizItemProperties();
1075
1113
  this.renderRoot.append(this.chartElement);
1076
1114
  }
@@ -1176,6 +1214,12 @@ __decorateClass([
1176
1214
  __decorateClass([
1177
1215
  property2()
1178
1216
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
1217
+ __decorateClass([
1218
+ property2({ type: Object })
1219
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
1220
+ __decorateClass([
1221
+ property2()
1222
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
1179
1223
 
1180
1224
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1181
1225
  var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
@@ -1,5 +1,6 @@
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
5
  appServer?: string;
5
6
  apiHost?: 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.6";
5981
+ var version = "5.1.3-beta.9";
5974
5982
 
5975
5983
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
5976
5984
  var LuzmoService = class {
@@ -7133,6 +7141,8 @@ var LuzmoBaseVizItem = class extends s3 {
7133
7141
  this.apiHost = "https://api.luzmo.com";
7134
7142
  this.slots = [];
7135
7143
  this.version = version + "-wc-luzmo";
7144
+ this.libVersion = version + "-wc-luzmo";
7145
+ this.postInitCallQueue = [];
7136
7146
  }
7137
7147
  static {
7138
7148
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -7147,6 +7157,32 @@ var LuzmoBaseVizItem = class extends s3 {
7147
7157
  canInitializeVizItem() {
7148
7158
  return !!(this.type || this.dashboardId && this.itemId);
7149
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
+ }
7150
7186
  async firstUpdated(_changedProperties) {
7151
7187
  super.firstUpdated(_changedProperties);
7152
7188
  if (this.canInitializeVizItem()) {
@@ -7158,6 +7194,16 @@ var LuzmoBaseVizItem = class extends s3 {
7158
7194
  if (!this.chartElement) {
7159
7195
  this.chartElement = document.createElement("chart-component");
7160
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)));
7206
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
7161
7207
  this.updateVizItemProperties();
7162
7208
  this.renderRoot.append(this.chartElement);
7163
7209
  }
@@ -7263,6 +7309,12 @@ __decorateClass([
7263
7309
  __decorateClass([
7264
7310
  n3()
7265
7311
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
7312
+ __decorateClass([
7313
+ n3({ type: Object })
7314
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
7315
+ __decorateClass([
7316
+ n3()
7317
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
7266
7318
 
7267
7319
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
7268
7320
  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.6";
5982
+ var version = "5.1.3-beta.9";
5975
5983
 
5976
5984
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
5977
5985
  var LuzmoService = class {
@@ -7139,6 +7147,8 @@ var LuzmoBaseVizItem = class extends s3 {
7139
7147
  this.apiHost = "https://api.luzmo.com";
7140
7148
  this.slots = [];
7141
7149
  this.version = version + "-wc-luzmo";
7150
+ this.libVersion = version + "-wc-luzmo";
7151
+ this.postInitCallQueue = [];
7142
7152
  }
7143
7153
  static {
7144
7154
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -7153,6 +7163,32 @@ var LuzmoBaseVizItem = class extends s3 {
7153
7163
  canInitializeVizItem() {
7154
7164
  return !!(this.type || this.dashboardId && this.itemId);
7155
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
+ }
7156
7192
  async firstUpdated(_changedProperties) {
7157
7193
  super.firstUpdated(_changedProperties);
7158
7194
  if (this.canInitializeVizItem()) {
@@ -7164,6 +7200,16 @@ var LuzmoBaseVizItem = class extends s3 {
7164
7200
  if (!this.chartElement) {
7165
7201
  this.chartElement = document.createElement("chart-component");
7166
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)));
7212
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
7167
7213
  this.updateVizItemProperties();
7168
7214
  this.renderRoot.append(this.chartElement);
7169
7215
  }
@@ -7269,6 +7315,12 @@ __decorateClass([
7269
7315
  __decorateClass([
7270
7316
  n3()
7271
7317
  ], LuzmoBaseVizItem.prototype, "itemId", 2);
7318
+ __decorateClass([
7319
+ n3({ type: Object })
7320
+ ], LuzmoBaseVizItem.prototype, "selectedData", 2);
7321
+ __decorateClass([
7322
+ n3()
7323
+ ], LuzmoBaseVizItem.prototype, "libVersion", 2);
7272
7324
 
7273
7325
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
7274
7326
  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.6",
3
+ "version": "5.1.3-beta.9",
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.8",
7
7
  "zod-validation-error": "3.2.0"
8
8
  },
9
9
  "type": "module",
@@ -1,5 +1,6 @@
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
5
  appServer?: string;
5
6
  apiHost?: 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 {};