@luzmo/embed 5.1.3-beta.1 → 5.1.3-beta.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/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.1";
59
+ var version = "5.1.3-beta.10";
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.
@@ -1092,9 +1088,37 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1092
1088
  }
1093
1089
  `;
1094
1090
  }
1091
+ canInitializeVizItem() {
1092
+ return !!(this.type || this.dashboardId && this.itemId);
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
+ if (name === "selecteddata") {
1112
+ if (this.chartElement) {
1113
+ this.setFilters(JSON.parse(value ?? "{}"));
1114
+ } else {
1115
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
1116
+ }
1117
+ }
1118
+ }
1095
1119
  async firstUpdated(_changedProperties) {
1096
1120
  super.firstUpdated(_changedProperties);
1097
- if (this.type) {
1121
+ if (this.canInitializeVizItem()) {
1098
1122
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1099
1123
  this.createAndAppendElement();
1100
1124
  }
@@ -1103,6 +1127,16 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1103
1127
  if (!this.chartElement) {
1104
1128
  this.chartElement = document.createElement("chart-component");
1105
1129
  this.chartElement.setAttribute("embedding-mode", "chart");
1130
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
1131
+ this.chartElement.addEventListener("rendered", (payload) => {
1132
+ for (const functionToCall of this.postInitCallQueue) {
1133
+ functionToCall[0].bind(this)(...functionToCall[1]);
1134
+ }
1135
+ this.dispatchEvent(new CustomEvent("rendered", payload));
1136
+ });
1137
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
1138
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
1139
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
1106
1140
  this.updateVizItemProperties();
1107
1141
  this.renderRoot.append(this.chartElement);
1108
1142
  }
@@ -1131,8 +1165,10 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1131
1165
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1132
1166
  }
1133
1167
  } else {
1134
- if (this.type) {
1135
- SharedLib3.itemTypeParser.parse(this.type);
1168
+ if (this.canInitializeVizItem()) {
1169
+ if (this.type) {
1170
+ this.parseAndValidate("type");
1171
+ }
1136
1172
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1137
1173
  this.createAndAppendElement();
1138
1174
  }
@@ -1146,11 +1182,13 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1146
1182
  SharedLib3.vizItemOptionsParser.parse(this.options);
1147
1183
  } else if (key === "canFilter") {
1148
1184
  SharedLib3.canFilterParser.parse(this.canFilter);
1185
+ } else if (key === "type") {
1186
+ SharedLib3.itemTypeParser.parse(this.type);
1149
1187
  }
1150
1188
  } catch (err) {
1151
1189
  const validationError = (0, import_zod_validation_error.fromError)(err);
1152
- console.error(err);
1153
- console.error(validationError.toString());
1190
+ console.warn(err);
1191
+ console.warn(validationError.toString());
1154
1192
  }
1155
1193
  }
1156
1194
  render() {
@@ -1198,6 +1236,18 @@ __decorateClass([
1198
1236
  __decorateClass([
1199
1237
  (0, import_decorators3.property)({ type: Array })
1200
1238
  ], LuzmoBaseVizItem.prototype, "filters", 2);
1239
+ __decorateClass([
1240
+ (0, import_decorators3.property)()
1241
+ ], LuzmoBaseVizItem.prototype, "dashboardId", 2);
1242
+ __decorateClass([
1243
+ (0, import_decorators3.property)()
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);
1201
1251
 
1202
1252
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
1203
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.1";
37
+ var version = "5.1.3-beta.10";
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.
@@ -1070,9 +1066,37 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1070
1066
  }
1071
1067
  `;
1072
1068
  }
