@salesforcedevs/dx-components 1.3.92-alpha-005-localstorage → 1.3.92-alpha-007-localstorage

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": "1.3.92-alpha-005-localstorage",
3
+ "version": "1.3.92-alpha-007-localstorage",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -88,7 +88,7 @@ export default class SidebarSearch extends LightningElement {
88
88
  private _coveoAdvancedQueryConfig!: { [key: string]: any };
89
89
  private dropdownRequestedOpen: boolean = false;
90
90
  private recentSearches: Option[] = [];
91
- private unsubscribeFromResultList: Unsubscribe = () => { };
91
+ private unsubscribeFromResultList: Unsubscribe = () => {};
92
92
  private resultList: ResultList | null = null;
93
93
  private resultsPerPage: ResultsPerPage | null = null;
94
94
  private preloadedState?: SearchAppState;
@@ -247,7 +247,9 @@ export default class SidebarSearch extends LightningElement {
247
247
  };
248
248
 
249
249
  private syncAnalytics = () => {
250
- const storedResult = window.localStorage.getItem(RESULT_CLICK_LOCAL_STORAGE_KEY);
250
+ const storedResult = window.localStorage.getItem(
251
+ RESULT_CLICK_LOCAL_STORAGE_KEY
252
+ );
251
253
  if (storedResult) {
252
254
  const interactiveResult = buildInteractiveResult(this.engine!, {
253
255
  options: { result: JSON.parse(storedResult) }
@@ -256,7 +258,7 @@ export default class SidebarSearch extends LightningElement {
256
258
  interactiveResult.select();
257
259
  window.localStorage.removeItem(RESULT_CLICK_LOCAL_STORAGE_KEY);
258
260
  }
259
- }
261
+ };
260
262
 
261
263
  private onResultListChange = () => {
262
264
  if (!this.resultList) {
@@ -364,12 +366,11 @@ export default class SidebarSearch extends LightningElement {
364
366
  uniqueId,
365
367
  href,
366
368
  selected: isSelected,
367
- select: () => {
368
- const resultStringified = JSON.stringify(result);
369
- console.log(result);
370
- console.log(resultStringified);
371
- window.localStorage.setItem(RESULT_CLICK_LOCAL_STORAGE_KEY, resultStringified)
372
- },
369
+ select: () =>
370
+ window.localStorage.setItem(
371
+ RESULT_CLICK_LOCAL_STORAGE_KEY,
372
+ JSON.stringify(result)
373
+ )
373
374
  };
374
375
  };
375
376
 
@@ -410,10 +411,10 @@ export default class SidebarSearch extends LightningElement {
410
411
  }
411
412
 
412
413
  private updateRecentSearches = () =>
413
- (this.recentSearches = UserRecentSearches.get().map((item: string) => ({
414
- id: item,
415
- label: item
416
- })));
414
+ (this.recentSearches = UserRecentSearches.get().map((item: string) => ({
415
+ id: item,
416
+ label: item
417
+ })));
417
418
 
418
419
  private dispatchSidebarSearchChange(searchTerm: string | undefined): void {
419
420
  this.dispatchEvent(
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <a class={className} onclick={onClick}>
2
+ <a class={className} href={href} onclick={onClick}>
3
3
  <span class="title search-text">
4
4
  <template for:each={titleChunks} for:item="chunk">
5
5
  <span class={chunk.class} key={chunk.id}>{chunk.value}</span>