@getlupa/client 1.2.3 → 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.
@@ -12257,7 +12257,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12257
12257
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
12258
12258
  __name: "SearchResultsSort",
12259
12259
  props: {
12260
- options: {}
12260
+ options: {},
12261
+ callbacks: {}
12261
12262
  },
12262
12263
  setup(__props) {
12263
12264
  const props = __props;
@@ -12285,11 +12286,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12285
12286
  setSortValue();
12286
12287
  });
12287
12288
  const handleSelect = () => {
12288
- var _a;
12289
+ var _a, _b, _c;
12289
12290
  const value = (_a = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a.key;
12290
12291
  if (!value) {
12291
12292
  return;
12292
12293
  }
12294
+ (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value });
12293
12295
  paramStore.appendParams({
12294
12296
  params: [{ name: QUERY_PARAMS$1.SORT, value }],
12295
12297
  paramsToRemove: [QUERY_PARAMS$1.PAGE]
@@ -12335,12 +12337,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12335
12337
  },
12336
12338
  setup(__props) {
12337
12339
  const props = __props;
12338
- const optionsValue = computed(
12339
- () => {
12340
- var _a;
12341
- return (_a = props.options) != null ? _a : { labels: {} };
12342
- }
12343
- );
12340
+ const optionsValue = computed(() => {
12341
+ var _a;
12342
+ return (_a = props.options) != null ? _a : { labels: {} };
12343
+ });
12344
12344
  const paramStore = useParamsStore();
12345
12345
  const searchResultStore = useSearchResultStore();
12346
12346
  const optionsStore = useOptionsStore();
@@ -12416,6 +12416,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12416
12416
  const hasResults = computed(() => {
12417
12417
  return searchResult.value.total > 0;
12418
12418
  });
12419
+ const callbacks = computed(() => {
12420
+ var _a;
12421
+ return (_a = props.options.callbacks) != null ? _a : {};
12422
+ });
12419
12423
  const handleClearAll = () => {
12420
12424
  paramStore.removeAllFilters();
12421
12425
  };
@@ -12451,8 +12455,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12451
12455
  }, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$2)),
12452
12456
  sortOptions.value ? (openBlock(), createBlock(_sfc_main$u, {
12453
12457
  key: 2,
12454
- options: sortOptions.value
12455
- }, 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))
12456
12461
  ])
12457
12462
  ], 2);
12458
12463
  };
@@ -12257,7 +12257,8 @@ const _hoisted_4$9 = ["value"];
12257
12257
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
12258
12258
  __name: "SearchResultsSort",
12259
12259
  props: {
12260
- options: {}
12260
+ options: {},
12261
+ callbacks: {}
12261
12262
  },
12262
12263
  setup(__props) {
12263
12264
  const props = __props;
@@ -12285,11 +12286,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
12285
12286
  setSortValue();
12286
12287
  });
12287
12288
  const handleSelect = () => {
12288
- var _a;
12289
+ var _a, _b, _c;
12289
12290
  const value = (_a = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a.key;
12290
12291
  if (!value) {
12291
12292
  return;
12292
12293
  }
12294
+ (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value });
12293
12295
  paramStore.appendParams({
12294
12296
  params: [{ name: QUERY_PARAMS$1.SORT, value }],
12295
12297
  paramsToRemove: [QUERY_PARAMS$1.PAGE]
@@ -12335,12 +12337,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12335
12337
  },
12336
12338
  setup(__props) {
12337
12339
  const props = __props;
12338
- const optionsValue = computed(
12339
- () => {
12340
- var _a;
12341
- return (_a = props.options) != null ? _a : { labels: {} };
12342
- }
12343
- );
12340
+ const optionsValue = computed(() => {
12341
+ var _a;
12342
+ return (_a = props.options) != null ? _a : { labels: {} };
12343
+ });
12344
12344
  const paramStore = useParamsStore();
12345
12345
  const searchResultStore = useSearchResultStore();
12346
12346
  const optionsStore = useOptionsStore();
@@ -12416,6 +12416,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12416
12416
  const hasResults = computed(() => {
12417
12417
  return searchResult.value.total > 0;
12418
12418
  });
12419
+ const callbacks = computed(() => {
12420
+ var _a;
12421
+ return (_a = props.options.callbacks) != null ? _a : {};
12422
+ });
12419
12423
  const handleClearAll = () => {
12420
12424
  paramStore.removeAllFilters();
12421
12425
  };
@@ -12451,8 +12455,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12451
12455
  }, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$2)),
12452
12456
  sortOptions.value ? (openBlock(), createBlock(_sfc_main$u, {
12453
12457
  key: 2,
12454
- options: sortOptions.value
12455
- }, 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))
12456
12461
  ])
12457
12462
  ], 2);
12458
12463
  };
