@admin-layout/tailwind-travel-pro 11.2.1-alpha.1
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/LICENSE +21 -0
- package/lib/components/CardList.d.ts +61 -0
- package/lib/components/CardList.d.ts.map +1 -0
- package/lib/components/CardList.js +41 -0
- package/lib/components/CardList.js.map +1 -0
- package/lib/components/CategoriesTypeList.d.ts +27 -0
- package/lib/components/CategoriesTypeList.d.ts.map +1 -0
- package/lib/components/CategoriesTypeList.js +163 -0
- package/lib/components/CategoriesTypeList.js.map +1 -0
- package/lib/components/LazyLoadingGoogleMarker.d.ts +83 -0
- package/lib/components/LazyLoadingGoogleMarker.d.ts.map +1 -0
- package/lib/components/LazyLoadingGoogleMarker.js +104 -0
- package/lib/components/LazyLoadingGoogleMarker.js.map +1 -0
- package/lib/components/Pagination.d.ts +7 -0
- package/lib/components/Pagination.d.ts.map +1 -0
- package/lib/components/Pagination.js +55 -0
- package/lib/components/Pagination.js.map +1 -0
- package/lib/components/ParamSearchResultContainer.d.ts +99 -0
- package/lib/components/ParamSearchResultContainer.d.ts.map +1 -0
- package/lib/components/ParamSearchResultContainer.js +115 -0
- package/lib/components/ParamSearchResultContainer.js.map +1 -0
- package/lib/components/PropertyCard.d.ts +25 -0
- package/lib/components/PropertyCard.d.ts.map +1 -0
- package/lib/components/PropertyCard.js +310 -0
- package/lib/components/PropertyCard.js.map +1 -0
- package/lib/components/PropertyCardOnMap.d.ts +10 -0
- package/lib/components/PropertyCardOnMap.d.ts.map +1 -0
- package/lib/components/PropertyCardOnMap.js +113 -0
- package/lib/components/PropertyCardOnMap.js.map +1 -0
- package/lib/components/VehicleCard/PricePopover.d.ts +8 -0
- package/lib/components/VehicleCard/PricePopover.d.ts.map +1 -0
- package/lib/components/VehicleCard/PricePopover.js +79 -0
- package/lib/components/VehicleCard/PricePopover.js.map +1 -0
- package/lib/components/VehicleCard/VehicleBadge.d.ts +7 -0
- package/lib/components/VehicleCard/VehicleBadge.d.ts.map +1 -0
- package/lib/components/VehicleCard/VehicleFeature.d.ts +9 -0
- package/lib/components/VehicleCard/VehicleFeature.d.ts.map +1 -0
- package/lib/components/VehicleCard/VehicleFeature.js +18 -0
- package/lib/components/VehicleCard/VehicleFeature.js.map +1 -0
- package/lib/components/VehicleCard/types.d.ts +59 -0
- package/lib/components/VehicleCard/types.d.ts.map +1 -0
- package/lib/components/VehicleCard.d.ts +15 -0
- package/lib/components/VehicleCard.d.ts.map +1 -0
- package/lib/components/VehicleCard.js +138 -0
- package/lib/components/VehicleCard.js.map +1 -0
- package/lib/components/VehicleCardList.d.ts +14 -0
- package/lib/components/VehicleCardList.d.ts.map +1 -0
- package/lib/components/VehicleCardList.js +37 -0
- package/lib/components/VehicleCardList.js.map +1 -0
- package/lib/components/VehicleParamSearchResultContainer.d.ts +90 -0
- package/lib/components/VehicleParamSearchResultContainer.d.ts.map +1 -0
- package/lib/components/icons/LocationIcon.d.ts +8 -0
- package/lib/components/icons/LocationIcon.d.ts.map +1 -0
- package/lib/components/icons/LocationIcon.js +17 -0
- package/lib/components/icons/LocationIcon.js.map +1 -0
- package/lib/components/icons/index.d.ts +2 -0
- package/lib/components/icons/index.d.ts.map +1 -0
- package/lib/components/index.d.ts +10 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/config/analytics-config.d.ts +59 -0
- package/lib/config/analytics-config.d.ts.map +1 -0
- package/lib/config/constants.d.ts +7 -0
- package/lib/config/constants.d.ts.map +1 -0
- package/lib/config/constants.js +6 -0
- package/lib/config/constants.js.map +1 -0
- package/lib/config/env-config.d.ts +19 -0
- package/lib/config/env-config.d.ts.map +1 -0
- package/lib/config/env-config.js +70 -0
- package/lib/config/env-config.js.map +1 -0
- package/lib/config/index.d.ts +3 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/use-get-current-lat-long.d.ts +18 -0
- package/lib/hooks/use-get-current-lat-long.d.ts.map +1 -0
- package/lib/hooks/use-get-current-lat-long.js +29 -0
- package/lib/hooks/use-get-current-lat-long.js.map +1 -0
- package/lib/hooks/useWindowSize.d.ts +5 -0
- package/lib/hooks/useWindowSize.d.ts.map +1 -0
- package/lib/hooks/useWindowSize.js +20 -0
- package/lib/hooks/useWindowSize.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -0
- package/lib/interfaces/travel.d.ts +6 -0
- package/lib/interfaces/travel.d.ts.map +1 -0
- package/lib/interfaces/travel.js +6 -0
- package/lib/interfaces/travel.js.map +1 -0
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts +6 -0
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/airbnbDatasourcesMiddleware.js +121 -0
- package/lib/middlewares/airbnbDatasourcesMiddleware.js.map +1 -0
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts +6 -0
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts.map +1 -0
- package/lib/middlewares/bookingCarRentalMiddleware.js +109 -0
- package/lib/middlewares/bookingCarRentalMiddleware.js.map +1 -0
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts +7 -0
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/bookingDatasourcesMiddleware.js +137 -0
- package/lib/middlewares/bookingDatasourcesMiddleware.js.map +1 -0
- package/lib/middlewares/datasourcesMiddleware.d.ts +6 -0
- package/lib/middlewares/datasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/datasourcesMiddleware.js +29 -0
- package/lib/middlewares/datasourcesMiddleware.js.map +1 -0
- package/lib/middlewares/index.d.ts +6 -0
- package/lib/middlewares/index.d.ts.map +1 -0
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts +7 -0
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/pricelineDatasourcesMiddleware.js +95 -0
- package/lib/middlewares/pricelineDatasourcesMiddleware.js.map +1 -0
- package/lib/routes.json +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 CDMBase LLC.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IBaseItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
types: string[];
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
introduction?: string;
|
|
9
|
+
address: any;
|
|
10
|
+
location: string;
|
|
11
|
+
images: any;
|
|
12
|
+
thumbnailUrl?: string;
|
|
13
|
+
thumbnailAlt?: string;
|
|
14
|
+
verificationDocuments?: any;
|
|
15
|
+
info?: any;
|
|
16
|
+
user: any;
|
|
17
|
+
status?: any;
|
|
18
|
+
errors?: any;
|
|
19
|
+
preferences?: any;
|
|
20
|
+
orgName?: string;
|
|
21
|
+
serviceConfiguration?: any;
|
|
22
|
+
totalReview?: number;
|
|
23
|
+
totalStar?: number;
|
|
24
|
+
reviews?: any;
|
|
25
|
+
comments?: any;
|
|
26
|
+
userLikes?: any;
|
|
27
|
+
calendarEvents?: any[];
|
|
28
|
+
isUserLike?: boolean;
|
|
29
|
+
formattedPrice?: number;
|
|
30
|
+
timeZone: string;
|
|
31
|
+
createdAt: any;
|
|
32
|
+
updatedAt?: any;
|
|
33
|
+
stats?: any;
|
|
34
|
+
guideBookId?: string;
|
|
35
|
+
guestSharing?: any;
|
|
36
|
+
}
|
|
37
|
+
type CardListProps = {
|
|
38
|
+
items?: IBaseItem[];
|
|
39
|
+
setFocus: (index: number) => void;
|
|
40
|
+
setBlur: (index: number) => void;
|
|
41
|
+
handleLike: (index: number) => void;
|
|
42
|
+
likeBtnLoading: boolean;
|
|
43
|
+
categoryTypes: any[];
|
|
44
|
+
extraIcons?: any;
|
|
45
|
+
className?: string;
|
|
46
|
+
customCardComponent?: (props: {
|
|
47
|
+
item: IBaseItem;
|
|
48
|
+
index: number;
|
|
49
|
+
setFocus: () => void;
|
|
50
|
+
setBlur: (index: number) => void;
|
|
51
|
+
handleLike: (index: number) => void;
|
|
52
|
+
likeBtnLoading: boolean;
|
|
53
|
+
categoryTypes: any[];
|
|
54
|
+
extraIcons?: any;
|
|
55
|
+
authenticated: boolean;
|
|
56
|
+
}) => React.ReactNode;
|
|
57
|
+
emptyMessage?: string;
|
|
58
|
+
};
|
|
59
|
+
export declare const CardList: React.FC<CardListProps>;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=CardList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardList.d.ts","sourceRoot":"","sources":["../../src/components/CardList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,SAAS;IACf,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,GAAG,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,GAAG,CAAC;IAC5B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,GAAG,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,GAAG,CAAC;IACf,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,GAAG,CAAC;CACtB;AAYD,KAAK,aAAa,GAAG;IACjB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,GAAG,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC1B,IAAI,EAAE,SAAS,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,IAAI,CAAC;QACrB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACpC,cAAc,EAAE,OAAO,CAAC;QACxB,aAAa,EAAE,GAAG,EAAE,CAAC;QACrB,UAAU,CAAC,EAAE,GAAG,CAAC;QACjB,aAAa,EAAE,OAAO,CAAC;KAC1B,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuC5C,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from'react';import {useTranslation}from'react-i18next';import {isEmpty}from'lodash-es';import {isUserAuthenticated}from'@adminide-stack/user-auth0-client';const CardList = props => {
|
|
2
|
+
const {
|
|
3
|
+
setBlur,
|
|
4
|
+
setFocus,
|
|
5
|
+
items,
|
|
6
|
+
handleLike,
|
|
7
|
+
likeBtnLoading,
|
|
8
|
+
categoryTypes,
|
|
9
|
+
extraIcons,
|
|
10
|
+
className = '',
|
|
11
|
+
customCardComponent,
|
|
12
|
+
emptyMessage = 'No items found'
|
|
13
|
+
} = props;
|
|
14
|
+
const {
|
|
15
|
+
t
|
|
16
|
+
} = useTranslation();
|
|
17
|
+
const {
|
|
18
|
+
authenticated
|
|
19
|
+
} = isUserAuthenticated();
|
|
20
|
+
if (isEmpty(items)) {
|
|
21
|
+
return React.createElement("div", {
|
|
22
|
+
className: "text-base text-foreground"
|
|
23
|
+
}, emptyMessage);
|
|
24
|
+
}
|
|
25
|
+
return React.createElement("div", {
|
|
26
|
+
className: `flex flex-wrap justify-evenly ${className}`
|
|
27
|
+
}, items?.map((item, index) => React.createElement("div", {
|
|
28
|
+
key: index,
|
|
29
|
+
className: "max-w-[100%] mb-4"
|
|
30
|
+
}, customCardComponent?.({
|
|
31
|
+
item,
|
|
32
|
+
index,
|
|
33
|
+
setFocus: () => setFocus(index),
|
|
34
|
+
setBlur,
|
|
35
|
+
handleLike,
|
|
36
|
+
likeBtnLoading,
|
|
37
|
+
categoryTypes,
|
|
38
|
+
extraIcons,
|
|
39
|
+
authenticated
|
|
40
|
+
}))));
|
|
41
|
+
};export{CardList};//# sourceMappingURL=CardList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardList.js","sources":["../../src/components/CardList.tsx"],"sourcesContent":[null],"names":[],"mappings":"wKA0EO,MAAM,QAAQ,GAA4B,KAAC,IAAO;QACrD;AAYA,IAAA;AACA,IAAA,QAAQ;AAER,IAAA,KAAI;AACA,IAAA,UAAA;IACJ,cAAC;AAED,IAAA,aACI;cAIoB;aACC,GAAA,EAAA;AACL,IAAA,mBAAe;gBACR,GAAA;WACP;QACA;;oBAEU,EAAA;QACV;AACH,IAAA;AAKrB,GAAE,GAAA,mBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ICategoryType<TTypename, TCategory, TName> {
|
|
3
|
+
__typename?: TTypename;
|
|
4
|
+
id: string;
|
|
5
|
+
description: string | null;
|
|
6
|
+
category: TCategory;
|
|
7
|
+
name: TName;
|
|
8
|
+
icon?: string | null;
|
|
9
|
+
imageKey?: string | null;
|
|
10
|
+
thumbnailUrl?: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface ICategoriesTypeListProps<TTypename, TCategory, TName> {
|
|
13
|
+
isExplorerView?: boolean;
|
|
14
|
+
categories: ICategoryType<TTypename, TCategory, TName>[];
|
|
15
|
+
initialCategory: ICategoryType<TTypename, TCategory, TName>;
|
|
16
|
+
boxColor: (categoryId: string) => string;
|
|
17
|
+
iconColor: (categoryId: string) => string;
|
|
18
|
+
badgeTitle?: string;
|
|
19
|
+
extraIcons: string[];
|
|
20
|
+
aria_label: string;
|
|
21
|
+
splideRef?: any;
|
|
22
|
+
isNewBadge: (categoryId: string) => boolean;
|
|
23
|
+
handleSearchClick: (cateItem: string, item: any, isExplorerView?: boolean) => void;
|
|
24
|
+
activeCategory?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const CategoriesTypeList: <TTypename, TCategory, TName>({ boxColor, iconColor, badgeTitle, extraIcons, categories, initialCategory, aria_label, isExplorerView, splideRef, isNewBadge, handleSearchClick, activeCategory, }: ICategoriesTypeListProps<TTypename, TCategory, TName>) => React.JSX.Element;
|
|
27
|
+
//# sourceMappingURL=CategoriesTypeList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CategoriesTypeList.d.ts","sourceRoot":"","sources":["../../src/components/CategoriesTypeList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAazE,MAAM,WAAW,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK;IACtD,UAAU,CAAC,EAAE,SAAS,CAAC;I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';import {useTranslation}from'react-i18next';import {renderDynamicIcon}from'@admin-layout/tailwind-design-pro/lib/helpers/DynamicIcon.js';import {useWindowSize}from'../hooks/useWindowSize.js';import {Carousel,CarouselContent,CarouselItem,CarouselPrevious,CarouselNext}from'@admin-layout/tailwind-ui/lib/shardui/carousel';// Helper function to merge arrays
|
|
2
|
+
const mergeArrays = (arr1, arr2, keyToMapIcons) => {
|
|
3
|
+
const iconMap = new Map(arr2.map(icon => [icon.split('.').pop(), icon]));
|
|
4
|
+
return arr1.filter(item => iconMap.has(item[keyToMapIcons])).map(item => ({
|
|
5
|
+
...item,
|
|
6
|
+
icon: iconMap.get(item[keyToMapIcons])
|
|
7
|
+
}));
|
|
8
|
+
};
|
|
9
|
+
// Create a memoized category item component
|
|
10
|
+
function CategoryItemComponent({
|
|
11
|
+
category,
|
|
12
|
+
boxColor,
|
|
13
|
+
size,
|
|
14
|
+
t,
|
|
15
|
+
isNewBadge,
|
|
16
|
+
badgeTitle,
|
|
17
|
+
handleSearchClick,
|
|
18
|
+
isExplorerView,
|
|
19
|
+
isActive
|
|
20
|
+
}) {
|
|
21
|
+
// Prevent multiple click propagation
|
|
22
|
+
const handleClick = useCallback(e => {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
e.stopPropagation();
|
|
25
|
+
handleSearchClick(category.id, category, isExplorerView);
|
|
26
|
+
}, [category, handleSearchClick, isExplorerView]);
|
|
27
|
+
// Compute the current color values
|
|
28
|
+
const currentBoxColor = isActive ? boxColor(category.id) : '#4A5568';
|
|
29
|
+
// Determine font size based on screen width
|
|
30
|
+
const fontSize = useMemo(() => {
|
|
31
|
+
if (size.width > 1200) return '16px';
|
|
32
|
+
if (size.width > 768) return '15px';
|
|
33
|
+
if (size.width > 480) return '14px';
|
|
34
|
+
return '12px';
|
|
35
|
+
}, [size.width]);
|
|
36
|
+
// Determine icon size based on screen width
|
|
37
|
+
const iconSize = useMemo(() => ({
|
|
38
|
+
w: size.width > 1200 ? '2vw' : '3vw',
|
|
39
|
+
h: size.height > 1200 ? '2vw' : '3vw'
|
|
40
|
+
}), [size.width, size.height]);
|
|
41
|
+
return React.createElement("div", {
|
|
42
|
+
className: `flex flex-col items-center justify-center cursor-pointer relative font-bold ${isActive ? 'text-primary' : 'text-muted-foreground'}`,
|
|
43
|
+
style: {
|
|
44
|
+
fontSize
|
|
45
|
+
},
|
|
46
|
+
onClick: handleClick
|
|
47
|
+
}, renderDynamicIcon({
|
|
48
|
+
name: category.icon,
|
|
49
|
+
style: {
|
|
50
|
+
iconColor: currentBoxColor,
|
|
51
|
+
...iconSize
|
|
52
|
+
}
|
|
53
|
+
}), React.createElement("div", {
|
|
54
|
+
className: "text-center"
|
|
55
|
+
}, t(category.description)), isNewBadge(category.id) && React.createElement("div", {
|
|
56
|
+
className: "absolute top-0 right-0 bg-primary text-primary-foreground rounded-themed text-xs p-1"
|
|
57
|
+
}, badgeTitle));
|
|
58
|
+
}
|
|
59
|
+
// Use React.memo with a custom comparison function
|
|
60
|
+
const CategoryItem = React.memo(CategoryItemComponent, (prevProps, nextProps) => {
|
|
61
|
+
if (prevProps.category.id !== nextProps.category.id) return false;
|
|
62
|
+
if (prevProps.isActive !== nextProps.isActive) return false;
|
|
63
|
+
if (prevProps.boxColor(prevProps.category.id) !== nextProps.boxColor(nextProps.category.id)) return false;
|
|
64
|
+
return true;
|
|
65
|
+
});
|
|
66
|
+
const CategoriesTypeList = ({
|
|
67
|
+
boxColor,
|
|
68
|
+
iconColor,
|
|
69
|
+
badgeTitle,
|
|
70
|
+
extraIcons,
|
|
71
|
+
categories,
|
|
72
|
+
initialCategory,
|
|
73
|
+
aria_label,
|
|
74
|
+
isExplorerView,
|
|
75
|
+
splideRef,
|
|
76
|
+
isNewBadge,
|
|
77
|
+
handleSearchClick,
|
|
78
|
+
activeCategory
|
|
79
|
+
}) => {
|
|
80
|
+
const size = useWindowSize();
|
|
81
|
+
const {
|
|
82
|
+
t
|
|
83
|
+
} = useTranslation(['property-types', 'common']);
|
|
84
|
+
const [carouselApi, setCarouselApi] = React.useState();
|
|
85
|
+
// Track the currently active category ID internally
|
|
86
|
+
const [activeCategoryId, setActiveCategoryId] = useState(() => activeCategory || initialCategory.id);
|
|
87
|
+
// Update internal state when activeCategory prop changes
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
setActiveCategoryId(activeCategory || initialCategory.id);
|
|
90
|
+
}, [activeCategory, initialCategory.id]);
|
|
91
|
+
// Memoize the merged array
|
|
92
|
+
const mappedArr = useMemo(() => mergeArrays([initialCategory, ...categories], extraIcons, 'icon'), [initialCategory, categories, extraIcons]);
|
|
93
|
+
// Add mouse wheel functionality
|
|
94
|
+
React.useEffect(() => {
|
|
95
|
+
if (!carouselApi) return;
|
|
96
|
+
const handleWheel = event => {
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
if (event.deltaY > 0) {
|
|
99
|
+
// Scrolling down - go to next slide
|
|
100
|
+
carouselApi.scrollNext();
|
|
101
|
+
} else {
|
|
102
|
+
// Scrolling up - go to previous slide
|
|
103
|
+
carouselApi.scrollPrev();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const carouselElement = carouselApi.rootNode();
|
|
107
|
+
carouselElement.addEventListener('wheel', handleWheel, {
|
|
108
|
+
passive: false
|
|
109
|
+
});
|
|
110
|
+
return () => {
|
|
111
|
+
carouselElement.removeEventListener('wheel', handleWheel);
|
|
112
|
+
};
|
|
113
|
+
}, [carouselApi]);
|
|
114
|
+
// Determine number of slides per view based on screen size
|
|
115
|
+
const slidesPerView = useMemo(() => {
|
|
116
|
+
if (size.width >= 1024) return 9; // Large screens
|
|
117
|
+
if (size.width >= 768) return 5; // Medium screens
|
|
118
|
+
return 3; // Small screens
|
|
119
|
+
}, [size.width]);
|
|
120
|
+
// Calculate item width based on slides per view
|
|
121
|
+
const itemWidth = useMemo(() => {
|
|
122
|
+
return `${100 / slidesPerView}%`;
|
|
123
|
+
}, [slidesPerView]);
|
|
124
|
+
// Carousel options based on screen size
|
|
125
|
+
const carouselOptions = useMemo(() => ({
|
|
126
|
+
align: 'start',
|
|
127
|
+
loop: true,
|
|
128
|
+
slidesToScroll: 1,
|
|
129
|
+
dragFree: true
|
|
130
|
+
}), []);
|
|
131
|
+
return React.createElement("div", {
|
|
132
|
+
className: "w-full relative"
|
|
133
|
+
}, React.createElement(Carousel, {
|
|
134
|
+
ref: splideRef,
|
|
135
|
+
setApi: setCarouselApi,
|
|
136
|
+
"aria-label": aria_label,
|
|
137
|
+
opts: carouselOptions,
|
|
138
|
+
className: "w-full relative"
|
|
139
|
+
}, React.createElement(CarouselContent, {
|
|
140
|
+
className: "-ml-2 md:-ml-6 lg:-ml-10"
|
|
141
|
+
}, mappedArr.map(d => React.createElement(CarouselItem, {
|
|
142
|
+
key: `button_${d.id}`,
|
|
143
|
+
className: "pl-2 md:pl-6 lg:pl-10",
|
|
144
|
+
style: {
|
|
145
|
+
flex: `0 0 ${itemWidth}`
|
|
146
|
+
}
|
|
147
|
+
}, React.createElement(CategoryItem, {
|
|
148
|
+
key: `category_${d.id}`,
|
|
149
|
+
category: d,
|
|
150
|
+
boxColor: boxColor,
|
|
151
|
+
size: size,
|
|
152
|
+
t: t,
|
|
153
|
+
isNewBadge: isNewBadge,
|
|
154
|
+
badgeTitle: badgeTitle,
|
|
155
|
+
handleSearchClick: handleSearchClick,
|
|
156
|
+
isExplorerView: isExplorerView,
|
|
157
|
+
isActive: d.id === activeCategoryId
|
|
158
|
+
})))), React.createElement(CarouselPrevious, {
|
|
159
|
+
className: "absolute left-2 top-1/2 -translate-y-1/2 bg-background hover:bg-muted"
|
|
160
|
+
}), React.createElement(CarouselNext, {
|
|
161
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 bg-background hover:bg-muted"
|
|
162
|
+
})));
|
|
163
|
+
};export{CategoriesTypeList};//# sourceMappingURL=CategoriesTypeList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CategoriesTypeList.js","sources":["../../src/components/CategoriesTypeList.tsx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AA,QAAA,EAAA;AACjB,IAAA,eAAU,CAAA,gBAAI,CAAA,OAAA,EAAA,WAAA,EAAA;MAChB,OAEJ,EAAA;AAEF,KAAA,CAAA;AAEQ,IAAA,OAAA,MAAA;AAOI,MAAA,eAAA,CAAA,2BAAgB,EAAC,WAAU,CAAA;;AAsB3B,EAAA,CAAA,EAAA,CAAA,WAAA,CAAA,CAAA;;AAKhB,EAAE,MAAA,aAAA,GAAA,OAAA,CAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface IProperty {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
types: string[];
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
introduction?: string;
|
|
9
|
+
address: any;
|
|
10
|
+
location: string;
|
|
11
|
+
images: any;
|
|
12
|
+
thumbnailUrl?: string;
|
|
13
|
+
thumbnailAlt?: string;
|
|
14
|
+
verificationDocuments?: any;
|
|
15
|
+
info?: any;
|
|
16
|
+
user: any;
|
|
17
|
+
status?: any;
|
|
18
|
+
errors?: any;
|
|
19
|
+
preferences?: any;
|
|
20
|
+
orgName?: string;
|
|
21
|
+
serviceConfiguration?: any;
|
|
22
|
+
totalReview?: number;
|
|
23
|
+
totalStar?: number;
|
|
24
|
+
reviews?: any;
|
|
25
|
+
comments?: any;
|
|
26
|
+
userLikes?: any;
|
|
27
|
+
calendarEvents?: any[];
|
|
28
|
+
isUserLike?: boolean;
|
|
29
|
+
formattedPrice?: number;
|
|
30
|
+
timeZone: string;
|
|
31
|
+
createdAt: any;
|
|
32
|
+
updatedAt?: any;
|
|
33
|
+
stats?: any;
|
|
34
|
+
guideBookId?: string;
|
|
35
|
+
guestSharing?: any;
|
|
36
|
+
}
|
|
37
|
+
export interface IAirbnbProperty {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
types: string[];
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
introduction?: string;
|
|
44
|
+
address: any;
|
|
45
|
+
location: string;
|
|
46
|
+
images: any;
|
|
47
|
+
thumbnailUrl?: string;
|
|
48
|
+
thumbnailAlt?: string;
|
|
49
|
+
verificationDocuments?: any;
|
|
50
|
+
info?: any;
|
|
51
|
+
user: any;
|
|
52
|
+
status?: any;
|
|
53
|
+
errors?: any;
|
|
54
|
+
preferences?: any;
|
|
55
|
+
orgName?: string;
|
|
56
|
+
serviceConfiguration?: any;
|
|
57
|
+
totalReview?: number;
|
|
58
|
+
totalStar?: number;
|
|
59
|
+
reviews?: any;
|
|
60
|
+
comments?: any;
|
|
61
|
+
userLikes?: any;
|
|
62
|
+
calendarEvents?: any[];
|
|
63
|
+
isUserLike?: boolean;
|
|
64
|
+
formattedPrice?: number;
|
|
65
|
+
timeZone: string;
|
|
66
|
+
createdAt: any;
|
|
67
|
+
updatedAt?: any;
|
|
68
|
+
stats?: any;
|
|
69
|
+
guideBookId?: string;
|
|
70
|
+
guestSharing?: any;
|
|
71
|
+
}
|
|
72
|
+
interface ILazyLoadingGoogleMarkerProps {
|
|
73
|
+
property: IProperty | IAirbnbProperty;
|
|
74
|
+
isHighlighted: boolean;
|
|
75
|
+
showPrices: boolean;
|
|
76
|
+
isActiveMarker: boolean;
|
|
77
|
+
propertyTypes: any;
|
|
78
|
+
onMarkerClick: () => void;
|
|
79
|
+
onInfoBoxClose: () => void;
|
|
80
|
+
}
|
|
81
|
+
export declare const LazyLoadingGoogleMarker: (props: ILazyLoadingGoogleMarkerProps) => ReactElement;
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=LazyLoadingGoogleMarker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LazyLoadingGoogleMarker.d.ts","sourceRoot":"","sources":["../../src/components/LazyLoadingGoogleMarker.tsx"],"names":[],"mappings":"AAAA,OAAc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AO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,GAAG,CAAC;IACnB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC9B;AAqFD,eAAO,MAAM,uBAAuB,GAAI,OAAO,6BAA6B,KAAG,YAmC9E,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React,{useState,useEffect}from'react';import {PropertyCardOnMap}from'./PropertyCardOnMap.js';import ReactDOMServer from'react-dom/server';import*as path from'@pubngo-stack/icons/lib/rifi-maps/index.js';import*as airbnbPath from'@pubngo-stack/icons/lib/airbnb/airbnbIcons-maps/index.js';import {AdvancedMarker}from'@vis.gl/react-google-maps';const getSvgMapIcon = (types, propertyTypes) => {
|
|
2
|
+
if (!types || types.length === 0) {
|
|
3
|
+
return 'data:image/svg+xml;charset=UTF-8,';
|
|
4
|
+
}
|
|
5
|
+
const icon = propertyTypes.find(item => item.id === types[0])?.icon || '';
|
|
6
|
+
return types.length > 1 ? `${icon}MultiType` : icon;
|
|
7
|
+
};
|
|
8
|
+
const pricesMarker = (price, isHighlighted) => {
|
|
9
|
+
const backgroundColor = isHighlighted ? 'rgb(0, 0, 0)' : 'rgb(255,255,255)';
|
|
10
|
+
const textColor = isHighlighted ? 'rgb(255, 255, 255)' : 'rgb(0, 0, 0)';
|
|
11
|
+
const borderRadius = isHighlighted ? '20' : '15';
|
|
12
|
+
const svgString = `<svg width="84" height="55" viewBox="0 0 84 55" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
+
<g filter="url(#filter0_dd_7163_1572)">
|
|
14
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M25 1C13.9543 1 5 9.95431 5 21C5 32.0457 13.9543 41 25 41H39.2222L42 46L44.7778 41H59C70.0457 41 79 32.0457 79 21C79 9.95431 70.0457 1 59 1H25Z" fill="${backgroundColor}"/>
|
|
15
|
+
</g>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<text x="42" y="26" font-family="Arial" font-size="14" text-anchor="middle" font-weight="bold" fill="${textColor}">${price || ''}</text>
|
|
19
|
+
<defs>
|
|
20
|
+
<filter id="filter0_dd_7163_1572" x="0" y="0" width="84" height="55" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
21
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
22
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
23
|
+
<feMorphology radius="${borderRadius}" operator="erode" in="SourceAlpha" result="effect1_dropShadow_7163_1572"/>
|
|
24
|
+
<feOffset dy="2"/>
|
|
25
|
+
<feGaussianBlur stdDeviation="2"/>
|
|
26
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/>
|
|
27
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_7163_1572"/>
|
|
28
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
29
|
+
<feMorphology radius="1" operator="erode" in="SourceAlpha" result="effect2_dropShadow_7163_1572"/>
|
|
30
|
+
<feOffset dy="4"/>
|
|
31
|
+
<feGaussianBlur stdDeviation="3"/>
|
|
32
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
|
33
|
+
<feBlend mode="normal" in2="effect1_dropShadow_7163_1572" result="effect2_dropShadow_7163_1572"/>
|
|
34
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_7163_1572" result="shape"/>
|
|
35
|
+
</filter>
|
|
36
|
+
</defs>
|
|
37
|
+
</svg>`;
|
|
38
|
+
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svgString);
|
|
39
|
+
};
|
|
40
|
+
const svgToMarkerIcon = async (types, isHighlighted, propertyTypes) => {
|
|
41
|
+
const resultantIcon = getSvgMapIcon(types, propertyTypes);
|
|
42
|
+
let iconPath = resultantIcon.toLowerCase().startsWith('airbnb') ? isHighlighted ? airbnbPath[`${resultantIcon}Dark`] : airbnbPath[`${resultantIcon}Light`] : isHighlighted ? path[`${resultantIcon}Dark`] : path[`${resultantIcon}Light`];
|
|
43
|
+
// New logic to handle the case when iconPath is not found
|
|
44
|
+
if (!iconPath) {
|
|
45
|
+
iconPath = isHighlighted ? airbnbPath['AirbnbApartmentDark'] : airbnbPath['AirbnbApartmentLight'];
|
|
46
|
+
}
|
|
47
|
+
if (typeof iconPath !== 'function') return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(iconPath);
|
|
48
|
+
const svg = ReactDOMServer.renderToString(iconPath({
|
|
49
|
+
width: '50px',
|
|
50
|
+
height: '50px'
|
|
51
|
+
}));
|
|
52
|
+
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg);
|
|
53
|
+
};
|
|
54
|
+
const getMapMarkerIcons = async (room, showPrices, isHighlighted, propertyTypes) => {
|
|
55
|
+
return showPrices ? pricesMarker(room?.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.totalBeforeDiscount, isHighlighted) : await svgToMarkerIcon(room.types, isHighlighted, propertyTypes);
|
|
56
|
+
};
|
|
57
|
+
const MarkerImage = React.memo(({
|
|
58
|
+
src,
|
|
59
|
+
showPrices
|
|
60
|
+
}) => React.createElement("img", {
|
|
61
|
+
src: src,
|
|
62
|
+
alt: "Property Marker",
|
|
63
|
+
className: showPrices ? 'w-[84px] h-[40px]' : 'w-[90px] h-[60px]'
|
|
64
|
+
}));
|
|
65
|
+
const LazyLoadingGoogleMarker = props => {
|
|
66
|
+
const {
|
|
67
|
+
property,
|
|
68
|
+
isHighlighted,
|
|
69
|
+
showPrices,
|
|
70
|
+
isActiveMarker,
|
|
71
|
+
onInfoBoxClose,
|
|
72
|
+
onMarkerClick,
|
|
73
|
+
propertyTypes
|
|
74
|
+
} = props;
|
|
75
|
+
const [mapIcon, setMapIcon] = useState('');
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
(async () => {
|
|
78
|
+
const icon = await getMapMarkerIcons(property, showPrices, isHighlighted, propertyTypes);
|
|
79
|
+
setMapIcon(icon);
|
|
80
|
+
})();
|
|
81
|
+
}, [isHighlighted, showPrices]);
|
|
82
|
+
if (!property) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
return React.createElement(AdvancedMarker, {
|
|
86
|
+
position: {
|
|
87
|
+
lat: property.address.latitude_around,
|
|
88
|
+
lng: property.address.longitude_around
|
|
89
|
+
},
|
|
90
|
+
title: property.name,
|
|
91
|
+
onClick: onMarkerClick,
|
|
92
|
+
zIndex: isHighlighted ? 999 : 1
|
|
93
|
+
}, React.createElement("div", {
|
|
94
|
+
className: "relative cursor-pointer transform -translate-x-1/2 -translate-y-1/2"
|
|
95
|
+
}, mapIcon && React.createElement(MarkerImage, {
|
|
96
|
+
src: mapIcon,
|
|
97
|
+
showPrices: showPrices
|
|
98
|
+
}), isActiveMarker && React.createElement("div", {
|
|
99
|
+
className: "absolute bottom-0 left-1/2 transform -translate-x-1/2 bg-white p-2.5 rounded-2xl z-[1000] w-[300px] shadow-[0_12px_24px_0_rgba(0,0,0,0.1),_0_2px_8px_0_rgba(0,0,0,0.05)]"
|
|
100
|
+
}, React.createElement(PropertyCardOnMap, {
|
|
101
|
+
room: property,
|
|
102
|
+
isSaved: false
|
|
103
|
+
}))));
|
|
104
|
+
};export{LazyLoadingGoogleMarker};//# sourceMappingURL=LazyLoadingGoogleMarker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LazyLoadingGoogleMarker.js","sources":["../../src/components/LazyLoadingGoogleMarker.tsx"],"sourcesContent":[null],"names":[],"mappings":"4VAwFA,MAAM,aAAa,GAAG,C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AA,CAAA;AAED,MAAA,UACI,CAAA,IAAA,CAAA;AAEQ,IAAA,CAAA,GAAA;AACA,EAAA,CAAA,EAAA,CAAA,aAAK,EAAA,UAAS,CAAA,CAAO;eAEzB;;;AAMK,EAAA,OAAA,KAAA,CAAA,aAAc,CAAA,cACX,EAAA;AACI,IAAA,QAAA,EAAA;AAMxB,MAAE,GAAA,EAAA,QAAA,CAAA,OAAA,CAAA,eAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/components/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,UAAU,GAAI;;;;CAAyC,sBAiEnE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from'react';import {TailwindUiButton}from'@admin-layout/tailwind-ui';const Pagination = ({
|
|
2
|
+
currentPage,
|
|
3
|
+
totalPages,
|
|
4
|
+
onPageChange
|
|
5
|
+
}) => {
|
|
6
|
+
const renderPageNumbers = () => {
|
|
7
|
+
const pageNumbers = [];
|
|
8
|
+
const maxPagesToShow = 4; // Number of pages to show in the middle
|
|
9
|
+
// Helper function to add page button
|
|
10
|
+
const addPageButton = pageNum => React.createElement(TailwindUiButton, {
|
|
11
|
+
key: pageNum,
|
|
12
|
+
variant: currentPage === pageNum ? 'primary' : 'outline',
|
|
13
|
+
size: "small",
|
|
14
|
+
onClick: () => onPageChange(pageNum),
|
|
15
|
+
className: `mx-2 ${currentPage === pageNum ? 'themed-button' : 'border-border text-foreground hover:bg-muted'}`
|
|
16
|
+
}, pageNum);
|
|
17
|
+
// Add first page
|
|
18
|
+
pageNumbers.push(addPageButton(1));
|
|
19
|
+
// Add ellipsis if needed
|
|
20
|
+
if (currentPage > maxPagesToShow) {
|
|
21
|
+
pageNumbers.push(React.createElement(TailwindUiButton, {
|
|
22
|
+
key: "ellipsis-start",
|
|
23
|
+
variant: "ghost",
|
|
24
|
+
size: "small",
|
|
25
|
+
disabled: true,
|
|
26
|
+
className: "mx-2 text-muted-foreground"
|
|
27
|
+
}, "..."));
|
|
28
|
+
}
|
|
29
|
+
// Calculate start and end page numbers
|
|
30
|
+
const startPage = Math.max(2, currentPage - 1);
|
|
31
|
+
const endPage = Math.min(totalPages - 1, currentPage + 2);
|
|
32
|
+
// Add middle page numbers
|
|
33
|
+
for (let i = startPage; i <= endPage; i++) {
|
|
34
|
+
pageNumbers.push(addPageButton(i));
|
|
35
|
+
}
|
|
36
|
+
// Add ellipsis if needed
|
|
37
|
+
if (endPage < totalPages - 1) {
|
|
38
|
+
pageNumbers.push(React.createElement(TailwindUiButton, {
|
|
39
|
+
key: "ellipsis-end",
|
|
40
|
+
variant: "ghost",
|
|
41
|
+
size: "small",
|
|
42
|
+
disabled: true,
|
|
43
|
+
className: "mx-2 text-muted-foreground"
|
|
44
|
+
}, "..."));
|
|
45
|
+
}
|
|
46
|
+
// Add last page
|
|
47
|
+
if (totalPages > 1) {
|
|
48
|
+
pageNumbers.push(addPageButton(totalPages));
|
|
49
|
+
}
|
|
50
|
+
return pageNumbers;
|
|
51
|
+
};
|
|
52
|
+
return React.createElement("div", {
|
|
53
|
+
className: "flex justify-center items-center mt-8"
|
|
54
|
+
}, renderPageNumbers());
|
|
55
|
+
};export{Pagination};//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../src/components/Pagination.tsx"],"sourcesContent":[null],"names":["Button"],"mappings":"kFAGO,MAAM,UAAU,GAAG,CAAC;aACjB;YACF;AACA,EAAA;;AAGA,EAAA,MAAA,iBAAM,GAAa,MAAI;UAcvB,WAAA,GAAA,EAAiB;UACjB,cAAgB,GAAC,CAAA,CAAA;;AAGjB,IAAA,MAAA,aAAe,GAAG,OAAA,IAAA,KAAgB,CAAC,aAAA,CAAAA,gBAAA,EAAA;kBAC/B;aAWH,EAAA,WAAA,KAAA,OAAA,GAAA,SAAA,GAAA,SAAA;UAED,EAAA,OAAA;AACA,MAAA,OAAA,EAAM,MAAA,YAAiB,CAAG,OAAI,CAAA;AAC9B,MAAA,SAAM,EAAA,CAAA,KAAO,EAAG,WAAS,KAAA,OAAc,GAAE,eAAiB,GAAA,8CAAA,CAAA;cAE1D,CAAA;AACA;eACI,CAAA,IAAA,CAAA,aAAiB,CAAA,CAAA,CAAA,CAAA;;QAGrB,WAAA,GAAA,cAAyB,EAAA;AACzB,MAAA,gBAAc,CAAA,KAAA,CAAA,aAAiB,CAAAA,gBAAA,EAAA;aAC3B,gBACI;QAIR,OAAC,EAAA,OAAA;QAED,IAAA,EAAA,OAAA;AACA,QAAA,QAAI,EAAA,IAAU;iBACV,EAAA;SACH,KAAA,CAAA,CAAA;AAED,IAAA;AACJ;IAEA,MAAA,SAAO,GAAA,IAAA,CAAA,GAAA,CAAA,CAAA,EAAA,eAAc,CAAA;AACzB,IAAE,MAAA,OAAA,GAAA,IAAA,CAAA,GAAA,CAAA,UAAA,GAAA,CAAA,EAAA,WAAA,GAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;"}
|