@getlupa/client 0.10.2 → 0.10.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.
Files changed (37) hide show
  1. package/dist/cjs/components/search-box/SearchBoxInput.vue.d.ts +2 -0
  2. package/dist/cjs/components/search-results/SearchResults.vue.d.ts +1 -0
  3. package/dist/cjs/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  4. package/dist/cjs/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  5. package/dist/cjs/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
  6. package/dist/cjs/constants/development/searchBoxDev.example.const.d.ts +1 -0
  7. package/dist/cjs/constants/global.const.d.ts +1 -0
  8. package/dist/cjs/index.min.js +255 -114
  9. package/dist/cjs/types/search-box/SearchBoxOptions.d.ts +1 -0
  10. package/dist/cjs/types/search-container/SearchContainerOptions.d.ts +1 -0
  11. package/dist/cjs/utils/shadowDom.utils.d.ts +5 -0
  12. package/dist/containerStyle.js +1 -0
  13. package/dist/es/components/search-box/SearchBoxInput.vue.d.ts +2 -0
  14. package/dist/es/components/search-results/SearchResults.vue.d.ts +1 -0
  15. package/dist/es/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  16. package/dist/es/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  17. package/dist/es/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
  18. package/dist/es/constants/development/searchBoxDev.example.const.d.ts +1 -0
  19. package/dist/es/constants/global.const.d.ts +1 -0
  20. package/dist/es/index.min.js +255 -114
  21. package/dist/es/types/search-box/SearchBoxOptions.d.ts +1 -0
  22. package/dist/es/types/search-container/SearchContainerOptions.d.ts +1 -0
  23. package/dist/es/utils/shadowDom.utils.d.ts +5 -0
  24. package/dist/iife/components/search-box/SearchBoxInput.vue.d.ts +2 -0
  25. package/dist/iife/components/search-results/SearchResults.vue.d.ts +1 -0
  26. package/dist/iife/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  27. package/dist/iife/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  28. package/dist/iife/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
  29. package/dist/iife/constants/development/searchBoxDev.example.const.d.ts +1 -0
  30. package/dist/iife/constants/global.const.d.ts +1 -0
  31. package/dist/iife/index.min.js +1 -1
  32. package/dist/iife/types/search-box/SearchBoxOptions.d.ts +1 -0
  33. package/dist/iife/types/search-container/SearchContainerOptions.d.ts +1 -0
  34. package/dist/iife/utils/shadowDom.utils.d.ts +5 -0
  35. package/dist/lupaContainerStyle.css +1 -0
  36. package/dist/style.css +1 -1
  37. package/package.json +3 -2
@@ -10980,7 +10980,7 @@ let SearchBoxInput = class SearchBoxInput extends Vue$1 {
10980
10980
  if (target) {
10981
10981
  this.inputValue = target.value;
10982
10982
  }
10983
- this.$emit("input", this.inputValue.replace(/\s+$/, ""));
10983
+ this.$emit("input", this.inputValue);
10984
10984
  }
10985
10985
  handleFocus() {
10986
10986
  this.$emit("focus");
@@ -10988,6 +10988,13 @@ let SearchBoxInput = class SearchBoxInput extends Vue$1 {
10988
10988
  this.handleInput();
10989
10989
  }
10990
10990
  }
10991
+ clear() {
10992
+ this.$emit("input", "");
10993
+ }
10994
+ focus() {
10995
+ var _a, _b;
10996
+ (_b = (_a = this.$refs) === null || _a === void 0 ? void 0 : _a.mainInput) === null || _b === void 0 ? void 0 : _b.focus();
10997
+ }
10991
10998
  };
