kupos-ui-components-lib 5.0.2 → 5.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.
- package/dist/components/FilterBar/FilterBarDesktop.js +20 -8
- package/dist/components/FilterBar/ServiceFilter.js +8 -8
- package/dist/components/ServiceItem/ServiceItemDesktop.js +1 -1
- package/dist/styles.css +3 -3
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBarDesktop.tsx +12 -0
- package/src/components/FilterBar/ServiceFilter.tsx +10 -9
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +1 -1
|
@@ -139,7 +139,7 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
139
139
|
let activeOptions = fil.options.filter((it) => it.active);
|
|
140
140
|
// if (activeOptions && activeOptions.length > 0) {
|
|
141
141
|
filteredRoutes = filteredRoutes.filter((it) => {
|
|
142
|
-
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;
|
|
142
|
+
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;
|
|
143
143
|
if (activeOptions && activeOptions.length)
|
|
144
144
|
for (let f of activeOptions) {
|
|
145
145
|
if (f.active) {
|
|
@@ -316,6 +316,18 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
+
else if (f.value.toLowerCase().indexOf("express") > -1) {
|
|
320
|
+
// for (let bt of it.fare_str.split(",")) {
|
|
321
|
+
// if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
|
|
322
|
+
// return true;
|
|
323
|
+
// }
|
|
324
|
+
// }
|
|
325
|
+
for (let bt of it.seat_types) {
|
|
326
|
+
if (((_u = bt === null || bt === void 0 ? void 0 : bt.label) === null || _u === void 0 ? void 0 : _u.toLowerCase().indexOf("express")) > -1) {
|
|
327
|
+
return true;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
319
331
|
else if (f.value.toLowerCase() == "cama") {
|
|
320
332
|
// for (let bt of it.fare_str.split(",")) {
|
|
321
333
|
// if (bt.toLowerCase().split(":")[0] == "cama") {
|
|
@@ -323,7 +335,7 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
323
335
|
// }
|
|
324
336
|
// }
|
|
325
337
|
for (let bt of it.seat_types) {
|
|
326
|
-
if (((
|
|
338
|
+
if (((_v = bt === null || bt === void 0 ? void 0 : bt.label) === null || _v === void 0 ? void 0 : _v.toLowerCase().indexOf("cama")) > -1) {
|
|
327
339
|
return true;
|
|
328
340
|
}
|
|
329
341
|
}
|
|
@@ -335,7 +347,7 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
335
347
|
// }
|
|
336
348
|
// }
|
|
337
349
|
for (let bt of it.seat_types) {
|
|
338
|
-
if (((
|
|
350
|
+
if (((_w = bt === null || bt === void 0 ? void 0 : bt.label) === null || _w === void 0 ? void 0 : _w.toLowerCase().indexOf("preferente")) > -1) {
|
|
339
351
|
return true;
|
|
340
352
|
}
|
|
341
353
|
}
|
|
@@ -347,7 +359,7 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
347
359
|
// }
|
|
348
360
|
// }
|
|
349
361
|
for (let bt of it.seat_types) {
|
|
350
|
-
if (((
|
|
362
|
+
if (((_x = bt === null || bt === void 0 ? void 0 : bt.label) === null || _x === void 0 ? void 0 : _x.toLowerCase().indexOf("vent")) > -1) {
|
|
351
363
|
return true;
|
|
352
364
|
}
|
|
353
365
|
}
|
|
@@ -361,28 +373,28 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
|
|
|
361
373
|
// }
|
|
362
374
|
// }
|
|
363
375
|
for (let bt of it.seat_types) {
|
|
364
|
-
if (((
|
|
376
|
+
if (((_y = bt === null || bt === void 0 ? void 0 : bt.label) === null || _y === void 0 ? void 0 : _y.toLowerCase().indexOf("clasico")) > -1) {
|
|
365
377
|
return true;
|
|
366
378
|
}
|
|
367
379
|
}
|
|
368
380
|
}
|
|
369
381
|
else if (f.value.toLowerCase().indexOf("killa plus") > -1) {
|
|
370
382
|
for (let bt of it.seat_types) {
|
|
371
|
-
if (((
|
|
383
|
+
if (((_z = bt === null || bt === void 0 ? void 0 : bt.label) === null || _z === void 0 ? void 0 : _z.toLowerCase().indexOf("killa plus")) > -1) {
|
|
372
384
|
return true;
|
|
373
385
|
}
|
|
374
386
|
}
|
|
375
387
|
}
|
|
376
388
|
else if (f.value.toLowerCase().indexOf("inka plus") > -1) {
|
|
377
389
|
for (let bt of it.seat_types) {
|
|
378
|
-
if (((
|
|
390
|
+
if (((_0 = bt === null || bt === void 0 ? void 0 : bt.label) === null || _0 === void 0 ? void 0 : _0.toLowerCase().indexOf("inka plus")) > -1) {
|
|
379
391
|
return true;
|
|
380
392
|
}
|
|
381
393
|
}
|
|
382
394
|
}
|
|
383
395
|
else if (f.value.toLowerCase().indexOf("emperador") > -1) {
|
|
384
396
|
for (let bt of it.seat_types) {
|
|
385
|
-
if (((
|
|
397
|
+
if (((_1 = bt === null || bt === void 0 ? void 0 : bt.label) === null || _1 === void 0 ? void 0 : _1.toLowerCase().indexOf("emperador")) > -1) {
|
|
386
398
|
return true;
|
|
387
399
|
}
|
|
388
400
|
}
|
|
@@ -15,14 +15,14 @@ class ServiceFilter extends React.Component {
|
|
|
15
15
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
16
16
|
super(props);
|
|
17
17
|
this.state = {
|
|
18
|
-
showOperators: ((_a = props.initialOpenFilters) === null || _a === void 0 ? void 0 : _a.includes("operator")) ||
|
|
19
|
-
showTimeOptions: ((_b = props.initialOpenFilters) === null || _b === void 0 ? void 0 : _b.includes("time")) ||
|
|
20
|
-
showSeatOptions: ((_c = props.initialOpenFilters) === null || _c === void 0 ? void 0 : _c.includes("seat_types")) ||
|
|
21
|
-
showTypeOptions: ((_d = props.initialOpenFilters) === null || _d === void 0 ? void 0 : _d.includes("tipo")) ||
|
|
22
|
-
showSpecialDeparture: ((_e = props.initialOpenFilters) === null || _e === void 0 ? void 0 : _e.includes("special_departure")) ||
|
|
23
|
-
showTrainType: ((_f = props.initialOpenFilters) === null || _f === void 0 ? void 0 : _f.includes("train_type")) ||
|
|
18
|
+
showOperators: ((_a = props.initialOpenFilters) === null || _a === void 0 ? void 0 : _a.includes("operator")) || true,
|
|
19
|
+
showTimeOptions: ((_b = props.initialOpenFilters) === null || _b === void 0 ? void 0 : _b.includes("time")) || true,
|
|
20
|
+
showSeatOptions: ((_c = props.initialOpenFilters) === null || _c === void 0 ? void 0 : _c.includes("seat_types")) || true,
|
|
21
|
+
showTypeOptions: ((_d = props.initialOpenFilters) === null || _d === void 0 ? void 0 : _d.includes("tipo")) || true,
|
|
22
|
+
showSpecialDeparture: ((_e = props.initialOpenFilters) === null || _e === void 0 ? void 0 : _e.includes("special_departure")) || true,
|
|
23
|
+
showTrainType: ((_f = props.initialOpenFilters) === null || _f === void 0 ? void 0 : _f.includes("train_type")) || true,
|
|
24
24
|
addMargin: false,
|
|
25
|
-
showAmenities: ((_g = props.initialOpenFilters) === null || _g === void 0 ? void 0 : _g.includes("amenities")) ||
|
|
25
|
+
showAmenities: ((_g = props.initialOpenFilters) === null || _g === void 0 ? void 0 : _g.includes("amenities")) || true,
|
|
26
26
|
sortedFilters: this.sortFilters(props.filtersArray),
|
|
27
27
|
};
|
|
28
28
|
this.handleScroll = this.handleScroll.bind(this);
|
|
@@ -211,7 +211,7 @@ class ServiceFilter extends React.Component {
|
|
|
211
211
|
color: val.active ? this.props.colors.selectedTextColor : "",
|
|
212
212
|
}, className: `flex items-center h-[24px] rounded-[15px] cursor-pointer pt-[4px] ${val.active ? "bold-text" : ""}` },
|
|
213
213
|
val.icon && this.props.icons && (React.createElement("img", { src: iconKey, alt: val.icon, className: "w-[20px] h-[20px] mr-[10px]" })),
|
|
214
|
-
label));
|
|
214
|
+
label.charAt(0).toUpperCase() + label.slice(1).toLowerCase()));
|
|
215
215
|
})));
|
|
216
216
|
}
|
|
217
217
|
render() {
|
|
@@ -441,7 +441,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
441
441
|
: "mt-[14px]"} ` },
|
|
442
442
|
React.createElement("div", { className: "bg-white rounded-[20px] shadow-service mx-auto relative" },
|
|
443
443
|
React.createElement("div", { className: "p-[15px] pt-[20px]" },
|
|
444
|
-
React.createElement("div", { className: "grid text-[#464647] w-full [grid-template-columns:
|
|
444
|
+
React.createElement("div", { className: "grid text-[#464647] w-full [grid-template-columns:18%_28%_0.5%_24%_13.5%] gap-x-[4%] items-center", style: { marginTop: showTopLabel ? "8px" : "" } },
|
|
445
445
|
React.createElement("div", { className: "flex items-center justify-center m-[auto]" },
|
|
446
446
|
React.createElement("div", { className: " " },
|
|
447
447
|
React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: ` h-auto object-contain ${isSoldOut ? "grayscale" : ""}` })),
|
package/dist/styles.css
CHANGED
|
@@ -397,12 +397,12 @@
|
|
|
397
397
|
.cursor-pointer {
|
|
398
398
|
cursor: pointer;
|
|
399
399
|
}
|
|
400
|
-
.\[grid-template-columns\:14\%_32\%_0\.5\%_24\%_13\.5\%\] {
|
|
401
|
-
grid-template-columns: 14% 32% 0.5% 24% 13.5%;
|
|
402
|
-
}
|
|
403
400
|
.\[grid-template-columns\:14\%_40\%_0\.5\%_24\%_13\.5\%\] {
|
|
404
401
|
grid-template-columns: 14% 40% 0.5% 24% 13.5%;
|
|
405
402
|
}
|
|
403
|
+
.\[grid-template-columns\:18\%_28\%_0\.5\%_24\%_13\.5\%\] {
|
|
404
|
+
grid-template-columns: 18% 28% 0.5% 24% 13.5%;
|
|
405
|
+
}
|
|
406
406
|
.\[grid-template-columns\:minmax\(0\,1\.4fr\)_minmax\(0\,0\.2fr\)_minmax\(0\,1fr\)_auto\] {
|
|
407
407
|
grid-template-columns: minmax(0,1.4fr) minmax(0,0.2fr) minmax(0,1fr) auto;
|
|
408
408
|
}
|
package/package.json
CHANGED
|
@@ -367,6 +367,18 @@ const FilterBarDesktop = ({
|
|
|
367
367
|
return true;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
+
} else if (f.value.toLowerCase().indexOf("express") > -1) {
|
|
371
|
+
// for (let bt of it.fare_str.split(",")) {
|
|
372
|
+
// if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
|
|
373
|
+
// return true;
|
|
374
|
+
// }
|
|
375
|
+
// }
|
|
376
|
+
|
|
377
|
+
for (let bt of it.seat_types) {
|
|
378
|
+
if (bt?.label?.toLowerCase().indexOf("express") > -1) {
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
370
382
|
} else if (f.value.toLowerCase() == "cama") {
|
|
371
383
|
// for (let bt of it.fare_str.split(",")) {
|
|
372
384
|
// if (bt.toLowerCase().split(":")[0] == "cama") {
|
|
@@ -34,16 +34,15 @@ class ServiceFilter extends React.Component<
|
|
|
34
34
|
super(props);
|
|
35
35
|
|
|
36
36
|
this.state = {
|
|
37
|
-
showOperators: props.initialOpenFilters?.includes("operator") ||
|
|
38
|
-
showTimeOptions: props.initialOpenFilters?.includes("time") ||
|
|
39
|
-
showSeatOptions:
|
|
40
|
-
|
|
41
|
-
showTypeOptions: props.initialOpenFilters?.includes("tipo") || false,
|
|
37
|
+
showOperators: props.initialOpenFilters?.includes("operator") || true,
|
|
38
|
+
showTimeOptions: props.initialOpenFilters?.includes("time") || true,
|
|
39
|
+
showSeatOptions: props.initialOpenFilters?.includes("seat_types") || true,
|
|
40
|
+
showTypeOptions: props.initialOpenFilters?.includes("tipo") || true,
|
|
42
41
|
showSpecialDeparture:
|
|
43
|
-
props.initialOpenFilters?.includes("special_departure") ||
|
|
44
|
-
showTrainType: props.initialOpenFilters?.includes("train_type") ||
|
|
42
|
+
props.initialOpenFilters?.includes("special_departure") || true,
|
|
43
|
+
showTrainType: props.initialOpenFilters?.includes("train_type") || true,
|
|
45
44
|
addMargin: false,
|
|
46
|
-
showAmenities: props.initialOpenFilters?.includes("amenities") ||
|
|
45
|
+
showAmenities: props.initialOpenFilters?.includes("amenities") || true,
|
|
47
46
|
sortedFilters: this.sortFilters(props.filtersArray),
|
|
48
47
|
};
|
|
49
48
|
|
|
@@ -294,7 +293,9 @@ class ServiceFilter extends React.Component<
|
|
|
294
293
|
className="w-[20px] h-[20px] mr-[10px]"
|
|
295
294
|
/>
|
|
296
295
|
)}
|
|
297
|
-
{label}
|
|
296
|
+
{/* {commonService.capitalize(label)} */}
|
|
297
|
+
|
|
298
|
+
{label.charAt(0).toUpperCase() + label.slice(1).toLowerCase()}
|
|
298
299
|
</div>
|
|
299
300
|
);
|
|
300
301
|
})}
|
|
@@ -651,7 +651,7 @@ function ServiceItemPB({
|
|
|
651
651
|
|
|
652
652
|
{/* <div className="grid grid-cols-[1.5fr_1fr_auto] gap-[3rem] sm:gap-[4rem] md:gap-[5rem] lg:gap-[6rem] xl:gap-[5rem] 2xl:gap-[7rem] text-[#464647]"> */}
|
|
653
653
|
<div
|
|
654
|
-
className="grid text-[#464647] w-full [grid-template-columns:
|
|
654
|
+
className="grid text-[#464647] w-full [grid-template-columns:18%_28%_0.5%_24%_13.5%] gap-x-[4%] items-center"
|
|
655
655
|
style={{ marginTop: showTopLabel ? "8px" : "" }}
|
|
656
656
|
>
|
|
657
657
|
{/* OPERATOR LOGO */}
|