1069
+ canInitializeVizItem() {
1070
+ return !!(this.type || this.dashboardId && this.itemId);
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
+ if (name === "selecteddata") {
1090
+ if (this.chartElement) {
1091
+ this.setFilters(JSON.parse(value ?? "{}"));
1092
+ } else {
1093
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
1094
+ }
1095
+ }
1096
+ }
1073
1097
  async firstUpdated(_changedProperties) {
1074
1098
  super.firstUpdated(_changedProperties);
1075
- if (this.type) {
1099
+ if (this.canInitializeVizItem()) {
1076
1100
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1077
1101
  this.createAndAppendElement();
1078
1102
  }
@@ -1081,6 +1105,16 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1081
1105
  if (!this.chartElement) {
1082
1106
  this.chartElement = document.createElement("chart-component");
1083
1107
  this.chartElement.setAttribute("embedding-mode", "chart");
1108
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
1109
+ this.chartElement.addEventListener("rendered", (payload) => {
1110
+ for (const functionToCall of this.postInitCallQueue) {
1111
+ functionToCall[0].bind(this)(...functionToCall[1]);
1112
+ }
1113
+ this.dispatchEvent(new CustomEvent("rendered", payload));
1114
+ });
1115
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
1116
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
1117
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
1084
1118
  this.updateVizItemProperties();
1085
1119
  this.renderRoot.append(this.chartElement);
1086
1120
  }
@@ -1109,8 +1143,10 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1109
1143
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1110
1144
  }
1111
1145
  } else {
1112
- if (this.type) {
1113
- SharedLib3.itemTypeParser.parse(this.type);
1146
+ if (this.canInitializeVizItem()) {
1147
+ if (this.type) {
1148
+ this.parseAndValidate("type");
1149
+ }
1114
1150
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1115
1151
  this.createAndAppendElement();
1116
1152
  }
@@ -1124,11 +1160,13 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1124
1160
  SharedLib3.vizItemOptionsParser.parse(this.options);
1125
1161
  } else if (key === "canFilter") {
1126
1162
  SharedLib3.canFilterParser.parse(this.canFilter);
1163
+ } else if (key === "type") {
1164
+ SharedLib3.itemTypeParser.parse(this.type);
1127
1165
  }
1128
1166
  } catch (err) {
1129
1167
  const validationError = fromError(err);
1130
- console.error(err);
1131
- console.error(validationError.toString());
1168
+ console.warn(err);
1169
+ console.warn(validationError.toString());
1132
1170
  }
1133
1171
  }
