@saasquatch/squatch-js 2.8.2-25 → 2.8.2-26
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/dist/squatch.cjs.js +14 -19
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +14 -19
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +14 -19
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +1 -1
- package/dist/widgets/declarative/DeclarativeWidget.d.ts +5 -2
- package/dist/widgets/declarative/DeclarativeWidgets.d.ts +7 -2
- package/package.json +1 -1
package/dist/squatch.js
CHANGED
|
@@ -2221,7 +2221,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2221
2221
|
}
|
|
2222
2222
|
const _log$1 = debug("squatch-js:DeclarativeWidget");
|
|
2223
2223
|
class DeclarativeWidget extends HTMLElement {
|
|
2224
|
-
constructor() {
|
|
2224
|
+
constructor(res) {
|
|
2225
2225
|
super();
|
|
2226
2226
|
/**
|
|
2227
2227
|
* Configuration overrides
|
|
@@ -2268,6 +2268,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2268
2268
|
*/
|
|
2269
2269
|
__publicField(this, "container");
|
|
2270
2270
|
__publicField(this, "element");
|
|
2271
|
+
__publicField(this, "widgetConfig");
|
|
2271
2272
|
/**
|
|
2272
2273
|
* Flag for if the component has been loaded or not
|
|
2273
2274
|
* @hidden
|
|
@@ -2331,6 +2332,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2331
2332
|
this.config = getConfig();
|
|
2332
2333
|
this.token = getToken();
|
|
2333
2334
|
this.tenant = window.squatchTenant;
|
|
2335
|
+
this.widgetConfig = res.widgetConfig;
|
|
2334
2336
|
this.container = this;
|
|
2335
2337
|
}
|
|
2336
2338
|
_setupApis(config) {
|
|
@@ -2421,8 +2423,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2421
2423
|
}
|
|
2422
2424
|
}
|
|
2423
2425
|
class DeclarativeEmbedWidget extends DeclarativeWidget {
|
|
2424
|
-
constructor() {
|
|
2425
|
-
super();
|
|
2426
|
+
constructor(res) {
|
|
2427
|
+
super(res);
|
|
2426
2428
|
this.type = "EMBED";
|
|
2427
2429
|
this.loaded = false;
|
|
2428
2430
|
}
|
|
@@ -2441,6 +2443,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2441
2443
|
async connectedCallback() {
|
|
2442
2444
|
this.loaded = true;
|
|
2443
2445
|
this.container = this.getAttribute("container");
|
|
2446
|
+
const brandingConfig = this.widgetConfig.values.brandingConfig;
|
|
2447
|
+
console.log("THIS IS THE BRANDING CONFIG", brandingConfig);
|
|
2444
2448
|
const skeletonHTML = getSkeleton({ height: "100%" });
|
|
2445
2449
|
const skeletonContainer = document.createElement("div");
|
|
2446
2450
|
skeletonContainer.id = "loading-skeleton";
|
|
@@ -2457,8 +2461,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2457
2461
|
}
|
|
2458
2462
|
}
|
|
2459
2463
|
class DeclarativePopupWidget extends DeclarativeWidget {
|
|
2460
|
-
constructor() {
|
|
2461
|
-
super();
|
|
2464
|
+
constructor(res) {
|
|
2465
|
+
super(res);
|
|
2462
2466
|
this.type = "POPUP";
|
|
2463
2467
|
this.loaded = false;
|
|
2464
2468
|
this.addEventListener("click", (e) => {
|
|
@@ -2479,26 +2483,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2479
2483
|
}
|
|
2480
2484
|
}
|
|
2481
2485
|
async connectedCallback() {
|
|
2482
|
-
var _a2;
|
|
2483
2486
|
this.loaded = true;
|
|
2484
2487
|
this.container = this.getAttribute("container");
|
|
2485
|
-
const skeletonHTML =
|
|
2486
|
-
<div>
|
|
2487
|
-
<h1>Dynamic Content</h1>
|
|
2488
|
-
<p>This content was dynamically added to the widget before it loaded.</p>
|
|
2489
|
-
</div>
|
|
2490
|
-
`;
|
|
2488
|
+
const skeletonHTML = getSkeleton({ height: "100%" });
|
|
2491
2489
|
const skeletonContainer = document.createElement("div");
|
|
2492
2490
|
skeletonContainer.id = "loading-skeleton";
|
|
2493
2491
|
skeletonContainer.innerHTML = skeletonHTML;
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
if (this.shadowRoot) {
|
|
2498
|
-
this.shadowRoot.innerHTML = skeletonHTML;
|
|
2499
|
-
}
|
|
2492
|
+
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2493
|
+
root.innerHTML = "";
|
|
2494
|
+
root.appendChild(skeletonContainer);
|
|
2500
2495
|
await this.renderWidget();
|
|
2501
|
-
const loadingElement =
|
|
2496
|
+
const loadingElement = root.getElementById("loading-skeleton");
|
|
2502
2497
|
if (loadingElement) {
|
|
2503
2498
|
loadingElement.remove();
|
|
2504
2499
|
}
|