@salesforcedevs/dx-components 0.19.3-alpha.38 → 0.19.3-alpha.39

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.38",
3
+ "version": "0.19.3-alpha.39",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -6,7 +6,7 @@ const MARK_TAGS = /<\/?mark>/gi;
6
6
 
7
7
  export const highlightTerms = (
8
8
  // eslint-disable-next-line no-undef
9
- elements: NodeListOf<Element>,
9
+ elements: NodeListOf<HTMLElement>,
10
10
  { query, termsToHighlight }: { query: string; termsToHighlight: string[] }
11
11
  ): void => {
12
12
  const searchExp = createSearchRegExp(termsToHighlight);
@@ -22,7 +22,11 @@ export const highlightTerms = (
22
22
 
23
23
  try {
24
24
  if (element.innerHTML.match(MARK_TAGS)) {
25
- console.log("matching marks", element);
25
+ console.log(
26
+ "matching marks",
27
+ element,
28
+ element.style.backgroundColor
29
+ );
26
30
  element.innerHTML = element.innerHTML.replace(
27
31
  // Remove previously added mark tags
28
32
  MARK_TAGS,
@@ -35,6 +39,7 @@ export const highlightTerms = (
35
39
  searchExp,
36
40
  "<mark>$&</mark>"
37
41
  );
42
+ element.style.backgroundColor = "var(--dx-g-yellow-vibrant-90)";
38
43
  }
39
44
  } catch (e) {
40
45
  console.error(
@@ -42,12 +47,12 @@ export const highlightTerms = (
42
47
  );
43
48
  }
44
49
 
45
- // element
46
- // .querySelectorAll("mark")
47
- // .forEach(
48
- // (el) =>
49
- // (el.style.backgroundColor = "var(--dx-g-yellow-vibrant-90)")
50
- // );
50
+ element
51
+ .querySelectorAll("mark")
52
+ .forEach(
53
+ (el) =>
54
+ (el.style.backgroundColor = "var(--dx-g-yellow-vibrant-90)")
55
+ );
51
56
 
52
57
  const mark = element.querySelector("mark");
53
58
  if (mark && !scrolled) {