10992
10999
  __decorate([
10993
11000
  Prop()
@@ -11157,6 +11164,14 @@ var __vue_render__$1b = function () {
11157
11164
  var _h = _vm.$createElement;
11158
11165
  var _c = _vm._self._c || _h;
11159
11166
  return _c("div", { attrs: { id: "lupa-search-box-input-container" } }, [
11167
+ _c("div", { staticClass: "lupa-input-clear" }, [
11168
+ _c("div", {
11169
+ staticClass: "lupa-input-clear-content",
11170
+ class: { "lupa-input-clear-filled": _vm.inputValue },
11171
+ on: { click: _vm.clear },
11172
+ }),
11173
+ ]),
11174
+ _vm._v(" "),
11160
11175
  _c("div", { attrs: { id: "lupa-search-box-input" } }, [
11161
11176
  _c("input", {
11162
11177
  staticClass: "lupa-hint",
@@ -11178,6 +11193,7 @@ var __vue_render__$1b = function () {
11178
11193
  expression: "inputValue",
11179
11194
  },
11180
11195
  ],
11196
+ ref: "mainInput",
11181
11197
  staticClass: "lupa-search-box-input-field",
11182
11198
  attrs: {
11183
11199
  autocomplete: "off",
@@ -11217,7 +11233,13 @@ var __vue_render__$1b = function () {
11217
11233
  },
11218
11234
  },
11219
11235
  },
11220
- [_c("span", { staticClass: "lupa-close-action" }, [_vm._v("×")])]
11236
+ [
11237
+ _vm.labels.close
11238
+ ? _c("span", { staticClass: "lupa-close-label" }, [
11239
+ _vm._v(_vm._s(_vm.labels.close)),
11240
+ ])
11241
+ : _vm._e(),
11242
+ ]
11221
11243
  )
11222
11244
  : _vm._e(),
11223
11245
  ])
@@ -11228,7 +11250,7 @@ __vue_render__$1b._withStripped = true;
11228
11250
  /* style */
11229
11251
  const __vue_inject_styles__$1b = function (inject) {
11230
11252
  if (!inject) return
11231
- inject("data-v-ccec518c_0", { source: "\n.lupa-search-box-input-field,\n.lupa-hint {\n width: 100%;\n}\n.lupa-search-box-input-field {\n position: relative !important;\n background: transparent !important;\n}\n.lupa-hint {\n opacity: 0.5;\n position: absolute !important;\n pointer-events: none;\n}\n", map: undefined, media: undefined });
11253
+ inject("data-v-219ea03b_0", { source: "\n.lupa-search-box-input-field,\n.lupa-hint {\n width: 100%;\n}\n.lupa-search-box-input-field {\n position: relative !important;\n background: transparent !important;\n}\n.lupa-hint {\n opacity: 0.5;\n position: absolute !important;\n pointer-events: none;\n}\n.lupa-input-clear {\n display: none;\n}\n", map: undefined, media: undefined });
11232
11254
 
11233
11255
  };
11234
11256
  /* scoped */
@@ -11962,7 +11984,8 @@ const MAX_FACET_VALUES = 5000;
11962
11984
  const CURRENCY_KEY_INDICATOR = "price";
11963
11985
  const DEFAULT_PAGE_SIZE = 12;
11964
11986
  const DEFAULT_PAGE_SIZE_SELECTION = [12, 24, 36, 60];
11965
- const LUPA_ROUTING_EVENT = "lupaRedirect";
11987
+ const LUPA_ROUTING_EVENT = "lupaRedirect";
11988
+ const DEFAULT_CONTAINER_STYLE = "containerStyle.css";
11966
11989
 
11967
11990
  const formatRange = (filter) => {
11968
11991
  var _a, _b;
@@ -30832,12 +30855,16 @@ let SearchBox = class SearchBox extends Vue$1 {
30832
30855
  return (_a = this.options.searchTriggers) !== null && _a !== void 0 ? _a : [];
30833
30856
  }
30834
30857
  mounted() {
30858
+ var _a, _b;
30835
30859
  window.addEventListener("keydown", this.handleKeyDown);
30836
30860
  window.addEventListener("click", this.handleMouseClick);
30837
30861
  this.setSearchResultsLink(this.options.links.searchResults);
30838
30862
  this.saveOptions({ options: this.options });
30839
30863
  this.setSearchBoxOptions({ options: this.options });
30840
30864
  bindSearchTriggers(this.searchTriggers, this.handleCurrentValueSearch);
30865
+ if (this.isSearchContainer) {
30866
+ (_b = (_a = this.$refs) === null || _a === void 0 ? void 0 : _a.searchBoxInput) === null || _b === void 0 ? void 0 : _b.focus();
30867
+ }
30841
30868
  }
30842
30869
  beforeDestroy() {
30843
30870
  window.removeEventListener("keydown", this.handleKeyDown);
@@ -30875,12 +30902,12 @@ let SearchBox = class SearchBox extends Vue$1 {
30875
30902
  }
30876
30903
  handleInput(value) {
30877
30904
  this.opened = true;
30878
- this.inputValue = value;
30905
+ this.inputValue = value.replace(/\s+$/, "");
30879
30906
  this.suggestedValue = defaultSuggestedValue;
30880
30907
  this.trackSearchQuery(value);
30881
30908
  if (this.isSearchContainer) {
30882
30909
  this.goToResultsDebounced({
30883
- searchText: this.searchValue,
30910
+ searchText: value,
30884
30911
  });
30885
30912
  }
30886
30913
  }
@@ -31069,6 +31096,7 @@ var __vue_render__$U = function () {
31069
31096
  { staticClass: "lupa-search-box-wrapper" },
31070
31097
  [
31071
31098
  _c("SearchBoxInput", {
31099
+ ref: "searchBoxInput",
31072
31100
  attrs: {
31073
31101
  options: _vm.inputOptions,
31074
31102
  suggestedValue: _vm.suggestedValue,
@@ -31108,7 +31136,7 @@ __vue_render__$U._withStripped = true;
31108
31136
  /* style */
31109
31137
  const __vue_inject_styles__$U = function (inject) {
31110
31138
  if (!inject) return
31111
- inject("data-v-d81b3ccc_0", { source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n", map: undefined, media: undefined });
31139
+ inject("data-v-49023ab6_0", { source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n", map: undefined, media: undefined });
31112
31140
 
31113
31141
  };
31114
31142
  /* scoped */
@@ -33085,6 +33113,7 @@ __vue_render__$L._withStripped = true;
33085
33113
  );
33086
33114
 
33087
33115
  const RESULT_ROOT_ID = "lupa-search-results";
33116
+ const SHADOW_ROOT_ID = "lupa-shadow-id";
33088
33117
  const CONTAINER_ROOT_ID = "lupa-search-container";
33089
33118
  const scrollToSearchResults = (timeout = 500) => {
33090
33119
  if (timeout) {
@@ -33095,12 +33124,19 @@ const scrollToSearchResults = (timeout = 500) => {
33095
33124
  }
33096
33125
  };
33097
33126
  const scrollTo = (elementId) => {
33098
- const el = document.getElementById(elementId);
33127
+ var _a, _b;
33128
+ let el = document.getElementById(elementId);
33129
+ const shadowRoot = (_a = document.getElementById(SHADOW_ROOT_ID)) === null || _a === void 0 ? void 0 : _a.shadowRoot;
33130
+ if (!el) {
33131
+ el = (_b = shadowRoot === null || shadowRoot === void 0 ? void 0 : shadowRoot.getElementById(elementId)) !== null && _b !== void 0 ? _b : null;
33132
+ }
33099
33133
  if (!el) {
33100
33134
  return;
33101
33135
  }
33102
- const serchContainer = document.getElementById(CONTAINER_ROOT_ID);
33103
- const container = serchContainer !== null && serchContainer !== void 0 ? serchContainer : window;
33136
+ const searchContainer = shadowRoot
33137
+ ? shadowRoot.getElementById(CONTAINER_ROOT_ID)
33138
+ : undefined;
33139
+ const container = searchContainer !== null && searchContainer !== void 0 ? searchContainer : window;
33104
33140
  container.scrollTo({
33105
33141
  top: el.offsetTop,
33106
33142
  behavior: "smooth",
@@ -34566,6 +34602,7 @@ var __vue_render__$x = function () {
34566
34602
  {
34567
34603
  staticClass: "lupa-search-results-product-title",
34568
34604
  style: "-webkit-line-clamp: " + _vm.maxLines,
34605
+ attrs: { title: _vm.title },
34569
34606
  },
34570
34607
  [
34571
34608
  !_vm.options.link
@@ -35070,9 +35107,17 @@ __vue_render__$s._withStripped = true;
35070
35107
  );
35071
35108
 
35072
35109
  let SearchResultsProductCustom = class SearchResultsProductCustom extends Vue$1 {
35073
- get text() {
35110
+ get value() {
35074
35111
  return this.item[this.options.key];
35075
35112
  }
35113
+ get text() {
35114
+ return this.isArray
35115
+ ? this.item[this.options.key].join(", ")
35116
+ : this.item[this.options.key];
35117
+ }
35118
+ get isArray() {
35119
+ return Array.isArray(this.value);
35120
+ }
35076
35121
  get className() {
35077
35122
  return this.options.className;
35078
35123
  }
@@ -36928,6 +36973,9 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
36928
36973
  var _a, _b, _c;
36929
36974
  return Boolean((_c = (_b = (_a = this.options.filters) === null || _a === void 0 ? void 0 : _a.currentFilters) === null || _b === void 0 ? void 0 : _b.mobileSidebar) === null || _c === void 0 ? void 0 : _c.showFilterCount);
36930
36975
  }
36976
+ get hasResults() {
36977
+ return this.searchResult.total > 0;
36978
+ }
36931
36979
  };
36932
36980
  __decorate([
36933
36981
  Prop({ default: () => ({ labels: {} }) })
@@ -36976,65 +37024,72 @@ var __vue_render__$f = function () {
36976
37024
  var _vm = this;
36977
37025
  var _h = _vm.$createElement;
36978
37026
  var _c = _vm._self._c || _h;
36979
- return _c("div", { attrs: { id: "lupa-search-results-toolbar" } }, [
36980
- _c(
36981
- "div",
36982
- { staticClass: "lupa-toolbar-left" },
36983
- [
36984
- _vm.showLayoutSelection
36985
- ? _c("SearchResultsLayoutSelection")
36986
- : _c("div"),
36987
- _vm._v(" "),
36988
- _vm.showItemSummary
36989
- ? _c("SearchResultsSummary", {
36990
- attrs: {
36991
- label: _vm.searchSummaryLabel,
36992
- clearable: _vm.hasAnyFilter && _vm.showFilterClear,
36993
- },
36994
- on: { clear: _vm.handleClearAll },
36995
- })
36996
- : _c("div"),
36997
- _vm._v(" "),
36998
- _vm.displayPageSelect
36999
- ? _c("SearchResultsPageSelect", {
37000
- attrs: {
37001
- options: _vm.paginationOptions.pageSelect,
37002
- "last-page-label": _vm.paginationOptions.labels.showMore,
37003
- "first-page-label": _vm.paginationOptions.labels.showLess,
37004
- },
37005
- })
37006
- : _c("div"),
37007
- ],
37008
- 1
37009
- ),
37010
- _vm._v(" "),
37011
- _c(
37012
- "div",
37013
- { staticClass: "lupa-toolbar-right" },
37014
- [
37015
- _c("SearchResultsMobileToggle", {
37016
- attrs: {
37017
- label: _vm.options.labels.mobileFilterButton,
37018
- "show-filter-count": _vm.showMobileFilterCount,
37019
- },
37020
- }),
37021
- _vm._v(" "),
37022
- _vm.paginationDisplay.pageSize
37023
- ? _c("SearchResultsPageSize", {
37024
- attrs: {
37025
- options: _vm.paginationOptions.pageSize,
37026
- label: _vm.paginationOptions.labels.pageSize,
37027
- },
37028
- })
37029
- : _c("div"),
37030
- _vm._v(" "),
37031
- _vm.sortOptions
37032
- ? _c("SearchResultsSort", { attrs: { options: _vm.sortOptions } })
37033
- : _c("div"),
37034
- ],
37035
- 1
37036
- ),
37037
- ])
37027
+ return _c(
37028
+ "div",
37029
+ {
37030
+ class: { "lupa-filter-no-results": !_vm.hasResults },
37031
+ attrs: { id: "lupa-search-results-toolbar" },
37032
+ },
37033
+ [
37034
+ _c(
37035
+ "div",
37036
+ { staticClass: "lupa-toolbar-left" },
37037
+ [
37038
+ _vm.showLayoutSelection
37039
+ ? _c("SearchResultsLayoutSelection")
37040
+ : _c("div"),
37041
+ _vm._v(" "),
37042
+ _vm.showItemSummary
37043
+ ? _c("SearchResultsSummary", {
37044
+ attrs: {
37045
+ label: _vm.searchSummaryLabel,
37046
+ clearable: _vm.hasAnyFilter && _vm.showFilterClear,
37047
+ },
37048
+ on: { clear: _vm.handleClearAll },
37049
+ })
37050
+ : _c("div"),
37051
+ _vm._v(" "),
37052
+ _vm.displayPageSelect
37053
+ ? _c("SearchResultsPageSelect", {
37054
+ attrs: {
37055
+ options: _vm.paginationOptions.pageSelect,
37056
+ "last-page-label": _vm.paginationOptions.labels.showMore,
37057
+ "first-page-label": _vm.paginationOptions.labels.showLess,
37058
+ },
37059
+ })
37060
+ : _c("div"),
37061
+ ],
37062
+ 1
37063
+ ),
37064
+ _vm._v(" "),
37065
+ _c(
37066
+ "div",
37067
+ { staticClass: "lupa-toolbar-right" },
37068
+ [
37069
+ _c("SearchResultsMobileToggle", {
37070
+ attrs: {
37071
+ label: _vm.options.labels.mobileFilterButton,
37072
+ "show-filter-count": _vm.showMobileFilterCount,
37073
+ },
37074
+ }),
37075
+ _vm._v(" "),
37076
+ _vm.paginationDisplay.pageSize
37077
+ ? _c("SearchResultsPageSize", {
37078
+ attrs: {
37079
+ options: _vm.paginationOptions.pageSize,
37080
+ label: _vm.paginationOptions.labels.pageSize,
37081
+ },
37082
+ })
37083
+ : _c("div"),
37084
+ _vm._v(" "),
37085
+ _vm.sortOptions
37086
+ ? _c("SearchResultsSort", { attrs: { options: _vm.sortOptions } })
37087
+ : _c("div"),
37088
+ ],
37089
+ 1
37090
+ ),
37091
+ ]
37092
+ )
37038
37093
  };
37039
37094
  var __vue_staticRenderFns__$f = [];
37040
37095
  __vue_render__$f._withStripped = true;
@@ -37096,7 +37151,7 @@ __vue_render__$e._withStripped = true;
37096
37151
  /* style */
37097
37152
  const __vue_inject_styles__$e = function (inject) {
37098
37153
  if (!inject) return
37099
- inject("data-v-ef12587c_0", { source: ".lupa-spinner {\n color: #555555;\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n padding-top: 100px;\n padding-right: 72px;\n}\n.lupa-spinner div {\n transform-origin: 40px 40px;\n animation: lupa-spinner 1.2s linear infinite;\n}\n.lupa-spinner div:after {\n content: \" \";\n display: block;\n position: absolute;\n top: 3px;\n left: 37px;\n width: 6px;\n height: 18px;\n border-radius: 20%;\n background: #555555;\n}\n.lupa-spinner div:nth-child(1) {\n transform: rotate(0deg);\n animation-delay: -1.1s;\n}\n.lupa-spinner div:nth-child(2) {\n transform: rotate(30deg);\n animation-delay: -1s;\n}\n.lupa-spinner div:nth-child(3) {\n transform: rotate(60deg);\n animation-delay: -0.9s;\n}\n.lupa-spinner div:nth-child(4) {\n transform: rotate(90deg);\n animation-delay: -0.8s;\n}\n.lupa-spinner div:nth-child(5) {\n transform: rotate(120deg);\n animation-delay: -0.7s;\n}\n.lupa-spinner div:nth-child(6) {\n transform: rotate(150deg);\n animation-delay: -0.6s;\n}\n.lupa-spinner div:nth-child(7) {\n transform: rotate(180deg);\n animation-delay: -0.5s;\n}\n.lupa-spinner div:nth-child(8) {\n transform: rotate(210deg);\n animation-delay: -0.4s;\n}\n.lupa-spinner div:nth-child(9) {\n transform: rotate(240deg);\n animation-delay: -0.3s;\n}\n.lupa-spinner div:nth-child(10) {\n transform: rotate(270deg);\n animation-delay: -0.2s;\n}\n.lupa-spinner div:nth-child(11) {\n transform: rotate(300deg);\n animation-delay: -0.1s;\n}\n.lupa-spinner div:nth-child(12) {\n transform: rotate(330deg);\n animation-delay: 0s;\n}\n@keyframes lupa-spinner {\n0% {\n opacity: 1;\n}\n100% {\n opacity: 0;\n}\n}\n.lupa-spinner-wrapper {\n width: 100%;\n}", map: undefined, media: undefined });
37154
+ inject("data-v-3353d3a1_0", { source: ".lupa-spinner {\n color: #555555;\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n padding-top: 100px;\n padding-right: 72px;\n}\n.lupa-spinner div {\n transform-origin: 40px 40px;\n animation: lupa-spinner 1.2s linear infinite;\n}\n.lupa-spinner div:after {\n content: \" \";\n display: block;\n position: absolute;\n top: 3px;\n left: 37px;\n width: 6px;\n height: 18px;\n border-radius: 20%;\n background: #555555;\n}\n.lupa-spinner div:nth-child(1) {\n transform: rotate(0deg);\n animation-delay: -1.1s;\n}\n.lupa-spinner div:nth-child(2) {\n transform: rotate(30deg);\n animation-delay: -1s;\n}\n.lupa-spinner div:nth-child(3) {\n transform: rotate(60deg);\n animation-delay: -0.9s;\n}\n.lupa-spinner div:nth-child(4) {\n transform: rotate(90deg);\n animation-delay: -0.8s;\n}\n.lupa-spinner div:nth-child(5) {\n transform: rotate(120deg);\n animation-delay: -0.7s;\n}\n.lupa-spinner div:nth-child(6) {\n transform: rotate(150deg);\n animation-delay: -0.6s;\n}\n.lupa-spinner div:nth-child(7) {\n transform: rotate(180deg);\n animation-delay: -0.5s;\n}\n.lupa-spinner div:nth-child(8) {\n transform: rotate(210deg);\n animation-delay: -0.4s;\n}\n.lupa-spinner div:nth-child(9) {\n transform: rotate(240deg);\n animation-delay: -0.3s;\n}\n.lupa-spinner div:nth-child(10) {\n transform: rotate(270deg);\n animation-delay: -0.2s;\n}\n.lupa-spinner div:nth-child(11) {\n transform: rotate(300deg);\n animation-delay: -0.1s;\n}\n.lupa-spinner div:nth-child(12) {\n transform: rotate(330deg);\n animation-delay: 0s;\n}\n@keyframes lupa-spinner {\n0% {\n opacity: 1;\n}\n100% {\n opacity: 0;\n}\n}\n.lupa-spinner-wrapper {\n width: 100%;\n overflow: hidden;\n}", map: undefined, media: undefined });
37100
37155
 
37101
37156
  };
37102
37157
  /* scoped */
@@ -37870,6 +37925,10 @@ let SearchResultsTitle = class SearchResultsTitle extends Vue$1 {
37870
37925
  var _a, _b;
37871
37926
  return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.descriptionTop;
37872
37927
  }
37928
+ get summaryLabel() {
37929
+ var _a, _b;
37930
+ return (_b = (_a = this.options.labels) === null || _a === void 0 ? void 0 : _a.itemCount) !== null && _b !== void 0 ? _b : "";
37931
+ }
37873
37932
  getLabel(label) {
37874
37933
  return addParamsToLabel(label, `'${this.currentQueryText}'`);
37875
37934
  }
@@ -37880,6 +37939,9 @@ __decorate([
37880
37939
  __decorate([
37881
37940
  Prop({ default: false })
37882
37941
  ], SearchResultsTitle.prototype, "isProductList", void 0);
37942
+ __decorate([
37943
+ Prop({ default: false })
37944
+ ], SearchResultsTitle.prototype, "showSummary", void 0);
37883
37945
  __decorate([
37884
37946
  searchResult$2.Getter("currentQueryText")
37885
37947
  ], SearchResultsTitle.prototype, "currentQueryText", void 0);
@@ -37892,6 +37954,9 @@ __decorate([
37892
37954
  SearchResultsTitle = __decorate([
37893
37955
  Component({
37894
37956
  name: "SearchResultsTitle",
37957
+ components: {
37958
+ SearchResultsSummary: __vue_component__$h,
37959
+ },
37895
37960
  })
37896
37961
  ], SearchResultsTitle);
37897
37962
  var script$8 = SearchResultsTitle;
@@ -37904,36 +37969,44 @@ var __vue_render__$8 = function () {
37904
37969
  var _vm = this;
37905
37970
  var _h = _vm.$createElement;
37906
37971
  var _c = _vm._self._c || _h;
37907
- return _c("div", [
37908
- _vm.showSearchTitle
37909
- ? _c(
37910
- "h1",
37911
- {
37912
- staticClass: "lupa-result-page-title",
37913
- attrs: { "data-cy": "lupa-result-page-title" },
37914
- },
37915
- [
37916
- _vm._v("\n " + _vm._s(_vm.options.labels.searchResults)),
37917
- _vm.queryText
37918
- ? _c("span", [_vm._v("'" + _vm._s(_vm.queryText) + "'")])
37919
- : _vm._e(),
37920
- _vm._v(" "),
37921
- _vm.showProductCount
37922
- ? _c("span", { staticClass: "lupa-results-total-count" }, [
37923
- _vm._v("(" + _vm._s(_vm.totalItems) + ")"),
37924
- ])
37925
- : _vm._e(),
37926
- ]
37927
- )
37928
- : _vm._e(),
37929
- _vm._v(" "),
37930
- _vm.descriptionTop
37931
- ? _c("div", {
37932
- staticClass: "lupa-result-page-description-top",
37933
- domProps: { innerHTML: _vm._s(_vm.descriptionTop) },
37934
- })
37935
- : _vm._e(),
37936
- ])
37972
+ return _c(
37973
+ "div",
37974
+ [
37975
+ _vm.showSearchTitle
37976
+ ? _c(
37977
+ "h1",
37978
+ {
37979
+ staticClass: "lupa-result-page-title",
37980
+ attrs: { "data-cy": "lupa-result-page-title" },
37981
+ },
37982
+ [
37983
+ _vm._v("\n " + _vm._s(_vm.options.labels.searchResults)),
37984
+ _vm.queryText
37985
+ ? _c("span", [_vm._v("'" + _vm._s(_vm.queryText) + "'")])
37986
+ : _vm._e(),
37987
+ _vm._v(" "),
37988
+ _vm.showProductCount
37989
+ ? _c("span", { staticClass: "lupa-results-total-count" }, [
37990
+ _vm._v("(" + _vm._s(_vm.totalItems) + ")"),
37991
+ ])
37992
+ : _vm._e(),
37993
+ ]
37994
+ )
37995
+ : _vm._e(),
37996
+ _vm._v(" "),
37997
+ _vm.showSummary
37998
+ ? _c("SearchResultsSummary", { attrs: { label: _vm.summaryLabel } })
37999
+ : _vm._e(),
38000
+ _vm._v(" "),
38001
+ _vm.descriptionTop
38002
+ ? _c("div", {
38003
+ staticClass: "lupa-result-page-description-top",
38004
+ domProps: { innerHTML: _vm._s(_vm.descriptionTop) },
38005
+ })
38006
+ : _vm._e(),
38007
+ ],
38008
+ 1
38009
+ )
37937
38010
  };
37938
38011
  var __vue_staticRenderFns__$8 = [];
37939
38012
  __vue_render__$8._withStripped = true;
@@ -38214,6 +38287,9 @@ __decorate([
38214
38287
  __decorate([
38215
38288
  Prop({ default: false })
38216
38289
  ], SearchResults.prototype, "isProductList", void 0);
38290
+ __decorate([
38291
+ Prop({ default: false })
38292
+ ], SearchResults.prototype, "isContainer", void 0);
38217
38293
  __decorate([
38218
38294
  searchResult$1.Getter("currentQueryText")
38219
38295
  ], SearchResults.prototype, "currentQueryText", void 0);
@@ -38297,6 +38373,29 @@ var __vue_render__$6 = function () {
38297
38373
  "div",
38298
38374
  { staticClass: "lupa-search-result-wrapper" },
38299
38375
  [
38376
+ _vm.isContainer
38377
+ ? [
38378
+ _c(
38379
+ "div",
38380
+ { staticClass: "lupa-container-title-summary-mobile" },
38381
+ [
38382
+ _c("SearchResultsDidYouMean", {
38383
+ attrs: { labels: _vm.didYouMeanLabels },
38384
+ }),
38385
+ _vm._v(" "),
38386
+ _c("SearchResultsTitle", {
38387
+ attrs: {
38388
+ "show-summary": true,
38389
+ options: _vm.options,
38390
+ "is-product-list": _vm.isProductList,
38391
+ },
38392
+ }),
38393
+ ],
38394
+ 1
38395
+ ),
38396
+ ]
38397
+ : _vm._e(),
38398
+ _vm._v(" "),
38300
38399
  _vm.isTitleResultTopPosition
38301
38400
  ? _c("CategoryTopFilters", { attrs: { options: _vm.options } })
38302
38401
  : _vm._e(),
@@ -38832,7 +38931,10 @@ var __vue_render__$1 = function () {
38832
38931
  _vm._v(" "),
38833
38932
  _c("SearchResults", {
38834
38933
  ref: "searchResults",
38835
- attrs: { options: _vm.fullSearchResultsOptions },
38934
+ attrs: {
38935
+ options: _vm.fullSearchResultsOptions,
38936
+ "is-container": true,
38937
+ },
38836
38938
  }),
38837
38939
  ],
38838
38940
  1
@@ -38944,13 +39046,19 @@ var __vue_render__ = function () {
38944
39046
  var _vm = this;
38945
39047
  var _h = _vm.$createElement;
38946
39048
  var _c = _vm._self._c || _h;
38947
- return _vm.isOpen
38948
- ? _c("SearchContainer", {
38949
- ref: "productList",
38950
- attrs: { options: _vm.containerOptions },
38951
- on: { "hook:mounted": _vm.focus, close: _vm.close },
38952
- })
38953
- : _vm._e()
39049
+ return _c(
39050
+ "div",
39051
+ [
39052
+ _vm.isOpen
39053
+ ? _c("SearchContainer", {
39054
+ ref: "productList",
39055
+ attrs: { options: _vm.containerOptions },
39056
+ on: { "hook:mounted": _vm.focus, close: _vm.close },
39057
+ })
39058
+ : _vm._e(),
39059
+ ],
39060
+ 1
39061
+ )
38954
39062
  };
38955
39063
  var __vue_staticRenderFns__ = [];
38956
39064
  __vue_render__._withStripped = true;
@@ -40106,6 +40214,30 @@ var store = new Vuex.Store({
40106
40214
  },
40107
40215
  });
40108
40216
 
40217
+ const attatchShadowDom = ({ host, manager, styleUrl, }) => {
40218
+ const link = document.createElement("link");
40219
+ link.type = "text/css";
40220
+ link.rel = "stylesheet";
40221
+ link.href = styleUrl;
40222
+ // Fonts only work when added in host document head
40223
+ const linkNode = document.createElement("link");
40224
+ linkNode.type = "text/css";
40225
+ linkNode.rel = "stylesheet";
40226
+ linkNode.href =
40227
+ "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
40228
+ document.head.appendChild(linkNode);
40229
+ // Add font for material icons
40230
+ const linkNode2 = document.createElement("link");
40231
+ linkNode2.type = "text/css";
40232
+ linkNode2.rel = "stylesheet";
40233
+ linkNode2.href =
40234
+ "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
40235
+ document.head.appendChild(linkNode2);
40236
+ const shadow = host.attachShadow({ mode: "open" });
40237
+ shadow.appendChild(manager);
40238
+ shadow.appendChild(link);
40239
+ };
40240
+
40109
40241
  /* eslint-disable @typescript-eslint/no-explicit-any */
40110
40242
  const app = {
40111
40243
  box: {},
@@ -40189,6 +40321,7 @@ const productList = (options, mountOptions) => {
40189
40321
  app.productList[options.containerSelector] = instance;
40190
40322
  };
40191
40323
  const searchContainer = (options, mountOptions) => {
40324
+ var _a;
40192
40325
  const existingInstance = app.productList[options.trigger];
40193
40326
  if (existingInstance) {
40194
40327
  existingInstance.productListOptions = options;
@@ -40201,13 +40334,21 @@ const searchContainer = (options, mountOptions) => {
40201
40334
  return;
40202
40335
  }
40203
40336
  Vue$1.use(Vuex);
40204
- const id = `lupa-search-container-manager`;
40205
- const managerElement = document.createElement("div");
40206
- managerElement.setAttribute("id", id);
40207
- document.body.appendChild(managerElement);
40337
+ const id = "lupa-search-container-manager";
40338
+ const shadowId = "lupa-shadow-id";
40339
+ const host = document.createElement("div");
40340
+ const manager = document.createElement("div");
40341
+ host.setAttribute("id", shadowId);
40342
+ manager.setAttribute("id", id);
40343
+ attatchShadowDom({
40344
+ host,
40345
+ manager,
40346
+ styleUrl: (_a = options.styleLink) !== null && _a !== void 0 ? _a : DEFAULT_CONTAINER_STYLE,
40347
+ });
40348
+ document.body.appendChild(host);
40208
40349
  const SearchContainerEntryComponent = Vue$1.component("SearchContainerEntry", __vue_component__);
40209
40350
  const instance = new SearchContainerEntryComponent({
40210
- el: `#${id}`,
40351
+ el: manager,
40211
40352
  propsData: { searchContainerOptions: options },
40212
40353
  store,
40213
40354
  });
@@ -14,6 +14,7 @@ export declare type SearchBoxOptionLabels = {
14
14
  currency: string;
15
15
  priceSeparator?: string;
16
16
  defaultFacetLabel?: string;
17
+ close?: string;
17
18
  };
18
19
  export declare type SearchBoxOptionLinks = {
19
20
  searchResults: string;
@@ -2,6 +2,7 @@ import { SearchBoxOptions } from "../search-box/SearchBoxOptions";
2
2
  import { SearchResultsOptions } from "../search-results/SearchResultsOptions";
3
3
  export declare type SearchContainerOptions = {
4
4
  trigger: string;
5
+ styleLink?: string;
5
6
  searchBox: SearchBoxOptions;
6
7
  searchResults: SearchResultsOptions;
7
8
  };
@@ -0,0 +1,5 @@
1
+ export declare const attatchShadowDom: ({ host, manager, styleUrl, }: {
2
+ host: HTMLElement;
3
+ manager: HTMLElement;
4
+ styleUrl: string;
5
+ }) => void;
@@ -20,4 +20,6 @@ export default class SearchBoxInput extends Vue {
20
20
  handleQueryChange(): void;
21
21
  handleInput(evt?: InputEvent): void;
22
22
  handleFocus(): void;
23
+ clear(): void;
24
+ focus(): void;
23
25
  }
@@ -7,6 +7,7 @@ export default class SearchResults extends Vue {
7
7
  options: SearchResultsOptions;
8
8
  initialFilters: FilterGroup;
9
9
  isProductList: boolean;
10
+ isContainer: boolean;
10
11
  get productsOptions(): SearchResultsProductOptions;
11
12
  currentQueryText: string;
12
13
  hasResults: boolean;
@@ -3,6 +3,7 @@ import Vue from "vue";
3
3
  export default class SearchResultsTitle extends Vue {
4
4
  options: SearchResultsOptions;
5
5
  isProductList: boolean;
6
+ showSummary: boolean;
6
7
  currentQueryText: string;
7
8
  totalItems: number;
8
9
  suggestedSearchText: string;
@@ -10,5 +11,6 @@ export default class SearchResultsTitle extends Vue {
10
11
  get showProductCount(): boolean;
11
12
  get showSearchTitle(): boolean;
12
13
  get descriptionTop(): string | undefined;
14
+ get summaryLabel(): string;
13
15
  getLabel(label: string): string;
14
16
  }
@@ -21,6 +21,7 @@ export default class SearchResultsToolbar extends Vue {
21
21
  get displayPageSelect(): boolean;
22
22
  get searchSummaryLabel(): string;
23
23
  get showMobileFilterCount(): boolean;
24
+ get hasResults(): boolean;
24
25
  currentResolutionPageSizes: number[];
25
26
  removeAllFilters: () => {
26
27
  params: QueryParams;
@@ -4,7 +4,9 @@ import { CustomDocumentElement } from "@/types/DocumentElement";
4
4
  export default class SearchResultsProductCustom extends Vue {
5
5
  item: Document;
6
6
  options: CustomDocumentElement;
7
+ get value(): unknown;
7
8
  get text(): string;
9
+ get isArray(): boolean;
8
10
  get className(): string;
9
11
  get label(): string | undefined;
10
12
  get isHtml(): boolean;