kupos-ui-components-lib 8.0.1 → 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.
- package/dist/components/FilterBar/FilterBarDesktop.d.ts +1 -1
- package/dist/components/FilterBar/FilterBarDesktop.js +47 -16
- package/dist/components/FilterBar/ServiceFilter.js +1 -3
- package/dist/components/FilterBar/tyoes.d.ts +0 -1
- package/dist/components/PaymentSideBar/PaymentSideBarDesktop.js +4 -28
- package/dist/components/PaymentSideBar/types.d.ts +0 -5
- package/dist/components/ServiceItem/ServiceItemDesktop.js +3 -1
- package/dist/styles.css +0 -3
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBarDesktop.tsx +48 -20
- package/src/components/FilterBar/ServiceFilter.tsx +8 -10
- package/src/components/FilterBar/mobileTypes.ts +28 -28
- package/src/components/FilterBar/tyoes.ts +37 -36
- package/src/components/PaymentSideBar/PaymentSideBarDesktop.tsx +5 -69
- package/src/components/PaymentSideBar/types.ts +0 -3
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +31 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FilterBarProps } from "./tyoes";
|
|
3
|
-
declare const FilterBarDesktop: ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, isPeru, hideOperator, setCoachLoading, setCoachKey,
|
|
3
|
+
declare const FilterBarDesktop: ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, isPeru, hideOperator, setCoachLoading, setCoachKey, }: FilterBarProps) => React.JSX.Element;
|
|
4
4
|
export default FilterBarDesktop;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import commonService from "../../utils/CommonService";
|
|
3
3
|
import ServiceFilter from "./ServiceFilter";
|
|
4
|
-
const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, isPeru, hideOperator, setCoachLoading, setCoachKey,
|
|
4
|
+
const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, isPeru, hideOperator, setCoachLoading, setCoachKey, }) => {
|
|
5
5
|
const filterBy = (filters) => {
|
|
6
6
|
try {
|
|
7
7
|
let routes = allSchedules;
|
|
@@ -135,6 +135,29 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
135
135
|
// }
|
|
136
136
|
}
|
|
137
137
|
if (isPeru) {
|
|
138
|
+
// if (fil.type == "seat_types") {
|
|
139
|
+
// let activeOptions = fil.options.filter((it) => it.active);
|
|
140
|
+
// filteredRoutes = filteredRoutes.filter((it) => {
|
|
141
|
+
// if (activeOptions && activeOptions.length) {
|
|
142
|
+
// // Check if ANY of the active filter options match ANY seat type
|
|
143
|
+
// for (let f of activeOptions) {
|
|
144
|
+
// if (f.active) {
|
|
145
|
+
// const filterValue = f.value.toLowerCase();
|
|
146
|
+
// // Check if this filter value appears in any seat type label
|
|
147
|
+
// const hasMatchingSeatType = it.seat_types.some(
|
|
148
|
+
// (bt) => bt?.label?.toLowerCase().indexOf(filterValue) > -1
|
|
149
|
+
// );
|
|
150
|
+
// if (hasMatchingSeatType) {
|
|
151
|
+
// return true;
|
|
152
|
+
// }
|
|
153
|
+
// }
|
|
154
|
+
// }
|
|
155
|
+
// return false;
|
|
156
|
+
// } else {
|
|
157
|
+
// return true;
|
|
158
|
+
// }
|
|
159
|
+
// });
|
|
160
|
+
// }
|
|
138
161
|
if (fil.type === "seat_types") {
|
|
139
162
|
const activeOptions = fil.options.filter((it) => it.active);
|
|
140
163
|
filteredRoutes = filteredRoutes.filter((route) => {
|
|
@@ -151,22 +174,30 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
151
174
|
});
|
|
152
175
|
}
|
|
153
176
|
}
|
|
154
|
-
else if (isTurbus) {
|
|
155
|
-
if (fil.type === "seat_types") {
|
|
156
|
-
const activeOptions = fil.options.filter((it) => it.active);
|
|
157
|
-
filteredRoutes = filteredRoutes.filter((route) => {
|
|
158
|
-
var _a;
|
|
159
|
-
if (!activeOptions.length)
|
|
160
|
-
return true;
|
|
161
|
-
const seatLabels = ((_a = route === null || route === void 0 ? void 0 : route.fare_str) === null || _a === void 0 ? void 0 : _a.split(",").map((item) => { var _a; return (_a = item.split(":")[0]) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase(); }).filter(Boolean)) || [];
|
|
162
|
-
return activeOptions.some((opt) => {
|
|
163
|
-
const filterValue = opt.value.trim().toLowerCase();
|
|
164
|
-
return seatLabels.includes(filterValue);
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
177
|
else {
|
|
178
|
+
// if (fil.type == "seat_types") {
|
|
179
|
+
// let activeOptions = fil.options.filter((it) => it.active);
|
|
180
|
+
// filteredRoutes = filteredRoutes.filter((it) => {
|
|
181
|
+
// if (activeOptions && activeOptions.length) {
|
|
182
|
+
// // Check if ANY of the active filter options match ANY seat type
|
|
183
|
+
// for (let f of activeOptions) {
|
|
184
|
+
// if (f.active) {
|
|
185
|
+
// const filterValue = f.value.toLowerCase();
|
|
186
|
+
// // Check if this filter value appears in any seat type label
|
|
187
|
+
// const hasMatchingSeatType = it.seat_types.some(
|
|
188
|
+
// (bt) => bt?.label?.toLowerCase().indexOf(filterValue) > -1
|
|
189
|
+
// );
|
|
190
|
+
// if (hasMatchingSeatType) {
|
|
191
|
+
// return true;
|
|
192
|
+
// }
|
|
193
|
+
// }
|
|
194
|
+
// }
|
|
195
|
+
// return false;
|
|
196
|
+
// } else {
|
|
197
|
+
// return true;
|
|
198
|
+
// }
|
|
199
|
+
// });
|
|
200
|
+
// }
|
|
170
201
|
if (fil.type === "seat_types") {
|
|
171
202
|
const activeOptions = fil.options.filter((it) => it.active);
|
|
172
203
|
filteredRoutes = filteredRoutes.filter((route) => {
|
|
@@ -151,9 +151,7 @@ class ServiceFilter extends React.Component {
|
|
|
151
151
|
this.props.t("RESULTS_PAGE." + option.title),
|
|
152
152
|
React.createElement("img", { src: this.props.icons.downArrow, alt: "downArrow", className: `${isOpen ? "rotate-180" : ""} w-[auto] h-[9px] transition-all duration-300 cursor-pointer` }))),
|
|
153
153
|
React.createElement("div", { className: ` transition-all duration-300 ease-in-out
|
|
154
|
-
${isOpen
|
|
155
|
-
? "max-h-[500px] opacity-100 translate-y-0"
|
|
156
|
-
: "max-h-0 opacity-0 -translate-y-1"}
|
|
154
|
+
${isOpen ? " opacity-100 translate-y-0" : "max-h-0 opacity-0 -translate-y-1"}
|
|
157
155
|
` }, (isOpen ||
|
|
158
156
|
(!this.props.isTrain &&
|
|
159
157
|
option.type !== "operator" &&
|
|
@@ -177,7 +177,7 @@ const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingSta
|
|
|
177
177
|
duration,
|
|
178
178
|
" horas")))))));
|
|
179
179
|
};
|
|
180
|
-
const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, conexionChecked, conexionPassengers, returnConexionFare, conexionFare, loginData, checkWhatsappEligibility, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, isAgency, agencyFee, walletMoney, virtualMoney, virtualLimit, showUsd, netFareInUsd, renderDiscount, discountAmount, walletLabel, creditosLabel, currency, customSideBarwidth, isLinatal,
|
|
180
|
+
const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, conexionChecked, conexionPassengers, returnConexionFare, conexionFare, loginData, checkWhatsappEligibility, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, isAgency, agencyFee, walletMoney, virtualMoney, virtualLimit, showUsd, netFareInUsd, renderDiscount, discountAmount, walletLabel, creditosLabel, currency, customSideBarwidth, isLinatal, }) => {
|
|
181
181
|
// REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN BOARDING STAGE
|
|
182
182
|
const depTime = droppingTimeOnward || "";
|
|
183
183
|
const returnTime = droppingTimeReturn || "";
|
|
@@ -356,9 +356,7 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
|
|
|
356
356
|
selectedOnward[1][key],
|
|
357
357
|
" "),
|
|
358
358
|
" x ",
|
|
359
|
-
val.is_pet_seat
|
|
360
|
-
? "Asiento Mascota"
|
|
361
|
-
: CommonService.capitalize(val.type)
|
|
359
|
+
val.is_pet_seat ? "Asiento Mascota" : val.type
|
|
362
360
|
// CommonService.capitalize(
|
|
363
361
|
// CommonService.getSeatName(val.type),
|
|
364
362
|
// )
|
|
@@ -380,9 +378,7 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
|
|
|
380
378
|
selectedReturn[1][key],
|
|
381
379
|
" "),
|
|
382
380
|
" x ",
|
|
383
|
-
val.is_pet_seat
|
|
384
|
-
? "Asiento Mascota"
|
|
385
|
-
: CommonService.capitalize(val.type)
|
|
381
|
+
val.is_pet_seat ? "Asiento Mascota" : val.type
|
|
386
382
|
// CommonService.capitalize(
|
|
387
383
|
// CommonService.getSeatName(val.type)
|
|
388
384
|
// )
|
|
@@ -413,33 +409,13 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
|
|
|
413
409
|
React.createElement("div", { className: "duration-mouseover font9", style: { lineHeight: "1.3" } },
|
|
414
410
|
React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.whatsappInfoIcon)))), amount: metaData.whatsapp_delivery_charges, className: "font10", customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesColor } })) : null,
|
|
415
411
|
removeDiscountAtomValue && (React.createElement(PaymentItem, { label: "Cup\u00F3n", amount: CommonService.currency(netFare, currencySign), isNegative: true, currency: "" })),
|
|
416
|
-
(
|
|
417
|
-
? selectSeatOnward.map((val, key) => {
|
|
418
|
-
var _a;
|
|
419
|
-
return (React.createElement("div", { key: key, className: "payment-seat-row flex-row font13-33 " },
|
|
420
|
-
React.createElement("div", null,
|
|
421
|
-
React.createElement("span", null, (_a = selectSeatOnward === null || selectSeatOnward === void 0 ? void 0 : selectSeatOnward.selectedSeatsToBook) === null || _a === void 0 ? void 0 : _a.length),
|
|
422
|
-
" x ",
|
|
423
|
-
"Vuelta\u00A0en\u00A0blanco:"),
|
|
424
|
-
React.createElement("div", { className: "bold-text font13-33" },
|
|
425
|
-
"CLP",
|
|
426
|
-
" ",
|
|
427
|
-
CommonService.currency(blankTicketValue === null || blankTicketValue === void 0 ? void 0 : blankTicketValue.blank_ticket_amount).split(",")[0])));
|
|
428
|
-
})
|
|
429
|
-
: null,
|
|
430
|
-
isTurbus ? (React.createElement("div", { style: { margin: "6px 0" } }, !blankTicketValue || !(blankTicketValue === null || blankTicketValue === void 0 ? void 0 : blankTicketValue.blank_ticket_amount)
|
|
431
|
-
? renderDiscount(discountAmount)
|
|
432
|
-
: null)) : (React.createElement("div", { style: { margin: "6px 0" } }, renderDiscount(discountAmount))),
|
|
433
|
-
isTurbus && (React.createElement(PaymentItem, { label: "Descuento", amount: CommonService.currency(discountAmount ? discountAmount : 0, currencySign), currency: "CLP", customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.agencyFeePriceColor } })),
|
|
412
|
+
React.createElement("div", { style: { margin: "6px 0" } }, renderDiscount(discountAmount)),
|
|
434
413
|
React.createElement(PaymentItem, { label: `${translation === null || translation === void 0 ? void 0 : translation.promotionalCode}:`, amount: CommonService.currency((promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCouponAmount) ? promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCouponAmount : 0, currencySign), className: "text-[13.33px]", currency: currency, customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.promoCodePriceColor } }),
|
|
435
414
|
(promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCouponAmount) ? (React.createElement("div", { className: "promocode font10 flex items-center gap-[5px]" },
|
|
436
415
|
React.createElement("div", null, promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCode),
|
|
437
416
|
React.createElement("span", { className: "promo-remove", onClick: onPromoRemove },
|
|
438
417
|
React.createElement("img", { src: icons === null || icons === void 0 ? void 0 : icons.closeIcon, alt: "close", className: "w-[16px] h-[16px]" })))) : null,
|
|
439
418
|
isAgency && (React.createElement(PaymentItem, { label: translation === null || translation === void 0 ? void 0 : translation.agencyFee, amount: CommonService.currency(agencyFee ? agencyFee : 0, currencySign), currency: "", customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.agencyFeePriceColor } })),
|
|
440
|
-
muvifyMoney &&
|
|
441
|
-
isTurbus &&
|
|
442
|
-
(!blankTicketValue || !(blankTicketValue === null || blankTicketValue === void 0 ? void 0 : blankTicketValue.blank_ticket_amount)) ? (React.createElement(PaymentItem, { label: walletLabel, amount: CommonService.currency(muvifyMoney, currencySign), currency: "" })) : null,
|
|
443
419
|
walletMoney ? (React.createElement(PaymentItem, { label: walletLabel, amount: CommonService.currency(walletMoney, currencySign), currency: "" })) : null,
|
|
444
420
|
virtualMoney ? (React.createElement(PaymentItem, { label: React.createElement("span", { className: "secondary-text " }, `${creditosLabel}(${virtualLimit}%)`), amount: CommonService.currency(virtualMoney, currencySign), customStyle: { color: "var(--secondary-color)" }, currency: "" })) : null,
|
|
445
421
|
showUsd ? (React.createElement(PaymentItem, { label: React.createElement("span", { className: "secondary-text" }, translation === null || translation === void 0 ? void 0 : translation.showUsd), className: "text-[13.33px]", amount: CommonService.currency(isAgency ? netFareInUsd + agencyFee : netFareInUsd, currencySign), currency: "USD", customStyle: { color: "var(--secondary-color)" } })) : null),
|
|
@@ -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
|
-
?
|
|
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/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -25,7 +25,6 @@ const FilterBarDesktop = ({
|
|
|
25
25
|
hideOperator,
|
|
26
26
|
setCoachLoading,
|
|
27
27
|
setCoachKey,
|
|
28
|
-
isTurbus,
|
|
29
28
|
}: FilterBarProps) => {
|
|
30
29
|
const filterBy = (filters) => {
|
|
31
30
|
try {
|
|
@@ -168,6 +167,30 @@ const FilterBarDesktop = ({
|
|
|
168
167
|
// }
|
|
169
168
|
}
|
|
170
169
|
if (isPeru) {
|
|
170
|
+
// if (fil.type == "seat_types") {
|
|
171
|
+
// let activeOptions = fil.options.filter((it) => it.active);
|
|
172
|
+
|
|
173
|
+
// filteredRoutes = filteredRoutes.filter((it) => {
|
|
174
|
+
// if (activeOptions && activeOptions.length) {
|
|
175
|
+
// // Check if ANY of the active filter options match ANY seat type
|
|
176
|
+
// for (let f of activeOptions) {
|
|
177
|
+
// if (f.active) {
|
|
178
|
+
// const filterValue = f.value.toLowerCase();
|
|
179
|
+
// // Check if this filter value appears in any seat type label
|
|
180
|
+
// const hasMatchingSeatType = it.seat_types.some(
|
|
181
|
+
// (bt) => bt?.label?.toLowerCase().indexOf(filterValue) > -1
|
|
182
|
+
// );
|
|
183
|
+
// if (hasMatchingSeatType) {
|
|
184
|
+
// return true;
|
|
185
|
+
// }
|
|
186
|
+
// }
|
|
187
|
+
// }
|
|
188
|
+
// return false;
|
|
189
|
+
// } else {
|
|
190
|
+
// return true;
|
|
191
|
+
// }
|
|
192
|
+
// });
|
|
193
|
+
// }
|
|
171
194
|
if (fil.type === "seat_types") {
|
|
172
195
|
const activeOptions = fil.options.filter((it) => it.active);
|
|
173
196
|
|
|
@@ -184,26 +207,31 @@ const FilterBarDesktop = ({
|
|
|
184
207
|
});
|
|
185
208
|
});
|
|
186
209
|
}
|
|
187
|
-
} else if (isTurbus) {
|
|
188
|
-
if (fil.type === "seat_types") {
|
|
189
|
-
const activeOptions = fil.options.filter((it) => it.active);
|
|
190
|
-
|
|
191
|
-
filteredRoutes = filteredRoutes.filter((route) => {
|
|
192
|
-
if (!activeOptions.length) return true;
|
|
193
|
-
|
|
194
|
-
const seatLabels =
|
|
195
|
-
route?.fare_str
|
|
196
|
-
?.split(",")
|
|
197
|
-
.map((item) => item.split(":")[0]?.trim().toLowerCase())
|
|
198
|
-
.filter(Boolean) || [];
|
|
199
|
-
|
|
200
|
-
return activeOptions.some((opt) => {
|
|
201
|
-
const filterValue = opt.value.trim().toLowerCase();
|
|
202
|
-
return seatLabels.includes(filterValue);
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
210
|
} else {
|
|
211
|
+
// if (fil.type == "seat_types") {
|
|
212
|
+
// let activeOptions = fil.options.filter((it) => it.active);
|
|
213
|
+
|
|
214
|
+
// filteredRoutes = filteredRoutes.filter((it) => {
|
|
215
|
+
// if (activeOptions && activeOptions.length) {
|
|
216
|
+
// // Check if ANY of the active filter options match ANY seat type
|
|
217
|
+
// for (let f of activeOptions) {
|
|
218
|
+
// if (f.active) {
|
|
219
|
+
// const filterValue = f.value.toLowerCase();
|
|
220
|
+
// // Check if this filter value appears in any seat type label
|
|
221
|
+
// const hasMatchingSeatType = it.seat_types.some(
|
|
222
|
+
// (bt) => bt?.label?.toLowerCase().indexOf(filterValue) > -1
|
|
223
|
+
// );
|
|
224
|
+
// if (hasMatchingSeatType) {
|
|
225
|
+
// return true;
|
|
226
|
+
// }
|
|
227
|
+
// }
|
|
228
|
+
// }
|
|
229
|
+
// return false;
|
|
230
|
+
// } else {
|
|
231
|
+
// return true;
|
|
232
|
+
// }
|
|
233
|
+
// });
|
|
234
|
+
// }
|
|
207
235
|
if (fil.type === "seat_types") {
|
|
208
236
|
const activeOptions = fil.options.filter((it) => it.active);
|
|
209
237
|
|
|
@@ -96,11 +96,11 @@ class ServiceFilter extends React.Component<
|
|
|
96
96
|
(opt: any, optIndex: number) => ({
|
|
97
97
|
...opt,
|
|
98
98
|
originalOptionIndex: optIndex,
|
|
99
|
-
})
|
|
99
|
+
}),
|
|
100
100
|
);
|
|
101
101
|
let newSeatOrder = [...optionsWithOriginalIndex].sort(
|
|
102
102
|
(a: any, b: any) =>
|
|
103
|
-
SEAT_ORDER.indexOf(a.label) - SEAT_ORDER.indexOf(b.label)
|
|
103
|
+
SEAT_ORDER.indexOf(a.label) - SEAT_ORDER.indexOf(b.label),
|
|
104
104
|
);
|
|
105
105
|
newArr.push({ ...val, options: newSeatOrder, originalIndex });
|
|
106
106
|
} else {
|
|
@@ -238,9 +238,7 @@ class ServiceFilter extends React.Component<
|
|
|
238
238
|
<div
|
|
239
239
|
className={` transition-all duration-300 ease-in-out
|
|
240
240
|
${
|
|
241
|
-
isOpen
|
|
242
|
-
? "max-h-[500px] opacity-100 translate-y-0"
|
|
243
|
-
: "max-h-0 opacity-0 -translate-y-1"
|
|
241
|
+
isOpen ? " opacity-100 translate-y-0" : "max-h-0 opacity-0 -translate-y-1"
|
|
244
242
|
}
|
|
245
243
|
`}
|
|
246
244
|
>
|
|
@@ -300,8 +298,8 @@ class ServiceFilter extends React.Component<
|
|
|
300
298
|
label = val.trText
|
|
301
299
|
? val.trText
|
|
302
300
|
: val.spText
|
|
303
|
-
|
|
304
|
-
|
|
301
|
+
? val.spText
|
|
302
|
+
: val.label;
|
|
305
303
|
}
|
|
306
304
|
|
|
307
305
|
return (
|
|
@@ -311,7 +309,7 @@ class ServiceFilter extends React.Component<
|
|
|
311
309
|
onClick(
|
|
312
310
|
val.originalOptionIndex !== undefined
|
|
313
311
|
? val.originalOptionIndex
|
|
314
|
-
: i
|
|
312
|
+
: i,
|
|
315
313
|
)
|
|
316
314
|
}
|
|
317
315
|
style={{
|
|
@@ -373,9 +371,9 @@ class ServiceFilter extends React.Component<
|
|
|
373
371
|
? this.renderFilterItem(
|
|
374
372
|
val,
|
|
375
373
|
(i) => onFilterSelected(val.originalIndex, i),
|
|
376
|
-
key
|
|
374
|
+
key,
|
|
377
375
|
)
|
|
378
|
-
: null
|
|
376
|
+
: null,
|
|
379
377
|
)}
|
|
380
378
|
</div>
|
|
381
379
|
</div>
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
export interface MobileFilterBarProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
typeOfComponent: string;
|
|
3
|
+
variant: string;
|
|
4
|
+
tripStep: number;
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
setIsOpen: (value: boolean) => void;
|
|
7
|
+
icons:{
|
|
8
|
+
crossIcon: string;
|
|
9
|
+
checkBoxIcon: string;
|
|
10
|
+
}
|
|
11
|
+
colors: {
|
|
12
|
+
kuposButtonColor?: string;
|
|
13
|
+
buttonTextColor?: string;
|
|
14
|
+
}
|
|
15
|
+
busTerminals: any;
|
|
16
|
+
myFilters: any;
|
|
17
|
+
setMyFilters: any;
|
|
18
|
+
serviceListReturn: any;
|
|
19
|
+
onwardMaster: any;
|
|
20
|
+
setOnwardMaster: any;
|
|
21
|
+
returnMaster: any;
|
|
22
|
+
setReturnMaster: any;
|
|
23
|
+
setActiveSortTab: any;
|
|
24
|
+
serviceListOnward: any;
|
|
25
|
+
setServiceListReturnFiltered: any;
|
|
26
|
+
blankTicket?: boolean
|
|
27
|
+
setServiceListOnwardFiltered: any;
|
|
28
|
+
setFiltersSelectedOnward: any;
|
|
29
|
+
setFiltersSelectedReturn: any;
|
|
30
30
|
}
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
export interface FilterBarProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
2
|
+
variant?: "mobile" | "desktop";
|
|
3
|
+
t?: (key: string) => string;
|
|
4
|
+
serviceList?: any;
|
|
5
|
+
setServiceList?: any;
|
|
6
|
+
allSchedules?: any;
|
|
7
|
+
showReturnTripModal?: boolean;
|
|
8
|
+
filterArrData?: any;
|
|
9
|
+
isBlankTicket?: boolean;
|
|
10
|
+
operatorId?: any;
|
|
11
|
+
filtersArray?: any;
|
|
12
|
+
setFiltersArray?: any;
|
|
13
|
+
metaData?: any;
|
|
14
|
+
busTerminals?: any;
|
|
15
|
+
setTypes?: any;
|
|
16
|
+
hideOperator?: boolean;
|
|
17
|
+
colors: {
|
|
18
|
+
selectedColor?: string;
|
|
19
|
+
selectedTextColor?: string;
|
|
20
|
+
|
|
21
|
+
};
|
|
22
|
+
icons?: {
|
|
23
|
+
iconSunrise?: string;
|
|
24
|
+
iconSunriseOrange?: string;
|
|
25
|
+
iconMorning?: string;
|
|
26
|
+
iconMorningOrange?: string;
|
|
27
|
+
iconSunset?: string;
|
|
28
|
+
iconSunsetOrange?: string;
|
|
29
|
+
iconNight?: string;
|
|
30
|
+
iconNightOrange?: string;
|
|
31
|
+
};
|
|
32
|
+
translation?: { [key: string]: string };
|
|
33
|
+
isTrain?: boolean;
|
|
34
|
+
isPeru?: boolean;
|
|
35
|
+
setCoachLoading?: any;
|
|
36
|
+
setCoachKey?: any;
|
|
37
|
+
|
|
38
|
+
}
|
|
@@ -332,9 +332,6 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
|
|
|
332
332
|
currency,
|
|
333
333
|
customSideBarwidth,
|
|
334
334
|
isLinatal,
|
|
335
|
-
blankTicketValue,
|
|
336
|
-
isTurbus,
|
|
337
|
-
muvifyMoney,
|
|
338
335
|
}) => {
|
|
339
336
|
// REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN BOARDING STAGE
|
|
340
337
|
const depTime = droppingTimeOnward || "";
|
|
@@ -579,9 +576,7 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
|
|
|
579
576
|
<span>{selectedOnward[1][key]} </span>
|
|
580
577
|
{" x "}
|
|
581
578
|
{
|
|
582
|
-
val.is_pet_seat
|
|
583
|
-
? "Asiento Mascota"
|
|
584
|
-
: CommonService.capitalize(val.type)
|
|
579
|
+
val.is_pet_seat ? "Asiento Mascota" : val.type
|
|
585
580
|
// CommonService.capitalize(
|
|
586
581
|
// CommonService.getSeatName(val.type),
|
|
587
582
|
// )
|
|
@@ -615,9 +610,7 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
|
|
|
615
610
|
<span>{selectedReturn[1][key]} </span>
|
|
616
611
|
{" x "}
|
|
617
612
|
{
|
|
618
|
-
val.is_pet_seat
|
|
619
|
-
? "Asiento Mascota"
|
|
620
|
-
: CommonService.capitalize(val.type)
|
|
613
|
+
val.is_pet_seat ? "Asiento Mascota" : val.type
|
|
621
614
|
// CommonService.capitalize(
|
|
622
615
|
// CommonService.getSeatName(val.type)
|
|
623
616
|
// )
|
|
@@ -700,56 +693,9 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
|
|
|
700
693
|
/>
|
|
701
694
|
)}
|
|
702
695
|
|
|
703
|
-
{
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
<div
|
|
707
|
-
key={key}
|
|
708
|
-
className="payment-seat-row flex-row font13-33 "
|
|
709
|
-
>
|
|
710
|
-
<div>
|
|
711
|
-
<span>
|
|
712
|
-
{selectSeatOnward?.selectedSeatsToBook?.length}
|
|
713
|
-
</span>
|
|
714
|
-
{" x "}
|
|
715
|
-
Vuelta en blanco:
|
|
716
|
-
</div>
|
|
717
|
-
<div className="bold-text font13-33">
|
|
718
|
-
CLP{" "}
|
|
719
|
-
{
|
|
720
|
-
CommonService.currency(
|
|
721
|
-
blankTicketValue?.blank_ticket_amount
|
|
722
|
-
).split(",")[0]
|
|
723
|
-
}
|
|
724
|
-
</div>
|
|
725
|
-
</div>
|
|
726
|
-
);
|
|
727
|
-
})
|
|
728
|
-
: null}
|
|
729
|
-
|
|
730
|
-
{isTurbus ? (
|
|
731
|
-
<div style={{ margin: "6px 0" }}>
|
|
732
|
-
{!blankTicketValue || !blankTicketValue?.blank_ticket_amount
|
|
733
|
-
? renderDiscount(discountAmount)
|
|
734
|
-
: null}
|
|
735
|
-
</div>
|
|
736
|
-
) : (
|
|
737
|
-
<div style={{ margin: "6px 0" }}>
|
|
738
|
-
{renderDiscount(discountAmount)}
|
|
739
|
-
</div>
|
|
740
|
-
)}
|
|
741
|
-
|
|
742
|
-
{isTurbus && (
|
|
743
|
-
<PaymentItem
|
|
744
|
-
label={"Descuento"}
|
|
745
|
-
amount={CommonService.currency(
|
|
746
|
-
discountAmount ? discountAmount : 0,
|
|
747
|
-
currencySign
|
|
748
|
-
)}
|
|
749
|
-
currency="CLP"
|
|
750
|
-
customStyle={{ color: colors?.agencyFeePriceColor }}
|
|
751
|
-
/>
|
|
752
|
-
)}
|
|
696
|
+
<div style={{ margin: "6px 0" }}>
|
|
697
|
+
{renderDiscount(discountAmount)}
|
|
698
|
+
</div>
|
|
753
699
|
|
|
754
700
|
<PaymentItem
|
|
755
701
|
label={`${translation?.promotionalCode}:`}
|
|
@@ -786,16 +732,6 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
|
|
|
786
732
|
/>
|
|
787
733
|
)}
|
|
788
734
|
|
|
789
|
-
{muvifyMoney &&
|
|
790
|
-
isTurbus &&
|
|
791
|
-
(!blankTicketValue || !blankTicketValue?.blank_ticket_amount) ? (
|
|
792
|
-
<PaymentItem
|
|
793
|
-
label={walletLabel}
|
|
794
|
-
amount={CommonService.currency(muvifyMoney, currencySign)}
|
|
795
|
-
currency=""
|
|
796
|
-
/>
|
|
797
|
-
) : null}
|
|
798
|
-
|
|
799
735
|
{walletMoney ? (
|
|
800
736
|
<PaymentItem
|
|
801
737
|
label={walletLabel}
|
|
@@ -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
|
-
?
|
|
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
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
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
|
-
|
|
966
|
-
|
|
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>
|