@getlupa/client 1.2.1 → 1.2.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.
@@ -9342,8 +9342,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9342
9342
  }
9343
9343
  };
9344
9344
  const handleInput = (value) => {
9345
+ var _a2;
9345
9346
  opened.value = true;
9346
- inputValue.value = value.replace(/\s+$/, "");
9347
+ inputValue.value = (_a2 = value == null ? void 0 : value.replace(/\s+$/, "")) != null ? _a2 : "";
9347
9348
  suggestedValue.value = defaultSuggestedValue;
9348
9349
  trackSearchQuery(value);
9349
9350
  if (props.isSearchContainer) {
@@ -12256,7 +12257,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12256
12257
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
12257
12258
  __name: "SearchResultsSort",
12258
12259
  props: {
12259
- options: {}
12260
+ options: {},
12261
+ callbacks: {}
12260
12262
  },
12261
12263
  setup(__props) {
12262
12264
  const props = __props;
@@ -12284,11 +12286,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12284
12286
  setSortValue();
12285
12287
  });
12286
12288
  const handleSelect = () => {
12287
- var _a;
12289
+ var _a, _b, _c;
12288
12290
  const value = (_a = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a.key;
12289
12291
  if (!value) {
12290
12292
  return;
12291
12293
  }
12294
+ (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value });
12292
12295
  paramStore.appendParams({
12293
12296
  params: [{ name: QUERY_PARAMS$1.SORT, value }],
12294
12297
  paramsToRemove: [QUERY_PARAMS$1.PAGE]
@@ -12334,12 +12337,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12334
12337
  },
12335
12338
  setup(__props) {
12336
12339
  const props = __props;
12337
- const optionsValue = computed(
12338
- () => {
12339
- var _a;
12340
- return (_a = props.options) != null ? _a : { labels: {} };
12341
- }
12342
- );
12340
+ const optionsValue = computed(() => {
12341
+ var _a;
12342
+ return (_a = props.options) != null ? _a : { labels: {} };
12343
+ });
12343
12344
  const paramStore = useParamsStore();
12344
12345
  const searchResultStore = useSearchResultStore();
12345
12346
  const optionsStore = useOptionsStore();
@@ -12415,6 +12416,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12415
12416
  const hasResults = computed(() => {
12416
12417
  return searchResult.value.total > 0;
12417
12418
  });
12419
+ const callbacks = computed(() => {
12420
+ var _a;
12421
+ return (_a = props.options.callbacks) != null ? _a : {};
12422
+ });
12418
12423
  const handleClearAll = () => {
12419
12424
  paramStore.removeAllFilters();
12420
12425
  };
@@ -12450,8 +12455,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12450
12455
  }, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$2)),
12451
12456
  sortOptions.value ? (openBlock(), createBlock(_sfc_main$u, {
12452
12457
  key: 2,
12453
- options: sortOptions.value
12454
- }, null, 8, ["options"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
12458
+ options: sortOptions.value,
12459
+ callbacks: callbacks.value
12460
+ }, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
12455
12461
  ])
12456
12462
  ], 2);
12457
12463
  };
@@ -9342,8 +9342,9 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
9342
9342
  }
9343
9343
  };
9344
9344
  const handleInput = (value) => {
9345
+ var _a2;
9345
9346
  opened.value = true;
9346
- inputValue.value = value.replace(/\s+$/, "");
9347
+ inputValue.value = (_a2 = value == null ? void 0 : value.replace(/\s+$/, "")) != null ? _a2 : "";
9347
9348
  suggestedValue.value = defaultSuggestedValue;
9348
9349
  trackSearchQuery(value);
9349
9350
  if (props.isSearchContainer) {
@@ -12256,7 +12257,8 @@ const _hoisted_4$9 = ["value"];
12256
12257
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
12257
12258
  __name: "SearchResultsSort",
12258
12259
  props: {
12259
- options: {}
12260
+ options: {},
12261
+ callbacks: {}
12260
12262
  },
12261
12263
  setup(__props) {
12262
12264
  const props = __props;
@@ -12284,11 +12286,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
12284
12286
  setSortValue();
12285
12287
  });
12286
12288
  const handleSelect = () => {
12287
- var _a;
12289
+ var _a, _b, _c;
12288
12290
  const value = (_a = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a.key;
12289
12291
  if (!value) {
12290
12292
  return;
12291
12293
  }
12294
+ (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value });
12292
12295
  paramStore.appendParams({
12293
12296
  params: [{ name: QUERY_PARAMS$1.SORT, value }],
12294
12297
  paramsToRemove: [QUERY_PARAMS$1.PAGE]
@@ -12334,12 +12337,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12334
12337
  },
12335
12338
  setup(__props) {
12336
12339
  const props = __props;
12337
- const optionsValue = computed(
12338
- () => {
12339
- var _a;
12340
- return (_a = props.options) != null ? _a : { labels: {} };
12341
- }
12342
- );
12340
+ const optionsValue = computed(() => {
12341
+ var _a;
12342
+ return (_a = props.options) != null ? _a : { labels: {} };
12343
+ });
12343
12344
  const paramStore = useParamsStore();
12344
12345
  const searchResultStore = useSearchResultStore();
12345
12346
  const optionsStore = useOptionsStore();
@@ -12415,6 +12416,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12415
12416
  const hasResults = computed(() => {
12416
12417
  return searchResult.value.total > 0;
12417
12418
  });
12419
+ const callbacks = computed(() => {
12420
+ var _a;
12421
+ return (_a = props.options.callbacks) != null ? _a : {};
12422
+ });
12418
12423
  const handleClearAll = () => {
12419
12424
  paramStore.removeAllFilters();
12420
12425
  };
@@ -12450,8 +12455,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12450
12455
  }, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$2)),
12451
12456
  sortOptions.value ? (openBlock(), createBlock(_sfc_main$u, {
12452
12457
  key: 2,
12453
- options: sortOptions.value
12454
- }, null, 8, ["options"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
12458
+ options: sortOptions.value,
12459
+ callbacks: callbacks.value
12460
+ }, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
12455
12461
  ])
12456
12462
  ], 2);
