@getlupa/client 0.10.2 → 0.10.5

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 +268 -115
  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 +9 -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 +268 -115
  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 +9 -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 +9 -0
  35. package/dist/lupaContainerStyle.css +1 -0
  36. package/dist/style.css +1 -1
  37. package/package.json +3 -2
@@ -10984,7 +10984,7 @@ let SearchBoxInput = class SearchBoxInput extends Vue$1 {
10984
10984
  if (target) {
10985
10985
  this.inputValue = target.value;
10986
10986
  }
10987
- this.$emit("input", this.inputValue.replace(/\s+$/, ""));
10987
+ this.$emit("input", this.inputValue);
10988
10988
  }
10989
10989
  handleFocus() {
10990
10990
  this.$emit("focus");
@@ -10992,6 +10992,13 @@ let SearchBoxInput = class SearchBoxInput extends Vue$1 {
10992
10992
  this.handleInput();
10993
10993
  }
10994
10994
  }
10995
+ clear() {
10996
+ this.$emit("input", "");
10997
+ }
10998
+ focus() {
10999
+ var _a, _b;
11000
+ (_b = (_a = this.$refs) === null || _a === void 0 ? void 0 : _a.mainInput) === null || _b === void 0 ? void 0 : _b.focus();
11001
+ }
10995
11002
  };
10996
11003
  __decorate([
10997
11004
  Prop()
@@ -11161,6 +11168,14 @@ var __vue_render__$1b = function () {
11161
11168
  var _h = _vm.$createElement;
11162
11169
  var _c = _vm._self._c || _h;
11163
11170
  return _c("div", { attrs: { id: "lupa-search-box-input-container" } }, [
11171
+ _c("div", { staticClass: "lupa-input-clear" }, [
11172
+ _c("div", {
11173
+ staticClass: "lupa-input-clear-content",
11174
+ class: { "lupa-input-clear-filled": _vm.inputValue },
11175
+ on: { click: _vm.clear },
11176
+ }),
11177
+ ]),
11178
+ _vm._v(" "),
11164
11179
  _c("div", { attrs: { id: "lupa-search-box-input" } }, [
11165
11180
  _c("input", {
11166
11181
  staticClass: "lupa-hint",
@@ -11182,6 +11197,7 @@ var __vue_render__$1b = function () {
11182
11197
  expression: "inputValue",
11183
11198
  },
11184
11199
  ],
11200
+ ref: "mainInput",
11185
11201
  staticClass: "lupa-search-box-input-field",
11186
11202
  attrs: {
11187
11203
  autocomplete: "off",
@@ -11221,7 +11237,13 @@ var __vue_render__$1b = function () {
11221
11237
  },
11222
11238
  },
11223
11239
  },
11224
- [_c("span", { staticClass: "lupa-close-action" }, [_vm._v("×")])]
11240
+ [
11241
+ _vm.labels.close
11242
+ ? _c("span", { staticClass: "lupa-close-label" }, [
11243
+ _vm._v(_vm._s(_vm.labels.close)),
11244
+ ])
11245
+ : _vm._e(),
11246
+ ]
11225
11247
  )
11226
11248
  : _vm._e(),
11227
11249
  ])
@@ -11232,7 +11254,7 @@ __vue_render__$1b._withStripped = true;
11232
11254
  /* style */
11233
11255
  const __vue_inject_styles__$1b = function (inject) {
11234
11256
  if (!inject) return
11235
- 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 });
11257
+ 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 });
11236
11258
 
11237
11259
  };
11238
11260
  /* scoped */
@@ -11966,7 +11988,8 @@ const MAX_FACET_VALUES = 5000;
11966
11988
  const CURRENCY_KEY_INDICATOR = "price";
11967
11989
  const DEFAULT_PAGE_SIZE = 12;
11968
11990
  const DEFAULT_PAGE_SIZE_SELECTION = [12, 24, 36, 60];
11969
- const LUPA_ROUTING_EVENT = "lupaRedirect";
11991
+ const LUPA_ROUTING_EVENT = "lupaRedirect";
11992
+ const DEFAULT_CONTAINER_STYLE = "containerStyle.css";
11970
11993
 
