kupos-ui-components-lib 10.3.7 → 10.3.9

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.
@@ -472,15 +472,10 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
472
472
  currency ? currency : "",
473
473
  " ",
474
474
  CommonService.currency(isPeru
475
- ? Math.round((removeDiscountAtomValue
476
- ? 0
477
- : isAgency
478
- ? netFare + agencyFee
479
- : netFare) * 100) / 100
475
+ ? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
476
+ 100
480
477
  : removeDiscountAtomValue
481
478
  ? 0
482
- : isAgency
483
- ? netFare + agencyFee
484
- : netFare, currencySign)))))));
479
+ : netFare, currencySign)))))));
485
480
  };
486
481
  export default PaymentSideBarDesktop;
@@ -259,15 +259,10 @@ const PaymentSideBarMobile = ({ serviceNameOnward, serviceNameReturn, metaData,
259
259
  currency ? currency : "",
260
260
  " ",
261
261
  CommonService.currency(isPeru
262
- ? Math.round((removeDiscountAtomValue
263
- ? 0
264
- : isAgency
265
- ? netFare + agencyFee
266
- : netFare) * 100) / 100
262
+ ? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
263
+ 100
267
264
  : removeDiscountAtomValue
268
265
  ? 0
269
- : isAgency
270
- ? netFare + agencyFee
271
- : netFare, currencySign)))))));
266
+ : netFare, currencySign)))))));
272
267
  };
273
268
  export default PaymentSideBarMobile;
@@ -91,6 +91,7 @@ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currenc
91
91
  : CommonService.currency(price, currencySign);
92
92
  const renderSeatNames = () => {
93
93
  const seats = removeDuplicateSeats ? uniqueSeats : sortedSeatTypes;
94
+ console.log("🚀 ~ renderSeatNames ~ removeDuplicateSeats:", seats);
94
95
  return seats.map((val, key) => {
95
96
  return SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("div", { className: "flex items-center", style: isTrain ? { cursor: "pointer" } : undefined, onClick: isTrain && !isSoldOut
96
97
  ? () => val.label === selectedSeatKey
@@ -235,7 +236,7 @@ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currenc
235
236
  height: "20px",
236
237
  marginRight: "5px",
237
238
  } })),
238
- CommonService.capitalize(seatLabel))) : (React.createElement("span", { className: "text-[13.33px]" }, "Desde")))));
239
+ CommonService.truncateSeatLabel(CommonService.capitalize(seatLabel), 15))) : (React.createElement("span", { className: "text-[13.33px]" }, "Desde")))));
239
240
  }
240
241
  return renderSeatNames();
241
242
  };
@@ -361,7 +362,7 @@ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currenc
361
362
  ? CommonService.currency(0, currencySign)
362
363
  : CommonService.discountedCurrency(discountSeat.discountedPrice, currencySign)))));
363
364
  }
364
- return (React.createElement("div", { className: "relative flex gap-[10px] text-[13.33px] justify-between min-h-[2.2rem]", style: isCentered ? { alignItems: "center" } : {} },
365
+ return isTrain && availableSeats <= 0 ? null : (React.createElement("div", { className: "relative flex gap-[10px] text-[13.33px] justify-between min-h-[2.2rem]", style: isCentered ? { alignItems: "center" } : {} },
365
366
  React.createElement("div", { className: "flex flex-col justify-between", style: { gap: "10px" } }, renderLabels()),
366
367
  React.createElement("div", { className: "flex flex-col justify-between absolute inset-y-0 right-0 left-1/2 h-full", style: {
367
368
  color: isSoldOut ? "#c0c0c0" : priceColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "10.3.7",
3
+ "version": "10.3.9",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -917,18 +917,11 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
917
917
  {currency ? currency : ""}{" "}
918
918
  {CommonService.currency(
919
919
  isPeru
920
- ? Math.round(
921
- (removeDiscountAtomValue
922
- ? 0
923
- : isAgency
924
- ? netFare + agencyFee
925
- : netFare) * 100,
926
- ) / 100
920
+ ? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
921
+ 100
927
922
  : removeDiscountAtomValue
928
923
  ? 0
929
- : isAgency
930
- ? netFare + agencyFee
931
- : netFare,
924
+ : netFare,
932
925
  currencySign,
933
926
  )}
934
927
  </div>
@@ -730,18 +730,11 @@ const PaymentSideBarMobile: React.FC<PaymentSideBarProps> = ({
730
730
  {currency ? currency : ""}{" "}
731
731
  {CommonService.currency(
732
732
  isPeru
733
- ? Math.round(
734
- (removeDiscountAtomValue
735
- ? 0
736
- : isAgency
737
- ? netFare + agencyFee
738
- : netFare) * 100,
739
- ) / 100
733
+ ? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
734
+ 100
740
735
  : removeDiscountAtomValue
741
736
  ? 0
742
- : isAgency
743
- ? netFare + agencyFee
744
- : netFare,
737
+ : netFare,
745
738
  currencySign,
746
739
  )}
747
740
  </div>
@@ -159,6 +159,7 @@ function SeatSection({
159
159
 
160
160
  const renderSeatNames = () => {
161
161
  const seats = removeDuplicateSeats ? uniqueSeats : sortedSeatTypes;
162
+ console.log("🚀 ~ renderSeatNames ~ removeDuplicateSeats:", seats);
162
163
 
163
164
  return seats.map((val, key: number) => {
164
165
  return SEAT_EXCEPTIONS.includes(val.label) ? null : (
@@ -443,7 +444,10 @@ function SeatSection({
443
444
  }}
444
445
  />
445
446
  )}
446
- {CommonService.capitalize(seatLabel)}
447
+ {CommonService.truncateSeatLabel(
448
+ CommonService.capitalize(seatLabel),
449
+ 15,
450
+ )}
447
451
  </span>
448
452
  ) : (
449
453
  <span className="text-[13.33px]">Desde</span>
@@ -715,7 +719,7 @@ function SeatSection({
715
719
  );
716
720
  }
717
721
 
718
- return (
722
+ return isTrain && availableSeats <= 0 ? null : (
719
723
  <div
720
724
  className="relative flex gap-[10px] text-[13.33px] justify-between min-h-[2.2rem]"
721
725
  style={isCentered ? { alignItems: "center" } : {}}