@salesforcedevs/dx-components 0.19.3-alpha.21 → 0.19.3-alpha.25

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": "0.19.3-alpha.21",
3
+ "version": "0.19.3-alpha.25",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -320,6 +320,7 @@ export default class SidebarSearch extends LightningElement {
320
320
 
321
321
  private dispatchOnChangeEvent(results: Result[]) {
322
322
  this.updateSessionStorage();
323
+ this.dispatchHighlightedTermChange();
323
324
  this.dispatchEvent(
324
325
  new CustomEvent("change", {
325
326
  detail: {
@@ -335,6 +336,19 @@ export default class SidebarSearch extends LightningElement {
335
336
  }
336
337
 
337
338
  private dispatchHighlightedTermChange = debounce(() => {
339
+ const { termsToHighlight, phrasesToHighlight } =
340
+ this.engine?.state?.search?.response;
341
+ if (!termsToHighlight || !phrasesToHighlight) {
342
+ return;
343
+ }
344
+ const terms = new Set(
345
+ [
346
+ Object.values(termsToHighlight),
347
+ Object.values(phrasesToHighlight),
348
+ this.value
349
+ ].flat(2)
350
+ );
351
+ console.log({ terms });
338
352
  this.dispatchEvent(
339
353
  new CustomEvent("highlightedtermchange", {
340
354
  detail: this.value,
@@ -397,7 +411,6 @@ export default class SidebarSearch extends LightningElement {
397
411
  this.value = e.detail;
398
412
 
399
413
  this.handleValueChange(false);
400
- this.dispatchHighlightedTermChange();
401
414
  }
402
415
 
403
416
  private onInputFocus() {