@salesforcedevs/dx-components 0.19.3-alpha.27 → 0.19.3-alpha.31

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.27",
3
+ "version": "0.19.3-alpha.31",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -141,12 +141,6 @@ export default class SidebarSearch extends LightningElement {
141
141
  );
142
142
  }
143
143
 
144
- // If this is the first render and there is a search value, trigger
145
- // term highlighting
146
- if (!this.didRender && this.value) {
147
- this.dispatchHighlightedTermChange();
148
- }
149
-
150
144
  this.didRender = true;
151
145
  }
152
146
 
@@ -341,12 +335,14 @@ export default class SidebarSearch extends LightningElement {
341
335
  if (!termsToHighlight || !phrasesToHighlight) {
342
336
  return;
343
337
  }
344
- const normalizedTermsToHighlight = new Set(
345
- [
346
- Object.values(termsToHighlight),
347
- Object.values(phrasesToHighlight),
348
- this.value
349
- ].flat(2)
338
+ const normalizedTermsToHighlight = Array.from(
339
+ new Set(
340
+ [
341
+ Object.values(termsToHighlight),
342
+ Object.values(phrasesToHighlight),
343
+ this.value
344
+ ].flat(2)
345
+ )
350
346
  );
351
347
  this.dispatchEvent(
352
348
  new CustomEvent("highlightedtermchange", {
@@ -9,9 +9,9 @@ export const highlightTerms = (
9
9
  elements: NodeListOf<Element>,
10
10
  { query, termsToHighlight }: { query: string; termsToHighlight: string[] }
11
11
  ): void => {
12
- console.log(query, termsToHighlight)
13
12
  const searchExp = createSearchRegExp(termsToHighlight);
14
13
  let scrolled = false;
14
+ console.log({ elements, query, termsToHighlight });
15
15
  elements.forEach((element) => {
16
16
  if (
17
17
  element?.innerHTML.includes("<dx-") ||