11971
11994
  const formatRange = (filter) => {
11972
11995
  var _a, _b;
@@ -30836,12 +30859,16 @@ let SearchBox = class SearchBox extends Vue$1 {
30836
30859
  return (_a = this.options.searchTriggers) !== null && _a !== void 0 ? _a : [];
30837
30860
  }
30838
30861
  mounted() {
30862
+ var _a, _b;
30839
30863
  window.addEventListener("keydown", this.handleKeyDown);
30840
30864
  window.addEventListener("click", this.handleMouseClick);
30841
30865
  this.setSearchResultsLink(this.options.links.searchResults);
30842
30866
  this.saveOptions({ options: this.options });
30843
30867
  this.setSearchBoxOptions({ options: this.options });
30844
30868
  bindSearchTriggers(this.searchTriggers, this.handleCurrentValueSearch);
30869
+ if (this.isSearchContainer) {
30870
+ (_b = (_a = this.$refs) === null || _a === void 0 ? void 0 : _a.searchBoxInput) === null || _b === void 0 ? void 0 : _b.focus();
30871
+ }
30845
30872
  }
30846
30873
  beforeDestroy() {
30847
30874
  window.removeEventListener("keydown", this.handleKeyDown);
@@ -30879,12 +30906,12 @@ let SearchBox = class SearchBox extends Vue$1 {
30879
30906
  }
30880
30907
  handleInput(value) {
30881
30908
  this.opened = true;
30882
- this.inputValue = value;
30909
+ this.inputValue = value.replace(/\s+$/, "");
30883
30910
  this.suggestedValue = defaultSuggestedValue;
30884
30911
  this.trackSearchQuery(value);
30885
30912
  if (this.isSearchContainer) {
30886
30913
  this.goToResultsDebounced({
30887
- searchText: this.searchValue,
30914
+ searchText: value,
30888
30915
  });
30889
30916
  }
30890
30917
  }
@@ -31073,6 +31100,7 @@ var __vue_render__$U = function () {
31073
31100
  { staticClass: "lupa-search-box-wrapper" },
31074
31101
  [
31075
31102
  _c("SearchBoxInput", {
31103
+ ref: "searchBoxInput",
31076
31104
  attrs: {
31077
31105
  options: _vm.inputOptions,
31078
31106
  suggestedValue: _vm.suggestedValue,
@@ -31112,7 +31140,7 @@ __vue_render__$U._withStripped = true;
31112
31140
  /* style */
31113
31141
  const __vue_inject_styles__$U = function (inject) {
31114
31142
  if (!inject) return
31115
- 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 });
31143
+ 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 });
31116
31144
 
31117
31145
  };
31118
31146
  /* scoped */
@@ -33089,6 +33117,7 @@ __vue_render__$L._withStripped = true;
33089
33117
  );
33090
33118
 
33091
33119
  const RESULT_ROOT_ID = "lupa-search-results";
33120
+ const SHADOW_ROOT_ID = "lupa-shadow-id";
33092
33121
  const CONTAINER_ROOT_ID = "lupa-search-container";
33093
33122
  const scrollToSearchResults = (timeout = 500) => {
33094
33123
  if (timeout) {
@@ -33099,12 +33128,19 @@ const scrollToSearchResults = (timeout = 500) => {
33099
33128
  }
33100
33129
  };
33101
33130
  const scrollTo = (elementId) => {
33102
- const el = document.getElementById(elementId);
33131
+ var _a, _b;
33132
+ let el = document.getElementById(elementId);
33133
+ const shadowRoot = (_a = document.getElementById(SHADOW_ROOT_ID)) === null || _a === void 0 ? void 0 : _a.shadowRoot;
33134
+ if (!el) {
33135
+ el = (_b = shadowRoot === null || shadowRoot === void 0 ? void 0 : shadowRoot.getElementById(elementId)) !== null && _b !== void 0 ? _b : null;
33136
+ }
33103
33137
  if (!el) {
33104
33138
  return;
33105
33139
  }
33106
- const serchContainer = document.getElementById(CONTAINER_ROOT_ID);
33107
- const container = serchContainer !== null && serchContainer !== void 0 ? serchContainer : window;
33140
+ const searchContainer = shadowRoot
33141
+ ? shadowRoot.getElementById(CONTAINER_ROOT_ID)
33142
+ : undefined;
33143
+ const container = searchContainer !== null && searchContainer !== void 0 ? searchContainer : window;
33108
33144
  container.scrollTo({
33109
33145
  top: el.offsetTop,
33110
33146
  behavior: "smooth",
@@ -34570,6 +34606,7 @@ var __vue_render__$x = function () {
34570
34606
  {
34571
34607
  staticClass: "lupa-search-results-product-title",
34572
34608
  style: "-webkit-line-clamp: " + _vm.maxLines,
34609
+ attrs: { title: _vm.title },
34573
34610
  },
34574
34611
  [
34575
34612
  !_vm.options.link
@@ -35074,9 +35111,17 @@ __vue_render__$s._withStripped = true;
35074
35111
  );
35075
35112
 
35076
35113
  let SearchResultsProductCustom = class SearchResultsProductCustom extends Vue$1 {
35077
- get text() {
35114
+ get value() {
35078
35115
  return this.item[this.options.key];
35079
35116
  }
35117
+ get text() {
35118
+ return this.isArray
35119
+ ? this.item[this.options.key].join(", ")
35120
+ : this.item[this.options.key];
35121
+ }
35122
+ get isArray() {
35123
+ return Array.isArray(this.value);
35124
+ }
35080
35125
  get className() {
35081
35126
  return this.options.className;
35082
35127
  }
@@ -36879,7 +36924,8 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
36879
36924
  : Boolean((_a = this.options.toolbar) === null || _a === void 0 ? void 0 : _a.layoutSelector);
36880
36925
  }
36881
36926
  get sortOptions() {
36882
- if (this.isBottomLocation) {
36927
+ var _a;
36928
+ if (this.isBottomLocation || !((_a = this.options.sort) === null || _a === void 0 ? void 0 : _a.length)) {
36883
36929
  return undefined;
36884
36930
  }
36885
36931
  return {
@@ -36932,6 +36978,9 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
36932
36978
  var _a, _b, _c;
36933
36979
  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);
36934
36980
  }
36981
+ get hasResults() {
36982
+ return this.searchResult.total > 0;
36983
+ }
36935
36984
  };
36936
36985
  __decorate([
36937
36986
  Prop({ default: () => ({ labels: {} }) })
@@ -36980,65 +37029,72 @@ var __vue_render__$f = function () {
36980
37029
  var _vm = this;
36981
37030
  var _h = _vm.$createElement;
36982
37031
  var _c = _vm._self._c || _h;
36983
- return _c("div", { attrs: { id: "lupa-search-results-toolbar" } }, [
36984
- _c(
36985
- "div",
36986
- { staticClass: "lupa-toolbar-left" },
36987
- [
36988
- _vm.showLayoutSelection
36989
- ? _c("SearchResultsLayoutSelection")
36990
- : _c("div"),
36991
- _vm._v(" "),
36992
- _vm.showItemSummary
36993
- ? _c("SearchResultsSummary", {
36994
- attrs: {
36995
- label: _vm.searchSummaryLabel,
36996
- clearable: _vm.hasAnyFilter && _vm.showFilterClear,
36997
- },
36998
- on: { clear: _vm.handleClearAll },
36999
- })
37000
- : _c("div"),
37001
- _vm._v(" "),
37002
- _vm.displayPageSelect
37003
- ? _c("SearchResultsPageSelect", {
37004
- attrs: {
37005
- options: _vm.paginationOptions.pageSelect,
37006
- "last-page-label": _vm.paginationOptions.labels.showMore,
37007
- "first-page-label": _vm.paginationOptions.labels.showLess,
37008
- },
37009
- })
37010
- : _c("div"),
37011
- ],
37012
- 1
37013
- ),
37014
- _vm._v(" "),
37015
- _c(
37016
- "div",
37017
- { staticClass: "lupa-toolbar-right" },
37018
- [
37019
- _c("SearchResultsMobileToggle", {
37020
- attrs: {
37021
- label: _vm.options.labels.mobileFilterButton,
37022
- "show-filter-count": _vm.showMobileFilterCount,
37023
- },
37024
- }),
37025
- _vm._v(" "),
37026
- _vm.paginationDisplay.pageSize
37027
- ? _c("SearchResultsPageSize", {
37028
- attrs: {
37029
- options: _vm.paginationOptions.pageSize,
37030
- label: _vm.paginationOptions.labels.pageSize,
37031
- },
37032
- })
37033
- : _c("div"),
37034
- _vm._v(" "),
37035
- _vm.sortOptions
37036
- ? _c("SearchResultsSort", { attrs: { options: _vm.sortOptions } })
37037
- : _c("div"),
37038
- ],
37039
- 1
37040
- ),
37041
- ])
37032
+ return _c(
37033
+ "div",
37034
+ {
37035
+ class: { "lupa-filter-no-results": !_vm.hasResults },
37036
+ attrs: { id: "lupa-search-results-toolbar" },
37037
+ },
37038
+ [
37039
+ _c(
37040
+ "div",
37041
+ { staticClass: "lupa-toolbar-left" },
37042
+ [
37043
+ _vm.showLayoutSelection
37044
+ ? _c("SearchResultsLayoutSelection")
37045
+ : _c("div"),
37046
+ _vm._v(" "),
37047
+ _vm.showItemSummary
37048
+ ? _c("SearchResultsSummary", {
37049
+ attrs: {
37050
+ label: _vm.searchSummaryLabel,
37051
+ clearable: _vm.hasAnyFilter && _vm.showFilterClear,
37052
+ },
37053
+ on: { clear: _vm.handleClearAll },
37054
+ })
37055
+ : _c("div"),
37056
+ _vm._v(" "),
37057
+ _vm.displayPageSelect
37058
+ ? _c("SearchResultsPageSelect", {
37059
+ attrs: {
37060
+ options: _vm.paginationOptions.pageSelect,
37061
+ "last-page-label": _vm.paginationOptions.labels.showMore,
37062
+ "first-page-label": _vm.paginationOptions.labels.showLess,
37063
+ },
37064
+ })
37065
+ : _c("div"),
37066
+ ],
37067
+ 1
37068
+ ),
37069
+ _vm._v(" "),
37070
+ _c(
37071
+ "div",
37072
+ { staticClass: "lupa-toolbar-right" },
37073
+ [
37074
+ _c("SearchResultsMobileToggle", {
37075
+ attrs: {
37076
+ label: _vm.options.labels.mobileFilterButton,
37077
+ "show-filter-count": _vm.showMobileFilterCount,
37078
+ },
37079
+ }),
37080
+ _vm._v(" "),
37081
+ _vm.paginationDisplay.pageSize
37082
+ ? _c("SearchResultsPageSize", {
37083
+ attrs: {
37084
+ options: _vm.paginationOptions.pageSize,
37085
+ label: _vm.paginationOptions.labels.pageSize,
37086
+ },
37087
+ })
37088
+ : _c("div"),
37089
+ _vm._v(" "),
37090
+ _vm.sortOptions
37091
+ ? _c("SearchResultsSort", { attrs: { options: _vm.sortOptions } })
37092
+ : _c("div"),
37093
+ ],
37094
+ 1
37095
+ ),
37096
+ ]
37097
+ )
37042
37098
  };
37043
37099
  var __vue_staticRenderFns__$f = [];
37044
37100
  __vue_render__$f._withStripped = true;
@@ -37100,7 +37156,7 @@ __vue_render__$e._withStripped = true;
37100
37156
  /* style */
37101
37157
  const __vue_inject_styles__$e = function (inject) {
37102
37158
  if (!inject) return
37103
- 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 });
37159
+ 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 });
37104
37160
 
37105
37161
  };
37106
37162
  /* scoped */
@@ -37874,6 +37930,10 @@ let SearchResultsTitle = class SearchResultsTitle extends Vue$1 {
37874
37930
  var _a, _b;
37875
37931
  return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.descriptionTop;
37876
37932
  }
37933
+ get summaryLabel() {
37934
+ var _a, _b;
37935
+ return (_b = (_a = this.options.labels) === null || _a === void 0 ? void 0 : _a.itemCount) !== null && _b !== void 0 ? _b : "";
37936
+ }
37877
37937
  getLabel(label) {
37878
37938
  return addParamsToLabel(label, `'${this.currentQueryText}'`);
37879
37939
  }
@@ -37884,6 +37944,9 @@ __decorate([
37884
37944
  __decorate([
37885
37945
  Prop({ default: false })
37886
37946
  ], SearchResultsTitle.prototype, "isProductList", void 0);
37947
+ __decorate([
37948
+ Prop({ default: false })
37949
+ ], SearchResultsTitle.prototype, "showSummary", void 0);
37887
37950
  __decorate([
37888
37951
  searchResult$2.Getter("currentQueryText")
37889
37952
  ], SearchResultsTitle.prototype, "currentQueryText", void 0);
@@ -37896,6 +37959,9 @@ __decorate([
37896
37959
  SearchResultsTitle = __decorate([
37897
37960
  Component({
37898
37961
  name: "SearchResultsTitle",
37962
+ components: {
37963
+ SearchResultsSummary: __vue_component__$h,
37964
+ },
37899
37965
  })
37900
37966
  ], SearchResultsTitle);
37901
37967
  var script$8 = SearchResultsTitle;
@@ -37908,36 +37974,44 @@ var __vue_render__$8 = function () {
37908
37974
  var _vm = this;
37909
37975
  var _h = _vm.$createElement;
37910
37976
  var _c = _vm._self._c || _h;
37911
- return _c("div", [
37912
- _vm.showSearchTitle
37913
- ? _c(
37914
- "h1",
37915
- {
37916
- staticClass: "lupa-result-page-title",
37917
- attrs: { "data-cy": "lupa-result-page-title" },
37918
- },
37919
- [
37920
- _vm._v("\n " + _vm._s(_vm.options.labels.searchResults)),
37921
- _vm.queryText
37922
- ? _c("span", [_vm._v("'" + _vm._s(_vm.queryText) + "'")])
37923
- : _vm._e(),
37924
- _vm._v(" "),
37925
- _vm.showProductCount
37926
- ? _c("span", { staticClass: "lupa-results-total-count" }, [
37927
- _vm._v("(" + _vm._s(_vm.totalItems) + ")"),
37928
- ])
37929
- : _vm._e(),
37930
- ]
37931
- )
37932
- : _vm._e(),
37933
- _vm._v(" "),
37934
- _vm.descriptionTop
37935
- ? _c("div", {
37936
- staticClass: "lupa-result-page-description-top",
37937
- domProps: { innerHTML: _vm._s(_vm.descriptionTop) },
37938
- })
37939
- : _vm._e(),
37940
- ])
37977
+ return _c(
37978
+ "div",
37979
+ [
37980
+ _vm.showSearchTitle
37981
+ ? _c(
37982
+ "h1",
37983
+ {
37984
+ staticClass: "lupa-result-page-title",
37985
+ attrs: { "data-cy": "lupa-result-page-title" },
37986
+ },
37987
+ [
37988
+ _vm._v("\n " + _vm._s(_vm.options.labels.searchResults)),
37989
+ _vm.queryText
37990
+ ? _c("span", [_vm._v("'" + _vm._s(_vm.queryText) + "'")])
37991
+ : _vm._e(),
37992
+ _vm._v(" "),
37993
+ _vm.showProductCount
37994
+ ? _c("span", { staticClass: "lupa-results-total-count" }, [
37995
+ _vm._v("(" + _vm._s(_vm.totalItems) + ")"),
37996
+ ])
37997
+ : _vm._e(),
37998
+ ]
37999
+ )
38000
+ : _vm._e(),
38001
+ _vm._v(" "),
38002
+ _vm.showSummary
38003
+ ? _c("SearchResultsSummary", { attrs: { label: _vm.summaryLabel } })
38004
+ : _vm._e(),
38005
+ _vm._v(" "),
38006
+ _vm.descriptionTop
38007
+ ? _c("div", {
38008
+ staticClass: "lupa-result-page-description-top",
38009
+ domProps: { innerHTML: _vm._s(_vm.descriptionTop) },
38010
+ })
38011
+ : _vm._e(),
38012
+ ],
38013
+ 1
38014
+ )
37941
38015
  };
37942
38016
  var __vue_staticRenderFns__$8 = [];
37943
38017
  __vue_render__$8._withStripped = true;
@@ -38218,6 +38292,9 @@ __decorate([
38218
38292
  __decorate([
38219
38293
  Prop({ default: false })
38220
38294
  ], SearchResults.prototype, "isProductList", void 0);
38295
+ __decorate([
38296
+ Prop({ default: false })
38297
+ ], SearchResults.prototype, "isContainer", void 0);
38221
38298
  __decorate([
38222
38299
  searchResult$1.Getter("currentQueryText")
38223
38300
  ], SearchResults.prototype, "currentQueryText", void 0);
@@ -38301,6 +38378,29 @@ var __vue_render__$6 = function () {
38301
38378
  "div",
38302
38379
  { staticClass: "lupa-search-result-wrapper" },
38303
38380
  [
38381
+ _vm.isContainer
38382
+ ? [
38383
+ _c(
38384
+ "div",
38385
+ { staticClass: "lupa-container-title-summary-mobile" },
38386
+ [
38387
+ _c("SearchResultsDidYouMean", {
38388
+ attrs: { labels: _vm.didYouMeanLabels },
38389
+ }),
38390
+ _vm._v(" "),
38391
+ _c("SearchResultsTitle", {
38392
+ attrs: {
38393
+ "show-summary": true,
38394
+ options: _vm.options,
38395
+ "is-product-list": _vm.isProductList,
38396
+ },
38397
+ }),
38398
+ ],
38399
+ 1
38400
+ ),
38401
+ ]
38402
+ : _vm._e(),
38403
+ _vm._v(" "),
38304
38404
  _vm.isTitleResultTopPosition
38305
38405
  ? _c("CategoryTopFilters", { attrs: { options: _vm.options } })
38306
38406
  : _vm._e(),
@@ -38836,7 +38936,10 @@ var __vue_render__$1 = function () {
38836
38936
  _vm._v(" "),
38837
38937
  _c("SearchResults", {
38838
38938
  ref: "searchResults",
38839
- attrs: { options: _vm.fullSearchResultsOptions },
38939
+ attrs: {
38940
+ options: _vm.fullSearchResultsOptions,
38941
+ "is-container": true,
38942
+ },
38840
38943
  }),
38841
38944
  ],
38842
38945
  1
@@ -38948,13 +39051,19 @@ var __vue_render__ = function () {
38948
39051
  var _vm = this;
38949
39052
  var _h = _vm.$createElement;
38950
39053
  var _c = _vm._self._c || _h;
38951
- return _vm.isOpen
38952
- ? _c("SearchContainer", {
38953
- ref: "productList",
38954
- attrs: { options: _vm.containerOptions },
38955
- on: { "hook:mounted": _vm.focus, close: _vm.close },
38956
- })
38957
- : _vm._e()
39054
+ return _c(
39055
+ "div",
39056
+ [
39057
+ _vm.isOpen
39058
+ ? _c("SearchContainer", {
39059
+ ref: "productList",
39060
+ attrs: { options: _vm.containerOptions },
39061
+ on: { "hook:mounted": _vm.focus, close: _vm.close },
39062
+ })
39063
+ : _vm._e(),
39064
+ ],
39065
+ 1
39066
+ )
38958
39067
  };
38959
39068
  var __vue_staticRenderFns__ = [];
38960
39069
  __vue_render__._withStripped = true;
@@ -40110,6 +40219,44 @@ var store = new Vuex.Store({
40110
40219
  },
40111
40220
  });
40112
40221
 
40222
+ const createShadowDom = (shadowId, managerId) => {
40223
+ let host = document.getElementById(shadowId);
40224
+ let manager = document.getElementById(managerId);
40225
+ if (!host) {
40226
+ host = document.createElement("div");
40227
+ manager = document.createElement("div");
40228
+ }
40229
+ if (!manager) {
40230
+ manager = document.createElement("div");
40231
+ }
40232
+ host.setAttribute("id", shadowId);
40233
+ manager === null || manager === void 0 ? void 0 : manager.setAttribute("id", managerId);
40234
+ return { host, manager };
40235
+ };
40236
+ const attatchShadowDom = ({ host, manager, styleUrl, }) => {
40237
+ const link = document.createElement("link");
40238
+ link.type = "text/css";
40239
+ link.rel = "stylesheet";
40240
+ link.href = styleUrl;
40241
+ // Fonts only work when added in host document head
40242
+ const linkNode = document.createElement("link");
40243
+ linkNode.type = "text/css";
40244
+ linkNode.rel = "stylesheet";
40245
+ linkNode.href =
40246
+ "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
40247
+ document.head.appendChild(linkNode);
40248
+ // Add font for material icons
40249
+ const linkNode2 = document.createElement("link");
40250
+ linkNode2.type = "text/css";
40251
+ linkNode2.rel = "stylesheet";
40252
+ linkNode2.href =
40253
+ "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
40254
+ document.head.appendChild(linkNode2);
40255
+ const shadow = host.attachShadow({ mode: "open" });
40256
+ shadow.appendChild(manager);
40257
+ shadow.appendChild(link);
40258
+ };
40259
+
40113
40260
  /* eslint-disable @typescript-eslint/no-explicit-any */
40114
40261
  const app = {
40115
40262
  box: {},
@@ -40193,6 +40340,7 @@ const productList = (options, mountOptions) => {
40193
40340
  app.productList[options.containerSelector] = instance;
40194
40341
  };
40195
40342
  const searchContainer = (options, mountOptions) => {
40343
+ var _a;
40196
40344
  const existingInstance = app.productList[options.trigger];
40197
40345
  if (existingInstance) {
40198
40346
  existingInstance.productListOptions = options;
@@ -40205,13 +40353,18 @@ const searchContainer = (options, mountOptions) => {
40205
40353
  return;
40206
40354
  }
40207
40355
  Vue$1.use(Vuex);
40208
- const id = `lupa-search-container-manager`;
40209
- const managerElement = document.createElement("div");
40210
- managerElement.setAttribute("id", id);
40211
- document.body.appendChild(managerElement);
40356
+ const id = "lupa-search-container-manager";
40357
+ const shadowId = "lupa-shadow-id";
40358
+ const { host, manager } = createShadowDom(shadowId, id);
40359
+ attatchShadowDom({
40360
+ host,
40361
+ manager,
40362
+ styleUrl: (_a = options.styleLink) !== null && _a !== void 0 ? _a : DEFAULT_CONTAINER_STYLE,
40363
+ });
40364
+ document.body.appendChild(host);
40212
40365
  const SearchContainerEntryComponent = Vue$1.component("SearchContainerEntry", __vue_component__);
40213
40366
  const instance = new SearchContainerEntryComponent({
40214
- el: `#${id}`,
40367
+ el: manager,
40215
40368
  propsData: { searchContainerOptions: options },
40216
40369
  store,
40217
40370
  });
@@ -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,9 @@
1
+ export declare const createShadowDom: (shadowId: string, managerId: string) => {
2
+ host: HTMLElement;
3
+ manager: HTMLElement;
4
+ };
5
+ export declare const attatchShadowDom: ({ host, manager, styleUrl, }: {
6
+ host: HTMLElement;
7
+ manager: HTMLElement;
8
+ styleUrl: string;
9
+ }) => void;
@@ -0,0 +1 @@
1
+
@@ -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
  }