kupos-ui-components-lib 4.0.5 → 4.0.7
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.js +5 -7
- package/dist/components/FilterBar/ServiceFilter.js +5 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +18 -4
- package/dist/components/ServiceItem/ServiceItemMobile.js +10 -1
- package/dist/components/ServiceItem/mobileTypes.d.ts +3 -0
- package/dist/components/ServiceItem/types.d.ts +3 -0
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBarDesktop.tsx +7 -7
- package/src/components/FilterBar/ServiceFilter.tsx +4 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +17 -3
- package/src/components/ServiceItem/ServiceItemMobile.tsx +9 -0
- package/src/components/ServiceItem/mobileTypes.ts +3 -0
- package/src/components/ServiceItem/types.ts +4 -1
|
@@ -455,13 +455,11 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
else if (f.value.toLowerCase().indexOf("salon") > -1) {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
// }
|
|
464
|
-
// }
|
|
458
|
+
for (let bt of it.fare_str.split(",")) {
|
|
459
|
+
if (bt.toLowerCase().split(":")[0].indexOf("salon") > -1) {
|
|
460
|
+
return true;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
465
463
|
for (let bt of it.seat_types) {
|
|
466
464
|
if (((_g = bt === null || bt === void 0 ? void 0 : bt.label) === null || _g === void 0 ? void 0 : _g.toLowerCase().indexOf("salon")) > -1) {
|
|
467
465
|
return true;
|
|
@@ -133,7 +133,8 @@ class ServiceFilter extends React.Component {
|
|
|
133
133
|
option.type !== "seat_types" &&
|
|
134
134
|
option.type !== "tipo" &&
|
|
135
135
|
option.type !== "special_departure" &&
|
|
136
|
-
option.type !== "train_type"
|
|
136
|
+
option.type !== "train_type" &&
|
|
137
|
+
option.type !== "amenities")) &&
|
|
137
138
|
option.options.map((val, i) => {
|
|
138
139
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
139
140
|
let iconKey = "";
|
|
@@ -188,6 +189,9 @@ class ServiceFilter extends React.Component {
|
|
|
188
189
|
else if (val.label === "PET_FRIENDLY") {
|
|
189
190
|
label = (_h = this.props.translation) === null || _h === void 0 ? void 0 : _h.petFriendly;
|
|
190
191
|
}
|
|
192
|
+
else if (val.label === "cortina divisoria") {
|
|
193
|
+
label = "Cortina divisoria";
|
|
194
|
+
}
|
|
191
195
|
else {
|
|
192
196
|
// Use translation if available, otherwise use the label
|
|
193
197
|
label = val.trText
|
|
@@ -8,9 +8,9 @@ import LottiePlayer from "../../assets/LottiePlayer";
|
|
|
8
8
|
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
9
9
|
function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, originIconStyle, t = (key) => key, }) {
|
|
10
10
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
11
|
-
console.log("🚀 ~ ServiceItemPB ~ metaData:", metaData);
|
|
12
11
|
const SvgAmenities = ({ moreAnemities, name, color, }) => {
|
|
13
|
-
|
|
12
|
+
var _a;
|
|
13
|
+
const amenityKey = (_a = name === null || name === void 0 ? void 0 : name.toLowerCase()) === null || _a === void 0 ? void 0 : _a.replace(/\s/g, "_");
|
|
14
14
|
const getIconPath = () => {
|
|
15
15
|
const amenityFileName = `${amenityKey}.png`;
|
|
16
16
|
const imagePath = getAmenitiesImage(amenityFileName);
|
|
@@ -25,7 +25,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
25
25
|
}, className: `object-contain ${moreAnemities ? "w-[16px] h-[16px]" : "w-[16px] h-[16px]"}` }));
|
|
26
26
|
};
|
|
27
27
|
const getAmenitiesImage = (name) => {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
29
29
|
switch (name) {
|
|
30
30
|
case "air_condtion.png": {
|
|
31
31
|
return (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.airConditionIcon;
|
|
@@ -96,13 +96,21 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
96
96
|
case "service_on_board.png": {
|
|
97
97
|
return (_y = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _y === void 0 ? void 0 : _y.serviceOnBoardIcon;
|
|
98
98
|
}
|
|
99
|
+
case "personal_tv.png": {
|
|
100
|
+
return (_z = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _z === void 0 ? void 0 : _z.personalTVIcon;
|
|
101
|
+
}
|
|
102
|
+
case "pet_admission.png": {
|
|
103
|
+
return (_0 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _0 === void 0 ? void 0 : _0.petAdmissionIcon;
|
|
104
|
+
}
|
|
105
|
+
case "music.png": {
|
|
106
|
+
return (_1 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _1 === void 0 ? void 0 : _1.musicIcon;
|
|
107
|
+
}
|
|
99
108
|
default: {
|
|
100
109
|
return "";
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
112
|
};
|
|
104
113
|
const getAmenityName = (rawAmenity) => {
|
|
105
|
-
console.log("🚀 ~ getAmenityName ~ rawAmenity:", rawAmenity);
|
|
106
114
|
switch (rawAmenity) {
|
|
107
115
|
case "mobile ticket":
|
|
108
116
|
return "Ticket móvil";
|
|
@@ -144,6 +152,12 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
144
152
|
return "Cinturón de seguridad";
|
|
145
153
|
case "service on board":
|
|
146
154
|
return "Servicio a bordo";
|
|
155
|
+
case "personal tv":
|
|
156
|
+
return "TV personal";
|
|
157
|
+
case "pet admission":
|
|
158
|
+
return "Admisión de mascotas";
|
|
159
|
+
case "music":
|
|
160
|
+
return "Música";
|
|
147
161
|
default:
|
|
148
162
|
return rawAmenity;
|
|
149
163
|
}
|
|
@@ -84,7 +84,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
84
84
|
return item;
|
|
85
85
|
};
|
|
86
86
|
const getAmenitiesImage = (name) => {
|
|
87
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
88
88
|
switch (name) {
|
|
89
89
|
case "air_condtion.png": {
|
|
90
90
|
return (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.airConditionIcon;
|
|
@@ -155,6 +155,15 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
155
155
|
case "service_on_board.png": {
|
|
156
156
|
return (_y = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _y === void 0 ? void 0 : _y.serviceOnBoardIcon;
|
|
157
157
|
}
|
|
158
|
+
case "personal_tv.png": {
|
|
159
|
+
return (_z = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _z === void 0 ? void 0 : _z.personalTVIcon;
|
|
160
|
+
}
|
|
161
|
+
case "pet_admission.png": {
|
|
162
|
+
return (_0 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _0 === void 0 ? void 0 : _0.petAdmissionIcon;
|
|
163
|
+
}
|
|
164
|
+
case "music.png": {
|
|
165
|
+
return (_1 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _1 === void 0 ? void 0 : _1.musicIcon;
|
|
166
|
+
}
|
|
158
167
|
default: {
|
|
159
168
|
return "";
|
|
160
169
|
}
|
|
@@ -101,6 +101,9 @@ export interface MobileServiceItemProps {
|
|
|
101
101
|
sercurityBeltIcon?: string;
|
|
102
102
|
serviceOnBoardIcon?: string;
|
|
103
103
|
airportIcon?: string;
|
|
104
|
+
personalTVIcon?: string;
|
|
105
|
+
petAdmissionIcon?: string;
|
|
106
|
+
musicIcon?: string;
|
|
104
107
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
105
108
|
};
|
|
106
109
|
useLottieFor?: string[];
|
|
@@ -105,6 +105,9 @@ export interface ServiceItemProps {
|
|
|
105
105
|
readingLIghtIcon?: string;
|
|
106
106
|
sercurityBeltIcon?: string;
|
|
107
107
|
serviceOnBoardIcon?: string;
|
|
108
|
+
personalTVIcon?: string;
|
|
109
|
+
petAdmissionIcon?: string;
|
|
110
|
+
musicIcon?: string;
|
|
108
111
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
109
112
|
};
|
|
110
113
|
useLottieFor?: string[];
|
package/package.json
CHANGED
|
@@ -525,13 +525,13 @@ const FilterBarDesktop = ({
|
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
} else if (f.value.toLowerCase().indexOf("salon") > -1) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
528
|
+
for (let bt of it.fare_str.split(",")) {
|
|
529
|
+
if (
|
|
530
|
+
bt.toLowerCase().split(":")[0].indexOf("salon") > -1
|
|
531
|
+
) {
|
|
532
|
+
return true;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
535
|
|
|
536
536
|
for (let bt of it.seat_types) {
|
|
537
537
|
if (bt?.label?.toLowerCase().indexOf("salon") > -1) {
|
|
@@ -214,7 +214,8 @@ class ServiceFilter extends React.Component<
|
|
|
214
214
|
option.type !== "seat_types" &&
|
|
215
215
|
option.type !== "tipo" &&
|
|
216
216
|
option.type !== "special_departure" &&
|
|
217
|
-
option.type !== "train_type"
|
|
217
|
+
option.type !== "train_type" &&
|
|
218
|
+
option.type !== "amenities")) &&
|
|
218
219
|
option.options.map((val: any, i: number) => {
|
|
219
220
|
let iconKey = "";
|
|
220
221
|
if (val.icon === "sunrise") {
|
|
@@ -256,6 +257,8 @@ class ServiceFilter extends React.Component<
|
|
|
256
257
|
label = "Tren express";
|
|
257
258
|
} else if (val.label === "PET_FRIENDLY") {
|
|
258
259
|
label = this.props.translation?.petFriendly;
|
|
260
|
+
} else if (val.label === "cortina divisoria") {
|
|
261
|
+
label = "Cortina divisoria";
|
|
259
262
|
} else {
|
|
260
263
|
// Use translation if available, otherwise use the label
|
|
261
264
|
label = val.trText
|
|
@@ -31,7 +31,6 @@ function ServiceItemPB({
|
|
|
31
31
|
originIconStyle,
|
|
32
32
|
t = (key: string) => key,
|
|
33
33
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
34
|
-
console.log("🚀 ~ ServiceItemPB ~ metaData:", metaData);
|
|
35
34
|
const SvgAmenities = ({
|
|
36
35
|
moreAnemities,
|
|
37
36
|
name,
|
|
@@ -41,7 +40,7 @@ function ServiceItemPB({
|
|
|
41
40
|
name: string;
|
|
42
41
|
color?: string;
|
|
43
42
|
}) => {
|
|
44
|
-
const amenityKey = name
|
|
43
|
+
const amenityKey = name?.toLowerCase()?.replace(/\s/g, "_");
|
|
45
44
|
|
|
46
45
|
const getIconPath = () => {
|
|
47
46
|
const amenityFileName = `${amenityKey}.png`;
|
|
@@ -141,6 +140,15 @@ function ServiceItemPB({
|
|
|
141
140
|
case "service_on_board.png": {
|
|
142
141
|
return serviceItem?.icons?.serviceOnBoardIcon;
|
|
143
142
|
}
|
|
143
|
+
case "personal_tv.png": {
|
|
144
|
+
return serviceItem?.icons?.personalTVIcon;
|
|
145
|
+
}
|
|
146
|
+
case "pet_admission.png": {
|
|
147
|
+
return serviceItem?.icons?.petAdmissionIcon;
|
|
148
|
+
}
|
|
149
|
+
case "music.png": {
|
|
150
|
+
return serviceItem?.icons?.musicIcon;
|
|
151
|
+
}
|
|
144
152
|
default: {
|
|
145
153
|
return "";
|
|
146
154
|
}
|
|
@@ -148,7 +156,6 @@ function ServiceItemPB({
|
|
|
148
156
|
};
|
|
149
157
|
|
|
150
158
|
const getAmenityName = (rawAmenity: string): string => {
|
|
151
|
-
console.log("🚀 ~ getAmenityName ~ rawAmenity:", rawAmenity);
|
|
152
159
|
switch (rawAmenity) {
|
|
153
160
|
case "mobile ticket":
|
|
154
161
|
return "Ticket móvil";
|
|
@@ -191,6 +198,13 @@ function ServiceItemPB({
|
|
|
191
198
|
return "Cinturón de seguridad";
|
|
192
199
|
case "service on board":
|
|
193
200
|
return "Servicio a bordo";
|
|
201
|
+
|
|
202
|
+
case "personal tv":
|
|
203
|
+
return "TV personal";
|
|
204
|
+
case "pet admission":
|
|
205
|
+
return "Admisión de mascotas";
|
|
206
|
+
case "music":
|
|
207
|
+
return "Música";
|
|
194
208
|
default:
|
|
195
209
|
return rawAmenity;
|
|
196
210
|
}
|
|
@@ -227,6 +227,15 @@ function ServiceItemMobile({
|
|
|
227
227
|
case "service_on_board.png": {
|
|
228
228
|
return serviceItem?.icons?.serviceOnBoardIcon;
|
|
229
229
|
}
|
|
230
|
+
case "personal_tv.png": {
|
|
231
|
+
return serviceItem?.icons?.personalTVIcon;
|
|
232
|
+
}
|
|
233
|
+
case "pet_admission.png": {
|
|
234
|
+
return serviceItem?.icons?.petAdmissionIcon;
|
|
235
|
+
}
|
|
236
|
+
case "music.png": {
|
|
237
|
+
return serviceItem?.icons?.musicIcon;
|
|
238
|
+
}
|
|
230
239
|
default: {
|
|
231
240
|
return "";
|
|
232
241
|
}
|
|
@@ -104,6 +104,9 @@ export interface MobileServiceItemProps {
|
|
|
104
104
|
sercurityBeltIcon?: string;
|
|
105
105
|
serviceOnBoardIcon?: string;
|
|
106
106
|
airportIcon?: string;
|
|
107
|
+
personalTVIcon?: string;
|
|
108
|
+
petAdmissionIcon?: string;
|
|
109
|
+
musicIcon?: string;
|
|
107
110
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
108
111
|
};
|
|
109
112
|
useLottieFor?: string[];
|
|
@@ -107,6 +107,10 @@ export interface ServiceItemProps {
|
|
|
107
107
|
readingLIghtIcon?: string;
|
|
108
108
|
sercurityBeltIcon?: string;
|
|
109
109
|
serviceOnBoardIcon?: string;
|
|
110
|
+
personalTVIcon?: string;
|
|
111
|
+
petAdmissionIcon?: string;
|
|
112
|
+
musicIcon?: string;
|
|
113
|
+
|
|
110
114
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
111
115
|
};
|
|
112
116
|
useLottieFor?: string[];
|
|
@@ -133,7 +137,6 @@ export interface ServiceItemProps {
|
|
|
133
137
|
primaryButtonTextColor?: string;
|
|
134
138
|
bottomStripColor?: string;
|
|
135
139
|
directoColor?: string;
|
|
136
|
-
|
|
137
140
|
seatPriceColor?: string;
|
|
138
141
|
};
|
|
139
142
|
cityOrigin?: { value: number; label: string };
|