kupos-ui-components-lib 9.8.0 → 9.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/dist/KuposUIComponent.d.ts +0 -3
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +21 -21
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +7 -16
- package/dist/components/ServiceItem/mobileTypes.d.ts +0 -32
- package/dist/components/ServiceItem/types.d.ts +7 -22
- package/dist/styles.css +3 -209
- package/dist/ui/SeatSection/SeatSection.d.ts +5 -1
- package/dist/ui/SeatSection/SeatSection.js +28 -6
- package/dist/utils/CommonService.js +1 -11
- package/package.json +1 -1
- package/src/KuposUIComponent.tsx +0 -3
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +38 -55
- package/src/components/ServiceItem/ServiceItemMobile.tsx +286 -340
- package/src/components/ServiceItem/mobileTypes.ts +1 -29
- package/src/components/ServiceItem/types.ts +7 -23
- package/src/styles.css +0 -15
- package/src/ui/SeatSection/SeatSection.tsx +59 -11
- package/src/utils/CommonService.ts +1 -13
- package/src/assets/images/anims/service_list/flame_anim.json +0 -1
- package/src/assets/images/anims/service_list/thunder_icon.json +0 -1
- package/src/assets/images/anims/service_list/users_anim.json +0 -1
- package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +0 -529
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +0 -559
|
@@ -27,8 +27,6 @@ import bombAnimation from "../../assets/images/anims/service_list/bomb.json";
|
|
|
27
27
|
import dotAnimation from "../../assets/images/anims/service_list/dot_animation.json";
|
|
28
28
|
import starAnimation from "../../assets/images/anims/service_list/star_anim.json";
|
|
29
29
|
import femaleAnimation from "../../assets/images/anims/service_list/female_anim.json";
|
|
30
|
-
import usersAnimation from "../../assets/images/anims/service_list/users_anim.json";
|
|
31
|
-
import flameAnimation from "../../assets/images/anims/service_list/flame_anim.json";
|
|
32
30
|
|
|
33
31
|
import RatingBlock from "../../ui/RatingBlock";
|
|
34
32
|
import DurationBlock from "../../ui/DurationBlock";
|
|
@@ -39,9 +37,6 @@ import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
|
39
37
|
import BottomAmenities from "../../ui/BottomAmenities/BottomAmenities";
|
|
40
38
|
import SeatSection from "../../ui/SeatSection/SeatSection";
|
|
41
39
|
import DateTimeSection from "../../ui/DateTimeSection/DateTimeSection";
|
|
42
|
-
import FeatureServiceUi from "../../ui/FeatureServiceUI/FeatureServiceUi";
|
|
43
|
-
|
|
44
|
-
import thunderAnimation from "../../assets/images/anims/service_list/thunder_icon.json";
|
|
45
40
|
import ServiceBadges from "../../ui/ServiceBadges/ServiceBadges";
|
|
46
41
|
|
|
47
42
|
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
@@ -76,9 +71,6 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
|
|
|
76
71
|
bombAnimation: {
|
|
77
72
|
kupos: bombAnimation,
|
|
78
73
|
},
|
|
79
|
-
thunderAnimation: {
|
|
80
|
-
kupos: thunderAnimation,
|
|
81
|
-
},
|
|
82
74
|
dotAnimation: {
|
|
83
75
|
kupos: dotAnimation,
|
|
84
76
|
},
|
|
@@ -88,12 +80,6 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
|
|
|
88
80
|
femaaleAnimation: {
|
|
89
81
|
kupos: femaleAnimation,
|
|
90
82
|
},
|
|
91
|
-
usersAnimation: {
|
|
92
|
-
kupos: usersAnimation,
|
|
93
|
-
},
|
|
94
|
-
flameAnimation: {
|
|
95
|
-
kupos: flameAnimation,
|
|
96
|
-
},
|
|
97
83
|
};
|
|
98
84
|
|
|
99
85
|
function ServiceItemPB({
|
|
@@ -127,21 +113,21 @@ function ServiceItemPB({
|
|
|
127
113
|
setIsExpand,
|
|
128
114
|
coachKey,
|
|
129
115
|
viewersConfig,
|
|
130
|
-
isNewUi,
|
|
131
116
|
showLoginModal,
|
|
132
117
|
isLoggedIn,
|
|
133
118
|
showLoginOption,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
onTimeSlotChange,
|
|
142
|
-
isTimeDropdownOpen,
|
|
143
|
-
onTimeDropdownToggle,
|
|
119
|
+
isTrain,
|
|
120
|
+
selectedSeatKey,
|
|
121
|
+
onSeatSelect,
|
|
122
|
+
onTrainButtonClick,
|
|
123
|
+
showSeatSelectionError,
|
|
124
|
+
onShowSeatSelectionError,
|
|
125
|
+
onClearSeatSelectionError,
|
|
144
126
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
127
|
+
const handleSeatSelect = (key: any, price: number) => {
|
|
128
|
+
onClearSeatSelectionError?.();
|
|
129
|
+
onSeatSelect?.(key, price);
|
|
130
|
+
};
|
|
145
131
|
const getAnimationIcon = (icon: string) => {
|
|
146
132
|
const animation = ANIMATION_MAP[icon];
|
|
147
133
|
if (!animation) return null;
|
|
@@ -338,6 +324,17 @@ function ServiceItemPB({
|
|
|
338
324
|
return;
|
|
339
325
|
}
|
|
340
326
|
|
|
327
|
+
if (isTrain) {
|
|
328
|
+
if (!selectedSeatKey) {
|
|
329
|
+
onShowSeatSelectionError?.(serviceItem.id);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
if (onTrainButtonClick) {
|
|
333
|
+
onTrainButtonClick();
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
341
338
|
onBookButtonPress();
|
|
342
339
|
};
|
|
343
340
|
|
|
@@ -440,35 +437,6 @@ function ServiceItemPB({
|
|
|
440
437
|
siteType={siteType}
|
|
441
438
|
isAllinBus={isAllinBus}
|
|
442
439
|
/>
|
|
443
|
-
) : isNewUi ? (
|
|
444
|
-
<FeatureServiceUi
|
|
445
|
-
serviceItem={serviceItem}
|
|
446
|
-
showTopLabel={showTopLabel}
|
|
447
|
-
isSoldOut={isSoldOut}
|
|
448
|
-
getAnimationIcon={getAnimationIcon}
|
|
449
|
-
cityOrigin={cityOrigin}
|
|
450
|
-
cityDestination={cityDestination}
|
|
451
|
-
renderIcon={renderIcon}
|
|
452
|
-
viewersConfig={viewersConfig}
|
|
453
|
-
isFeatureDropDownExpand={isFeatureDropDownExpand}
|
|
454
|
-
ticketQuantity={ticketQuantity}
|
|
455
|
-
onIncreaseTicketQuantity={onIncreaseTicketQuantity}
|
|
456
|
-
onDecreaseTicketQuantity={onDecreaseTicketQuantity}
|
|
457
|
-
onBookButtonPress={onRemateUiButtonClick}
|
|
458
|
-
onToggleExpand={() =>
|
|
459
|
-
setIsFeatureDropDownExpand &&
|
|
460
|
-
setIsFeatureDropDownExpand(
|
|
461
|
-
isFeatureDropDownExpand === serviceItem.id ||
|
|
462
|
-
isFeatureDropDownExpand === true
|
|
463
|
-
? null
|
|
464
|
-
: serviceItem.id,
|
|
465
|
-
)
|
|
466
|
-
}
|
|
467
|
-
selectedTimeSlot={selectedTimeSlot}
|
|
468
|
-
onTimeSlotChange={onTimeSlotChange}
|
|
469
|
-
isTimeDropdownOpen={isTimeDropdownOpen}
|
|
470
|
-
onTimeDropdownToggle={onTimeDropdownToggle}
|
|
471
|
-
/>
|
|
472
440
|
) : (
|
|
473
441
|
<div
|
|
474
442
|
className={`relative hover:z-[150] ${hasOfferText || hasDpEnabled ? "mb-[55px]" : "mb-[10px]"} ${
|
|
@@ -579,6 +547,10 @@ function ServiceItemPB({
|
|
|
579
547
|
isPeru={isPeru}
|
|
580
548
|
renderIcon={renderIcon}
|
|
581
549
|
discountSeatPriceColor={colors.discountSeatPriceColor}
|
|
550
|
+
isTrain={isTrain}
|
|
551
|
+
selectedSeatKey={selectedSeatKey}
|
|
552
|
+
onSeatSelect={handleSeatSelect}
|
|
553
|
+
topLabelColor={colors.topLabelColor}
|
|
582
554
|
/>
|
|
583
555
|
</div>
|
|
584
556
|
|
|
@@ -594,6 +566,18 @@ function ServiceItemPB({
|
|
|
594
566
|
soldOutIcon={renderIcon("soldOutIcon", "14px")}
|
|
595
567
|
onClick={checkMidnight}
|
|
596
568
|
/>
|
|
569
|
+
{showSeatSelectionError === serviceItem.id && isTrain && (
|
|
570
|
+
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
571
|
+
<div
|
|
572
|
+
className="text-[9px] text-center whitespace-nowrap"
|
|
573
|
+
style={{
|
|
574
|
+
color: colors.seatPriceColor,
|
|
575
|
+
}}
|
|
576
|
+
>
|
|
577
|
+
Selecciona el tipo de servicio
|
|
578
|
+
</div>
|
|
579
|
+
</div>
|
|
580
|
+
)}
|
|
597
581
|
{showLastSeats ? (
|
|
598
582
|
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
599
583
|
{serviceItem?.available_seats < 10 &&
|
|
@@ -640,7 +624,6 @@ function ServiceItemPB({
|
|
|
640
624
|
"grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
641
625
|
position: "relative",
|
|
642
626
|
zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
|
|
643
|
-
marginTop: isItemExpanded ? "" : "-10px",
|
|
644
627
|
}}
|
|
645
628
|
>
|
|
646
629
|
<div
|