kupos-ui-components-lib 8.0.2 → 8.0.3

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.
@@ -373,7 +373,9 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
373
373
  const sortedSeatTypes = getSortedSeatTypes();
374
374
  if (removeDuplicateSeats) {
375
375
  return uniqueSeats.map((val, key) => SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: `flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` }, typeof val.label === "string" || typeof val.label === "number"
376
- ? val.label
376
+ ? isPeru
377
+ ? truncateSeatLabel(val.label)
378
+ : val.label
377
379
  : null)));
378
380
  }
379
381
  return sortedSeatTypes.map((val, key) => SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: `flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` }, typeof val.label === "string" || typeof val.label === "number"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "8.0.2",
3
+ "version": "8.0.3",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -318,7 +318,7 @@ function ServiceItemPB({
318
318
  stageData: any,
319
319
  direction: number = 1,
320
320
  terminals: any = null,
321
- hideTime: boolean = false
321
+ hideTime: boolean = false,
322
322
  ) => {
323
323
  if (typeof stageData === "string") {
324
324
  const arr = direction === 1 ? stageData.split(",") : stageData.split(",");
@@ -412,7 +412,7 @@ function ServiceItemPB({
412
412
 
413
413
  let seatTypesWithPrices = getAllSeatTypes();
414
414
  const premiumIndex = seatTypesWithPrices.findIndex(
415
- (item) => item.label === "Premium"
415
+ (item) => item.label === "Premium",
416
416
  );
417
417
 
418
418
  if (premiumIndex >= 3) {
@@ -442,7 +442,7 @@ function ServiceItemPB({
442
442
 
443
443
  const getNumberOfSeats = () => {
444
444
  return serviceItem.seat_types.filter(
445
- (val) => !SEAT_EXCEPTIONS.includes(val.label)
445
+ (val) => !SEAT_EXCEPTIONS.includes(val.label),
446
446
  ).length;
447
447
  };
448
448
 
@@ -487,10 +487,12 @@ function ServiceItemPB({
487
487
  }`}
488
488
  >
489
489
  {typeof val.label === "string" || typeof val.label === "number"
490
- ? val.label
490
+ ? isPeru
491
+ ? truncateSeatLabel(val.label)
492
+ : val.label
491
493
  : null}
492
494
  </span>
493
- )
495
+ ),
494
496
  );
495
497
  }
496
498
  return sortedSeatTypes.map((val, key: number) =>
@@ -505,7 +507,7 @@ function ServiceItemPB({
505
507
  ? val.label
506
508
  : null}
507
509
  </span>
508
- )
510
+ ),
509
511
  );
510
512
  };
511
513
 
@@ -529,10 +531,10 @@ function ServiceItemPB({
529
531
  ? CommonService.currency(0, currencySign)
530
532
  : CommonService.currency(val.price, currencySign)
531
533
  : typeof val.price === "number"
532
- ? serviceItem?.available_seats <= 0
533
- ? CommonService.currency(0, currencySign)
534
- : CommonService.currency(val.price, currencySign)
535
- : null}
534
+ ? serviceItem?.available_seats <= 0
535
+ ? CommonService.currency(0, currencySign)
536
+ : CommonService.currency(val.price, currencySign)
537
+ : null}
536
538
  </span>
537
539
  );
538
540
  });
@@ -805,7 +807,7 @@ function ServiceItemPB({
805
807
  <div className="h-[20px] flex items-center group relative">
806
808
  <span className="cursor-pointer bold-text capitalize">
807
809
  {DateService.getServiceItemDate(
808
- serviceItem.travel_date
810
+ serviceItem.travel_date,
809
811
  )}
810
812
  </span>
811
813
  {serviceItem.boarding_stages && (
@@ -831,8 +833,8 @@ function ServiceItemPB({
831
833
  1,
832
834
  busStage,
833
835
  hideBoardingTime(
834
- serviceItem?.api_type || serviceItem?.apiType
835
- )
836
+ serviceItem?.api_type || serviceItem?.apiType,
837
+ ),
836
838
  )}
837
839
  </div>
838
840
  </div>
@@ -844,7 +846,7 @@ function ServiceItemPB({
844
846
  <div className="h-[20px] flex items-center group relative">
845
847
  <span className="cursor-pointer bold-text capitalize">
846
848
  {DateService.getServiceItemDate(
847
- serviceItem.arrival_date
849
+ serviceItem.arrival_date,
848
850
  )}
849
851
  </span>
850
852
  {serviceItem.dropoff_stages && (
@@ -872,8 +874,8 @@ function ServiceItemPB({
872
874
  2,
873
875
  busStage,
874
876
  hideBoardingTime(
875
- serviceItem?.api_type || serviceItem?.apiType
876
- )
877
+ serviceItem?.api_type || serviceItem?.apiType,
878
+ ),
877
879
  )}
878
880
  </div>
879
881
  </div>
@@ -947,8 +949,8 @@ function ServiceItemPB({
947
949
  1,
948
950
  busStage,
949
951
  hideBoardingTime(
950
- serviceItem?.api_type || serviceItem?.apiType
951
- )
952
+ serviceItem?.api_type || serviceItem?.apiType,
953
+ ),
952
954
  )}
953
955
  </div>
954
956
  </div>
@@ -962,8 +964,8 @@ function ServiceItemPB({
962
964
  {removeArrivalTime
963
965
  ? null
964
966
  : serviceItem.arr_time
965
- ? DateService.formatTime(serviceItem.arr_time)
966
- : null}
967
+ ? DateService.formatTime(serviceItem.arr_time)
968
+ : null}
967
969
  </div>
968
970
  {/* Dropping stage tooltip */}
969
971
  {serviceItem.dropoff_stages && (
@@ -992,8 +994,8 @@ function ServiceItemPB({
992
994
  2,
993
995
  busStage,
994
996
  hideBoardingTime(
995
- serviceItem?.api_type || serviceItem?.apiType
996
- )
997
+ serviceItem?.api_type || serviceItem?.apiType,
998
+ ),
997
999
  )}
998
1000
  </div>
999
1001
  </div>
@@ -1262,11 +1264,11 @@ function ServiceItemPB({
1262
1264
  const amenities = [...serviceItem.operator_details[4]];
1263
1265
 
1264
1266
  const priorityAmenities = amenities.filter((id) =>
1265
- PRIORITY_IDS.includes(id)
1267
+ PRIORITY_IDS.includes(id),
1266
1268
  );
1267
1269
 
1268
1270
  const nonPriorityAmenities = amenities.filter(
1269
- (id) => !PRIORITY_IDS.includes(id)
1271
+ (id) => !PRIORITY_IDS.includes(id),
1270
1272
  );
1271
1273
 
1272
1274
  const hasPriority = priorityAmenities.length > 0;
@@ -1297,7 +1299,7 @@ function ServiceItemPB({
1297
1299
  const sortedAmenities = [...amenities].sort(
1298
1300
  (a, b) =>
1299
1301
  Number(PRIORITY_IDS.includes(b)) -
1300
- Number(PRIORITY_IDS.includes(a))
1302
+ Number(PRIORITY_IDS.includes(a)),
1301
1303
  );
1302
1304
 
1303
1305
  visibleAmenities = sortedAmenities.slice(0, 3);
@@ -1350,12 +1352,12 @@ function ServiceItemPB({
1350
1352
  metaData.amenities[val]
1351
1353
  ?.split(".")[0]
1352
1354
  ?.split("_")
1353
- ?.join(" ")
1355
+ ?.join(" "),
1354
1356
  )}
1355
1357
  </div>
1356
1358
  </div>
1357
1359
  </div>
1358
- ) : null
1360
+ ) : null,
1359
1361
  )}
1360
1362
 
1361
1363
  {/* PLUS ICON */}
@@ -1407,10 +1409,10 @@ function ServiceItemPB({
1407
1409
  metaData.amenities[val]
1408
1410
  ?.split(".")[0]
1409
1411
  ?.split("_")
1410
- ?.join(" ")
1412
+ ?.join(" "),
1411
1413
  )}
1412
1414
  </div>
1413
- ) : null
1415
+ ) : null,
1414
1416
  )}
1415
1417
  </div>
1416
1418
  </div>