@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
@@ -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;
@@ -15,6 +15,7 @@ export declare const SEARCH_BOX_CONFIGURATION: {
15
15
  currency: string;
16
16
  priceSeparator: string;
17
17
  defaultFacetLabel: string;
18
+ close: string;
18
19
  };
19
20
  links: {
20
21
  searchResults: string;
@@ -13,3 +13,4 @@ export declare const CURRENCY_KEY_INDICATOR = "price";
13
13
  export declare const DEFAULT_PAGE_SIZE = 12;
14
14
  export declare const DEFAULT_PAGE_SIZE_SELECTION: number[];
15
15
  export declare const LUPA_ROUTING_EVENT = "lupaRedirect";
16
+ export declare const DEFAULT_CONTAINER_STYLE = "containerStyle.css";
@@ -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
  }
@@ -36875,7 +36920,8 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
36875
36920
  : Boolean((_a = this.options.toolbar) === null || _a === void 0 ? void 0 : _a.layoutSelector);
36876
36921
  }
36877
36922
  get sortOptions() {
36878
- if (this.isBottomLocation) {
36923
+ var _a;
36924
+ if (this.isBottomLocation || !((_a = this.options.sort) === null || _a === void 0 ? void 0 : _a.length)) {
36879
36925
  return undefined;
36880
36926
  }
36881
36927
  return {
@@ -36928,6 +36974,9 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
36928
36974
  var _a, _b, _c;
36929
36975
  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
36976
  }
36977
+ get hasResults() {
36978
+ return this.searchResult.total > 0;
36979
+ }
36931
36980
  };
36932
36981
  __decorate([
36933
36982
  Prop({ default: () => ({ labels: {} }) })
@@ -36976,65 +37025,72 @@ var __vue_render__$f = function () {
36976
37025
  var _vm = this;
36977
37026
  var _h = _vm.$createElement;
36978
37027
  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
- ])
37028
+ return _c(
37029
+ "div",
37030
+ {
37031
+ class: { "lupa-filter-no-results": !_vm.hasResults },
37032
+ attrs: { id: "lupa-search-results-toolbar" },
37033
+ },
37034
+ [
37035
+ _c(
37036
+ "div",
37037
+ { staticClass: "lupa-toolbar-left" },
37038
+ [
37039
+ _vm.showLayoutSelection
37040
+ ? _c("SearchResultsLayoutSelection")
37041
+ : _c("div"),
37042
+ _vm._v(" "),
37043
+ _vm.showItemSummary
37044
+ ? _c("SearchResultsSummary", {
37045
+ attrs: {
37046
+ label: _vm.searchSummaryLabel,
37047
+ clearable: _vm.hasAnyFilter && _vm.showFilterClear,
37048
+ },
37049
+ on: { clear: _vm.handleClearAll },
37050
+ })
37051
+ : _c("div"),
37052
+ _vm._v(" "),
37053
+ _vm.displayPageSelect
37054
+ ? _c("SearchResultsPageSelect", {
37055
+ attrs: {
37056
+ options: _vm.paginationOptions.pageSelect,
37057
+ "last-page-label": _vm.paginationOptions.labels.showMore,
37058
+ "first-page-label": _vm.paginationOptions.labels.showLess,
37059
+ },
37060
+ })
37061
+ : _c("div"),
37062
+ ],
37063
+ 1
37064
+ ),
37065
+ _vm._v(" "),
37066
+ _c(
37067
+ "div",
37068
+ { staticClass: "lupa-toolbar-right" },
37069
+ [
37070
+ _c("SearchResultsMobileToggle", {
37071
+ attrs: {
37072
+ label: _vm.options.labels.mobileFilterButton,
37073
+ "show-filter-count": _vm.showMobileFilterCount,
37074
+ },
37075
+ }),
37076
+ _vm._v(" "),
37077
+ _vm.paginationDisplay.pageSize
37078
+ ? _c("SearchResultsPageSize", {
37079
+ attrs: {
37080
+ options: _vm.paginationOptions.pageSize,
37081
+ label: _vm.paginationOptions.labels.pageSize,
37082
+ },
37083
+ })
37084
+ : _c("div"),
37085
+ _vm._v(" "),
37086
+ _vm.sortOptions
37087
+ ? _c("SearchResultsSort", { attrs: { options: _vm.sortOptions } })
37088
+ : _c("div"),
37089
+ ],
37090
+ 1
37091
+ ),
37092
+ ]
37093
+ )
37038
37094
  };
37039
37095
  var __vue_staticRenderFns__$f = [];
37040
37096
  __vue_render__$f._withStripped = true;
@@ -37096,7 +37152,7 @@ __vue_render__$e._withStripped = true;
37096
37152
  /* style */
37097
37153
  const __vue_inject_styles__$e = function (inject) {
37098
37154
  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 });
37155
+ 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
37156
 
37101
37157
  };
37102
37158
  /* scoped */
