@propeller-commerce/propeller-v2-vue-ui 0.3.37 → 0.3.38

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.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,20 @@ once it reaches 1.0. Until then (the `0.x` line) the public API may change
8
8
  between minor versions; breaking changes are called out below and in
9
9
  [MIGRATION.md](./MIGRATION.md).
10
10
 
11
+ ## [0.3.38] - 2026-07-21
12
+
13
+ ### Fixed
14
+
15
+ - **`SearchBar` autosuggest orderlist scoping — real fix.** 0.3.37 set
16
+ `orderlistIds`/`applyOrderlists` on the flat `products` search input, but the
17
+ server's `products` resolver does not honour orderlist scoping (only the
18
+ `category.products` resolver does), so the preview still leaked the full
19
+ catalogue inside a contract. The debounced autosuggest now runs the **same
20
+ category term-search the grid uses** (`getCategory` over the base category)
21
+ instead of the flat `getProducts`, so contract scoping is applied server-side
22
+ and the preview matches the grid exactly. Requires
23
+ `configuration.baseCategoryId` (already provided by all consumers).
24
+
11
25
  ## [0.3.37] - 2026-07-21
12
26
 
13
27
  ### Fixed
package/dist/index.cjs CHANGED
@@ -2190,15 +2190,24 @@ function useProductSearch(options) {
2190
2190
  if (!graphqlClient) return;
2191
2191
  searchLoading.value = true;
2192
2192
  try {
2193
- const service = index.createServices(graphqlClient).product;
2194
2193
  const lang = languageRef.value || "NL";
2194
+ const service = index.createServices(graphqlClient).category;
2195
+ const catId = configuration?.baseCategoryId ?? 0;
2196
+ if (!catId) {
2197
+ searchResults.value = [];
2198
+ searchItemsFound.value = 0;
2199
+ return;
2200
+ }
2195
2201
  const searchOrderlistIds = options.orderlistIds?.value;
2196
2202
  const orderlistScope = searchOrderlistIds && searchOrderlistIds.length > 0 ? {
2197
2203
  applyOrderlists: options.applyOrderlists?.value !== false,
2198
2204
  orderlistIds: searchOrderlistIds
2199
2205
  } : { applyOrderlists: false };
2200
- const input = {
2201
- term,
2206
+ const user = userRef.value;
2207
+ const userId = user && "contactId" in user ? user.contactId : user && "customerId" in user ? user.customerId : void 0;
2208
+ const contactId = user && "contactId" in user ? user.contactId : void 0;
2209
+ const customerId = user && "customerId" in user ? user.customerId : void 0;
2210
+ const categoryProductSearchInput = {
2202
2211
  language: lang,
2203
2212
  page: 1,
2204
2213
  offset: 10,
@@ -2208,8 +2217,8 @@ function useProductSearch(options) {
2208
2217
  propellerSdkV2.ProductStatus.T,
2209
2218
  propellerSdkV2.ProductStatus.S
2210
2219
  ],
2211
- ...orderlistScope,
2212
- sortInputs: [{ field: propellerSdkV2.ProductSortField.RELEVANCE, order: propellerSdkV2.SortOrder.DESC }],
2220
+ hidden: false,
2221
+ term,
2213
2222
  searchFields: [
2214
2223
  {
2215
2224
  fieldNames: [
@@ -2236,16 +2245,30 @@ function useProductSearch(options) {
2236
2245
  ],
2237
2246
  boost: 1
2238
2247
  }
2239
- ]
2248
+ ],
2249
+ sortInputs: [{ field: propellerSdkV2.ProductSortField.RELEVANCE, order: propellerSdkV2.SortOrder.DESC }],
2250
+ ...companyIdRef.value && { companyId: companyIdRef.value },
2251
+ ...userId !== void 0 && { userId },
2252
+ ...orderlistScope
2253
+ };
2254
+ const priceCalculateProductInput = {
2255
+ taxZone,
2256
+ ...companyIdRef.value && { companyId: companyIdRef.value },
2257
+ ...contactId !== void 0 && { contactId },
2258
+ ...customerId !== void 0 && { customerId }
2240
2259
  };
2241
2260
  const variables = {
2242
- input,
2261
+ categoryId: catId,
2243
2262
  language: lang,
2263
+ categoryProductSearchInput,
2264
+ priceCalculateProductInput,
2265
+ imageSearchFilters: configuration?.imageSearchFiltersGrid,
2244
2266
  imageVariantFilters: configuration?.imageVariantFiltersMedium
2245
2267
  };
2246
- const result = await service.getProducts(variables);
2247
- searchResults.value = result?.items ?? [];
2248
- searchItemsFound.value = result?.itemsFound ?? searchResults.value.length;
2268
+ const response = await service.getCategory(variables);
2269
+ const productsResponse = response?.products;
2270
+ searchResults.value = productsResponse?.items ?? [];
2271
+ searchItemsFound.value = productsResponse?.itemsFound ?? searchResults.value.length;
2249
2272
  } catch {
2250
2273
  searchResults.value = [];
2251
2274
  searchItemsFound.value = 0;