@@ -12255,7 +12255,8 @@ const _hoisted_4$9 = ["value"];
12255
12255
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
12256
12256
  __name: "SearchResultsSort",
12257
12257
  props: {
12258
- options: {}
12258
+ options: {},
12259
+ callbacks: {}
12259
12260
  },
12260
12261
  setup(__props) {
12261
12262
  const props = __props;
@@ -12283,11 +12284,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
12283
12284
  setSortValue();
12284
12285
  });
12285
12286
  const handleSelect = () => {
12286
- var _a;
12287
+ var _a, _b, _c;
12287
12288
  const value = (_a = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a.key;
12288
12289
  if (!value) {
12289
12290
  return;
12290
12291
  }
12292
+ (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value });
12291
12293
  paramStore.appendParams({
12292
12294
  params: [{ name: QUERY_PARAMS$1.SORT, value }],
12293
12295
  paramsToRemove: [QUERY_PARAMS$1.PAGE]
@@ -12333,12 +12335,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12333
12335
  },
12334
12336
  setup(__props) {
12335
12337
  const props = __props;
12336
- const optionsValue = computed(
12337
- () => {
12338
- var _a;
12339
- return (_a = props.options) != null ? _a : { labels: {} };
12340
- }
12341
- );
12338
+ const optionsValue = computed(() => {
12339
+ var _a;
12340
+ return (_a = props.options) != null ? _a : { labels: {} };
12341
+ });
12342
12342
  const paramStore = useParamsStore();
12343
12343
  const searchResultStore = useSearchResultStore();
12344
12344
  const optionsStore = useOptionsStore();
@@ -12414,6 +12414,10 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12414
12414
  const hasResults = computed(() => {
12415
12415
  return searchResult.value.total > 0;
12416
12416
  });
12417
+ const callbacks = computed(() => {
12418
+ var _a;
12419
+ return (_a = props.options.callbacks) != null ? _a : {};
12420
+ });
12417
12421
  const handleClearAll = () => {
12418
12422
  paramStore.removeAllFilters();
12419
12423
  };
@@ -12449,8 +12453,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12449
12453
  }, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$2)),
12450
12454
  sortOptions.value ? (openBlock(), createBlock(_sfc_main$u, {
12451
12455
  key: 2,
12452
- options: sortOptions.value
12453
- }, 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))
12454
12459
  ])
12455
12460
  ], 2);
12456
12461
  };
@@ -12259,7 +12259,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12259
12259
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
12260
12260
  __name: "SearchResultsSort",
12261
12261
  props: {
12262
- options: {}
12262
+ options: {},
12263
+ callbacks: {}
12263
12264
  },
12264
12265
  setup(__props) {
12265
12266
  const props = __props;
@@ -12287,11 +12288,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12287
12288
  setSortValue();
12288
12289
  });
12289
12290
  const handleSelect = () => {
12290
- var _a;
12291
+ var _a, _b, _c;
12291
12292
  const value = (_a = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a.key;
12292
12293
  if (!value) {
12293
12294
  return;
12294
12295
  }
12296
+ (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value });
12295
12297
  paramStore.appendParams({
12296
12298
  params: [{ name: QUERY_PARAMS$1.SORT, value }],
12297
12299
  paramsToRemove: [QUERY_PARAMS$1.PAGE]
@@ -12337,12 +12339,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12337
12339
  },
12338
12340
  setup(__props) {
12339
12341
  const props = __props;
12340
- const optionsValue = computed(
12341
- () => {
12342
- var _a;
12343
- return (_a = props.options) != null ? _a : { labels: {} };
12344
- }
12345
- );
12342
+ const optionsValue = computed(() => {
12343
+ var _a;
12344
+ return (_a = props.options) != null ? _a : { labels: {} };
12345
+ });
12346
12346
  const paramStore = useParamsStore();
12347
12347
  const searchResultStore = useSearchResultStore();
12348
12348
  const optionsStore = useOptionsStore();
@@ -12418,6 +12418,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12418
12418
  const hasResults = computed(() => {
12419
12419
  return searchResult.value.total > 0;
12420
12420
  });
12421
+ const callbacks = computed(() => {
12422
+ var _a;
12423
+ return (_a = props.options.callbacks) != null ? _a : {};
12424
+ });
12421
12425
  const handleClearAll = () => {
12422
12426
  paramStore.removeAllFilters();
12423
12427
  };
@@ -12453,8 +12457,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12453
12457
  }, null, 8, ["options", "label"])) : (openBlock(), createElementBlock("div", _hoisted_6$2)),
12454
12458
  sortOptions.value ? (openBlock(), createBlock(_sfc_main$u, {
12455
12459
  key: 2,
12456
- options: sortOptions.value
12457
- }, 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))
12458
12463
  ])
12459
12464
  ], 2);
12460
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.3",
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.1",
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",