@@ -37870,6 +37926,10 @@ let SearchResultsTitle = class SearchResultsTitle extends Vue$1 {
37870
37926
  var _a, _b;
37871
37927
  return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.descriptionTop;
37872
37928
  }
37929
+ get summaryLabel() {
37930
+ var _a, _b;
37931
+ return (_b = (_a = this.options.labels) === null || _a === void 0 ? void 0 : _a.itemCount) !== null && _b !== void 0 ? _b : "";
37932
+ }
37873
37933
  getLabel(label) {
37874
37934
  return addParamsToLabel(label, `'${this.currentQueryText}'`);
37875
37935
  }
@@ -37880,6 +37940,9 @@ __decorate([
37880
37940
  __decorate([
37881
37941
  Prop({ default: false })
37882
37942
  ], SearchResultsTitle.prototype, "isProductList", void 0);
37943
+ __decorate([
37944
+ Prop({ default: false })
37945
+ ], SearchResultsTitle.prototype, "showSummary", void 0);
37883
37946
  __decorate([
37884
37947
  searchResult$2.Getter("currentQueryText")
37885
37948
  ], SearchResultsTitle.prototype, "currentQueryText", void 0);
@@ -37892,6 +37955,9 @@ __decorate([
37892
37955
  SearchResultsTitle = __decorate([
37893
37956
  Component({
37894
37957
  name: "SearchResultsTitle",
37958
+ components: {
37959
+ SearchResultsSummary: __vue_component__$h,
37960
+ },
37895
37961
  })
37896
37962
  ], SearchResultsTitle);
37897
37963
  var script$8 = SearchResultsTitle;
@@ -37904,36 +37970,44 @@ var __vue_render__$8 = function () {
37904
37970
  var _vm = this;
37905
37971
  var _h = _vm.$createElement;
37906
37972
  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
- ])
37973
+ return _c(
37974
+ "div",
37975
+ [
37976
+ _vm.showSearchTitle
37977
+ ? _c(
37978
+ "h1",
37979
+ {
37980
+ staticClass: "lupa-result-page-title",
37981
+ attrs: { "data-cy": "lupa-result-page-title" },
37982
+ },
37983
+ [
37984
+ _vm._v("\n " + _vm._s(_vm.options.labels.searchResults)),
37985
+ _vm.queryText
37986
+ ? _c("span", [_vm._v("'" + _vm._s(_vm.queryText) + "'")])
37987
+ : _vm._e(),
37988
+ _vm._v(" "),
37989
+ _vm.showProductCount
37990
+ ? _c("span", { staticClass: "lupa-results-total-count" }, [
37991
+ _vm._v("(" + _vm._s(_vm.totalItems) + ")"),
37992
+ ])
37993
+ : _vm._e(),
37994
+ ]
37995
+ )
37996
+ : _vm._e(),
37997
+ _vm._v(" "),
37998
+ _vm.showSummary
37999
+ ? _c("SearchResultsSummary", { attrs: { label: _vm.summaryLabel } })
38000
+ : _vm._e(),
38001
+ _vm._v(" "),
38002
+ _vm.descriptionTop
38003
+ ? _c("div", {
38004
+ staticClass: "lupa-result-page-description-top",
38005
+ domProps: { innerHTML: _vm._s(_vm.descriptionTop) },
38006
+ })
38007
+ : _vm._e(),
38008
+ ],
38009
+ 1
38010
+ )
37937
38011
  };
37938
38012
  var __vue_staticRenderFns__$8 = [];
37939
38013
  __vue_render__$8._withStripped = true;
@@ -38214,6 +38288,9 @@ __decorate([
38214
38288
  __decorate([
38215
38289
  Prop({ default: false })
38216
38290
  ], SearchResults.prototype, "isProductList", void 0);
38291
+ __decorate([
38292
+ Prop({ default: false })
38293
+ ], SearchResults.prototype, "isContainer", void 0);
38217
38294
  __decorate([
38218
38295
  searchResult$1.Getter("currentQueryText")
38219
38296
  ], SearchResults.prototype, "currentQueryText", void 0);
@@ -38297,6 +38374,29 @@ var __vue_render__$6 = function () {
38297
38374
  "div",
38298
38375
  { staticClass: "lupa-search-result-wrapper" },
38299
38376
  [
38377
+ _vm.isContainer
38378
+ ? [
38379
+ _c(
38380
+ "div",
38381
+ { staticClass: "lupa-container-title-summary-mobile" },
38382
+ [
38383
+ _c("SearchResultsDidYouMean", {
38384
+ attrs: { labels: _vm.didYouMeanLabels },
38385
+ }),
38386
+ _vm._v(" "),
38387
+ _c("SearchResultsTitle", {
38388
+ attrs: {
38389
+ "show-summary": true,
38390
+ options: _vm.options,
38391
+ "is-product-list": _vm.isProductList,
38392
+ },
38393
+ }),
38394
+ ],
38395
+ 1
38396
+ ),
38397
+ ]
38398
+ : _vm._e(),
38399
+ _vm._v(" "),
38300
38400
  _vm.isTitleResultTopPosition
38301
38401
  ? _c("CategoryTopFilters", { attrs: { options: _vm.options } })
38302
38402
  : _vm._e(),
@@ -38832,7 +38932,10 @@ var __vue_render__$1 = function () {
38832
38932
  _vm._v(" "),
38833
38933
  _c("SearchResults", {
38834
38934
  ref: "searchResults",
38835
- attrs: { options: _vm.fullSearchResultsOptions },
38935
+ attrs: {
38936
+ options: _vm.fullSearchResultsOptions,
38937
+ "is-container": true,
38938
+ },
38836
38939
  }),
38837
38940
  ],
38838
38941
  1
@@ -38944,13 +39047,19 @@ var __vue_render__ = function () {
38944
39047
  var _vm = this;
38945
39048
  var _h = _vm.$createElement;
38946
39049
  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()
39050
+ return _c(
39051
+ "div",
39052
+ [
39053
+ _vm.isOpen
39054
+ ? _c("SearchContainer", {
39055
+ ref: "productList",
39056
+ attrs: { options: _vm.containerOptions },
39057
+ on: { "hook:mounted": _vm.focus, close: _vm.close },
39058
+ })
39059
+ : _vm._e(),
39060
+ ],
39061
+ 1
39062
+ )
38954
39063
  };
38955
39064
  var __vue_staticRenderFns__ = [];
38956
39065
  __vue_render__._withStripped = true;
@@ -40106,6 +40215,44 @@ var store = new Vuex.Store({
40106
40215
  },
40107
40216
  });
40108
40217
 
40218
+ const createShadowDom = (shadowId, managerId) => {
40219
+ let host = document.getElementById(shadowId);
40220
+ let manager = document.getElementById(managerId);
40221
+ if (!host) {
40222
+ host = document.createElement("div");
40223
+ manager = document.createElement("div");
40224
+ }
40225
+ if (!manager) {
40226
+ manager = document.createElement("div");
40227
+ }
40228
+ host.setAttribute("id", shadowId);
40229
+ manager === null || manager === void 0 ? void 0 : manager.setAttribute("id", managerId);
40230
+ return { host, manager };
40231
+ };
40232
+ const attatchShadowDom = ({ host, manager, styleUrl, }) => {
40233
+ const link = document.createElement("link");
40234
+ link.type = "text/css";
40235
+ link.rel = "stylesheet";
40236
+ link.href = styleUrl;
40237
+ // Fonts only work when added in host document head
40238
+ const linkNode = document.createElement("link");
40239
+ linkNode.type = "text/css";
40240
+ linkNode.rel = "stylesheet";
40241
+ linkNode.href =
40242
+ "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
40243
+ document.head.appendChild(linkNode);
40244
+ // Add font for material icons
40245
+ const linkNode2 = document.createElement("link");
40246
+ linkNode2.type = "text/css";
40247
+ linkNode2.rel = "stylesheet";
40248
+ linkNode2.href =
40249
+ "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
40250
+ document.head.appendChild(linkNode2);
40251
+ const shadow = host.attachShadow({ mode: "open" });
40252
+ shadow.appendChild(manager);
40253
+ shadow.appendChild(link);
40254
+ };
40255
+
40109
40256
  /* eslint-disable @typescript-eslint/no-explicit-any */
40110
40257
  const app = {
40111
40258
  box: {},
@@ -40189,6 +40336,7 @@ const productList = (options, mountOptions) => {
40189
40336
  app.productList[options.containerSelector] = instance;
40190
40337
  };
40191
40338
  const searchContainer = (options, mountOptions) => {
40339
+ var _a;
40192
40340
  const existingInstance = app.productList[options.trigger];
40193
40341
  if (existingInstance) {
40194
40342
  existingInstance.productListOptions = options;
@@ -40201,13 +40349,18 @@ const searchContainer = (options, mountOptions) => {
40201
40349
  return;
40202
40350
  }
40203
40351
  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);
40352
+ const id = "lupa-search-container-manager";
40353
+ const shadowId = "lupa-shadow-id";
40354
+ const { host, manager } = createShadowDom(shadowId, id);
40355
+ attatchShadowDom({
40356
+ host,
40357
+ manager,
40358
+ styleUrl: (_a = options.styleLink) !== null && _a !== void 0 ? _a : DEFAULT_CONTAINER_STYLE,
40359
+ });
40360
+ document.body.appendChild(host);
40208
40361
  const SearchContainerEntryComponent = Vue$1.component("SearchContainerEntry", __vue_component__);
40209
40362
  const instance = new SearchContainerEntryComponent({
40210
- el: `#${id}`,
40363
+ el: manager,
40211
40364
  propsData: { searchContainerOptions: options },
40212
40365
  store,
40213
40366
  });
@@ -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;