1134
1172
  render() {
@@ -1176,6 +1214,18 @@ __decorateClass([
1176
1214
  __decorateClass([
1177
1215
  property2({ type: Array })
1178
1216
  ], LuzmoBaseVizItem.prototype, "filters", 2);
1217
+ __decorateClass([
1218
+ property2()
1219
+ ], LuzmoBaseVizItem.prototype, "dashboardId", 2);
1220
+ __decorateClass([
1221
+ property2()
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);
1179
1229
 
1180
1230
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
1181
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.1";
58
+ var version = "5.1.3-beta.10";
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.
@@ -1086,9 +1082,37 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1086
1082
  }
1087
1083
  `;
1088
1084
  }
1085
+ canInitializeVizItem() {
1086
+ return !!(this.type || this.dashboardId && this.itemId);
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
+ if (name === "selecteddata") {
1106
+ if (this.chartElement) {
1107
+ this.setFilters(JSON.parse(value ?? "{}"));
1108
+ } else {
1109
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
1110
+ }
1111
+ }
1112
+ }
1089
1113
  async firstUpdated(_changedProperties) {
1090
1114
  super.firstUpdated(_changedProperties);
1091
- if (this.type) {
1115
+ if (this.canInitializeVizItem()) {
1092
1116
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1093
1117
  this.createAndAppendElement();
1094
1118
  }
@@ -1097,6 +1121,16 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1097
1121
  if (!this.chartElement) {
1098
1122
  this.chartElement = document.createElement("chart-component");
1099
1123
  this.chartElement.setAttribute("embedding-mode", "chart");
1124
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
1125
+ this.chartElement.addEventListener("rendered", (payload) => {
1126
+ for (const functionToCall of this.postInitCallQueue) {
1127
+ functionToCall[0].bind(this)(...functionToCall[1]);
1128
+ }
1129
+ this.dispatchEvent(new CustomEvent("rendered", payload));
1130
+ });
1131
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
1132
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
1133
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
1100
1134
  this.updateVizItemProperties();
1101
1135
  this.renderRoot.append(this.chartElement);
1102
1136
  }
@@ -1125,8 +1159,10 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1125
1159
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1126
1160
  }
1127
1161
  } else {
1128
- if (this.type) {
1129
- SharedLib3.itemTypeParser.parse(this.type);
1162
+ if (this.canInitializeVizItem()) {
1163
+ if (this.type) {
1164
+ this.parseAndValidate("type");
1165
+ }
1130
1166
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1131
1167
  this.createAndAppendElement();
1132
1168
  }
@@ -1140,11 +1176,13 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1140
1176
  SharedLib3.vizItemOptionsParser.parse(this.options);
1141
1177
  } else if (key === "canFilter") {
1142
1178
  SharedLib3.canFilterParser.parse(this.canFilter);
1179
+ } else if (key === "type") {
1180
+ SharedLib3.itemTypeParser.parse(this.type);
1143
1181
  }
1144
1182
  } catch (err) {
1145
1183
  const validationError = (0, import_zod_validation_error.fromError)(err);
1146
- console.error(err);
1147
- console.error(validationError.toString());
1184
+ console.warn(err);
1185
+ console.warn(validationError.toString());
1148
1186
  }
1149
1187
  }
1150
1188
  render() {
@@ -1192,6 +1230,18 @@ __decorateClass([
1192
1230
  __decorateClass([
1193
1231
  (0, import_decorators3.property)({ type: Array })
1194
1232
  ], LuzmoBaseVizItem.prototype, "filters", 2);
1233
+ __decorateClass([
1234
+ (0, import_decorators3.property)()
1235
+ ], LuzmoBaseVizItem.prototype, "dashboardId", 2);
1236
+ __decorateClass([
1237
+ (0, import_decorators3.property)()
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);
1195
1245
 
1196
1246
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1197
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.1";
35
+ var version = "5.1.3-beta.10";
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.
@@ -1063,9 +1059,37 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1063
1059
  }
1064
1060
  `;
1065
1061
  }
1062
+ canInitializeVizItem() {
1063
+ return !!(this.type || this.dashboardId && this.itemId);
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
+ if (name === "selecteddata") {
1083
+ if (this.chartElement) {
1084
+ this.setFilters(JSON.parse(value ?? "{}"));
1085
+ } else {
1086
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
1087
+ }
1088
+ }
1089
+ }
1066
1090
  async firstUpdated(_changedProperties) {
1067
1091
  super.firstUpdated(_changedProperties);
1068
- if (this.type) {
1092
+ if (this.canInitializeVizItem()) {
1069
1093
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1070
1094
  this.createAndAppendElement();
1071
1095
  }
@@ -1074,6 +1098,16 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1074
1098
  if (!this.chartElement) {
1075
1099
  this.chartElement = document.createElement("chart-component");
1076
1100
  this.chartElement.setAttribute("embedding-mode", "chart");
1101
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
1102
+ this.chartElement.addEventListener("rendered", (payload) => {
1103
+ for (const functionToCall of this.postInitCallQueue) {
1104
+ functionToCall[0].bind(this)(...functionToCall[1]);
1105
+ }
1106
+ this.dispatchEvent(new CustomEvent("rendered", payload));
1107
+ });
1108
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
1109
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
1110
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
1077
1111
  this.updateVizItemProperties();
1078
1112
  this.renderRoot.append(this.chartElement);
1079
1113
  }
@@ -1102,8 +1136,10 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1102
1136
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1103
1137
  }
1104
1138
  } else {
1105
- if (this.type) {
1106
- SharedLib3.itemTypeParser.parse(this.type);
1139
+ if (this.canInitializeVizItem()) {
1140
+ if (this.type) {
1141
+ this.parseAndValidate("type");
1142
+ }
1107
1143
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1108
1144
  this.createAndAppendElement();
1109
1145
  }
@@ -1117,11 +1153,13 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1117
1153
  SharedLib3.vizItemOptionsParser.parse(this.options);
1118
1154
  } else if (key === "canFilter") {
1119
1155
  SharedLib3.canFilterParser.parse(this.canFilter);
1156
+ } else if (key === "type") {
1157
+ SharedLib3.itemTypeParser.parse(this.type);
1120
1158
  }
1121
1159
  } catch (err) {
1122
1160
  const validationError = fromError(err);
1123
- console.error(err);
1124
- console.error(validationError.toString());
1161
+ console.warn(err);
1162
+ console.warn(validationError.toString());
1125
1163
  }
1126
1164
  }
1127
1165
  render() {
@@ -1169,6 +1207,18 @@ __decorateClass([
1169
1207
  __decorateClass([
1170
1208
  property2({ type: Array })
1171
1209
  ], LuzmoBaseVizItem.prototype, "filters", 2);
1210
+ __decorateClass([
1211
+ property2()
1212
+ ], LuzmoBaseVizItem.prototype, "dashboardId", 2);
1213
+ __decorateClass([
1214
+ property2()
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);
1172
1222
 
1173
1223
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1174
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
- export declare class LuzmoBaseVizItem extends LitElement {
4
- appServer: string;
5
- apiHost: string;
6
- slots: SharedLib.Slots;
7
- options: SharedLib.VizItemOptions;
3
+ type FunctionCall = [(...args: any) => any, any[]];
4
+ export declare class LuzmoBaseVizItem extends LitElement implements SharedLib.LuzmoVizItemComponentInterface {
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;
@@ -12,13 +13,28 @@ export declare class LuzmoBaseVizItem extends LitElement {
12
13
  contextId?: string;
13
14
  canFilter?: SharedLib.CanFilter;
14
15
  filters?: SharedLib.FilterGroup[];
15
- chartElement: HTMLElement;
16
+ dashboardId?: string;
17
+ itemId?: string;
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[];
16
24
  static styles: import("lit").CSSResult;
17
25
  constructor();
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;
18
33
  protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
19
34
  private createAndAppendElement;
20
35
  private updateVizItemProperties;
21
36
  updated(changedProperties: PropertyValues): Promise<void>;
22
- parseAndValidate(key: keyof this): void;
37
+ private parseAndValidate;
23
38
  protected render(): unknown;
24
39
  }
40
+ export {};
@@ -5462,50 +5462,57 @@ 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({
5508
- title: z.union([z.boolean(), z.record(z.string())]).optional(),
5515
+ title: z.record(z.string()).optional(),
5509
5516
  theme: z.union([z.string(), z.record(z.any())]).optional(),
5510
5517
  locale: z.string().optional(),
5511
5518
  html: z.record(z.string()).optional(),
@@ -5525,7 +5532,6 @@ var vizItemOptionsParser = z.object({
5525
5532
  var canFilterParser = z.union([z.array(z.string()), z.literal("all")]);
5526
5533
  var libraryTypeToWebComponentTypeMapping = {
5527
5534
  type: "type",
5528
- theme: "theme",
5529
5535
  slots: "slots",
5530
5536
  options: "options",
5531
5537
  appServer: "app-server",
@@ -5534,7 +5540,10 @@ var libraryTypeToWebComponentTypeMapping = {
5534
5540
  authToken: "auth-token",
5535
5541
  contextId: "context-id",
5536
5542
  canFilter: "can-filter",
5537
- filters: "filters"
5543
+ filters: "filters",
5544
+ dashboardId: "dashboard-id",
5545
+ itemId: "item-id",
5546
+ libVersion: "lib-version"
5538
5547
  };
5539
5548
 
5540
5549
  // libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
@@ -5969,7 +5978,7 @@ var o5 = e6(class extends i4 {
5969
5978
  });
5970
5979
 
5971
5980
  // libs/embed-libs/embed/package.json
5972
- var version = "5.1.3-beta.1";
5981
+ var version = "5.1.3-beta.10";
5973
5982
 
5974
5983
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
5975
5984
  var LuzmoService = class {
@@ -7131,13 +7140,9 @@ var LuzmoBaseVizItem = class extends s3 {
7131
7140
  this.appServer = "https://app.luzmo.com";
7132
7141
  this.apiHost = "https://api.luzmo.com";
7133
7142
  this.slots = [];
7134
- this.options = {
7135
- title: {
7136
- en: ""
7137
- },
7138
- theme: "default"
7139
- };
7140
7143
  this.version = version + "-wc-luzmo";
7144
+ this.libVersion = version + "-wc-luzmo";
7145
+ this.postInitCallQueue = [];
7141
7146
  }
7142
7147
  static {
7143
7148
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -7149,9 +7154,37 @@ var LuzmoBaseVizItem = class extends s3 {
7149
7154
  }
7150
7155
  `;
7151
7156
  }
7157
+ canInitializeVizItem() {
7158
+ return !!(this.type || this.dashboardId && this.itemId);
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
+ if (name === "selecteddata") {
7178
+ if (this.chartElement) {
7179
+ this.setFilters(JSON.parse(value ?? "{}"));
7180
+ } else {
7181
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
7182
+ }
7183
+ }
7184
+ }
7152
7185
  async firstUpdated(_changedProperties) {
7153
7186
  super.firstUpdated(_changedProperties);
7154
- if (this.type) {
7187
+ if (this.canInitializeVizItem()) {
7155
7188
  await loadLibrary(this.appServer, "DashboardApp");
7156
7189
  this.createAndAppendElement();
7157
7190
  }
@@ -7160,6 +7193,16 @@ var LuzmoBaseVizItem = class extends s3 {
7160
7193
  if (!this.chartElement) {
7161
7194
  this.chartElement = document.createElement("chart-component");
7162
7195
  this.chartElement.setAttribute("embedding-mode", "chart");
7196
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
7197
+ this.chartElement.addEventListener("rendered", (payload) => {
7198
+ for (const functionToCall of this.postInitCallQueue) {
7199
+ functionToCall[0].bind(this)(...functionToCall[1]);
7200
+ }
7201
+ this.dispatchEvent(new CustomEvent("rendered", payload));
7202
+ });
7203
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
7204
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
7205
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
7163
7206
  this.updateVizItemProperties();
7164
7207
  this.renderRoot.append(this.chartElement);
7165
7208
  }
@@ -7188,8 +7231,10 @@ var LuzmoBaseVizItem = class extends s3 {
7188
7231
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
7189
7232
  }
7190
7233
  } else {
7191
- if (this.type) {
7192
- itemTypeParser.parse(this.type);
7234
+ if (this.canInitializeVizItem()) {
7235
+ if (this.type) {
7236
+ this.parseAndValidate("type");
7237
+ }
7193
7238
  await loadLibrary(this.appServer, "DashboardApp");
7194
7239
  this.createAndAppendElement();
7195
7240
  }
@@ -7203,11 +7248,13 @@ var LuzmoBaseVizItem = class extends s3 {
7203
7248
  vizItemOptionsParser.parse(this.options);
7204
7249
  } else if (key === "canFilter") {
7205
7250
  canFilterParser.parse(this.canFilter);
7251
+ } else if (key === "type") {
7252
+ itemTypeParser.parse(this.type);
7206
7253
  }
7207
7254
  } catch (err) {
7208
7255
  const validationError = fromError(err);
7209
- console.error(err);
7210
- console.error(validationError.toString());
7256
+ console.warn(err);
7257
+ console.warn(validationError.toString());
7211
7258
  }
7212
7259
  }
7213
7260
  render() {
@@ -7255,6 +7302,18 @@ __decorateClass([
7255
7302
  __decorateClass([
7256
7303
  n3({ type: Array })
7257
7304
  ], LuzmoBaseVizItem.prototype, "filters", 2);
7305
+ __decorateClass([
7306
+ n3()
7307
+ ], LuzmoBaseVizItem.prototype, "dashboardId", 2);
7308
+ __decorateClass([
7309
+ n3()
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);
7258
7317
 
7259
7318
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
7260
7319
  var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
@@ -5463,50 +5463,57 @@ 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({
5509
- title: z.union([z.boolean(), z.record(z.string())]).optional(),
5516
+ title: z.record(z.string()).optional(),
5510
5517
  theme: z.union([z.string(), z.record(z.any())]).optional(),
5511
5518
  locale: z.string().optional(),
5512
5519
  html: z.record(z.string()).optional(),
@@ -5526,7 +5533,6 @@ var vizItemOptionsParser = z.object({
5526
5533
  var canFilterParser = z.union([z.array(z.string()), z.literal("all")]);
5527
5534
  var libraryTypeToWebComponentTypeMapping = {
5528
5535
  type: "type",
5529
- theme: "theme",
5530
5536
  slots: "slots",
5531
5537
  options: "options",
5532
5538
  appServer: "app-server",
@@ -5535,7 +5541,10 @@ var libraryTypeToWebComponentTypeMapping = {
5535
5541
  authToken: "auth-token",
5536
5542
  contextId: "context-id",
5537
5543
  canFilter: "can-filter",
5538
- filters: "filters"
5544
+ filters: "filters",
5545
+ dashboardId: "dashboard-id",
5546
+ itemId: "item-id",
5547
+ libVersion: "lib-version"
5539
5548
  };
5540
5549
 
5541
5550
  // libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
@@ -5970,7 +5979,7 @@ var o5 = e6(class extends i4 {
5970
5979
  });
5971
5980
 
5972
5981
  // libs/embed-libs/embed/package.json
5973
- var version = "5.1.3-beta.1";
5982
+ var version = "5.1.3-beta.10";
5974
5983
 
5975
5984
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
5976
5985
  var LuzmoService = class {
@@ -7137,13 +7146,9 @@ var LuzmoBaseVizItem = class extends s3 {
7137
7146
  this.appServer = "https://app.luzmo.com";
7138
7147
  this.apiHost = "https://api.luzmo.com";
7139
7148
  this.slots = [];
7140
- this.options = {
7141
- title: {
7142
- en: ""
7143
- },
7144
- theme: "default"
7145
- };
7146
7149
  this.version = version + "-wc-luzmo";
7150
+ this.libVersion = version + "-wc-luzmo";
7151
+ this.postInitCallQueue = [];
7147
7152
  }
7148
7153
  static {
7149
7154
  // Static styles to set host display to block, else it is not shown at all for some reason.
@@ -7155,9 +7160,37 @@ var LuzmoBaseVizItem = class extends s3 {
7155
7160
  }
7156
7161
  `;
7157
7162
  }
7163
+ canInitializeVizItem() {
7164
+ return !!(this.type || this.dashboardId && this.itemId);
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
+ if (name === "selecteddata") {
7184
+ if (this.chartElement) {
7185
+ this.setFilters(JSON.parse(value ?? "{}"));
7186
+ } else {
7187
+ this.postInitCallQueue.push([this.setFilters, [JSON.parse(value ?? "{}")]]);
7188
+ }
7189
+ }
7190
+ }
7158
7191
  async firstUpdated(_changedProperties) {
7159
7192
  super.firstUpdated(_changedProperties);
7160
- if (this.type) {
7193
+ if (this.canInitializeVizItem()) {
7161
7194
  await loadLibrary(this.appServer, "DashboardApp");
7162
7195
  this.createAndAppendElement();
7163
7196
  }
@@ -7166,6 +7199,16 @@ var LuzmoBaseVizItem = class extends s3 {
7166
7199
  if (!this.chartElement) {
7167
7200
  this.chartElement = document.createElement("chart-component");
7168
7201
  this.chartElement.setAttribute("embedding-mode", "chart");
7202
+ this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
7203
+ this.chartElement.addEventListener("rendered", (payload) => {
7204
+ for (const functionToCall of this.postInitCallQueue) {
7205
+ functionToCall[0].bind(this)(...functionToCall[1]);
7206
+ }
7207
+ this.dispatchEvent(new CustomEvent("rendered", payload));
7208
+ });
7209
+ this.chartElement.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
7210
+ this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
7211
+ this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
7169
7212
  this.updateVizItemProperties();
7170
7213
  this.renderRoot.append(this.chartElement);
7171
7214
  }
@@ -7194,8 +7237,10 @@ var LuzmoBaseVizItem = class extends s3 {
7194
7237
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
7195
7238
  }
7196
7239
  } else {
7197
- if (this.type) {
7198
- itemTypeParser.parse(this.type);
7240
+ if (this.canInitializeVizItem()) {
7241
+ if (this.type) {
7242
+ this.parseAndValidate("type");
7243
+ }
7199
7244
  await loadLibrary(this.appServer, "DashboardApp");
7200
7245
  this.createAndAppendElement();
7201
7246
  }
@@ -7209,11 +7254,13 @@ var LuzmoBaseVizItem = class extends s3 {
7209
7254
  vizItemOptionsParser.parse(this.options);
7210
7255
  } else if (key === "canFilter") {
7211
7256
  canFilterParser.parse(this.canFilter);
7257
+ } else if (key === "type") {
7258
+ itemTypeParser.parse(this.type);
7212
7259
  }
7213
7260
  } catch (err) {
7214
7261
  const validationError = fromError(err);
7215
- console.error(err);
7216
- console.error(validationError.toString());
7262
+ console.warn(err);
7263
+ console.warn(validationError.toString());
7217
7264
  }
7218
7265
  }
7219
7266
  render() {
@@ -7261,6 +7308,18 @@ __decorateClass([
7261
7308
  __decorateClass([
7262
7309
  n3({ type: Array })
7263
7310
  ], LuzmoBaseVizItem.prototype, "filters", 2);
7311
+ __decorateClass([
7312
+ n3()
7313
+ ], LuzmoBaseVizItem.prototype, "dashboardId", 2);
7314
+ __decorateClass([
7315
+ n3()
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);
7264
7323
 
7265
7324
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
7266
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.1",
3
+ "version": "5.1.3-beta.10",
4
4
  "dependencies": {
5
5
  "lit": "3.1.2",
6
- "@luzmo/shared-embed": "5.0.8-beta.3",
6
+ "@luzmo/shared-embed": "5.0.8-beta.8",
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
- export declare class LuzmoBaseVizItem extends LitElement {
4
- appServer: string;
5
- apiHost: string;
6
- slots: SharedLib.Slots;
7
- options: SharedLib.VizItemOptions;
3
+ type FunctionCall = [(...args: any) => any, any[]];
4
+ export declare class LuzmoBaseVizItem extends LitElement implements SharedLib.LuzmoVizItemComponentInterface {
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;
@@ -12,13 +13,28 @@ export declare class LuzmoBaseVizItem extends LitElement {
12
13
  contextId?: string;
13
14
  canFilter?: SharedLib.CanFilter;
14
15
  filters?: SharedLib.FilterGroup[];
15
- chartElement: HTMLElement;
16
+ dashboardId?: string;
17
+ itemId?: string;
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[];
16
24
  static styles: import("lit").CSSResult;
17
25
  constructor();
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;
18
33
  protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
19
34
  private createAndAppendElement;
20
35
  private updateVizItemProperties;
21
36
  updated(changedProperties: PropertyValues): Promise<void>;
22
- parseAndValidate(key: keyof this): void;
37
+ private parseAndValidate;
23
38
  protected render(): unknown;
24
39
  }
40
+ export {};