@wix/headless-stores 0.0.57 → 0.0.58
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/cjs/dist/react/ProductList.js +1 -0
- package/cjs/dist/react/ProductListSort.d.ts +14 -0
- package/cjs/dist/react/ProductListSort.js +14 -0
- package/cjs/dist/react/core/ProductList.d.ts +3 -0
- package/cjs/dist/react/core/ProductList.js +2 -0
- package/cjs/dist/react/core/ProductListFilters.d.ts +8 -180
- package/cjs/dist/react/core/ProductListFilters.js +137 -171
- package/cjs/dist/react/core/ProductListPagination.d.ts +0 -192
- package/cjs/dist/react/core/ProductListPagination.js +2 -160
- package/cjs/dist/react/core/ProductListSort.d.ts +9 -57
- package/cjs/dist/react/core/ProductListSort.js +32 -52
- package/cjs/dist/services/index.d.ts +2 -2
- package/cjs/dist/services/products-list-search-service.d.ts +3 -162
- package/cjs/dist/services/products-list-search-service.js +31 -424
- package/cjs/dist/services/products-list-service.d.ts +86 -4
- package/cjs/dist/services/products-list-service.js +125 -4
- package/dist/react/ProductList.js +1 -0
- package/dist/react/ProductListSort.d.ts +14 -0
- package/dist/react/ProductListSort.js +14 -0
- package/dist/react/core/ProductList.d.ts +3 -0
- package/dist/react/core/ProductList.js +2 -0
- package/dist/react/core/ProductListFilters.d.ts +8 -180
- package/dist/react/core/ProductListFilters.js +137 -171
- package/dist/react/core/ProductListPagination.d.ts +0 -192
- package/dist/react/core/ProductListPagination.js +2 -160
- package/dist/react/core/ProductListSort.d.ts +9 -57
- package/dist/react/core/ProductListSort.js +32 -52
- package/dist/services/index.d.ts +2 -2
- package/dist/services/products-list-search-service.d.ts +3 -162
- package/dist/services/products-list-search-service.js +31 -424
- package/dist/services/products-list-service.d.ts +86 -4
- package/dist/services/products-list-service.js +125 -4
- package/package.json +4 -4
|
@@ -1,162 +1,5 @@
|
|
|
1
1
|
import { useService } from '@wix/services-manager-react';
|
|
2
|
-
import { ProductsListSearchServiceDefinition } from '../../services/products-list-search-service.js';
|
|
3
2
|
import { ProductsListServiceDefinition } from '../../services/products-list-service.js';
|
|
4
|
-
/**
|
|
5
|
-
* Headless component for managing page size (items per page)
|
|
6
|
-
*
|
|
7
|
-
* @component
|
|
8
|
-
* @example
|
|
9
|
-
* ```tsx
|
|
10
|
-
* import { ProductList, ProductListPagination } from '@wix/stores/components';
|
|
11
|
-
*
|
|
12
|
-
* function PageSizeSelector() {
|
|
13
|
-
* return (
|
|
14
|
-
* <ProductList.Root
|
|
15
|
-
* productsListConfig={{ products: [], searchOptions: {}, pagingMetadata: {}, aggregations: {} }}
|
|
16
|
-
* productsListSearchConfig={{ customizations: [] }}
|
|
17
|
-
* >
|
|
18
|
-
* <ProductListPagination.PageSize>
|
|
19
|
-
* {({ currentLimit, setLimit }) => (
|
|
20
|
-
* <div>
|
|
21
|
-
* <label>Items per page:</label>
|
|
22
|
-
* <select
|
|
23
|
-
* value={currentLimit}
|
|
24
|
-
* onChange={(e) => setLimit(Number(e.target.value))}
|
|
25
|
-
* >
|
|
26
|
-
* <option value={10}>10</option>
|
|
27
|
-
* <option value={20}>20</option>
|
|
28
|
-
* <option value={50}>50</option>
|
|
29
|
-
* </select>
|
|
30
|
-
* </div>
|
|
31
|
-
* )}
|
|
32
|
-
* </ProductListPagination.PageSize>
|
|
33
|
-
* </ProductList.Root>
|
|
34
|
-
* );
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export function PageSize(props) {
|
|
39
|
-
const service = useService(ProductsListSearchServiceDefinition);
|
|
40
|
-
const currentLimit = service.currentLimit.get();
|
|
41
|
-
const setLimit = service.setLimit;
|
|
42
|
-
return typeof props.children === 'function'
|
|
43
|
-
? props.children({ currentLimit, setLimit })
|
|
44
|
-
: props.children;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Headless component for navigating to the next page
|
|
48
|
-
*
|
|
49
|
-
* @component
|
|
50
|
-
* @example
|
|
51
|
-
* ```tsx
|
|
52
|
-
* import { ProductList, ProductListPagination } from '@wix/stores/components';
|
|
53
|
-
*
|
|
54
|
-
* function NextPageButton() {
|
|
55
|
-
* return (
|
|
56
|
-
* <ProductList.Root
|
|
57
|
-
* productsListConfig={{ products: [], searchOptions: {}, pagingMetadata: {}, aggregations: {} }}
|
|
58
|
-
* productsListSearchConfig={{ customizations: [] }}
|
|
59
|
-
* >
|
|
60
|
-
* <ProductListPagination.NextPageTrigger>
|
|
61
|
-
* {({ nextPage, hasNextPage }) => (
|
|
62
|
-
* <button
|
|
63
|
-
* onClick={nextPage}
|
|
64
|
-
* disabled={!hasNextPage}
|
|
65
|
-
* className={hasNextPage ? 'enabled' : 'disabled'}
|
|
66
|
-
* >
|
|
67
|
-
* Next →
|
|
68
|
-
* </button>
|
|
69
|
-
* )}
|
|
70
|
-
* </ProductListPagination.NextPageTrigger>
|
|
71
|
-
* </ProductList.Root>
|
|
72
|
-
* );
|
|
73
|
-
* }
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export function NextPageTrigger(props) {
|
|
77
|
-
const service = useService(ProductsListSearchServiceDefinition);
|
|
78
|
-
const nextPage = service.nextPage;
|
|
79
|
-
const hasNextPage = service.hasNextPage.get();
|
|
80
|
-
return typeof props.children === 'function'
|
|
81
|
-
? props.children({ nextPage, hasNextPage })
|
|
82
|
-
: props.children;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Headless component for navigating to the previous page
|
|
86
|
-
*
|
|
87
|
-
* @component
|
|
88
|
-
* @example
|
|
89
|
-
* ```tsx
|
|
90
|
-
* import { ProductList, ProductListPagination } from '@wix/stores/components';
|
|
91
|
-
*
|
|
92
|
-
* function PrevPageButton() {
|
|
93
|
-
* return (
|
|
94
|
-
* <ProductList.Root
|
|
95
|
-
* productsListConfig={{ products: [], searchOptions: {}, pagingMetadata: {}, aggregations: {} }}
|
|
96
|
-
* productsListSearchConfig={{ customizations: [] }}
|
|
97
|
-
* >
|
|
98
|
-
* <ProductListPagination.PreviousPageTrigger>
|
|
99
|
-
* {({ prevPage, hasPrevPage }) => (
|
|
100
|
-
* <button
|
|
101
|
-
* onClick={prevPage}
|
|
102
|
-
* disabled={!hasPrevPage}
|
|
103
|
-
* className={hasPrevPage ? 'enabled' : 'disabled'}
|
|
104
|
-
* >
|
|
105
|
-
* ← Previous
|
|
106
|
-
* </button>
|
|
107
|
-
* )}
|
|
108
|
-
* </ProductListPagination.PreviousPageTrigger>
|
|
109
|
-
* </ProductList.Root>
|
|
110
|
-
* );
|
|
111
|
-
* }
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
export function PreviousPageTrigger(props) {
|
|
115
|
-
const service = useService(ProductsListSearchServiceDefinition);
|
|
116
|
-
const prevPage = service.prevPage;
|
|
117
|
-
const hasPrevPage = service.hasPrevPage.get();
|
|
118
|
-
return typeof props.children === 'function'
|
|
119
|
-
? props.children({ prevPage, hasPrevPage })
|
|
120
|
-
: props.children;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Headless component for navigating to the first page
|
|
124
|
-
*
|
|
125
|
-
* @component
|
|
126
|
-
* @example
|
|
127
|
-
* ```tsx
|
|
128
|
-
* import { ProductList, ProductListPagination } from '@wix/stores/components';
|
|
129
|
-
*
|
|
130
|
-
* function FirstPageButton() {
|
|
131
|
-
* return (
|
|
132
|
-
* <ProductList.Root
|
|
133
|
-
* productsListConfig={{ products: [], searchOptions: {}, pagingMetadata: {}, aggregations: {} }}
|
|
134
|
-
* productsListSearchConfig={{ customizations: [] }}
|
|
135
|
-
* >
|
|
136
|
-
* <ProductListPagination.FirstPageTrigger>
|
|
137
|
-
* {({ navigateToFirstPage, hasPrevPage }) => (
|
|
138
|
-
* <button
|
|
139
|
-
* onClick={navigateToFirstPage}
|
|
140
|
-
* disabled={!hasPrevPage}
|
|
141
|
-
* title="Go to first page"
|
|
142
|
-
* >
|
|
143
|
-
* ⏮ First
|
|
144
|
-
* </button>
|
|
145
|
-
* )}
|
|
146
|
-
* </ProductListPagination.FirstPageTrigger>
|
|
147
|
-
* </ProductList.Root>
|
|
148
|
-
* );
|
|
149
|
-
* }
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
export function FirstPageTrigger(props) {
|
|
153
|
-
const service = useService(ProductsListSearchServiceDefinition);
|
|
154
|
-
const navigateToFirstPage = service.navigateToFirstPage;
|
|
155
|
-
const hasPrevPage = service.hasPrevPage.get();
|
|
156
|
-
return typeof props.children === 'function'
|
|
157
|
-
? props.children({ navigateToFirstPage, hasPrevPage })
|
|
158
|
-
: props.children;
|
|
159
|
-
}
|
|
160
3
|
/**
|
|
161
4
|
* Headless component for loading more products (infinite scroll pattern)
|
|
162
5
|
*
|
|
@@ -188,10 +31,9 @@ export function FirstPageTrigger(props) {
|
|
|
188
31
|
* ```
|
|
189
32
|
*/
|
|
190
33
|
export function LoadMoreTrigger(props) {
|
|
191
|
-
const service = useService(ProductsListSearchServiceDefinition);
|
|
192
34
|
const productsListService = useService(ProductsListServiceDefinition);
|
|
193
|
-
const loadMore =
|
|
194
|
-
const hasMoreProducts =
|
|
35
|
+
const loadMore = productsListService.loadMore;
|
|
36
|
+
const hasMoreProducts = productsListService.hasMoreProducts.get();
|
|
195
37
|
const isLoading = productsListService.isLoading.get();
|
|
196
38
|
return typeof props.children === 'function'
|
|
197
39
|
? props.children({ loadMore, hasMoreProducts, isLoading })
|
|
@@ -1,58 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Sort as SortPrimitive } from '@wix/headless-components/react';
|
|
2
|
+
import { productsV3 } from '@wix/stores';
|
|
3
|
+
export interface ProductListSortProps {
|
|
4
|
+
children: (props: {
|
|
5
|
+
currentSort: productsV3.V3ProductSearch['sort'];
|
|
6
|
+
sortOptions: SortPrimitive.SortOption[];
|
|
7
|
+
setSort: (sort: productsV3.V3ProductSearch['sort']) => void;
|
|
8
|
+
}) => React.ReactNode;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
* Render props for Options component
|
|
11
|
-
*/
|
|
12
|
-
export interface OptionsRenderProps {
|
|
13
|
-
/** Currently selected sort option value */
|
|
14
|
-
selectedSortOption: string;
|
|
15
|
-
/** Function to update the selected sort option */
|
|
16
|
-
updateSortOption: (sort: string) => void;
|
|
17
|
-
/** Available sort options */
|
|
18
|
-
sortOptions: SortType[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Headless component for managing product list sorting options
|
|
22
|
-
*
|
|
23
|
-
* @component
|
|
24
|
-
* @example
|
|
25
|
-
* ```tsx
|
|
26
|
-
* import { ProductList, ProductListSort } from '@wix/stores/components';
|
|
27
|
-
*
|
|
28
|
-
* function ProductSortDropdown() {
|
|
29
|
-
* return (
|
|
30
|
-
* <ProductList.Root
|
|
31
|
-
* productsListConfig={{ products: [], searchOptions: {}, pagingMetadata: {}, aggregations: {} }}
|
|
32
|
-
* productsListSearchConfig={{ customizations: [] }}
|
|
33
|
-
* >
|
|
34
|
-
* <ProductListSort.Options>
|
|
35
|
-
* {({ selectedSortOption, updateSortOption, sortOptions }) => (
|
|
36
|
-
* <div className="sort-container">
|
|
37
|
-
* <label htmlFor="sort-select">Sort by:</label>
|
|
38
|
-
* <select
|
|
39
|
-
* id="sort-select"
|
|
40
|
-
* value={selectedSortOption}
|
|
41
|
-
* onChange={(e) => updateSortOption(e.target.value)}
|
|
42
|
-
* className="sort-dropdown"
|
|
43
|
-
* >
|
|
44
|
-
* {sortOptions.map(option => (
|
|
45
|
-
* <option key={option} value={option}>
|
|
46
|
-
* {option}
|
|
47
|
-
* </option>
|
|
48
|
-
* ))}
|
|
49
|
-
* </select>
|
|
50
|
-
* </div>
|
|
51
|
-
* )}
|
|
52
|
-
* </ProductListSort.Options>
|
|
53
|
-
* </ProductList.Root>
|
|
54
|
-
* );
|
|
55
|
-
* }
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export declare function Options(props: OptionsProps): import("react").ReactNode;
|
|
10
|
+
export declare const ProductListSort: (props: ProductListSortProps) => import("react").ReactNode;
|
|
@@ -1,53 +1,33 @@
|
|
|
1
1
|
import { useService } from '@wix/services-manager-react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* )}
|
|
35
|
-
* </ProductListSort.Options>
|
|
36
|
-
* </ProductList.Root>
|
|
37
|
-
* );
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export function Options(props) {
|
|
42
|
-
const service = useService(ProductsListSearchServiceDefinition);
|
|
43
|
-
const selectedSortOption = service.selectedSortOption.get();
|
|
44
|
-
const sortOptions = service.sortOptions;
|
|
45
|
-
const updateSortOption = service.setSelectedSortOption;
|
|
46
|
-
return typeof props.children === 'function'
|
|
47
|
-
? props.children({
|
|
48
|
-
selectedSortOption,
|
|
49
|
-
updateSortOption,
|
|
50
|
-
sortOptions,
|
|
51
|
-
})
|
|
52
|
-
: props.children;
|
|
53
|
-
}
|
|
2
|
+
import { ProductsListServiceDefinition } from '../../services/products-list-service.js';
|
|
3
|
+
export const ProductListSort = (props) => {
|
|
4
|
+
const productListService = useService(ProductsListServiceDefinition);
|
|
5
|
+
const currentSort = productListService.searchOptions.get().sort;
|
|
6
|
+
// Define sort options - primitive handles all conversion logic
|
|
7
|
+
const sortOptions = [
|
|
8
|
+
{ fieldName: 'name', order: 'ASC', label: 'Name (A-Z)' },
|
|
9
|
+
{ fieldName: 'name', order: 'DESC', label: 'Name (Z-A)' },
|
|
10
|
+
{
|
|
11
|
+
fieldName: 'actualPriceRange.minValue.amount',
|
|
12
|
+
order: 'ASC',
|
|
13
|
+
label: 'Price: Low to High',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
fieldName: 'actualPriceRange.minValue.amount',
|
|
17
|
+
order: 'DESC',
|
|
18
|
+
label: 'Price: High to Low',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
fieldName: 'name',
|
|
22
|
+
order: 'DESC',
|
|
23
|
+
label: 'Latest Arrivals',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
return props.children({
|
|
27
|
+
currentSort,
|
|
28
|
+
sortOptions,
|
|
29
|
+
setSort: (sort) => {
|
|
30
|
+
productListService.setSort(sort);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
};
|
package/dist/services/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export { CategoriesListService, CategoriesListServiceDefinition, loadCategoriesL
|
|
|
3
3
|
export { ProductModifiersService, ProductModifiersServiceDefinition, } from './product-modifiers-service.js';
|
|
4
4
|
export { ProductService, ProductServiceDefinition, loadProductServiceConfig, } from './product-service.js';
|
|
5
5
|
export { SelectedVariantService, SelectedVariantServiceDefinition, } from './selected-variant-service.js';
|
|
6
|
-
export { ProductListService, ProductsListServiceDefinition, loadProductsListServiceConfig, ProductsListServiceConfig, } from './products-list-service.js';
|
|
7
|
-
export {
|
|
6
|
+
export { ProductListService, ProductsListServiceDefinition, loadProductsListServiceConfig, ProductsListServiceConfig, ProductOption, ProductChoice, } from './products-list-service.js';
|
|
7
|
+
export { InventoryStatusType, SortType, ProductsListSearchService, ProductsListSearchServiceDefinition, ProductsListSearchServiceConfig, loadProductsListSearchServiceConfig, parseUrlToSearchOptions, convertUrlSortToSortType, } from './products-list-search-service.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Signal } from '@wix/services-definitions/core-services/signals';
|
|
2
1
|
import { productsV3, customizationsV3 } from '@wix/stores';
|
|
3
2
|
import { type Category } from './category-service.js';
|
|
4
3
|
import { SortType } from './../enums/sort-enums.js';
|
|
@@ -13,23 +12,6 @@ export declare const InventoryStatusType: typeof productsV3.InventoryAvailabilit
|
|
|
13
12
|
* Re-exports the Wix inventory availability status enum type.
|
|
14
13
|
*/
|
|
15
14
|
export type InventoryStatusType = productsV3.InventoryAvailabilityStatus;
|
|
16
|
-
/**
|
|
17
|
-
* Interface representing a product option (like Size, Color, etc.).
|
|
18
|
-
*/
|
|
19
|
-
export interface ProductOption {
|
|
20
|
-
id: string;
|
|
21
|
-
name: string;
|
|
22
|
-
choices: ProductChoice[];
|
|
23
|
-
optionRenderType?: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Interface representing a choice within a product option.
|
|
27
|
-
*/
|
|
28
|
-
export interface ProductChoice {
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
colorCode?: string;
|
|
32
|
-
}
|
|
33
15
|
/**
|
|
34
16
|
* Initial search state that can be loaded from URL parameters.
|
|
35
17
|
*/
|
|
@@ -51,7 +33,6 @@ export type InitialSearchState = {
|
|
|
51
33
|
* Configuration interface for the Products List Search service.
|
|
52
34
|
*/
|
|
53
35
|
export type ProductsListSearchServiceConfig = {
|
|
54
|
-
customizations: customizationsV3.Customization[];
|
|
55
36
|
initialSearchState?: InitialSearchState;
|
|
56
37
|
};
|
|
57
38
|
/**
|
|
@@ -59,79 +40,9 @@ export type ProductsListSearchServiceConfig = {
|
|
|
59
40
|
* This consolidates sort, pagination, and filtering functionality.
|
|
60
41
|
*/
|
|
61
42
|
export declare const ProductsListSearchServiceDefinition: string & {
|
|
62
|
-
__api: {
|
|
63
|
-
selectedSortOption: Signal<string>;
|
|
64
|
-
sortOptions: SortType[];
|
|
65
|
-
setSelectedSortOption: (sort: string) => void;
|
|
66
|
-
currentLimit: Signal<number>;
|
|
67
|
-
currentCursor: Signal<string | null>;
|
|
68
|
-
hasNextPage: {
|
|
69
|
-
get: () => boolean;
|
|
70
|
-
};
|
|
71
|
-
hasPrevPage: {
|
|
72
|
-
get: () => boolean;
|
|
73
|
-
};
|
|
74
|
-
setLimit: (limit: number) => void;
|
|
75
|
-
nextPage: () => void;
|
|
76
|
-
prevPage: () => void;
|
|
77
|
-
navigateToFirstPage: () => void;
|
|
78
|
-
loadMore: (count: number) => void;
|
|
79
|
-
selectedMinPrice: Signal<number>;
|
|
80
|
-
selectedMaxPrice: Signal<number>;
|
|
81
|
-
availableMinPrice: Signal<number>;
|
|
82
|
-
availableMaxPrice: Signal<number>;
|
|
83
|
-
availableInventoryStatuses: Signal<InventoryStatusType[]>;
|
|
84
|
-
selectedInventoryStatuses: Signal<InventoryStatusType[]>;
|
|
85
|
-
availableProductOptions: Signal<ProductOption[]>;
|
|
86
|
-
selectedProductOptions: Signal<Record<string, string[]>>;
|
|
87
|
-
selectedCategory: Signal<Category | null>;
|
|
88
|
-
setSelectedMinPrice: (minPrice: number) => void;
|
|
89
|
-
setSelectedMaxPrice: (maxPrice: number) => void;
|
|
90
|
-
toggleInventoryStatus: (status: InventoryStatusType) => void;
|
|
91
|
-
toggleProductOption: (optionId: string, choiceId: string) => void;
|
|
92
|
-
setSelectedCategory: (category: Category | null) => void;
|
|
93
|
-
isFiltered: {
|
|
94
|
-
get: () => boolean;
|
|
95
|
-
};
|
|
96
|
-
reset: () => void;
|
|
97
|
-
};
|
|
43
|
+
__api: {};
|
|
98
44
|
__config: {};
|
|
99
45
|
isServiceDefinition?: boolean;
|
|
100
|
-
} & {
|
|
101
|
-
selectedSortOption: Signal<string>;
|
|
102
|
-
sortOptions: SortType[];
|
|
103
|
-
setSelectedSortOption: (sort: string) => void;
|
|
104
|
-
currentLimit: Signal<number>;
|
|
105
|
-
currentCursor: Signal<string | null>;
|
|
106
|
-
hasNextPage: {
|
|
107
|
-
get: () => boolean;
|
|
108
|
-
};
|
|
109
|
-
hasPrevPage: {
|
|
110
|
-
get: () => boolean;
|
|
111
|
-
};
|
|
112
|
-
setLimit: (limit: number) => void;
|
|
113
|
-
nextPage: () => void;
|
|
114
|
-
prevPage: () => void;
|
|
115
|
-
navigateToFirstPage: () => void;
|
|
116
|
-
loadMore: (count: number) => void;
|
|
117
|
-
selectedMinPrice: Signal<number>;
|
|
118
|
-
selectedMaxPrice: Signal<number>;
|
|
119
|
-
availableMinPrice: Signal<number>;
|
|
120
|
-
availableMaxPrice: Signal<number>;
|
|
121
|
-
availableInventoryStatuses: Signal<InventoryStatusType[]>;
|
|
122
|
-
selectedInventoryStatuses: Signal<InventoryStatusType[]>;
|
|
123
|
-
availableProductOptions: Signal<ProductOption[]>;
|
|
124
|
-
selectedProductOptions: Signal<Record<string, string[]>>;
|
|
125
|
-
selectedCategory: Signal<Category | null>;
|
|
126
|
-
setSelectedMinPrice: (minPrice: number) => void;
|
|
127
|
-
setSelectedMaxPrice: (maxPrice: number) => void;
|
|
128
|
-
toggleInventoryStatus: (status: InventoryStatusType) => void;
|
|
129
|
-
toggleProductOption: (optionId: string, choiceId: string) => void;
|
|
130
|
-
setSelectedCategory: (category: Category | null) => void;
|
|
131
|
-
isFiltered: {
|
|
132
|
-
get: () => boolean;
|
|
133
|
-
};
|
|
134
|
-
reset: () => void;
|
|
135
46
|
};
|
|
136
47
|
/**
|
|
137
48
|
* Convert URL sort format to SortType enum
|
|
@@ -164,7 +75,7 @@ export declare function convertUrlSortToSortType(urlSort: string): SortType | nu
|
|
|
164
75
|
* const filterState = initialSearchState.productOptions; // { colorId: ['red-id', 'blue-id'] }
|
|
165
76
|
* ```
|
|
166
77
|
*/
|
|
167
|
-
export declare function parseUrlToSearchOptions(url: string, categoriesList: Category[], defaultSearchOptions?: productsV3.V3ProductSearch): Promise<{
|
|
78
|
+
export declare function parseUrlToSearchOptions(url: string, categoriesList: Category[], customizations: customizationsV3.Customization[], defaultSearchOptions?: productsV3.V3ProductSearch): Promise<{
|
|
168
79
|
searchOptions: productsV3.V3ProductSearch;
|
|
169
80
|
initialSearchState: InitialSearchState;
|
|
170
81
|
}>;
|
|
@@ -211,77 +122,7 @@ export declare function loadProductsListSearchServiceConfig(input: string | {
|
|
|
211
122
|
* Implementation of the Products List Search service
|
|
212
123
|
*/
|
|
213
124
|
export declare const ProductsListSearchService: import("@wix/services-definitions").ServiceFactory<string & {
|
|
214
|
-
__api: {
|
|
215
|
-
selectedSortOption: Signal<string>;
|
|
216
|
-
sortOptions: SortType[];
|
|
217
|
-
setSelectedSortOption: (sort: string) => void;
|
|
218
|
-
currentLimit: Signal<number>;
|
|
219
|
-
currentCursor: Signal<string | null>;
|
|
220
|
-
hasNextPage: {
|
|
221
|
-
get: () => boolean;
|
|
222
|
-
};
|
|
223
|
-
hasPrevPage: {
|
|
224
|
-
get: () => boolean;
|
|
225
|
-
};
|
|
226
|
-
setLimit: (limit: number) => void;
|
|
227
|
-
nextPage: () => void;
|
|
228
|
-
prevPage: () => void;
|
|
229
|
-
navigateToFirstPage: () => void;
|
|
230
|
-
loadMore: (count: number) => void;
|
|
231
|
-
selectedMinPrice: Signal<number>;
|
|
232
|
-
selectedMaxPrice: Signal<number>;
|
|
233
|
-
availableMinPrice: Signal<number>;
|
|
234
|
-
availableMaxPrice: Signal<number>;
|
|
235
|
-
availableInventoryStatuses: Signal<InventoryStatusType[]>;
|
|
236
|
-
selectedInventoryStatuses: Signal<InventoryStatusType[]>;
|
|
237
|
-
availableProductOptions: Signal<ProductOption[]>;
|
|
238
|
-
selectedProductOptions: Signal<Record<string, string[]>>;
|
|
239
|
-
selectedCategory: Signal<Category | null>;
|
|
240
|
-
setSelectedMinPrice: (minPrice: number) => void;
|
|
241
|
-
setSelectedMaxPrice: (maxPrice: number) => void;
|
|
242
|
-
toggleInventoryStatus: (status: InventoryStatusType) => void;
|
|
243
|
-
toggleProductOption: (optionId: string, choiceId: string) => void;
|
|
244
|
-
setSelectedCategory: (category: Category | null) => void;
|
|
245
|
-
isFiltered: {
|
|
246
|
-
get: () => boolean;
|
|
247
|
-
};
|
|
248
|
-
reset: () => void;
|
|
249
|
-
};
|
|
125
|
+
__api: {};
|
|
250
126
|
__config: {};
|
|
251
127
|
isServiceDefinition?: boolean;
|
|
252
|
-
} & {
|
|
253
|
-
selectedSortOption: Signal<string>;
|
|
254
|
-
sortOptions: SortType[];
|
|
255
|
-
setSelectedSortOption: (sort: string) => void;
|
|
256
|
-
currentLimit: Signal<number>;
|
|
257
|
-
currentCursor: Signal<string | null>;
|
|
258
|
-
hasNextPage: {
|
|
259
|
-
get: () => boolean;
|
|
260
|
-
};
|
|
261
|
-
hasPrevPage: {
|
|
262
|
-
get: () => boolean;
|
|
263
|
-
};
|
|
264
|
-
setLimit: (limit: number) => void;
|
|
265
|
-
nextPage: () => void;
|
|
266
|
-
prevPage: () => void;
|
|
267
|
-
navigateToFirstPage: () => void;
|
|
268
|
-
loadMore: (count: number) => void;
|
|
269
|
-
selectedMinPrice: Signal<number>;
|
|
270
|
-
selectedMaxPrice: Signal<number>;
|
|
271
|
-
availableMinPrice: Signal<number>;
|
|
272
|
-
availableMaxPrice: Signal<number>;
|
|
273
|
-
availableInventoryStatuses: Signal<InventoryStatusType[]>;
|
|
274
|
-
selectedInventoryStatuses: Signal<InventoryStatusType[]>;
|
|
275
|
-
availableProductOptions: Signal<ProductOption[]>;
|
|
276
|
-
selectedProductOptions: Signal<Record<string, string[]>>;
|
|
277
|
-
selectedCategory: Signal<Category | null>;
|
|
278
|
-
setSelectedMinPrice: (minPrice: number) => void;
|
|
279
|
-
setSelectedMaxPrice: (maxPrice: number) => void;
|
|
280
|
-
toggleInventoryStatus: (status: InventoryStatusType) => void;
|
|
281
|
-
toggleProductOption: (optionId: string, choiceId: string) => void;
|
|
282
|
-
setSelectedCategory: (category: Category | null) => void;
|
|
283
|
-
isFiltered: {
|
|
284
|
-
get: () => boolean;
|
|
285
|
-
};
|
|
286
|
-
reset: () => void;
|
|
287
128
|
}, ProductsListSearchServiceConfig>;
|