12457
12463
  };
@@ -9340,8 +9340,9 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
9340
9340
  }
9341
9341
  };
9342
9342
  const handleInput = (value) => {
9343
+ var _a2;
9343
9344
  opened.value = true;
9344
- inputValue.value = value.replace(/\s+$/, "");
9345
+ inputValue.value = (_a2 = value == null ? void 0 : value.replace(/\s+$/, "")) != null ? _a2 : "";
9345
9346
  suggestedValue.value = defaultSuggestedValue;
9346
9347
  trackSearchQuery(value);
9347
9348
  if (props.isSearchContainer) {
@@ -12254,7 +12255,8 @@ const _hoisted_4$9 = ["value"];
12254
12255
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
12255
12256
  __name: "SearchResultsSort",
12256
12257
  props: {
12257
- options: {}
12258
+ options: {},
12259
+ callbacks: {}
12258
12260
  },
12259
12261
  setup(__props) {
12260
12262
  const props = __props;
@@ -12282,11 +12284,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
12282
12284
  setSortValue();
12283
12285
  });
12284
12286
  const handleSelect = () => {
12285
- var _a;
12287
+ var _a, _b, _c;
12286
12288
  const value = (_a = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a.key;
12287
12289
  if (!value) {
12288
12290
  return;
12289
12291
  }
12292
+ (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value });
12290
12293
  paramStore.appendParams({
12291
12294
  params: [{ name: QUERY_PARAMS$1.SORT, value }],
12292
12295
  paramsToRemove: [QUERY_PARAMS$1.PAGE]
@@ -12332,12 +12335,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12332
12335
  },
12333
12336
  setup(__props) {
12334
12337
  const props = __props;
12335
- const optionsValue = computed(
12336
- () => {
12337
- var _a;
12338
- return (_a = props.options) != null ? _a : { labels: {} };
12339
- }
12340
- );
12338
+ const optionsValue = computed(() => {
12339
+ var _a;
12340
+ return (_a = props.options) != null ? _a : { labels: {} };
12341
+ });
12341
12342
  const paramStore = useParamsStore();
12342
12343
  const searchResultStore = useSearchResultStore();
12343
12344
  const optionsStore = useOptionsStore();
@@ -12413,6 +12414,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12413
12414
  const hasResults = computed(() => {
12414
12415
  return searchResult.value.total > 0;
12415
12416
  });
12417
+ const callbacks = computed(() => {
12418
+ var _a;
12419
+ return (_a = props.options.callbacks) != null ? _a : {};
12420
+ });
12416
12421
  const handleClearAll = () => {
12417
12422
  paramStore.removeAllFilters();
12418
12423
  };
@@ -12448,8 +12453,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12448
12453
  }, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$2)),
12449
12454
  sortOptions.value ? (openBlock(), createBlock(_sfc_main$u, {
12450
12455
  key: 2,
12451
- options: sortOptions.value
12452
- }, null, 8, ["options"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
12456
+ options: sortOptions.value,
12457
+ callbacks: callbacks.value
12458
+ }, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
12453
12459
  ])
12454
12460
  ], 2);
12455
12461
  };
@@ -9344,8 +9344,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9344
9344
  }
9345
9345
  };
