@salesforcedevs/dx-components 1.3.37-alpha06 → 1.3.37-alpha09

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.37-alpha06",
3
+ "version": "1.3.37-alpha09",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -1,4 +1,4 @@
1
- import { LightningElement, api, track } from "lwc";
1
+ import { createElement, LightningElement, api, track } from "lwc";
2
2
  import type * as CoveoSDK from "coveo-search-ui";
3
3
 
4
4
  interface CoveoSearch {
@@ -176,7 +176,8 @@ export default class SearchResults extends LightningElement {
176
176
 
177
177
  Coveo.TemplateHelpers.registerTemplateHelper(
178
178
  "badge",
179
- (value: string) => `<div class="type-badge-shell ${value}"></div>`
179
+ (value: string) =>
180
+ `<dx-type-badge variant="${value}"></dx-type-badge>`
180
181
  );
181
182
 
182
183
  Coveo.init(this.root);
@@ -186,9 +187,12 @@ export default class SearchResults extends LightningElement {
186
187
  this.template.querySelectorAll(".type-badge-shell")?.forEach((el) => {
187
188
  el.classList.remove("type-badge-shell");
188
189
  el.classList.forEach((cl) => {
189
- const typeBadge = document.createElement("dx-type-badge");
190
- typeBadge.setAttribute("variant", cl);
191
- el.appendChild(typeBadge);
190
+ const component = createElement("dx-type-badge", {
191
+ is: LightningElement
192
+ });
193
+ Object.assign(component, { variant: cl });
194
+ document.body.appendChild(component as unknown as Node);
195
+ el.appendChild(component);
192
196
  });
193
197
  });
194
198
  };