@salesforcedevs/dx-components 0.19.3-alpha.31 → 0.19.3-alpha.35
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
|
@@ -338,9 +338,11 @@ export default class SidebarSearch extends LightningElement {
|
|
|
338
338
|
const normalizedTermsToHighlight = Array.from(
|
|
339
339
|
new Set(
|
|
340
340
|
[
|
|
341
|
+
this.value,
|
|
342
|
+
Object.keys(termsToHighlight),
|
|
343
|
+
Object.keys(phrasesToHighlight),
|
|
341
344
|
Object.values(termsToHighlight),
|
|
342
|
-
Object.values(phrasesToHighlight)
|
|
343
|
-
this.value
|
|
345
|
+
Object.values(phrasesToHighlight)
|
|
344
346
|
].flat(2)
|
|
345
347
|
)
|
|
346
348
|
);
|
|
@@ -11,7 +11,7 @@ export const highlightTerms = (
|
|
|
11
11
|
): void => {
|
|
12
12
|
const searchExp = createSearchRegExp(termsToHighlight);
|
|
13
13
|
let scrolled = false;
|
|
14
|
-
console.log({ elements, query, termsToHighlight });
|
|
14
|
+
console.log({ elements, query, termsToHighlight, searchExp });
|
|
15
15
|
elements.forEach((element) => {
|
|
16
16
|
if (
|
|
17
17
|
element?.innerHTML.includes("<dx-") ||
|
|
@@ -33,15 +33,15 @@ export const highlightTerms = (
|
|
|
33
33
|
|
|
34
34
|
element.innerHTML = innerHtml;
|
|
35
35
|
} catch (e) {
|
|
36
|
-
console.error(e
|
|
36
|
+
console.error(`${element} could not be parsed by the highlight utility: ${e}`);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
element
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
// element
|
|
40
|
+
// .querySelectorAll("mark")
|
|
41
|
+
// .forEach(
|
|
42
|
+
// (el) =>
|
|
43
|
+
// (el.style.backgroundColor = "var(--dx-g-yellow-vibrant-90)")
|
|
44
|
+
// );
|
|
45
45
|
|
|
46
46
|
const mark = element.querySelector("mark");
|
|
47
47
|
if (mark && !scrolled) {
|