kupos-ui-components-lib 3.0.2 → 3.0.4

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.
@@ -393,76 +393,180 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
393
393
  let activeOptions = fil.options.filter((it) => it.active);
394
394
  // if (activeOptions && activeOptions.length > 0) {
395
395
  filteredRoutes = filteredRoutes.filter((it) => {
396
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
396
397
  if (activeOptions && activeOptions.length)
397
398
  for (let f of activeOptions) {
399
+ console.log("🚀 ~ filterBy ~ f:", f);
398
400
  if (f.active) {
399
- if (f.value.toLowerCase().indexOf("semi") > -1) {
400
- for (let bt of it.fare_str.split(",")) {
401
- if (bt.toLowerCase().split(":")[0].indexOf("semi") > -1) {
401
+ if (f.value.toLowerCase().indexOf("salon cama low") > -1) {
402
+ for (let bt of it.seat_types) {
403
+ if (((_a = bt === null || bt === void 0 ? void 0 : bt.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().indexOf("salon cama low")) >
404
+ -1) {
402
405
  return true;
403
406
  }
404
407
  }
405
408
  }
406
- else if (f.value.toLowerCase().indexOf("salon") > -1) {
407
- for (let bt of it.fare_str.split(",")) {
408
- if (bt.toLowerCase().split(":")[0].indexOf("salon") > -1) {
409
+ else if (f.value.toLowerCase().indexOf("salón cama low") > -1) {
410
+ for (let bt of it.seat_types) {
411
+ if (((_b = bt === null || bt === void 0 ? void 0 : bt.label) === null || _b === void 0 ? void 0 : _b.toLowerCase().indexOf("salón cama low")) >
412
+ -1) {
409
413
  return true;
410
414
  }
411
415
  }
412
416
  }
413
- else if (f.value.toLowerCase().indexOf("ejecutivo") > -1) {
414
- for (let bt of it.fare_str.split(",")) {
415
- if (bt.toLowerCase().split(":")[0].indexOf("ejecutivo") >
417
+ else if (f.value.toLowerCase().indexOf("semi cama low") > -1) {
418
+ for (let bt of it.seat_types) {
419
+ if (((_c = bt === null || bt === void 0 ? void 0 : bt.label) === null || _c === void 0 ? void 0 : _c.toLowerCase().indexOf("semi cama low")) > -1) {
420
+ return true;
421
+ }
422
+ }
423
+ }
424
+ else if (f.value.toLowerCase().indexOf("cama premium (i)") > -1) {
425
+ for (let bt of it.seat_types) {
426
+ if (((_d = bt === null || bt === void 0 ? void 0 : bt.label) === null || _d === void 0 ? void 0 : _d.toLowerCase().indexOf("cama premium (i)")) >
416
427
  -1) {
417
428
  return true;
418
429
  }
419
430
  }
420
431
  }
432
+ else if (f.value.toLowerCase().indexOf("ejecutivo") > -1) {
433
+ // for (let bt of it.fare_str.split(",")) {
434
+ // if (
435
+ // bt.toLowerCase().split(":")[0].indexOf("ejecutivo") > -1
436
+ // ) {
437
+ // return true;
438
+ // }
439
+ // }
440
+ for (let bt of it.seat_types) {
441
+ if (((_e = bt === null || bt === void 0 ? void 0 : bt.label) === null || _e === void 0 ? void 0 : _e.toLowerCase().indexOf("ejecutivo")) > -1) {
442
+ return true;
443
+ }
444
+ }
445
+ }
446
+ else if (f.value.toLowerCase().indexOf("semi") > -1) {
447
+ // for (let bt of it.fare_str.split(",")) {
448
+ // if (bt.toLowerCase().split(":")[0].indexOf("semi") > -1) {
449
+ // return true;
450
+ // }
451
+ // }
452
+ for (let bt of it.seat_types) {
453
+ if (((_f = bt === null || bt === void 0 ? void 0 : bt.label) === null || _f === void 0 ? void 0 : _f.toLowerCase().indexOf("semi")) > -1) {
454
+ return true;
455
+ }
456
+ }
457
+ }
458
+ else if (f.value.toLowerCase().indexOf("salon") > -1) {
459
+ // for (let bt of it.fare_str.split(",")) {
460
+ // if (
461
+ // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
462
+ // ) {
463
+ // return true;
464
+ // }
465
+ // }
466
+ for (let bt of it.seat_types) {
467
+ if (((_g = bt === null || bt === void 0 ? void 0 : bt.label) === null || _g === void 0 ? void 0 : _g.toLowerCase().indexOf("salon")) > -1) {
468
+ return true;
469
+ }
470
+ }
471
+ }
472
+ else if (f.value.toLowerCase().indexOf("salón") > -1) {
473
+ // for (let bt of it.fare_str.split(",")) {
474
+ // if (
475
+ // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
476
+ // ) {
477
+ // return true;
478
+ // }
479
+ // }
480
+ for (let bt of it.seat_types) {
481
+ if (((_h = bt === null || bt === void 0 ? void 0 : bt.label) === null || _h === void 0 ? void 0 : _h.toLowerCase().indexOf("salón")) > -1) {
482
+ return true;
483
+ }
484
+ }
485
+ }
421
486
  else if (f.value.toLowerCase().indexOf("suite") > -1) {
422
- for (let bt of it.fare_str.split(",")) {
423
- if (bt.toLowerCase().split(":")[0].indexOf("suite") > -1) {
487
+ // for (let bt of it.fare_str.split(",")) {
488
+ // if (
489
+ // bt.toLowerCase().split(":")[0].indexOf("suite") > -1
490
+ // ) {
491
+ // return true;
492
+ // }
493
+ // }
494
+ for (let bt of it.seat_types) {
495
+ if (((_j = bt === null || bt === void 0 ? void 0 : bt.label) === null || _j === void 0 ? void 0 : _j.toLowerCase().indexOf("suite")) > -1) {
424
496
  return true;
425
497
  }
426
498
  }
427
499
  }
428
500
  else if (f.value.toLowerCase().indexOf("premium") > -1) {
429
- for (let bt of it.fare_str.split(",")) {
430
- if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
501
+ // for (let bt of it.fare_str.split(",")) {
502
+ // if (bt.toLowerCase().split(":")[0].indexOf("premium") > -1) {
503
+ // return true;
504
+ // }
505
+ // }
506
+ for (let bt of it.seat_types) {
507
+ if (((_k = bt === null || bt === void 0 ? void 0 : bt.label) === null || _k === void 0 ? void 0 : _k.toLowerCase().indexOf("premium")) > -1) {
431
508
  return true;
432
509
  }
433
510
  }
434
511
  }
435
512
  else if (f.value.toLowerCase().indexOf("vip") > -1) {
436
- for (let bt of it.fare_str.split(",")) {
437
- if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
513
+ // for (let bt of it.fare_str.split(",")) {
514
+ // if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
515
+ // return true;
516
+ // }
517
+ // }
518
+ for (let bt of it.seat_types) {
519
+ if (((_l = bt === null || bt === void 0 ? void 0 : bt.label) === null || _l === void 0 ? void 0 : _l.toLowerCase().indexOf("vip")) > -1) {
438
520
  return true;
439
521
  }
440
522
  }
441
523
  }
442
524
  else if (f.value.toLowerCase() == "cama") {
443
- for (let bt of it.fare_str.split(",")) {
444
- if (bt.toLowerCase().split(":")[0] == "cama") {
525
+ // for (let bt of it.fare_str.split(",")) {
526
+ // if (bt.toLowerCase().split(":")[0] == "cama") {
527
+ // return true;
528
+ // }
529
+ // }
530
+ for (let bt of it.seat_types) {
531
+ if (((_m = bt === null || bt === void 0 ? void 0 : bt.label) === null || _m === void 0 ? void 0 : _m.toLowerCase().indexOf("cama")) > -1) {
445
532
  return true;
446
533
  }
447
534
  }
448
535
  }
449
536
  else if (f.value.toLowerCase() == "preferente") {
450
- for (let bt of it.fare_str.split(",")) {
451
- if (bt.toLowerCase().split(":")[0] == "preferente") {
537
+ // for (let bt of it.fare_str.split(",")) {
538
+ // if (bt.toLowerCase().split(":")[0] == "preferente") {
539
+ // return true;
540
+ // }
541
+ // }
542
+ for (let bt of it.seat_types) {
543
+ if (((_o = bt === null || bt === void 0 ? void 0 : bt.label) === null || _o === void 0 ? void 0 : _o.toLowerCase().indexOf("preferente")) > -1) {
452
544
  return true;
453
545
  }
454
546
  }
455
547
  }
456
548
  else if (f.value.toLowerCase().indexOf("vent") > -1) {
457
- for (let bt of it.fare_str.split(",")) {
458
- if (bt.toLowerCase().split(":")[0].indexOf("vent") > -1) {
549
+ // for (let bt of it.fare_str.split(",")) {
550
+ // if (bt.toLowerCase().split(":")[0].indexOf("vent") > -1) {
551
+ // return true;
552
+ // }
553
+ // }
554
+ for (let bt of it.seat_types) {
555
+ if (((_p = bt === null || bt === void 0 ? void 0 : bt.label) === null || _p === void 0 ? void 0 : _p.toLowerCase().indexOf("vent")) > -1) {
459
556
  return true;
460
557
  }
461
558
  }
462
559
  }
463
560
  else if (f.value.toLowerCase().indexOf("clasico") > -1) {
464
- for (let bt of it.fare_str.split(",")) {
465
- if (bt.toLowerCase().split(":")[0].indexOf("clasico") > -1) {
561
+ // for (let bt of it.fare_str.split(",")) {
562
+ // if (
563
+ // bt.toLowerCase().split(":")[0].indexOf("clasico") > -1
564
+ // ) {
565
+ // return true;
566
+ // }
567
+ // }
568
+ for (let bt of it.seat_types) {
569
+ if (((_q = bt === null || bt === void 0 ? void 0 : bt.label) === null || _q === void 0 ? void 0 : _q.toLowerCase().indexOf("clasico")) > -1) {
466
570
  return true;
467
571
  }
468
572
  }
@@ -454,7 +454,9 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
454
454
  React.createElement(LottiePlayer, { animationData: serviceItem.icons.promoAnim, width: "18px", height: "18px" }),
455
455
  React.createElement("span", { className: "ml-[10px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text))),
456
456
  React.createElement("div", { className: "absolute -top-[13px] left-0 w-full flex items-center justify-end gap-[12px] pr-[15px] z-10 " },
457
- showTopLabel && (React.createElement("div", { className: `flex items-center gap-[10px] py-[5px] px-[14px] rounded-[38px] text-[13.33px] z-20`, style: { backgroundColor: !isSoldOut && colors.ratingBottomColor } },
457
+ showTopLabel && (React.createElement("div", { className: `flex items-center gap-[10px] py-[5px] px-[14px] rounded-[38px] text-[13.33px] z-20`, style: {
458
+ backgroundColor: isSoldOut ? "#ddd" : colors.ratingBottomColor,
459
+ } },
458
460
  React.createElement("div", { className: isSoldOut ? "grayscale" : "" },
459
461
  React.createElement(LottiePlayer, { animationData: serviceItem.icons.priorityStageAnim, width: "16px", height: "16px" })),
460
462
  React.createElement("div", { className: isSoldOut ? "text-white" : `text-[${colors.topLabelColor}]` }, showTopLabel))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -454,83 +454,192 @@ const FilterBarDesktop = ({
454
454
  filteredRoutes = filteredRoutes.filter((it) => {
455
455
  if (activeOptions && activeOptions.length)
456
456
  for (let f of activeOptions) {
457
+ console.log("🚀 ~ filterBy ~ f:", f);
457
458
  if (f.active) {
458
- if (f.value.toLowerCase().indexOf("semi") > -1) {
459
- for (let bt of it.fare_str.split(",")) {
459
+ if (f.value.toLowerCase().indexOf("salon cama low") > -1) {
460
+ for (let bt of it.seat_types) {
460
461
  if (
461
- bt.toLowerCase().split(":")[0].indexOf("semi") > -1
462
+ bt?.label?.toLowerCase().indexOf("salon cama low") >
463
+ -1
462
464
  ) {
463
465
  return true;
464
466
  }
465
467
  }
466
- } else if (f.value.toLowerCase().indexOf("salon") > -1) {
467
- for (let bt of it.fare_str.split(",")) {
468
+ } else if (
469
+ f.value.toLowerCase().indexOf("salón cama low") > -1
470
+ ) {
471
+ for (let bt of it.seat_types) {
468
472
  if (
469
- bt.toLowerCase().split(":")[0].indexOf("salon") > -1
473
+ bt?.label?.toLowerCase().indexOf("salón cama low") >
474
+ -1
470
475
  ) {
471
476
  return true;
472
477
  }
473
478
  }
474
479
  } else if (
475
- f.value.toLowerCase().indexOf("ejecutivo") > -1
480
+ f.value.toLowerCase().indexOf("semi cama low") > -1
476
481
  ) {
477
- for (let bt of it.fare_str.split(",")) {
482
+ for (let bt of it.seat_types) {
478
483
  if (
479
- bt.toLowerCase().split(":")[0].indexOf("ejecutivo") >
480
- -1
484
+ bt?.label?.toLowerCase().indexOf("semi cama low") > -1
481
485
  ) {
482
486
  return true;
483
487
  }
484
488
  }
485
- } else if (f.value.toLowerCase().indexOf("suite") > -1) {
486
- for (let bt of it.fare_str.split(",")) {
489
+ } else if (
490
+ f.value.toLowerCase().indexOf("cama premium (i)") > -1
491
+ ) {
492
+ for (let bt of it.seat_types) {
487
493
  if (
488
- bt.toLowerCase().split(":")[0].indexOf("suite") > -1
494
+ bt?.label?.toLowerCase().indexOf("cama premium (i)") >
495
+ -1
489
496
  ) {
490
497
  return true;
491
498
  }
492
499
  }
493
- } else if (f.value.toLowerCase().indexOf("premium") > -1) {
494
- for (let bt of it.fare_str.split(",")) {
500
+ } else if (
501
+ f.value.toLowerCase().indexOf("ejecutivo") > -1
502
+ ) {
503
+ // for (let bt of it.fare_str.split(",")) {
504
+ // if (
505
+ // bt.toLowerCase().split(":")[0].indexOf("ejecutivo") > -1
506
+ // ) {
507
+ // return true;
508
+ // }
509
+ // }
510
+ for (let bt of it.seat_types) {
495
511
  if (
496
- bt.toLowerCase().split(":")[0].indexOf("vip") > -1
512
+ bt?.label?.toLowerCase().indexOf("ejecutivo") > -1
497
513
  ) {
498
514
  return true;
499
515
  }
500
516
  }
517
+ } else if (f.value.toLowerCase().indexOf("semi") > -1) {
518
+ // for (let bt of it.fare_str.split(",")) {
519
+ // if (bt.toLowerCase().split(":")[0].indexOf("semi") > -1) {
520
+ // return true;
521
+ // }
522
+ // }
523
+ for (let bt of it.seat_types) {
524
+ if (bt?.label?.toLowerCase().indexOf("semi") > -1) {
525
+ return true;
526
+ }
527
+ }
528
+ } else if (f.value.toLowerCase().indexOf("salon") > -1) {
529
+ // for (let bt of it.fare_str.split(",")) {
530
+ // if (
531
+ // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
532
+ // ) {
533
+ // return true;
534
+ // }
535
+ // }
536
+
537
+ for (let bt of it.seat_types) {
538
+ if (bt?.label?.toLowerCase().indexOf("salon") > -1) {
539
+ return true;
540
+ }
541
+ }
542
+ } else if (f.value.toLowerCase().indexOf("salón") > -1) {
543
+ // for (let bt of it.fare_str.split(",")) {
544
+ // if (
545
+ // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
546
+ // ) {
547
+ // return true;
548
+ // }
549
+ // }
550
+
551
+ for (let bt of it.seat_types) {
552
+ if (bt?.label?.toLowerCase().indexOf("salón") > -1) {
553
+ return true;
554
+ }
555
+ }
556
+ } else if (f.value.toLowerCase().indexOf("suite") > -1) {
557
+ // for (let bt of it.fare_str.split(",")) {
558
+ // if (
559
+ // bt.toLowerCase().split(":")[0].indexOf("suite") > -1
560
+ // ) {
561
+ // return true;
562
+ // }
563
+ // }
564
+
565
+ for (let bt of it.seat_types) {
566
+ if (bt?.label?.toLowerCase().indexOf("suite") > -1) {
567
+ return true;
568
+ }
569
+ }
570
+ } else if (f.value.toLowerCase().indexOf("premium") > -1) {
571
+ // for (let bt of it.fare_str.split(",")) {
572
+ // if (bt.toLowerCase().split(":")[0].indexOf("premium") > -1) {
573
+ // return true;
574
+ // }
575
+ // }
576
+
577
+ for (let bt of it.seat_types) {
578
+ if (bt?.label?.toLowerCase().indexOf("premium") > -1) {
579
+ return true;
580
+ }
581
+ }
501
582
  } else if (f.value.toLowerCase().indexOf("vip") > -1) {
502
- for (let bt of it.fare_str.split(",")) {
503
- if (
504
- bt.toLowerCase().split(":")[0].indexOf("vip") > -1
505
- ) {
583
+ // for (let bt of it.fare_str.split(",")) {
584
+ // if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
585
+ // return true;
586
+ // }
587
+ // }
588
+
589
+ for (let bt of it.seat_types) {
590
+ if (bt?.label?.toLowerCase().indexOf("vip") > -1) {
506
591
  return true;
507
592
  }
508
593
  }
509
594
  } else if (f.value.toLowerCase() == "cama") {
510
- for (let bt of it.fare_str.split(",")) {
511
- if (bt.toLowerCase().split(":")[0] == "cama") {
595
+ // for (let bt of it.fare_str.split(",")) {
596
+ // if (bt.toLowerCase().split(":")[0] == "cama") {
597
+ // return true;
598
+ // }
599
+ // }
600
+
601
+ for (let bt of it.seat_types) {
602
+ if (bt?.label?.toLowerCase().indexOf("cama") > -1) {
512
603
  return true;
513
604
  }
514
605
  }
515
606
  } else if (f.value.toLowerCase() == "preferente") {
516
- for (let bt of it.fare_str.split(",")) {
517
- if (bt.toLowerCase().split(":")[0] == "preferente") {
607
+ // for (let bt of it.fare_str.split(",")) {
608
+ // if (bt.toLowerCase().split(":")[0] == "preferente") {
609
+ // return true;
610
+ // }
611
+ // }
612
+
613
+ for (let bt of it.seat_types) {
614
+ if (
615
+ bt?.label?.toLowerCase().indexOf("preferente") > -1
616
+ ) {
518
617
  return true;
519
618
  }
520
619
  }
521
620
  } else if (f.value.toLowerCase().indexOf("vent") > -1) {
522
- for (let bt of it.fare_str.split(",")) {
523
- if (
524
- bt.toLowerCase().split(":")[0].indexOf("vent") > -1
525
- ) {
621
+ // for (let bt of it.fare_str.split(",")) {
622
+ // if (bt.toLowerCase().split(":")[0].indexOf("vent") > -1) {
623
+ // return true;
624
+ // }
625
+ // }
626
+
627
+ for (let bt of it.seat_types) {
628
+ if (bt?.label?.toLowerCase().indexOf("vent") > -1) {
526
629
  return true;
527
630
  }
528
631
  }
529
632
  } else if (f.value.toLowerCase().indexOf("clasico") > -1) {
530
- for (let bt of it.fare_str.split(",")) {
531
- if (
532
- bt.toLowerCase().split(":")[0].indexOf("clasico") > -1
533
- ) {
633
+ // for (let bt of it.fare_str.split(",")) {
634
+ // if (
635
+ // bt.toLowerCase().split(":")[0].indexOf("clasico") > -1
636
+ // ) {
637
+ // return true;
638
+ // }
639
+ // }
640
+
641
+ for (let bt of it.seat_types) {
642
+ if (bt?.label?.toLowerCase().indexOf("clasico") > -1) {
534
643
  return true;
535
644
  }
536
645
  }
@@ -988,7 +988,9 @@ function ServiceItemPB({
988
988
  {showTopLabel && (
989
989
  <div
990
990
  className={`flex items-center gap-[10px] py-[5px] px-[14px] rounded-[38px] text-[13.33px] z-20`}
991
- style={{ backgroundColor: !isSoldOut && colors.ratingBottomColor }}
991
+ style={{
992
+ backgroundColor: isSoldOut ? "#ddd" : colors.ratingBottomColor,
993
+ }}
992
994
  >
993
995
  <div className={isSoldOut ? "grayscale" : ""}>
994
996
  <LottiePlayer