@bridgeline-digital/hawksearch-handlebars-ui 6.2.2 → 6.2.3

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * name: @bridgeline-digital/hawksearch-handlebars-ui
3
3
  *
4
- * version: v6.2.1
4
+ * version: v6.2.3
5
5
  *
6
6
  * description: The HawkSearch Handlebars UI package allows you to add a highly-customizable search results page to your website powered by HawkSearch.
7
7
  *
@@ -10781,7 +10781,7 @@ class SearchService extends BaseService {
10781
10781
  if (facetType === "recent-searches") {
10782
10782
  const recentQueries = this.getRecentQueries();
10783
10783
  return recentQueries.map((s) => ({
10784
- title: s
10784
+ title: this.decodeFacetValues ? decodeNestedURI(s) : s
10785
10785
  }));
10786
10786
  }
10787
10787
  return values == null ? void 0 : values.map((v) => {
@@ -11465,6 +11465,7 @@ class TrackingService extends BaseService {
11465
11465
  UniqueId: id,
11466
11466
  Url: url,
11467
11467
  TrackingId: HawkSearch.searchResponse.trackingId,
11468
+ ElementNo: this.getElementNo(id),
11468
11469
  RequestPath: window.location.pathname,
11469
11470
  Qs: window.location.search,
11470
11471
  ScrollX: window.scrollX,
@@ -11522,6 +11523,21 @@ class TrackingService extends BaseService {
11522
11523
  localStorage.setItem("QueryId", queryId);
11523
11524
  return queryId;
11524
11525
  }
11526
+ getElementNo(id) {
11527
+ var _a, _b;
11528
+ const searchResponse = HawkSearch.searchResponse;
11529
+ if (!searchResponse || !searchResponse.results) {
11530
+ return 0;
11531
+ }
11532
+ const itemIndex = searchResponse.results.findIndex((item) => item.id === id);
11533
+ if (itemIndex === -1) {
11534
+ return 0;
11535
+ }
11536
+ const pageSize = ((_a = searchResponse.pagination) == null ? void 0 : _a.pageSize) ?? 1;
11537
+ const page = ((_b = searchResponse.pagination) == null ? void 0 : _b.page) ?? 1;
11538
+ const itemPosition = itemIndex + 1;
11539
+ return itemPosition + pageSize * (page - 1);
11540
+ }
11525
11541
  }
11526
11542
  if (!window.HawkSearch) {
11527
11543
  window.HawkSearch = {};