@wix/headless-stores 0.0.67 → 0.0.69
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.
|
@@ -8,3 +8,12 @@ export interface ProductListSortProps {
|
|
|
8
8
|
}) => React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
export declare const ProductListSort: (props: ProductListSortProps) => import("react").ReactNode;
|
|
11
|
+
export interface ProductListSeperateSortProps {
|
|
12
|
+
children: (props: {
|
|
13
|
+
currentSort: productsV3.V3ProductSearch['sort'];
|
|
14
|
+
sortFieldOptions: SortPrimitive.SortOption[];
|
|
15
|
+
sortOrderOptions: SortPrimitive.SortOption[];
|
|
16
|
+
setSort: (sort: productsV3.V3ProductSearch['sort']) => void;
|
|
17
|
+
}) => React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function ProductListSeperateSort(props: ProductListSeperateSortProps): import("react").ReactNode;
|
|
@@ -17,11 +17,6 @@ export const ProductListSort = (props) => {
|
|
|
17
17
|
order: 'DESC',
|
|
18
18
|
label: 'Price: High to Low',
|
|
19
19
|
},
|
|
20
|
-
{
|
|
21
|
-
fieldName: 'name',
|
|
22
|
-
order: 'DESC',
|
|
23
|
-
label: 'Latest Arrivals',
|
|
24
|
-
},
|
|
25
20
|
];
|
|
26
21
|
return props.children({
|
|
27
22
|
currentSort,
|
|
@@ -31,3 +26,27 @@ export const ProductListSort = (props) => {
|
|
|
31
26
|
},
|
|
32
27
|
});
|
|
33
28
|
};
|
|
29
|
+
export function ProductListSeperateSort(props) {
|
|
30
|
+
const productListService = useService(ProductsListServiceDefinition);
|
|
31
|
+
const currentSort = productListService.searchOptions.get().sort;
|
|
32
|
+
// Define sort options - primitive handles all conversion logic
|
|
33
|
+
const sortFieldOptions = [
|
|
34
|
+
{ fieldName: 'name', label: 'Name' },
|
|
35
|
+
{
|
|
36
|
+
fieldName: 'actualPriceRange.minValue.amount',
|
|
37
|
+
label: 'Price',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
const sortOrderOptions = [
|
|
41
|
+
{ order: 'ASC', label: 'Ascending' },
|
|
42
|
+
{ order: 'DESC', label: 'Descending' },
|
|
43
|
+
];
|
|
44
|
+
return props.children({
|
|
45
|
+
currentSort,
|
|
46
|
+
sortFieldOptions,
|
|
47
|
+
sortOrderOptions,
|
|
48
|
+
setSort: (sort) => {
|
|
49
|
+
productListService.setSort(sort);
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -8,3 +8,12 @@ export interface ProductListSortProps {
|
|
|
8
8
|
}) => React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
export declare const ProductListSort: (props: ProductListSortProps) => import("react").ReactNode;
|
|
11
|
+
export interface ProductListSeperateSortProps {
|
|
12
|
+
children: (props: {
|
|
13
|
+
currentSort: productsV3.V3ProductSearch['sort'];
|
|
14
|
+
sortFieldOptions: SortPrimitive.SortOption[];
|
|
15
|
+
sortOrderOptions: SortPrimitive.SortOption[];
|
|
16
|
+
setSort: (sort: productsV3.V3ProductSearch['sort']) => void;
|
|
17
|
+
}) => React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function ProductListSeperateSort(props: ProductListSeperateSortProps): import("react").ReactNode;
|
|
@@ -17,11 +17,6 @@ export const ProductListSort = (props) => {
|
|
|
17
17
|
order: 'DESC',
|
|
18
18
|
label: 'Price: High to Low',
|
|
19
19
|
},
|
|
20
|
-
{
|
|
21
|
-
fieldName: 'name',
|
|
22
|
-
order: 'DESC',
|
|
23
|
-
label: 'Latest Arrivals',
|
|
24
|
-
},
|
|
25
20
|
];
|
|
26
21
|
return props.children({
|
|
27
22
|
currentSort,
|
|
@@ -31,3 +26,27 @@ export const ProductListSort = (props) => {
|
|
|
31
26
|
},
|
|
32
27
|
});
|
|
33
28
|
};
|
|
29
|
+
export function ProductListSeperateSort(props) {
|
|
30
|
+
const productListService = useService(ProductsListServiceDefinition);
|
|
31
|
+
const currentSort = productListService.searchOptions.get().sort;
|
|
32
|
+
// Define sort options - primitive handles all conversion logic
|
|
33
|
+
const sortFieldOptions = [
|
|
34
|
+
{ fieldName: 'name', label: 'Name' },
|
|
35
|
+
{
|
|
36
|
+
fieldName: 'actualPriceRange.minValue.amount',
|
|
37
|
+
label: 'Price',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
const sortOrderOptions = [
|
|
41
|
+
{ order: 'ASC', label: 'Ascending' },
|
|
42
|
+
{ order: 'DESC', label: 'Descending' },
|
|
43
|
+
];
|
|
44
|
+
return props.children({
|
|
45
|
+
currentSort,
|
|
46
|
+
sortFieldOptions,
|
|
47
|
+
sortOrderOptions,
|
|
48
|
+
setSort: (sort) => {
|
|
49
|
+
productListService.setSort(sort);
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-stores",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.69",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prebuild": "cd ../media && yarn build && cd ../ecom && yarn build",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@wix/auto_sdk_stores_read-only-variants-v-3": "^1.0.23",
|
|
63
63
|
"@wix/ecom": "^1.0.1278",
|
|
64
64
|
"@wix/essentials": "^0.1.24",
|
|
65
|
-
"@wix/headless-components": "0.0.
|
|
65
|
+
"@wix/headless-components": "0.0.7",
|
|
66
66
|
"@wix/headless-ecom": "0.0.20",
|
|
67
67
|
"@wix/headless-media": "0.0.11",
|
|
68
68
|
"@wix/headless-utils": "0.0.3",
|