@tapcart/mobile-components 0.6.12 → 0.6.14
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/dist/components/hooks/use-collection.d.ts +3 -1
- package/dist/components/hooks/use-collection.d.ts.map +1 -1
- package/dist/components/hooks/use-collection.js +56 -43
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +4 -3
- package/dist/components/ui/price.d.ts.map +1 -1
- package/dist/components/ui/price.js +1 -1
- package/dist/components/ui/scroll-area.js +1 -1
- package/dist/components/ui/subcollection-tabs.d.ts +11 -0
- package/dist/components/ui/subcollection-tabs.d.ts.map +1 -0
- package/dist/components/ui/subcollection-tabs.js +49 -0
- package/dist/components/ui/tabs.d.ts +3 -2
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +17 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/styles.css +50 -20
- package/package.json +16 -16
|
@@ -9,13 +9,15 @@ interface UseCollectionProps {
|
|
|
9
9
|
appId: string;
|
|
10
10
|
collectionId?: string;
|
|
11
11
|
collectionHandle?: string;
|
|
12
|
+
collectionIdList?: string[];
|
|
12
13
|
language: string;
|
|
13
14
|
getCollections?: boolean;
|
|
15
|
+
limit?: number;
|
|
14
16
|
}
|
|
15
17
|
interface Product {
|
|
16
18
|
handle: string;
|
|
17
19
|
}
|
|
18
|
-
export declare const useCollection: ({ apiUrl, appId, collectionId, collectionHandle, language, getCollections, }: UseCollectionProps) => {
|
|
20
|
+
export declare const useCollection: ({ apiUrl, appId, collectionId, collectionHandle, collectionIdList, language, limit, getCollections, }: UseCollectionProps) => {
|
|
19
21
|
collections: Collection[] | null;
|
|
20
22
|
specificCollection: Collection | null;
|
|
21
23
|
loading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-collection.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-collection.ts"],"names":[],"mappings":"AAGA,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-collection.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-collection.ts"],"names":[],"mappings":"AAGA,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,OAAO,EAAE,CAAA;CACpB;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAA;CAEf;AA6ED,eAAO,MAAM,aAAa,0GASvB,kBAAkB;;;;;CA0DpB,CAAA"}
|
|
@@ -9,56 +9,60 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
import { useState, useEffect } from "react";
|
|
12
|
-
|
|
12
|
+
const notEmpty = (value) => {
|
|
13
|
+
return value !== null && value !== undefined;
|
|
14
|
+
};
|
|
15
|
+
const fetchWrapper = (url, errorCallback) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
const res = yield fetch(url, {
|
|
18
|
+
method: "GET",
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-Type": "application/json",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return yield res.json();
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
console.error("Error fetching collection:", error);
|
|
27
|
+
errorCallback(error instanceof Error ? error.message : "An unknown error occurred.");
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const fetchCollection = (apiUrl, language, setError, collectionId = "", collectionHandle = "") => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const collectionBy = collectionHandle ? "by-handle" : "by-id";
|
|
32
|
+
const params = new URLSearchParams({
|
|
33
|
+
collectionHandle: collectionHandle,
|
|
34
|
+
collectionId: collectionId,
|
|
35
|
+
language,
|
|
36
|
+
}).toString();
|
|
37
|
+
return yield fetchWrapper(`${apiUrl}/collections/${collectionBy}?${params}`, setError);
|
|
38
|
+
});
|
|
39
|
+
const fetchAllCollections = (apiUrl, setError, limit = 100) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const limitParam = new URLSearchParams({
|
|
41
|
+
limit: `${limit}`,
|
|
42
|
+
}).toString();
|
|
43
|
+
return yield fetchWrapper(`${apiUrl}/collections/by-app-id?${limitParam}`, setError);
|
|
44
|
+
});
|
|
45
|
+
export const useCollection = ({ apiUrl, appId, collectionId, collectionHandle, collectionIdList, language, limit = 100, getCollections = false, }) => {
|
|
13
46
|
const [collections, setCollections] = useState(null);
|
|
14
47
|
const [specificCollection, setSpecificCollection] = useState(null);
|
|
15
48
|
const [loading, setLoading] = useState(true);
|
|
16
49
|
const [error, setError] = useState(null);
|
|
17
50
|
useEffect(() => {
|
|
18
|
-
const
|
|
51
|
+
const fetchAllOrSumCollections = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
52
|
try {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// Fetch specific collection by ID or handle
|
|
24
|
-
const params = new URLSearchParams({
|
|
25
|
-
collectionHandle: collectionHandle || "",
|
|
26
|
-
collectionId: collectionId || "",
|
|
27
|
-
language,
|
|
28
|
-
}).toString();
|
|
29
|
-
const collectionBy = collectionHandle ? "by-handle" : "by-id";
|
|
30
|
-
specificCollectionUrl = `${apiUrl}/collections/${collectionBy}?${params}`;
|
|
53
|
+
if (getCollections) {
|
|
54
|
+
const collections = yield fetchAllCollections(apiUrl, setError, limit);
|
|
55
|
+
return setCollections(collections);
|
|
31
56
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"Content-Type": "application/json",
|
|
37
|
-
},
|
|
38
|
-
})
|
|
39
|
-
: null;
|
|
40
|
-
const fetchSpecificCollection = specificCollectionUrl
|
|
41
|
-
? fetch(specificCollectionUrl, {
|
|
42
|
-
method: "GET",
|
|
43
|
-
headers: {
|
|
44
|
-
"Content-Type": "application/json",
|
|
45
|
-
},
|
|
46
|
-
})
|
|
47
|
-
: null;
|
|
48
|
-
const [allCollectionsResponse, specificCollectionResponse] = yield Promise.all([
|
|
49
|
-
fetchAllCollections,
|
|
50
|
-
fetchSpecificCollection,
|
|
51
|
-
]);
|
|
52
|
-
if (fetchAllCollections && allCollectionsResponse && !allCollectionsResponse.ok) {
|
|
53
|
-
throw new Error(`Failed to fetch all collections: ${allCollectionsResponse.statusText}`);
|
|
57
|
+
if (collectionIdList === null || collectionIdList === void 0 ? void 0 : collectionIdList.length) {
|
|
58
|
+
const collections = yield Promise.all(collectionIdList.map((id) => fetchCollection(apiUrl, language, setError, id)));
|
|
59
|
+
const filteredCollections = collections.filter(notEmpty);
|
|
60
|
+
return setCollections(filteredCollections);
|
|
54
61
|
}
|
|
55
|
-
if (
|
|
56
|
-
|
|
62
|
+
if (collectionId || collectionHandle) {
|
|
63
|
+
const collection = yield fetchCollection(apiUrl, language, setError, collectionId, collectionHandle);
|
|
64
|
+
return setSpecificCollection(collection);
|
|
57
65
|
}
|
|
58
|
-
const allCollectionsData = fetchAllCollections && allCollectionsResponse ? yield allCollectionsResponse.json() : null;
|
|
59
|
-
const specificCollectionData = fetchSpecificCollection && specificCollectionResponse ? yield specificCollectionResponse.json() : null;
|
|
60
|
-
setCollections(allCollectionsData);
|
|
61
|
-
setSpecificCollection(specificCollectionData);
|
|
62
66
|
}
|
|
63
67
|
catch (error) {
|
|
64
68
|
console.error("Error fetching collection:", error);
|
|
@@ -68,7 +72,16 @@ export const useCollection = ({ apiUrl, appId, collectionId, collectionHandle, l
|
|
|
68
72
|
setLoading(false);
|
|
69
73
|
}
|
|
70
74
|
});
|
|
71
|
-
|
|
72
|
-
}, [
|
|
75
|
+
fetchAllOrSumCollections();
|
|
76
|
+
}, [
|
|
77
|
+
apiUrl,
|
|
78
|
+
appId,
|
|
79
|
+
collectionId,
|
|
80
|
+
collectionHandle,
|
|
81
|
+
language,
|
|
82
|
+
getCollections,
|
|
83
|
+
limit,
|
|
84
|
+
collectionIdList,
|
|
85
|
+
]);
|
|
73
86
|
return { collections, specificCollection, loading, error };
|
|
74
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAGL,KAAK,EAEL,SAAS,EAET,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AAIxB,QAAA,MAAM,cAAc;;;mFAgCnB,CAAA;AAwCD,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAA;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;I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E,CAAA"}
|
|
@@ -81,10 +81,11 @@ const labelVariants = cva("truncate", {
|
|
|
81
81
|
const Button = React.forwardRef((_a, ref) => {
|
|
82
82
|
var { className, labelClassName, labelStyle, variant, size, asChild = false, loading, icon, iconColor, iconStrokeColor, iconPosition, iconSize, iconUrl } = _a, props = __rest(_a, ["className", "labelClassName", "labelStyle", "variant", "size", "asChild", "loading", "icon", "iconColor", "iconStrokeColor", "iconPosition", "iconSize", "iconUrl"]);
|
|
83
83
|
const Comp = asChild ? Slot : "button";
|
|
84
|
-
const IconButton = () => icon || iconUrl ? _jsx(Icon, { name: icon, size: "sm", style: { color: iconColor } }) : null;
|
|
84
|
+
const IconButton = () => icon || iconUrl ? (_jsx(Icon, { name: icon, size: "sm", style: { color: iconColor } })) : null;
|
|
85
85
|
const BasicButton = () => (_jsxs(_Fragment, { children: [icon || iconUrl ? (_jsx(Icon, { name: iconUrl ? undefined : icon, url: iconUrl, size: iconSize || variant === "quickadd" ? "xs" : "sm", className: cn(iconVariants({ variant }), {
|
|
86
|
-
"mr-2": iconPosition
|
|
87
|
-
|
|
86
|
+
"mr-2": iconPosition === "left",
|
|
87
|
+
"ml-2": iconPosition === "right",
|
|
88
|
+
}), strokeColor: iconStrokeColor, style: { color: iconColor, stroke: iconColor, fill: iconColor } })) : null, !loading ? (_jsx(Text, Object.assign({ type: "body-primary", className: cn(labelVariants({ variant }), labelClassName), style: labelStyle }, { children: props.children }))) : (_jsx(_Fragment, {}))] }));
|
|
88
89
|
const LoadingButton = () => (_jsx("div", Object.assign({ className: cn("flex items-center justify-center", size === "icon" ? "h-5" : "h-6") }, { children: _jsx(Icon, { className: cn(iconVariants({ variant }), "h-5 w-5 animate-spin"), name: "loader", style: { color: iconColor } }) })));
|
|
89
90
|
return (_jsx(Comp, Object.assign({ className: cn(buttonVariants({ variant, size }), className, {
|
|
90
91
|
"pointer-events-none": loading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":";AAIA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC3C;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,EACb,aAAkB,EAClB,cAAc,EACd,UAAU,EACV,mBAAmB,GACpB,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":";AAIA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC3C;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,EACb,aAAkB,EAClB,cAAc,EACd,UAAU,EACV,mBAAmB,GACpB,EAAE,UAAU,2CAiEZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -12,7 +12,7 @@ function Price({ price, priceHigh, priceRanges = false, isSale = false, compareA
|
|
|
12
12
|
const StrikeThroughPrice = () => {
|
|
13
13
|
if (!isSale || !compareAtPrice)
|
|
14
14
|
return null;
|
|
15
|
-
return (_jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0", style:
|
|
15
|
+
return (_jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0 flex items-center", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: compareAtPrice, currency: currency, locale: locale, styles: strikeThroughStyles }), priceRanges && compareAtPriceHigh && _jsx(Spacer, {}), priceRanges && compareAtPriceHigh && (_jsx(Money, { price: compareAtPriceHigh, currency: currency, locale: locale, styles: strikeThroughStyles }))] })));
|
|
16
16
|
};
|
|
17
17
|
return (_jsxs("div", Object.assign({ className: cn("flex flex-wrap gap-2", { "justify-start": textAlignment === "left" }, { "justify-end": textAlignment === "right" }, { "justify-center": textAlignment === "center" }) }, { children: [_jsx(ProductPrice, {}), _jsx(StrikeThroughPrice, {})] })));
|
|
18
18
|
}
|
|
@@ -16,7 +16,7 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
|
16
16
|
import { cn } from "../../lib/utils";
|
|
17
17
|
const ScrollArea = React.forwardRef((_a, ref) => {
|
|
18
18
|
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
19
|
-
return (_jsxs(ScrollAreaPrimitive.Root, Object.assign({ ref: ref, className: cn("relative overflow-hidden", className) }, props, { children: [_jsx(ScrollAreaPrimitive.Viewport, Object.assign({ className: "h-full w-full rounded-[inherit]" }, { children: _jsx("div", Object.assign({ className: "flex w-max
|
|
19
|
+
return (_jsxs(ScrollAreaPrimitive.Root, Object.assign({ ref: ref, className: cn("relative overflow-hidden", className) }, props, { children: [_jsx(ScrollAreaPrimitive.Viewport, Object.assign({ className: "h-full w-full rounded-[inherit]" }, { children: _jsx("div", Object.assign({ className: "flex w-max" }, { children: children })) })), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] })));
|
|
20
20
|
});
|
|
21
21
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
22
22
|
const ScrollBar = React.forwardRef((_a, ref) => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type RelatedCategory = {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
handle: string;
|
|
5
|
+
};
|
|
6
|
+
declare function SubCollectionTabs({ subCollections, useActions, }: {
|
|
7
|
+
subCollections: RelatedCategory[];
|
|
8
|
+
useActions: any;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export { SubCollectionTabs };
|
|
11
|
+
//# sourceMappingURL=subcollection-tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subcollection-tabs.d.ts","sourceRoot":"","sources":["../../../components/ui/subcollection-tabs.tsx"],"names":[],"mappings":"AAOA,KAAK,eAAe,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,iBAAS,iBAAiB,CAAC,EACzB,cAAc,EACd,UAAU,GACX,EAAE;IACD,cAAc,EAAE,eAAe,EAAE,CAAA;IAEjC,UAAU,EAAE,GAAG,CAAA;CAChB,kDA6DA;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useCallback, useMemo, useRef } from "react";
|
|
4
|
+
import { Tabs } from "./tabs";
|
|
5
|
+
import { getIdFromGid } from "../../lib/utils";
|
|
6
|
+
import { useSearchParams } from "next/navigation";
|
|
7
|
+
function SubCollectionTabs({ subCollections, useActions, }) {
|
|
8
|
+
const searchParams = useSearchParams();
|
|
9
|
+
const [activeTab, setActiveTab] = useState(null);
|
|
10
|
+
const isInitialLoad = useRef(true);
|
|
11
|
+
const prevActiveTab = useRef(null);
|
|
12
|
+
const { openCollection } = useActions();
|
|
13
|
+
// Memoize the tabs array
|
|
14
|
+
const tabs = useMemo(() => subCollections === null || subCollections === void 0 ? void 0 : subCollections.map((category) => ({
|
|
15
|
+
label: category.title,
|
|
16
|
+
children: null,
|
|
17
|
+
})), [subCollections]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
// Set initial active tab based on URL params
|
|
20
|
+
const collectionId = searchParams.get("collectionId");
|
|
21
|
+
const collectionHandle = searchParams.get("collectionHandle");
|
|
22
|
+
const initialIndex = subCollections.findIndex((cat) => (collectionId && getIdFromGid(cat.id) === collectionId) ||
|
|
23
|
+
(collectionHandle && cat.handle === collectionHandle));
|
|
24
|
+
setActiveTab(initialIndex !== -1 ? initialIndex : null);
|
|
25
|
+
prevActiveTab.current = initialIndex !== -1 ? initialIndex : null;
|
|
26
|
+
isInitialLoad.current = false;
|
|
27
|
+
}, [subCollections, searchParams]);
|
|
28
|
+
const handleTabChange = useCallback((index) => {
|
|
29
|
+
if (index !== prevActiveTab.current) {
|
|
30
|
+
if (index !== null && !isInitialLoad.current) {
|
|
31
|
+
const category = subCollections[index];
|
|
32
|
+
const newCollectionId = (category === null || category === void 0 ? void 0 : category.id)
|
|
33
|
+
? getIdFromGid(category.id)
|
|
34
|
+
: null;
|
|
35
|
+
const newCollectionHandle = (category === null || category === void 0 ? void 0 : category.handle) || null;
|
|
36
|
+
if (newCollectionId) {
|
|
37
|
+
openCollection({ collectionId: newCollectionId });
|
|
38
|
+
}
|
|
39
|
+
else if (newCollectionHandle) {
|
|
40
|
+
openCollection({ collectionId: newCollectionHandle });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, [subCollections, openCollection]);
|
|
45
|
+
if (!tabs)
|
|
46
|
+
return null;
|
|
47
|
+
return (_jsx(Tabs, { tabs: tabs, activeTab: activeTab, onTabChange: handleTabChange, links: true }));
|
|
48
|
+
}
|
|
49
|
+
export { SubCollectionTabs };
|
|
@@ -4,9 +4,10 @@ export interface TabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
label: string;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
}[];
|
|
7
|
-
activeTab: number;
|
|
8
|
-
onTabChange: (_: number) => void;
|
|
7
|
+
activeTab: number | null;
|
|
8
|
+
onTabChange: (_: number | null) => void;
|
|
9
9
|
active?: number;
|
|
10
|
+
links?: boolean;
|
|
10
11
|
}
|
|
11
12
|
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
13
|
export { Tabs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,EAAE,CAAA;IACpD,SAAS,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,EAAE,CAAA;IACpD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AA4CD,QAAA,MAAM,IAAI,kFAmHT,CAAA;AAGD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -10,29 +10,35 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
16
|
import { cn } from "../../lib/utils";
|
|
17
17
|
import { Text } from "./text";
|
|
18
|
-
const tabVariants = cva("flex items-center justify-center px-4 py-2
|
|
18
|
+
const tabVariants = cva("flex items-center justify-center px-4 py-2 active:opacity-70", {
|
|
19
19
|
variants: {
|
|
20
20
|
isActive: {
|
|
21
21
|
true: "[&>p]:text-textColors-primaryColor",
|
|
22
22
|
false: "[&>p]:text-textColors-secondaryColor",
|
|
23
23
|
},
|
|
24
|
+
isLink: {
|
|
25
|
+
true: "[&>p]:text-textColors-primaryColor",
|
|
26
|
+
false: "",
|
|
27
|
+
},
|
|
24
28
|
},
|
|
25
29
|
defaultVariants: {
|
|
26
30
|
isActive: false,
|
|
31
|
+
isLink: false,
|
|
27
32
|
},
|
|
28
33
|
});
|
|
29
|
-
const Tab = ({ label, isActive = false, onClick }) => {
|
|
34
|
+
const Tab = ({ label, isActive = false, onClick, isLink }) => {
|
|
30
35
|
return (_jsx("button", Object.assign({ className: cn(tabVariants({
|
|
31
36
|
isActive,
|
|
32
|
-
|
|
37
|
+
isLink,
|
|
38
|
+
}), "whitespace-nowrap"), onClick: onClick }, { children: _jsx(Text, Object.assign({ type: "body-primary" }, { children: label })) })));
|
|
33
39
|
};
|
|
34
40
|
const Tabs = React.forwardRef((_a, ref) => {
|
|
35
|
-
var { className, tabs, activeTab, onTabChange } = _a, props = __rest(_a, ["className", "tabs", "activeTab", "onTabChange"]);
|
|
41
|
+
var { className, tabs, activeTab, onTabChange, links = false } = _a, props = __rest(_a, ["className", "tabs", "activeTab", "onTabChange", "links"]);
|
|
36
42
|
const [underlinePosition, setUnderlinePosition] = React.useState({
|
|
37
43
|
left: 0,
|
|
38
44
|
width: 0,
|
|
@@ -50,6 +56,10 @@ const Tabs = React.forwardRef((_a, ref) => {
|
|
|
50
56
|
};
|
|
51
57
|
const handleTabChanged = React.useCallback(() => {
|
|
52
58
|
var _a, _b;
|
|
59
|
+
if (activeTab === null) {
|
|
60
|
+
setUnderlinePosition({ left: 0, width: 0 });
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
53
63
|
const currentTab = containerRef.current.children[activeTab];
|
|
54
64
|
setUnderlinePosition({
|
|
55
65
|
left: (_a = currentTab === null || currentTab === void 0 ? void 0 : currentTab.offsetLeft) !== null && _a !== void 0 ? _a : 0,
|
|
@@ -87,10 +97,10 @@ const Tabs = React.forwardRef((_a, ref) => {
|
|
|
87
97
|
}
|
|
88
98
|
}
|
|
89
99
|
}, [ref]);
|
|
90
|
-
return (_jsxs("div", Object.assign({ className: "relative" }, props, { children: [_jsxs("div", Object.assign({ ref: containerRef, className: "relative flex overflow-x-auto", onScroll: checkShowGradients }, { children: [tabs.map((tab, index) => (_jsx(Tab, { label: tab.label, isActive: activeTab === index, onClick: () => onTabChange(index) }, index))), _jsx("div", { className: `absolute bottom-0 bg-coreColors-brandColorPrimary h-[2px] transition-all duration-300`, style: {
|
|
100
|
+
return (_jsxs("div", Object.assign({ className: "relative no-scrollbar" }, props, { children: [_jsxs("div", Object.assign({ ref: containerRef, className: "relative flex overflow-x-auto no-scrollbar", onScroll: checkShowGradients }, { children: [tabs.map((tab, index) => (_jsx(Tab, { label: tab.label, isActive: activeTab === index, onClick: () => onTabChange(index), isLink: links }, index))), activeTab !== null && !links && (_jsx("div", { className: `absolute bottom-0 bg-coreColors-brandColorPrimary h-[2px] transition-all duration-300`, style: {
|
|
91
101
|
left: underlinePosition.left,
|
|
92
102
|
width: underlinePosition.width,
|
|
93
|
-
} })] })), showRightGradient
|
|
103
|
+
} }))] })), showRightGradient && (_jsx("div", Object.assign({ className: "absolute right-0 bottom-0 w-16 h-10 pointer-events-none overflow-hidden" }, { children: _jsx("div", { className: "w-full h-full gradient-right" }) }))), showLeftGradient && (_jsx("div", Object.assign({ className: "absolute left-0 bottom-0 w-16 h-10 pointer-events-none overflow-hidden" }, { children: _jsx("div", { className: "w-full h-full gradient-left" }) })))] })));
|
|
94
104
|
});
|
|
95
105
|
Tabs.displayName = "Tabs";
|
|
96
106
|
export { Tabs };
|
package/dist/index.d.ts
CHANGED
|
@@ -50,4 +50,5 @@ export * from "./components/hooks/use-product-options";
|
|
|
50
50
|
export * from "./components/ui/wishlist-select";
|
|
51
51
|
export * from "./components/hooks/use-shop";
|
|
52
52
|
export * from "./components/libs/sort-filter/search-integration";
|
|
53
|
+
export * from "./components/ui/subcollection-tabs";
|
|
53
54
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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AA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,sCAAsC,CAAA;AACpD,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wCAAwC,CAAA;AACtD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kDAAkD,CAAA;AAChE,cAAc,oCAAoC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -51,3 +51,4 @@ export * from "./components/hooks/use-product-options";
|
|
|
51
51
|
export * from "./components/ui/wishlist-select";
|
|
52
52
|
export * from "./components/hooks/use-shop";
|
|
53
53
|
export * from "./components/libs/sort-filter/search-integration";
|
|
54
|
+
export * from "./components/ui/subcollection-tabs";
|
package/dist/styles.css
CHANGED
|
@@ -481,7 +481,7 @@ video {
|
|
|
481
481
|
--productImage-scaling: cover;
|
|
482
482
|
--productImage-isCustom: "false";
|
|
483
483
|
|
|
484
|
-
--standard-shadow:
|
|
484
|
+
--standard-shadow: 0px 5px 25px 0px rgba (0, 0, 0, 0.10);
|
|
485
485
|
}
|
|
486
486
|
.textarea-component::-webkit-scrollbar {
|
|
487
487
|
width: 4px;
|
|
@@ -1054,6 +1054,9 @@ video {
|
|
|
1054
1054
|
.w-8 {
|
|
1055
1055
|
width: 2rem;
|
|
1056
1056
|
}
|
|
1057
|
+
.w-\[138px\] {
|
|
1058
|
+
width: 138px;
|
|
1059
|
+
}
|
|
1057
1060
|
.w-\[140px\] {
|
|
1058
1061
|
width: 140px;
|
|
1059
1062
|
}
|
|
@@ -1086,6 +1089,9 @@ video {
|
|
|
1086
1089
|
.min-w-0 {
|
|
1087
1090
|
min-width: 0px;
|
|
1088
1091
|
}
|
|
1092
|
+
.min-w-\[138px\] {
|
|
1093
|
+
min-width: 138px;
|
|
1094
|
+
}
|
|
1089
1095
|
.min-w-\[148px\] {
|
|
1090
1096
|
min-width: 148px;
|
|
1091
1097
|
}
|
|
@@ -1367,6 +1373,9 @@ video {
|
|
|
1367
1373
|
.whitespace-nowrap {
|
|
1368
1374
|
white-space: nowrap;
|
|
1369
1375
|
}
|
|
1376
|
+
.break-words {
|
|
1377
|
+
overflow-wrap: break-word;
|
|
1378
|
+
}
|
|
1370
1379
|
.rounded {
|
|
1371
1380
|
border-radius: 0.25rem;
|
|
1372
1381
|
}
|
|
@@ -1541,10 +1550,6 @@ video {
|
|
|
1541
1550
|
.bg-coreColors-pageColor {
|
|
1542
1551
|
background-color: var(--coreColors-pageColor);
|
|
1543
1552
|
}
|
|
1544
|
-
.bg-gray-100 {
|
|
1545
|
-
--tw-bg-opacity: 1;
|
|
1546
|
-
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
|
1547
|
-
}
|
|
1548
1553
|
.bg-gray-300 {
|
|
1549
1554
|
--tw-bg-opacity: 1;
|
|
1550
1555
|
background-color: rgb(209 213 219 / var(--tw-bg-opacity));
|
|
@@ -1574,12 +1579,6 @@ video {
|
|
|
1574
1579
|
--tw-bg-opacity: 1;
|
|
1575
1580
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
1576
1581
|
}
|
|
1577
|
-
.bg-\[linear-gradient\(270deg\2c \#ffffff00_0\%\2c \#FFF_100\%\)\] {
|
|
1578
|
-
background-image: linear-gradient(270deg,#ffffff00 0%,#FFF 100%);
|
|
1579
|
-
}
|
|
1580
|
-
.bg-\[linear-gradient\(90deg\2c \#ffffff00_0\%\2c \#FFF_100\%\)\] {
|
|
1581
|
-
background-image: linear-gradient(90deg,#ffffff00 0%,#FFF 100%);
|
|
1582
|
-
}
|
|
1583
1582
|
.bg-fade-left {
|
|
1584
1583
|
background-image: linear-gradient(to right, var(--coreColors-pageColor) 0%, #ffffff00 100%);;
|
|
1585
1584
|
}
|
|
@@ -1660,10 +1659,6 @@ video {
|
|
|
1660
1659
|
padding-left: 2rem;
|
|
1661
1660
|
padding-right: 2rem;
|
|
1662
1661
|
}
|
|
1663
|
-
.px-\[16px\] {
|
|
1664
|
-
padding-left: 16px;
|
|
1665
|
-
padding-right: 16px;
|
|
1666
|
-
}
|
|
1667
1662
|
.py-1 {
|
|
1668
1663
|
padding-top: 0.25rem;
|
|
1669
1664
|
padding-bottom: 0.25rem;
|
|
@@ -1710,6 +1705,9 @@ video {
|
|
|
1710
1705
|
.pl-8 {
|
|
1711
1706
|
padding-left: 2rem;
|
|
1712
1707
|
}
|
|
1708
|
+
.pr-0 {
|
|
1709
|
+
padding-right: 0px;
|
|
1710
|
+
}
|
|
1713
1711
|
.pr-1 {
|
|
1714
1712
|
padding-right: 0.25rem;
|
|
1715
1713
|
}
|
|
@@ -2028,11 +2026,6 @@ video {
|
|
|
2028
2026
|
--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
|
|
2029
2027
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
2030
2028
|
}
|
|
2031
|
-
.shadow-none {
|
|
2032
|
-
--tw-shadow: 0 0 #0000;
|
|
2033
|
-
--tw-shadow-colored: 0 0 #0000;
|
|
2034
|
-
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
2035
|
-
}
|
|
2036
2029
|
.shadow-primary {
|
|
2037
2030
|
--tw-shadow: calc(var(--buttonColors-primaryShadowEnabled) * 0px) calc(var(--buttonColors-primaryShadowEnabled) * 5px) calc(var(--buttonColors-primaryShadowEnabled) * 25px) calc(var(--buttonColors-primaryShadowEnabled)* 0px) rgb(0, 0, 0, 0.10);;
|
|
2038
2031
|
--tw-shadow-colored: calc(var(--buttonColors-primaryShadowEnabled) * 0px) calc(var(--buttonColors-primaryShadowEnabled) * 5px) calc(var(--buttonColors-primaryShadowEnabled) * 25px) calc(var(--buttonColors-primaryShadowEnabled)* 0px) rgb(0, 0, 0, 0.10);;
|
|
@@ -2189,6 +2182,43 @@ body::-webkit-scrollbar {
|
|
|
2189
2182
|
scrollbar-width: none; /* Firefox */
|
|
2190
2183
|
}
|
|
2191
2184
|
|
|
2185
|
+
.gradient-right::before,
|
|
2186
|
+
.gradient-left::before {
|
|
2187
|
+
content: "";
|
|
2188
|
+
position: absolute;
|
|
2189
|
+
top: 0;
|
|
2190
|
+
bottom: 0;
|
|
2191
|
+
left: 0;
|
|
2192
|
+
right: 0;
|
|
2193
|
+
background: var(--coreColors-pageColor);
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
.gradient-right::before {
|
|
2197
|
+
-webkit-mask-image: linear-gradient(
|
|
2198
|
+
to left,
|
|
2199
|
+
var(--coreColors-pageColor),
|
|
2200
|
+
transparent
|
|
2201
|
+
);
|
|
2202
|
+
mask-image: linear-gradient(
|
|
2203
|
+
to left,
|
|
2204
|
+
var(--coreColors-pageColor),
|
|
2205
|
+
transparent
|
|
2206
|
+
);
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
.gradient-left::before {
|
|
2210
|
+
-webkit-mask-image: linear-gradient(
|
|
2211
|
+
to right,
|
|
2212
|
+
var(--coreColors-pageColor),
|
|
2213
|
+
transparent
|
|
2214
|
+
);
|
|
2215
|
+
mask-image: linear-gradient(
|
|
2216
|
+
to right,
|
|
2217
|
+
var(--coreColors-pageColor),
|
|
2218
|
+
transparent
|
|
2219
|
+
);
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2192
2222
|
.file\:border-0::file-selector-button {
|
|
2193
2223
|
border-width: 0px;
|
|
2194
2224
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
@@ -11,16 +11,6 @@
|
|
|
11
11
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
12
|
"author": "Tapcart Inc.",
|
|
13
13
|
"homepage": "https://tapcart.com",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"lint": "eslint \"**/*.ts*\"",
|
|
16
|
-
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
17
|
-
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
18
|
-
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
19
|
-
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
20
|
-
"dev:ts": "tsc -w -p tsconfig.json",
|
|
21
|
-
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
22
|
-
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\""
|
|
23
|
-
},
|
|
24
14
|
"peerDependencies": {
|
|
25
15
|
"react": "^17.0.2 || ^18.0.0",
|
|
26
16
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
@@ -29,17 +19,17 @@
|
|
|
29
19
|
"@types/lodash": "4.17.5",
|
|
30
20
|
"@types/react": "^18.2.0",
|
|
31
21
|
"@types/react-dom": "^18.2.0",
|
|
32
|
-
"app-studio-types": "workspace:*",
|
|
33
22
|
"autoprefixer": "^10.4.14",
|
|
34
23
|
"chokidar-cli": "^3.0.0",
|
|
35
24
|
"concurrently": "^8.2.2",
|
|
36
25
|
"eslint": "^7.32.0",
|
|
37
|
-
"eslint-config-custom": "workspace:*",
|
|
38
26
|
"postcss": "^8.4.24",
|
|
39
27
|
"tailwindcss": "^3.3.2",
|
|
40
28
|
"tsc-alias": "^1.8.10",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
29
|
+
"typescript": "^4.5.2",
|
|
30
|
+
"app-studio-types": "0.0.3",
|
|
31
|
+
"eslint-config-custom": "0.0.0",
|
|
32
|
+
"tsconfig": "0.0.0"
|
|
43
33
|
},
|
|
44
34
|
"dependencies": {
|
|
45
35
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
@@ -73,5 +63,15 @@
|
|
|
73
63
|
"tailwind-merge": "^1.13.2",
|
|
74
64
|
"tailwindcss-animate": "^1.0.6",
|
|
75
65
|
"vaul": "^0.9.1"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"lint": "eslint \"**/*.ts*\"",
|
|
69
|
+
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
70
|
+
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
71
|
+
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
72
|
+
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
73
|
+
"dev:ts": "tsc -w -p tsconfig.json",
|
|
74
|
+
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
75
|
+
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\""
|
|
76
76
|
}
|
|
77
|
-
}
|
|
77
|
+
}
|