@luzmo/embed 5.0.14-beta.4 → 5.0.14-beta.5

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
@@ -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.0.14-beta.4";
58
+ var version = "5.0.14-beta.5";
59
59
 
60
60
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
61
61
  var LuzmoService = class {
@@ -1129,10 +1129,17 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1129
1129
  async firstUpdated(_changedProperties) {
1130
1130
  super.firstUpdated(_changedProperties);
1131
1131
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1132
- this.chartElement = document.createElement("chart-component");
1133
- this.chartElement.setAttribute("embedding-mode", "chart");
1134
- this.updateVizItemProperties();
1135
- this.renderRoot.append(this.chartElement);
1132
+ if (this.type) {
1133
+ this.createAndAppendElement();
1134
+ }
1135
+ }
1136
+ createAndAppendElement() {
1137
+ if (!this.chartElement) {
1138
+ this.chartElement = document.createElement("chart-component");
1139
+ this.chartElement.setAttribute("embedding-mode", "chart");
1140
+ this.updateVizItemProperties();
1141
+ this.renderRoot.append(this.chartElement);
1142
+ }
1136
1143
  }
1137
1144
  updateVizItemProperties() {
1138
1145
  if (this.chartElement) {
@@ -1150,11 +1157,19 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1150
1157
  }
1151
1158
  updated(changedProperties) {
1152
1159
  if (this.chartElement) {
1153
- this.updateVizItemProperties();
1160
+ for (const [propertyName] of changedProperties.entries()) {
1161
+ const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1162
+ const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1163
+ this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1164
+ }
1165
+ } else {
1166
+ if (this.type) {
1167
+ this.createAndAppendElement();
1168
+ }
1154
1169
  }
1155
1170
  }
1156
1171
  render() {
1157
- return import_lit3.html``;
1172
+ return import_lit3.html` `;
1158
1173
  }
1159
1174
  };
1160
1175
  __decorateClass([
package/index.js CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  } from "@luzmo/shared-embed";
38
38
 
39
39
  // libs/embed-libs/embed/package.json
40
- var version = "5.0.14-beta.4";
40
+ var version = "5.0.14-beta.5";
41
41
 
42
42
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
43
43
  var LuzmoService = class {
@@ -1111,10 +1111,17 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1111
1111
  async firstUpdated(_changedProperties) {
1112
1112
  super.firstUpdated(_changedProperties);
1113
1113
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1114
- this.chartElement = document.createElement("chart-component");
1115
- this.chartElement.setAttribute("embedding-mode", "chart");
1116
- this.updateVizItemProperties();
1117
- this.renderRoot.append(this.chartElement);
1114
+ if (this.type) {
1115
+ this.createAndAppendElement();
1116
+ }
1117
+ }
1118
+ createAndAppendElement() {
1119
+ if (!this.chartElement) {
1120
+ this.chartElement = document.createElement("chart-component");
1121
+ this.chartElement.setAttribute("embedding-mode", "chart");
1122
+ this.updateVizItemProperties();
1123
+ this.renderRoot.append(this.chartElement);
1124
+ }
1118
1125
  }
1119
1126
  updateVizItemProperties() {
1120
1127
  if (this.chartElement) {
@@ -1132,11 +1139,19 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1132
1139
  }
1133
1140
  updated(changedProperties) {
1134
1141
  if (this.chartElement) {
1135
- this.updateVizItemProperties();
1142
+ for (const [propertyName] of changedProperties.entries()) {
1143
+ const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1144
+ const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1145
+ this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1146
+ }
1147
+ } else {
1148
+ if (this.type) {
1149
+ this.createAndAppendElement();
1150
+ }
1136
1151
  }
1137
1152
  }
1138
1153
  render() {
1139
- return html2``;
1154
+ return html2` `;
1140
1155
  }
1141
1156
  };
1142
1157
  __decorateClass([
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.0.14-beta.4";
58
+ var version = "5.0.14-beta.5";
59
59
 
60
60
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
61
61
  var LuzmoService = class {
@@ -1129,10 +1129,17 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1129
1129
  async firstUpdated(_changedProperties) {
1130
1130
  super.firstUpdated(_changedProperties);
1131
1131
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1132
- this.chartElement = document.createElement("chart-component");
1133
- this.chartElement.setAttribute("embedding-mode", "chart");
1134
- this.updateVizItemProperties();
1135
- this.renderRoot.append(this.chartElement);
1132
+ if (this.type) {
1133
+ this.createAndAppendElement();
1134
+ }
1135
+ }
1136
+ createAndAppendElement() {
1137
+ if (!this.chartElement) {
1138
+ this.chartElement = document.createElement("chart-component");
1139
+ this.chartElement.setAttribute("embedding-mode", "chart");
1140
+ this.updateVizItemProperties();
1141
+ this.renderRoot.append(this.chartElement);
1142
+ }
1136
1143
  }
1137
1144
  updateVizItemProperties() {
1138
1145
  if (this.chartElement) {
@@ -1150,11 +1157,19 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1150
1157
  }
1151
1158
  updated(changedProperties) {
1152
1159
  if (this.chartElement) {
1153
- this.updateVizItemProperties();
1160
+ for (const [propertyName] of changedProperties.entries()) {
1161
+ const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1162
+ const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1163
+ this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1164
+ }
1165
+ } else {
1166
+ if (this.type) {
1167
+ this.createAndAppendElement();
1168
+ }
1154
1169
  }
1155
1170
  }
1156
1171
  render() {
1157
- return import_lit3.html``;
1172
+ return import_lit3.html` `;
1158
1173
  }
1159
1174
  };
1160
1175
  __decorateClass([
package/index.libs.js CHANGED
@@ -35,7 +35,7 @@ import {
35
35
  } from "@luzmo/shared-embed";
36
36
 
37
37
  // libs/embed-libs/embed/package.json
38
- var version = "5.0.14-beta.4";
38
+ var version = "5.0.14-beta.5";
39
39
 
40
40
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
41
41
  var LuzmoService = class {
@@ -1109,10 +1109,17 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1109
1109
  async firstUpdated(_changedProperties) {
1110
1110
  super.firstUpdated(_changedProperties);
1111
1111
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1112
- this.chartElement = document.createElement("chart-component");
1113
- this.chartElement.setAttribute("embedding-mode", "chart");
1114
- this.updateVizItemProperties();
1115
- this.renderRoot.append(this.chartElement);
1112
+ if (this.type) {
1113
+ this.createAndAppendElement();
1114
+ }
1115
+ }
1116
+ createAndAppendElement() {
1117
+ if (!this.chartElement) {
1118
+ this.chartElement = document.createElement("chart-component");
1119
+ this.chartElement.setAttribute("embedding-mode", "chart");
1120
+ this.updateVizItemProperties();
1121
+ this.renderRoot.append(this.chartElement);
1122
+ }
1116
1123
  }
1117
1124
  updateVizItemProperties() {
1118
1125
  if (this.chartElement) {
@@ -1130,11 +1137,19 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1130
1137
  }
1131
1138
  updated(changedProperties) {
1132
1139
  if (this.chartElement) {
1133
- this.updateVizItemProperties();
1140
+ for (const [propertyName] of changedProperties.entries()) {
1141
+ const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1142
+ const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1143
+ this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1144
+ }
1145
+ } else {
1146
+ if (this.type) {
1147
+ this.createAndAppendElement();
1148
+ }
1134
1149
  }
1135
1150
  }
1136
1151
  render() {
1137
- return html2``;
1152
+ return html2` `;
1138
1153
  }
1139
1154
  };
1140
1155
  __decorateClass([
@@ -13,6 +13,7 @@ export declare class LuzmoBaseVizItem extends LitElement {
13
13
  static styles: import("lit").CSSResult;
14
14
  constructor();
15
15
  protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
16
+ private createAndAppendElement;
16
17
  private updateVizItemProperties;
17
18
  updated(changedProperties: PropertyValues): void;
18
19
  protected render(): unknown;
@@ -1930,7 +1930,7 @@ var o5 = e6(class extends i4 {
1930
1930
  });
1931
1931
 
1932
1932
  // libs/embed-libs/embed/package.json
1933
- var version = "5.0.14-beta.4";
1933
+ var version = "5.0.14-beta.5";
1934
1934
 
1935
1935
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
1936
1936
  var LuzmoService = class {
@@ -2996,10 +2996,17 @@ var LuzmoBaseVizItem = class extends s3 {
2996
2996
  async firstUpdated(_changedProperties) {
2997
2997
  super.firstUpdated(_changedProperties);
2998
2998
  await loadLibrary(this.appServer, "DashboardApp");
2999
- this.chartElement = document.createElement("chart-component");
3000
- this.chartElement.setAttribute("embedding-mode", "chart");
3001
- this.updateVizItemProperties();
3002
- this.renderRoot.append(this.chartElement);
2999
+ if (this.type) {
3000
+ this.createAndAppendElement();
3001
+ }
3002
+ }
3003
+ createAndAppendElement() {
3004
+ if (!this.chartElement) {
3005
+ this.chartElement = document.createElement("chart-component");
3006
+ this.chartElement.setAttribute("embedding-mode", "chart");
3007
+ this.updateVizItemProperties();
3008
+ this.renderRoot.append(this.chartElement);
3009
+ }
3003
3010
  }
3004
3011
  updateVizItemProperties() {
3005
3012
  if (this.chartElement) {
@@ -3017,11 +3024,19 @@ var LuzmoBaseVizItem = class extends s3 {
3017
3024
  }
3018
3025
  updated(changedProperties) {
3019
3026
  if (this.chartElement) {
3020
- this.updateVizItemProperties();
3027
+ for (const [propertyName] of changedProperties.entries()) {
3028
+ const mappedAttributeName = libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
3029
+ const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
3030
+ this.chartElement.setAttribute(mappedAttributeName, attributeValue);
3031
+ }
3032
+ } else {
3033
+ if (this.type) {
3034
+ this.createAndAppendElement();
3035
+ }
3021
3036
  }
3022
3037
  }
3023
3038
  render() {
3024
- return x``;
3039
+ return x` `;
3025
3040
  }
3026
3041
  };
3027
3042
  __decorateClass([
@@ -1930,7 +1930,7 @@ var o5 = e6(class extends i4 {
1930
1930
  });
1931
1931
 
1932
1932
  // libs/embed-libs/embed/package.json
1933
- var version = "5.0.14-beta.4";
1933
+ var version = "5.0.14-beta.5";
1934
1934
 
1935
1935
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
1936
1936
  var LuzmoService = class {
@@ -2996,10 +2996,17 @@ var LuzmoBaseVizItem = class extends s3 {
2996
2996
  async firstUpdated(_changedProperties) {
2997
2997
  super.firstUpdated(_changedProperties);
2998
2998
  await loadLibrary(this.appServer, "DashboardApp");
2999
- this.chartElement = document.createElement("chart-component");
3000
- this.chartElement.setAttribute("embedding-mode", "chart");
3001
- this.updateVizItemProperties();
3002
- this.renderRoot.append(this.chartElement);
2999
+ if (this.type) {
3000
+ this.createAndAppendElement();
3001
+ }
3002
+ }
3003
+ createAndAppendElement() {
3004
+ if (!this.chartElement) {
3005
+ this.chartElement = document.createElement("chart-component");
3006
+ this.chartElement.setAttribute("embedding-mode", "chart");
3007
+ this.updateVizItemProperties();
3008
+ this.renderRoot.append(this.chartElement);
3009
+ }
3003
3010
  }
3004
3011
  updateVizItemProperties() {
3005
3012
  if (this.chartElement) {
@@ -3017,11 +3024,19 @@ var LuzmoBaseVizItem = class extends s3 {
3017
3024
  }
3018
3025
  updated(changedProperties) {
3019
3026
  if (this.chartElement) {
3020
- this.updateVizItemProperties();
3027
+ for (const [propertyName] of changedProperties.entries()) {
3028
+ const mappedAttributeName = libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
3029
+ const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
3030
+ this.chartElement.setAttribute(mappedAttributeName, attributeValue);
3031
+ }
3032
+ } else {
3033
+ if (this.type) {
3034
+ this.createAndAppendElement();
3035
+ }
3021
3036
  }
3022
3037
  }
3023
3038
  render() {
3024
- return x``;
3039
+ return x` `;
3025
3040
  }
3026
3041
  };
3027
3042
  __decorateClass([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luzmo/embed",
3
- "version": "5.0.14-beta.4",
3
+ "version": "5.0.14-beta.5",
4
4
  "dependencies": {
5
5
  "lit": "3.1.2",
6
6
  "@luzmo/shared-embed": "5.0.7-beta.0"