kupos-ui-components-lib 10.4.52 → 10.4.54

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.
@@ -470,12 +470,11 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
470
470
  justifyContent: "flex-end",
471
471
  } },
472
472
  currency ? currency : "",
473
- " ",
474
- CommonService.currency(isPeru
473
+ CommonService.currencyExact(isPeru
475
474
  ? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
476
475
  100
477
476
  : removeDiscountAtomValue
478
477
  ? 0
479
- : netFare, currencySign)))))));
478
+ : netFare)))))));
480
479
  };
481
480
  export default PaymentSideBarDesktop;
@@ -168,7 +168,7 @@ function PeruServiceItemDesktop({ serviceItem, onBookButtonPress, colors, metaDa
168
168
  };
169
169
  // Seat type icon logic
170
170
  const getSeatTypeIcon = (seatLabel) => {
171
- var _a, _b, _c, _d;
171
+ var _a, _b, _c, _d, _e;
172
172
  // Icon keys follow the seat{degrees}Icon format in serviceItem.icons
173
173
  if (seatLabel.includes("180°"))
174
174
  return (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.seat180Icon;
@@ -176,7 +176,9 @@ function PeruServiceItemDesktop({ serviceItem, onBookButtonPress, colors, metaDa
176
176
  return (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.seat160Icon;
177
177
  if (seatLabel.includes("140°"))
178
178
  return (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.seat140Icon;
179
- return (_d = serviceItem.icons) === null || _d === void 0 ? void 0 : _d.seatFallBackIcon;
179
+ if (seatLabel.includes("145°"))
180
+ return (_d = serviceItem.icons) === null || _d === void 0 ? void 0 : _d.seat145Icon;
181
+ return (_e = serviceItem.icons) === null || _e === void 0 ? void 0 : _e.seatFallBackIcon;
180
182
  };
181
183
  const getSeatNames = () => {
182
184
  const uniqueSeats = getUniqueSeats();
@@ -60,7 +60,7 @@ function hasInclinationSeatTypes(seatTypes) {
60
60
  return (seatTypes !== null && seatTypes !== void 0 ? seatTypes : []).some((seat) => { var _a; return String((_a = seat === null || seat === void 0 ? void 0 : seat.label) !== null && _a !== void 0 ? _a : "").includes("°"); });
61
61
  }
62
62
  function getSeatTypeIcon(label, serviceItem) {
63
- var _a, _b, _c, _d;
63
+ var _a, _b, _c, _d, _e;
64
64
  const seatLabel = String(label !== null && label !== void 0 ? label : "");
65
65
  if (seatLabel.includes("180°"))
66
66
  return (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.seat180Icon;
@@ -68,7 +68,9 @@ function getSeatTypeIcon(label, serviceItem) {
68
68
  return (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.seat160Icon;
69
69
  if (seatLabel.includes("140°"))
70
70
  return (_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _c === void 0 ? void 0 : _c.seat140Icon;
71
- return (_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _d === void 0 ? void 0 : _d.seatFallBackIcon;
71
+ if (seatLabel.includes("145°"))
72
+ return (_d = serviceItem.icons) === null || _d === void 0 ? void 0 : _d.seat145Icon;
73
+ return (_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _e === void 0 ? void 0 : _e.seatFallBackIcon;
72
74
  }
73
75
  function PeruSeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currencySign, removeDuplicateSeats, serviceItem, renderIcon, discountSeatPriceColor, isSeatIcon, }) {
74
76
  var _a;
@@ -1,5 +1,6 @@
1
1
  declare const commonService: {
2
2
  currency(amount: number, currencySign?: string): string;
3
+ currencyExact: (amount: any) => string;
3
4
  currencyFixed(amount: number, currencySign?: string, decimals?: number): string;
4
5
  currencyRounded(amount: number, currencySign?: string): string;
5
6
  discountedCurrency(amount: number, currencySign?: string): string;
@@ -13,6 +13,14 @@ const commonService = {
13
13
  const sign = currencySign || "$";
14
14
  return sign + formattedAmount;
15
15
  },
16
+ currencyExact: (amount) => {
17
+ if (amount === null || amount === undefined || isNaN(amount))
18
+ return "S/0";
19
+ const rounded = Math.round(+amount * 100) / 100;
20
+ const parts = String(rounded).split(".");
21
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
22
+ return "S/" + parts.join(".");
23
+ },
16
24
  currencyFixed(amount, currencySign, decimals = 2) {
17
25
  const formattedAmount = fixFloatPrecision(amount, decimals)
18
26
  .toString()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "10.4.52",
3
+ "version": "10.4.54",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -914,15 +914,15 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
914
914
  justifyContent: "flex-end",
915
915
  }}
916
916
  >
917
- {currency ? currency : ""}{" "}
918
- {CommonService.currency(
917
+ {currency ? currency : ""}
918
+
919
+ {CommonService.currencyExact(
919
920
  isPeru
920
921
  ? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
921
922
  100
922
923
  : removeDiscountAtomValue
923
924
  ? 0
924
925
  : netFare,
925
- currencySign,
926
926
  )}
927
927
  </div>
928
928
  </div>
@@ -263,6 +263,7 @@ function PeruServiceItemDesktop({
263
263
  if (seatLabel.includes("180°")) return serviceItem.icons?.seat180Icon;
264
264
  if (seatLabel.includes("160°")) return serviceItem.icons?.seat160Icon;
265
265
  if (seatLabel.includes("140°")) return serviceItem.icons?.seat140Icon;
266
+ if (seatLabel.includes("145°")) return serviceItem.icons?.seat145Icon;
266
267
 
267
268
  return serviceItem.icons?.seatFallBackIcon;
268
269
  };
@@ -105,6 +105,7 @@ function getSeatTypeIcon(label: string, serviceItem: any) {
105
105
  if (seatLabel.includes("180°")) return serviceItem?.icons?.seat180Icon;
106
106
  if (seatLabel.includes("160°")) return serviceItem?.icons?.seat160Icon;
107
107
  if (seatLabel.includes("140°")) return serviceItem?.icons?.seat140Icon;
108
+ if (seatLabel.includes("145°")) return serviceItem.icons?.seat145Icon;
108
109
  return serviceItem?.icons?.seatFallBackIcon;
109
110
  }
110
111
 
@@ -16,6 +16,14 @@ const commonService = {
16
16
  return sign + formattedAmount;
17
17
  },
18
18
 
19
+ currencyExact: (amount) => {
20
+ if (amount === null || amount === undefined || isNaN(amount)) return "S/0";
21
+ const rounded = Math.round(+amount * 100) / 100;
22
+ const parts = String(rounded).split(".");
23
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
24
+ return "S/" + parts.join(".");
25
+ },
26
+
19
27
  currencyFixed(amount: number, currencySign?: string, decimals: number = 2) {
20
28
  const formattedAmount = fixFloatPrecision(amount, decimals)
21
29
  .toString()