@salesforcedevs/dx-components 0.19.3-alpha.58 → 0.19.3-alpha.59
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
|
@@ -27,7 +27,8 @@ export const SESSION_KEY = "dx-sidebar-search-state";
|
|
|
27
27
|
|
|
28
28
|
const DEFAULT_RESULT_COUNT = 20;
|
|
29
29
|
const SEARCH_DEBOUNCE_DELAY = 780;
|
|
30
|
-
|
|
30
|
+
|
|
31
|
+
const;
|
|
31
32
|
|
|
32
33
|
const UserRecentSearches = new RecentSearches();
|
|
33
34
|
|
|
@@ -95,17 +96,22 @@ export default class SidebarSearch extends LightningElement {
|
|
|
95
96
|
if (!termsToHighlight || !phrasesToHighlight) {
|
|
96
97
|
return null;
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
|
|
100
|
+
const flattenTerms = (terms: Object): string[] =>
|
|
101
|
+
Object.entries(terms).reduce((acc, [key, value]) => {
|
|
102
|
+
if (Array.isArray(value)) {
|
|
103
|
+
return [...acc, key, ...value];
|
|
104
|
+
}
|
|
105
|
+
const values = flattenTerms(value);
|
|
106
|
+
return [...acc, key, ...values];
|
|
107
|
+
}, []);
|
|
108
|
+
|
|
109
|
+
const terms = flattenTerms({
|
|
110
|
+
...termsToHighlight,
|
|
111
|
+
...phrasesToHighlight
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
return Array.from(new Set([this.value, ...terms].flat(2))) as string[];
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
private get hasCorrectCoveoConfig(): boolean {
|