@getlupa/vue 0.25.0 → 0.25.1

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.
@@ -26657,17 +26657,25 @@ const useLoadingSkeleton = () => {
26657
26657
  loadingRelatedQueries
26658
26658
  } = storeToRefs(searchResultStore);
26659
26659
  const { searchResultOptions } = storeToRefs(optionsStore);
26660
+ const enabled = vue.computed(() => {
26661
+ var _a25, _b25;
26662
+ return (_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.enabled;
26663
+ });
26664
+ const showOnEveryFetch = vue.computed(() => {
26665
+ var _a25, _b25;
26666
+ return (_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.showOnEveryFetch;
26667
+ });
26660
26668
  const skeletonEnabled = vue.computed(() => {
26661
- var _a25, _b25, _c, _d;
26662
- return ((_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.enabled) && !((_d = (_c = searchResult.value) == null ? void 0 : _c.items) == null ? void 0 : _d.length);
26669
+ var _a25, _b25, _c;
26670
+ return enabled.value && (!((_b25 = (_a25 = searchResult.value) == null ? void 0 : _a25.items) == null ? void 0 : _b25.length) || ((_c = showOnEveryFetch.value) == null ? void 0 : _c.results));
26663
26671
  });
26664
26672
  const relatedQueriesSkeletonEnabled = vue.computed(() => {
26665
- var _a25, _b25, _c, _d, _e;
26666
- return ((_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.enabled) && Boolean((_c = searchResultOptions.value) == null ? void 0 : _c.relatedQueries) && !((_e = (_d = relatedQueriesResult.value) == null ? void 0 : _d.relatedQueries) == null ? void 0 : _e.length);
26673
+ var _a25, _b25, _c, _d;
26674
+ return enabled.value && Boolean((_a25 = searchResultOptions.value) == null ? void 0 : _a25.relatedQueries) && (!((_c = (_b25 = relatedQueriesResult.value) == null ? void 0 : _b25.relatedQueries) == null ? void 0 : _c.length) || ((_d = showOnEveryFetch.value) == null ? void 0 : _d.relatedQueries));
26667
26675
  });
26668
26676
  const facetSkeletonEnabled = vue.computed(() => {
26669
- var _a25, _b25, _c, _d;
26670
- return ((_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.enabled) && !((_d = (_c = searchResult.value) == null ? void 0 : _c.facets) == null ? void 0 : _d.length);
26677
+ var _a25, _b25, _c;
26678
+ return enabled.value && (!((_b25 = (_a25 = searchResult.value) == null ? void 0 : _a25.facets) == null ? void 0 : _b25.length) || ((_c = showOnEveryFetch.value) == null ? void 0 : _c.facets));
26671
26679
  });
26672
26680
  const loadingFacets = vue.computed(() => {
26673
26681
  var _a25;
@@ -26655,17 +26655,25 @@ const useLoadingSkeleton = () => {
26655
26655
  loadingRelatedQueries
26656
26656
  } = storeToRefs(searchResultStore);
26657
26657
  const { searchResultOptions } = storeToRefs(optionsStore);
26658
+ const enabled = computed(() => {
26659
+ var _a25, _b25;
26660
+ return (_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.enabled;
26661
+ });
26662
+ const showOnEveryFetch = computed(() => {
26663
+ var _a25, _b25;
26664
+ return (_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.showOnEveryFetch;
26665
+ });
26658
26666
  const skeletonEnabled = computed(() => {
26659
- var _a25, _b25, _c, _d;
26660
- return ((_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.enabled) && !((_d = (_c = searchResult.value) == null ? void 0 : _c.items) == null ? void 0 : _d.length);
26667
+ var _a25, _b25, _c;
26668
+ return enabled.value && (!((_b25 = (_a25 = searchResult.value) == null ? void 0 : _a25.items) == null ? void 0 : _b25.length) || ((_c = showOnEveryFetch.value) == null ? void 0 : _c.results));
26661
26669
  });
26662
26670
  const relatedQueriesSkeletonEnabled = computed(() => {
26663
- var _a25, _b25, _c, _d, _e;
26664
- return ((_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.enabled) && Boolean((_c = searchResultOptions.value) == null ? void 0 : _c.relatedQueries) && !((_e = (_d = relatedQueriesResult.value) == null ? void 0 : _d.relatedQueries) == null ? void 0 : _e.length);
26671
+ var _a25, _b25, _c, _d;
26672
+ return enabled.value && Boolean((_a25 = searchResultOptions.value) == null ? void 0 : _a25.relatedQueries) && (!((_c = (_b25 = relatedQueriesResult.value) == null ? void 0 : _b25.relatedQueries) == null ? void 0 : _c.length) || ((_d = showOnEveryFetch.value) == null ? void 0 : _d.relatedQueries));
26665
26673
  });
26666
26674
  const facetSkeletonEnabled = computed(() => {
26667
- var _a25, _b25, _c, _d;
26668
- return ((_b25 = (_a25 = searchResultOptions.value) == null ? void 0 : _a25.loadingSkeleton) == null ? void 0 : _b25.enabled) && !((_d = (_c = searchResult.value) == null ? void 0 : _c.facets) == null ? void 0 : _d.length);
26675
+ var _a25, _b25, _c;
26676
+ return enabled.value && (!((_b25 = (_a25 = searchResult.value) == null ? void 0 : _a25.facets) == null ? void 0 : _b25.length) || ((_c = showOnEveryFetch.value) == null ? void 0 : _c.facets));
26669
26677
  });
26670
26678
  const loadingFacets = computed(() => {
26671
26679
  var _a25;
@@ -26,6 +26,11 @@ export type SearchResultsOptions = SearchResultsProductOptions & SearchResultsAd
26
26
  selectFields?: string[];
27
27
  loadingSkeleton?: {
28
28
  enabled: boolean;
29
+ showOnEveryFetch?: {
30
+ results?: boolean;
31
+ facets?: boolean;
32
+ relatedQueries?: boolean;
33
+ };
29
34
  };
30
35
  } & Partial<MultiCurrencyConfig>;
31
36
  export type ZeroResultsOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/vue",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "main": "dist/lupaSearch.mjs",
5
5
  "module": "dist/lupaSearch.mjs",
6
6
  "types": "dist/src/index.d.ts",