Implement AND/OR filter logic in useCategoryFilter and update MarketPage UI
- Added support for AND/OR filtering modes in the `useCategoryFilter` composable, allowing users to filter products based on all or any selected categories. - Introduced reactive state management for filter mode and updated the filtering logic to accommodate the new functionality. - Enhanced the MarketPage UI with a toggle for selecting filter modes, improving user experience and accessibility. - Updated ARIA attributes for better screen reader support in the filter mode selection. These changes significantly enhance the category filtering capabilities, providing users with more control over product visibility. Refactor CreateProductDialog and MarketPage for improved category handling - Updated CreateProductDialog to utilize `model-value` and `@update:model-value` for the CategoryInput component, enhancing reactivity in category selection. - Enhanced MarketPage filtering logic to support AND/OR modes, allowing for more flexible product filtering based on selected categories. - Improved category normalization and matching logic to ensure accurate filtering results. These changes streamline the category management and filtering processes, providing users with a more intuitive experience when creating and finding products.
This commit is contained in:
parent
bb761abe75
commit
39ecba581f
3 changed files with 106 additions and 24 deletions
|
|
@ -105,13 +105,14 @@
|
|||
</div>
|
||||
|
||||
<!-- Categories -->
|
||||
<FormField v-slot="{ componentField }" name="categories">
|
||||
<FormField v-slot="{ value, handleChange }" name="categories">
|
||||
<FormItem>
|
||||
<FormLabel>Categories</FormLabel>
|
||||
<FormDescription>Add categories to help customers find your product</FormDescription>
|
||||
<FormControl>
|
||||
<CategoryInput
|
||||
v-bind="componentField"
|
||||
:model-value="value || []"
|
||||
@update:model-value="handleChange"
|
||||
:disabled="isCreating"
|
||||
placeholder="Enter category (e.g., electronics, clothing, books...)"
|
||||
:max-categories="10"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue