@riosst100/pwa-marketplace 1.8.1 → 1.8.2
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/i18n/id_ID.json +508 -508
- package/package.json +1 -2
- package/src/components/CustomSubCategory/subCategory.js +0 -14
- package/src/components/FilterTop/FilterBlockList/filterTopItemGroup.module.css +1 -1
- package/src/components/FilterTop/filterTop.js +2 -2
- package/src/components/FilterTop/filterTop.module.css +1 -1
- package/src/components/FilterTopBackup/CustomFilters/customFilter.js +83 -83
- package/src/components/FilterTopBackup/CustomFilters/customFilter.module.css +21 -21
- package/src/components/FilterTopBackup/CustomFilters/customFilters.js +131 -131
- package/src/components/FilterTopBackup/CustomFilters/customFilters.module.css +22 -22
- package/src/components/FilterTopBackup/CustomFilters/index.js +1 -1
- package/src/components/FilterTopBackup/filterTop.js +14 -14
- package/src/components/FilterTopBackup/filterTop.module.css +22 -22
- package/src/components/FilterTopBackup/filterTop.shimmer.js +24 -24
- package/src/components/FilterTopBackup/index.js +2 -2
- package/src/components/Header/websiteSwitcher.shimmer.js +6 -6
- package/src/components/Header/websiteSwitcherItem.js +47 -47
- package/src/components/Header/websiteSwitcherItem.module.css +20 -20
- package/src/components/PhoneTextInput/index.js +1 -1
- package/src/components/PhoneTextInput/phoneTextInput.js +62 -62
- package/src/components/ProductListTab/index.js +4 -4
- package/src/components/ProductListTab/productListTab.module.css +64 -64
- package/src/components/ProductListTab/productListTab.shimmer.js +24 -24
- package/src/components/SellerCountry/index.js +1 -1
- package/src/components/SellerCountry/sellerCountry.js +71 -71
- package/src/components/SellerCountry/sellerCountry.module.css +3 -3
- package/src/components/ShopByCategory/index.js +2 -2
- package/src/components/ShopByCategory/shopByCategory.js +69 -69
- package/src/components/ShopByCategory/shopByCategory.module.css +58 -58
- package/src/components/ShopByCategory/shopByCategory.shimmer.js +24 -24
- package/src/components/SubCategory/subCategory.js +1 -1
- package/src/components/WebsiteSwitcher/websiteSwitcher.shimmer.js +6 -6
- package/src/components/WebsiteSwitcher/websiteSwitcherItem.js +47 -47
- package/src/components/WebsiteSwitcher/websiteSwitcherItem.module.css +20 -20
- package/src/overwrites/peregrine/lib/talons/MegaMenu/megaMenu.gql.js +96 -96
- package/src/overwrites/peregrine/lib/talons/MegaMenu/useMegaMenu.js +199 -199
- package/src/overwrites/peregrine/lib/talons/MegaMenu/useMegaMenuItem.js +66 -66
- package/src/overwrites/peregrine/lib/talons/MegaMenu/useSubMenu.js +20 -20
- package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +642 -642
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/category.gql.js +49 -49
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategory.js +227 -227
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/product.gql.js +31 -31
- package/src/overwrites/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js +235 -235
- package/src/overwrites/venia-ui/lib/components/Header/cartTrigger.module.css +47 -47
- package/src/overwrites/venia-ui/lib/components/RadioGroup/radio.js +60 -60
- package/src/overwrites/venia-ui/lib/components/RadioGroup/radio.module.css +70 -70
- package/src/talons/AttributesBlock/attributesBlock.gql.js +15 -15
- package/src/talons/CustomFilters/customFilters.gql.js +45 -45
- package/src/talons/CustomFilters/useCustomFilters.js +5 -2
- package/src/talons/FilterTop/filterTop.gql.js +45 -45
- package/src/talons/FilterTop/index.js +1 -1
- package/src/talons/FilterTop/useFilterTop.js +5 -4
- package/src/talons/Header/websiteSwitcher.gql.js +45 -45
- package/src/talons/SellerReview/sellerReview.gql.js +53 -53
- package/src/talons/ShopByCategory/index.js +1 -1
- package/src/talons/ShopByCategory/shopByCategory.gql.js +38 -38
- package/src/talons/ShopByCategory/useShopByCategory.js +69 -69
- package/src/talons/SubCategory/subCategory.gql.js +15 -15
- package/src/talons/SubCategory/useSubCategory.js +3 -3
- package/src/talons/WebsiteSwitcher/websiteSwitcher.gql.js +45 -45
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
export const useMegaMenuItem = props => {
|
|
4
|
-
const { category, activeCategoryId, subMenuState, disableFocus } = props;
|
|
5
|
-
|
|
6
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
7
|
-
const isActive = category.id === activeCategoryId;
|
|
8
|
-
|
|
9
|
-
const handleMenuItemFocus = useCallback(() => {
|
|
10
|
-
setIsFocused(true);
|
|
11
|
-
}, [setIsFocused]);
|
|
12
|
-
|
|
13
|
-
const handleCloseSubMenu = useCallback(() => {
|
|
14
|
-
setIsFocused(false);
|
|
15
|
-
}, [setIsFocused]);
|
|
16
|
-
|
|
17
|
-
const isMenuActive = useMemo(() => {
|
|
18
|
-
if (!isFocused) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
if (subMenuState) {
|
|
22
|
-
return true;
|
|
23
|
-
} else if (disableFocus) {
|
|
24
|
-
setIsFocused(false);
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
}, [isFocused, subMenuState, disableFocus]);
|
|
28
|
-
|
|
29
|
-
const handleKeyDown = useCallback(
|
|
30
|
-
event => {
|
|
31
|
-
const { key: pressedKey, shiftKey } = event;
|
|
32
|
-
|
|
33
|
-
// checking down arrow and spacebar
|
|
34
|
-
if (pressedKey === 'ArrowDown' || pressedKey === ' ') {
|
|
35
|
-
event.preventDefault();
|
|
36
|
-
if (category.children.length || category.name == "Lego") {
|
|
37
|
-
setIsFocused(true);
|
|
38
|
-
} else {
|
|
39
|
-
setIsFocused(false);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
//checking up arrow or escape
|
|
46
|
-
if (pressedKey === 'ArrowUp' || pressedKey === 'Escape') {
|
|
47
|
-
setIsFocused(false);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//checking Tab with Shift
|
|
51
|
-
if (shiftKey && pressedKey === 'Tab') {
|
|
52
|
-
setIsFocused(false);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
[category.children.length, category.name]
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
isFocused,
|
|
60
|
-
isActive,
|
|
61
|
-
handleMenuItemFocus,
|
|
62
|
-
handleCloseSubMenu,
|
|
63
|
-
isMenuActive,
|
|
64
|
-
handleKeyDown
|
|
65
|
-
};
|
|
66
|
-
};
|
|
1
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export const useMegaMenuItem = props => {
|
|
4
|
+
const { category, activeCategoryId, subMenuState, disableFocus } = props;
|
|
5
|
+
|
|
6
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
7
|
+
const isActive = category.id === activeCategoryId;
|
|
8
|
+
|
|
9
|
+
const handleMenuItemFocus = useCallback(() => {
|
|
10
|
+
setIsFocused(true);
|
|
11
|
+
}, [setIsFocused]);
|
|
12
|
+
|
|
13
|
+
const handleCloseSubMenu = useCallback(() => {
|
|
14
|
+
setIsFocused(false);
|
|
15
|
+
}, [setIsFocused]);
|
|
16
|
+
|
|
17
|
+
const isMenuActive = useMemo(() => {
|
|
18
|
+
if (!isFocused) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (subMenuState) {
|
|
22
|
+
return true;
|
|
23
|
+
} else if (disableFocus) {
|
|
24
|
+
setIsFocused(false);
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}, [isFocused, subMenuState, disableFocus]);
|
|
28
|
+
|
|
29
|
+
const handleKeyDown = useCallback(
|
|
30
|
+
event => {
|
|
31
|
+
const { key: pressedKey, shiftKey } = event;
|
|
32
|
+
|
|
33
|
+
// checking down arrow and spacebar
|
|
34
|
+
if (pressedKey === 'ArrowDown' || pressedKey === ' ') {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
if (category.children.length || category.name == "Lego") {
|
|
37
|
+
setIsFocused(true);
|
|
38
|
+
} else {
|
|
39
|
+
setIsFocused(false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//checking up arrow or escape
|
|
46
|
+
if (pressedKey === 'ArrowUp' || pressedKey === 'Escape') {
|
|
47
|
+
setIsFocused(false);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//checking Tab with Shift
|
|
51
|
+
if (shiftKey && pressedKey === 'Tab') {
|
|
52
|
+
setIsFocused(false);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
[category.children.length, category.name]
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
isFocused,
|
|
60
|
+
isActive,
|
|
61
|
+
handleMenuItemFocus,
|
|
62
|
+
handleCloseSubMenu,
|
|
63
|
+
isMenuActive,
|
|
64
|
+
handleKeyDown
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { useKeyboard } from 'react-aria';
|
|
2
|
-
|
|
3
|
-
export const useSubMenu = props => {
|
|
4
|
-
const { isFocused, subMenuState, handleCloseSubMenu } = props;
|
|
5
|
-
|
|
6
|
-
const { keyboardProps } = useKeyboard({
|
|
7
|
-
onKeyDown: e => {
|
|
8
|
-
//checking for Tab without Shift
|
|
9
|
-
if (!e.shiftKey && e.key === 'Tab') {
|
|
10
|
-
e.target.addEventListener('blur', handleCloseSubMenu);
|
|
11
|
-
} else {
|
|
12
|
-
e.target.removeEventListener('blur', handleCloseSubMenu);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const isSubMenuActive = isFocused && subMenuState;
|
|
18
|
-
|
|
19
|
-
return { keyboardProps, isSubMenuActive };
|
|
20
|
-
};
|
|
1
|
+
import { useKeyboard } from 'react-aria';
|
|
2
|
+
|
|
3
|
+
export const useSubMenu = props => {
|
|
4
|
+
const { isFocused, subMenuState, handleCloseSubMenu } = props;
|
|
5
|
+
|
|
6
|
+
const { keyboardProps } = useKeyboard({
|
|
7
|
+
onKeyDown: e => {
|
|
8
|
+
//checking for Tab without Shift
|
|
9
|
+
if (!e.shiftKey && e.key === 'Tab') {
|
|
10
|
+
e.target.addEventListener('blur', handleCloseSubMenu);
|
|
11
|
+
} else {
|
|
12
|
+
e.target.removeEventListener('blur', handleCloseSubMenu);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const isSubMenuActive = isFocused && subMenuState;
|
|
18
|
+
|
|
19
|
+
return { keyboardProps, isSubMenuActive };
|
|
20
|
+
};
|