9346
9346
  const handleInput = (value) => {
9347
+ var _a2;
9347
9348
  opened.value = true;
9348
- inputValue.value = value.replace(/\s+$/, "");
9349
+ inputValue.value = (_a2 = value == null ? void 0 : value.replace(/\s+$/, "")) != null ? _a2 : "";
9349
9350
  suggestedValue.value = defaultSuggestedValue;
9350
9351
  trackSearchQuery(value);
9351
9352
  if (props.isSearchContainer) {
@@ -12258,7 +12259,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12258
12259
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
12259
12260
  __name: "SearchResultsSort",
12260
12261
  props: {
12261
- options: {}
12262
+ options: {},
12263
+ callbacks: {}
12262
12264
  },
12263
12265
  setup(__props) {
12264
12266
  const props = __props;
@@ -12286,11 +12288,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12286
12288
  setSortValue();
12287
12289
  });
12288
12290
  const handleSelect = () => {
12289
- var _a;
12291
+ var _a, _b, _c;
12290
12292
  const value = (_a = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a.key;
12291
12293
  if (!value) {
12292
12294
  return;
12293
12295
  }
12296
+ (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value });
12294
12297
  paramStore.appendParams({
12295
12298
  params: [{ name: QUERY_PARAMS$1.SORT, value }],
12296
12299
  paramsToRemove: [QUERY_PARAMS$1.PAGE]
@@ -12336,12 +12339,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12336
12339
  },
12337
12340
  setup(__props) {
12338
12341
  const props = __props;
12339
- const optionsValue = computed(
12340
- () => {
12341
- var _a;
12342
- return (_a = props.options) != null ? _a : { labels: {} };
12343
- }
12344
- );
12342
+ const optionsValue = computed(() => {
12343
+ var _a;
12344
+ return (_a = props.options) != null ? _a : { labels: {} };
12345
+ });
12345
12346
  const paramStore = useParamsStore();
12346
12347
  const searchResultStore = useSearchResultStore();
12347
12348
  const optionsStore = useOptionsStore();
@@ -12417,6 +12418,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12417
12418
  const hasResults = computed(() => {
12418
12419
  return searchResult.value.total > 0;
12419
12420
  });
12421
+ const callbacks = computed(() => {
12422
+ var _a;
12423
+ return (_a = props.options.callbacks) != null ? _a : {};
12424
+ });
12420
12425
  const handleClearAll = () => {
12421
12426
  paramStore.removeAllFilters();
12422
12427
  };
@@ -12452,8 +12457,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12452
12457
  }, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$2)),
12453
12458
  sortOptions.value ? (openBlock(), createBlock(_sfc_main$u, {
12454
12459
  key: 2,
12455
- options: sortOptions.value
12456
- }, null, 8, ["options"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
12460
+ options: sortOptions.value,
12461
+ callbacks: callbacks.value
12462
+ }, null, 8, ["options", "callbacks"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
12457
12463
  ])
12458
12464
  ], 2);
12459
12465
  };
@@ -1,4 +1,4 @@
1
- import type { Environment, SdkOptions, SortDirection, TrackingOptions, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SingleStarRatingElement, ProductListOptions, CategoryFilterOptions, ProductRecommendationOptions, RecommendationABTestingOptions, SearchBoxOptions, SearchContainerOptions, SearchContainerConfigOptions, SearchResultBadgeElement, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, RoutingBehavior, SearchResultsOptions, FacetStyle, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, SearchResultsFilterOptions, ResultFacetOptions, DynamicData, AnchorPosition, SortOptions, SearchResultsSortOptions } from '@getlupa/vue';
1
+ import type { Environment, SdkOptions, SortDirection, TrackingOptions, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SingleStarRatingElement, ProductListOptions, CategoryFilterOptions, ProductRecommendationOptions, RecommendationABTestingOptions, SearchBoxOptions, SearchContainerOptions, SearchContainerConfigOptions, SearchResultBadgeElement, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, RoutingBehavior, SearchResultsOptions, FacetStyle, SearchResultEventCallbacks, CallbackContext, SortCallbackContext, FacetFilterQuery, SearchResultsFilterOptions, ResultFacetOptions, DynamicData, AnchorPosition, SortOptions, SearchResultsSortOptions } from '@getlupa/vue';
2
2
  import { DocumentElementType, SearchBoxPanelType, BadgeType, SearchResultBadgeType } from '@getlupa/vue';
3
3
  type MountOptions = {
4
4
  fetch: boolean;
@@ -17,7 +17,7 @@ declare const lupaSearch: {
17
17
  clearRecommendations: (selector?: string) => void;
18
18
  };
19
19
  export { DocumentElementType, SearchBoxPanelType, BadgeType };
20
- export type { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, FacetStyle, Environment, RoutingBehavior, AnchorPosition, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, SearchContainerOptions, SearchContainerConfigOptions, SingleStarRatingElement, DynamicData, ProductRecommendationOptions, RecommendationABTestingOptions };
20
+ export type { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, FacetStyle, Environment, RoutingBehavior, AnchorPosition, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, SortCallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, MountOptions, SearchContainerOptions, SearchContainerConfigOptions, SingleStarRatingElement, DynamicData, ProductRecommendationOptions, RecommendationABTestingOptions };
21
21
  declare global {
22
22
  interface Window {
23
23
  getLupa: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.2.1",
3
+ "version": "1.2.5",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.3.4",
23
- "@getlupa/vue": "0.2.0",
23
+ "@getlupa/vue": "0.2.3",
24
24
  "@rushstack/eslint-patch": "^1.3.2",
25
25
  "@tsconfig/node18": "^2.0.1",
26
26
  "@types/jsdom": "^21.1.1",