@bridgeline-digital/hawksearch-handlebars-ui 6.2.5 → 6.2.7
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.
|
|
4
|
+
* version: v6.2.6
|
|
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
|
*
|
|
@@ -7327,7 +7327,7 @@ class RecommendationsItemComponent extends BaseComponent {
|
|
|
7327
7327
|
});
|
|
7328
7328
|
}
|
|
7329
7329
|
}
|
|
7330
|
-
const defaultHtml$t = '<div class="autocomplete">\n <div class="row">\n {{#if products.results.length}}\n <div class="column column--12 column-md--8">\n <span class="autocomplete__title autocomplete__title--products">{{products.title}}</span>\n <div class="row autocomplete__products">\n {{#each products.results}}\n <div class="column column--12 column-sm--4">\n <div class="autocomplete__product">\n <a hawksearch-product="{{id}}" href="{{url}}" class="autocomplete__product__image">\n <img hawksearch-image src="{{imageUrl}}" alt="" />\n </a>\n <span class="autocomplete__product__title">\n <a hawksearch-product="{{id}}" href="{{url}}">{{html title}}</a>\n </span>\n {{#if rating}}\n <hawksearch-rating rating="{{rating}}"></hawksearch-rating>\n {{/if}}\n {{#unless (eq price undefined)}}\n <div class="autocomplete__product__price" itemprop="offers" itemtype="http://schema.org/Offer" itemscope>\n {{#if (lt salePrice price)}}\n <span class="autocomplete__product__price__original">{{currency price}}</span>\n <span class="autocomplete__product__price__current" itemprop="price">{{currency salePrice}}</span>\n {{else}}\n <span class="autocomplete__product__price-__current" itemprop="price">{{currency price}}</span>\n {{/if}}\n </div>\n {{/unless}}\n <hawksearch-variant-selector></hawksearch-variant-selector>\n </div>\n </div>\n {{/each}}\n </div>\n </div>\n {{/if}}\n {{#if (or categories.results.length content.results.length queries.results.length)}}\n <div class="column column--12 column-md--4">\n {{#if productSuggestedQueries.results.length}}\n <span class="autocomplete__title autocomplete__title--queries">{{productSuggestedQueries.title}}</span>\n <ul class="autocomplete__list">\n {{#each productSuggestedQueries.results}}\n <li>\n <a hawksearch-query="{{query}}" href="{{url}}">{{query}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n {{#if contentSuggestedQueries.results.length}}\n <span class="autocomplete__title autocomplete__title--queries">{{contentSuggestedQueries.title}}</span>\n <ul class="autocomplete__list">\n {{#each contentSuggestedQueries.results}}\n <li>\n <a hawksearch-query="{{query}}" href="{{url}}">{{query}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n {{#if categories.results.length}}\n <span class="autocomplete__title autocomplete__title--categories">{{categories.title}}</span>\n <ul class="autocomplete__list">\n {{#each categories.results}}\n <li>\n <a hawksearch-category-field="{{field}}" hawksearch-category-value="{{value}}" href="{{url}}">{{html title}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n {{#if content.results.length}}\n <span class="autocomplete__title autocomplete__title--content">{{content.title}}</span>\n <ul class="autocomplete__list">\n {{#each content.results}}\n <li>\n <a hawksearch-content="{{id}}" href="{{url}}">{{html title}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n {{#if queries.results.length}}\n <span class="autocomplete__title autocomplete__title--queries">{{queries.title}}</span>\n <ul class="autocomplete__list">\n {{#each queries.results}}\n <li>\n <a hawksearch-query="{{query}}" href="{{url}}">{{query}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n </div>\n {{/if}}\n </div>\n <div class="autocomplete__view-all">\n <a hawksearch-view-all>{{viewAllText}}</a>\n </div>\n</div>';
|
|
7330
|
+
const defaultHtml$t = '<div class="autocomplete">\n <div class="row">\n {{#if products.results.length}}\n <div class="column column--12 column-md--8">\n <span class="autocomplete__title autocomplete__title--products">{{products.title}}</span>\n <div class="row autocomplete__products">\n {{#each products.results}}\n <div class="column column--12 column-sm--4">\n <div class="autocomplete__product">\n <a hawksearch-product="{{id}}" href="{{url}}" class="autocomplete__product__image">\n <img hawksearch-image src="{{imageUrl}}" alt="" />\n </a>\n <span class="autocomplete__product__title">\n <a hawksearch-product="{{id}}" href="{{url}}">{{html title}}</a>\n </span>\n {{#if rating}}\n <hawksearch-rating rating="{{rating}}"></hawksearch-rating>\n {{/if}}\n {{#unless (eq price undefined)}}\n <div class="autocomplete__product__price" itemprop="offers" itemtype="http://schema.org/Offer" itemscope>\n {{#if (lt salePrice price)}}\n <span class="autocomplete__product__price__original">{{currency price}}</span>\n <span class="autocomplete__product__price__current" itemprop="price">{{currency salePrice}}</span>\n {{else}}\n <span class="autocomplete__product__price-__current" itemprop="price">{{currency price}}</span>\n {{/if}}\n </div>\n {{/unless}}\n <hawksearch-variant-selector></hawksearch-variant-selector>\n </div>\n </div>\n {{/each}}\n </div>\n </div>\n {{/if}}\n {{#if (or categories.results.length content.results.length queries.results.length productSuggestedQueries.results.length contentSuggestedQueries.results.length)}}\n <div class="column column--12 column-md--4">\n {{#if productSuggestedQueries.results.length}}\n <span class="autocomplete__title autocomplete__title--queries">{{productSuggestedQueries.title}}</span>\n <ul class="autocomplete__list">\n {{#each productSuggestedQueries.results}}\n <li>\n <a hawksearch-query="{{query}}" href="{{url}}">{{query}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n {{#if contentSuggestedQueries.results.length}}\n <span class="autocomplete__title autocomplete__title--queries">{{contentSuggestedQueries.title}}</span>\n <ul class="autocomplete__list">\n {{#each contentSuggestedQueries.results}}\n <li>\n <a hawksearch-query="{{query}}" href="{{url}}">{{query}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n {{#if categories.results.length}}\n <span class="autocomplete__title autocomplete__title--categories">{{categories.title}}</span>\n <ul class="autocomplete__list">\n {{#each categories.results}}\n <li>\n <a hawksearch-category-field="{{field}}" hawksearch-category-value="{{value}}" href="{{url}}">{{html title}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n {{#if content.results.length}}\n <span class="autocomplete__title autocomplete__title--content">{{content.title}}</span>\n <ul class="autocomplete__list">\n {{#each content.results}}\n <li>\n <a hawksearch-content="{{id}}" href="{{url}}">{{html title}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n {{#if queries.results.length}}\n <span class="autocomplete__title autocomplete__title--queries">{{queries.title}}</span>\n <ul class="autocomplete__list">\n {{#each queries.results}}\n <li>\n <a hawksearch-query="{{query}}" href="{{url}}">{{query}}</a>\n </li>\n {{/each}}\n </ul>\n {{/if}}\n </div>\n {{/if}}\n </div>\n <div class="autocomplete__view-all">\n <a hawksearch-view-all>{{viewAllText}}</a>\n </div>\n</div>';
|
|
7331
7331
|
class AutocompleteComponent extends BaseComponent {
|
|
7332
7332
|
constructor() {
|
|
7333
7333
|
super(...arguments);
|
|
@@ -7336,8 +7336,8 @@ class AutocompleteComponent extends BaseComponent {
|
|
|
7336
7336
|
this.defaultHtml = defaultHtml$t;
|
|
7337
7337
|
}
|
|
7338
7338
|
renderContent() {
|
|
7339
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7340
|
-
return !!this.data && (!!((_b = (_a = this.data.categories) == null ? void 0 : _a.results) == null ? void 0 : _b.length) || !!((_d = (_c = this.data.content) == null ? void 0 : _c.results) == null ? void 0 : _d.length) || !!((_f = (_e = this.data.products) == null ? void 0 : _e.results) == null ? void 0 : _f.length) || !!((_h = (_g = this.data.
|
|
7339
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
7340
|
+
return !!this.data && (!!((_b = (_a = this.data.categories) == null ? void 0 : _a.results) == null ? void 0 : _b.length) || !!((_d = (_c = this.data.content) == null ? void 0 : _c.results) == null ? void 0 : _d.length) || !!((_f = (_e = this.data.products) == null ? void 0 : _e.results) == null ? void 0 : _f.length) || !!((_h = (_g = this.data.contentSuggestedQueries) == null ? void 0 : _g.results) == null ? void 0 : _h.length) || !!((_j = (_i = this.data.productSuggestedQueries) == null ? void 0 : _i.results) == null ? void 0 : _j.length) || !!((_l = (_k = this.data.queries) == null ? void 0 : _k.results) == null ? void 0 : _l.length));
|
|
7341
7341
|
}
|
|
7342
7342
|
getContentModel() {
|
|
7343
7343
|
return {
|
|
@@ -11262,7 +11262,7 @@ class SearchService extends BaseService {
|
|
|
11262
11262
|
getSearchUrl(searchRequest) {
|
|
11263
11263
|
const searchPage = window.location.pathname === this.searchUrl || !!searchRequest.url;
|
|
11264
11264
|
const url = new URL(searchPage ? window.location.href : this.searchUrl, window.location.origin);
|
|
11265
|
-
const nonFacetParams = Object.
|
|
11265
|
+
const nonFacetParams = Object.values(this.queryStringParams);
|
|
11266
11266
|
url.searchParams.delete(this.queryStringParams.query);
|
|
11267
11267
|
if (searchRequest.query && !isQueryBase64Image(searchRequest.query)) {
|
|
11268
11268
|
url.searchParams.set(this.queryStringParams.query, searchRequest.query);
|