mautourco-components 0.2.137 → 0.2.139
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/molecules/PaxChips/PaxChips.js +1 -1
- package/dist/components/molecules/TableServiceItem/ItemCol.d.ts +1 -0
- package/dist/components/molecules/TableServiceItem/ItemCol.js +10 -5
- package/dist/components/molecules/TableServiceItem/RowExcursion.js +2 -2
- package/dist/components/organisms/Table/columns/detail-resume-columns.js +1 -1
- package/dist/types/table/detail-resume.types.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/molecules/PaxChips/PaxChips.tsx +1 -0
- package/src/components/molecules/TableServiceItem/ItemCol.tsx +29 -13
- package/src/components/molecules/TableServiceItem/RowExcursion.tsx +2 -2
- package/src/components/organisms/Table/columns/detail-resume-columns.tsx +4 -1
- package/src/types/table/detail-resume.types.ts +1 -1
|
@@ -4,6 +4,6 @@ export function PaxChips(props) {
|
|
|
4
4
|
var pax = props.pax;
|
|
5
5
|
return (_jsx("div", { className: "flex flex-wrap gap-2", children: Object.entries(pax).map(function (_a) {
|
|
6
6
|
var key = _a[0], value = _a[1];
|
|
7
|
-
return (_jsx(Chip, { label: "".concat(key, " ").concat(value), size: "sm", color: "accent", type: value > 0 ? 'filled' : 'outline' }, key));
|
|
7
|
+
return (_jsx(Chip, { label: "".concat(key, " ").concat(value), size: "sm", color: "accent", className: "capitalize", type: value > 0 ? 'filled' : 'outline' }, key));
|
|
8
8
|
}) }));
|
|
9
9
|
}
|
|
@@ -3,11 +3,16 @@ import { Text } from '../../atoms/Typography/Typography';
|
|
|
3
3
|
import { cn } from '../../../lib/utils';
|
|
4
4
|
import Chip from '../../atoms/Chip/Chip';
|
|
5
5
|
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
6
|
+
var ExtraContent = function (props) {
|
|
7
|
+
return (_jsxs("div", { children: [_jsx(Text, { variant: "bold", size: "sm", leading: "5", children: props.label }), _jsx(Text, { variant: "regular", size: "sm", leading: "5", children: props.children })] }));
|
|
8
|
+
};
|
|
6
9
|
export function ItemCol(props) {
|
|
7
|
-
var serviceType = props.serviceType, serviceName = props.serviceName, offers = props.offers, status = props.status, _a = props.iconName, iconName = _a === void 0 ? 'accom' : _a, _b = props.showName, showName = _b === void 0 ? true : _b, extraTitle = props.extraTitle, children = props.children;
|
|
10
|
+
var serviceType = props.serviceType, serviceName = props.serviceName, offers = props.offers, status = props.status, _a = props.iconName, iconName = _a === void 0 ? 'accom' : _a, _b = props.showName, showName = _b === void 0 ? true : _b, extraTitle = props.extraTitle, extraContent = props.extraContent, children = props.children;
|
|
8
11
|
var isOnRequest = (status === null || status === void 0 ? void 0 : status.toLowerCase()) === 'on request';
|
|
9
|
-
return (_jsxs("div", { className: cn('grid',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
return (_jsxs("div", { className: cn('grid', {
|
|
13
|
+
'gap-y-3': (offers === null || offers === void 0 ? void 0 : offers.length) || !!extraContent,
|
|
14
|
+
}), children: [_jsxs("div", { children: [serviceName && (_jsxs("div", { className: "grid gap-y-1", children: [_jsxs("div", { className: "flex items-center gap-x-2", children: [_jsx(TextWithIcon, { icon: iconName, color: isOnRequest ? 'yellow' : 'accent', children: serviceType }), isOnRequest && _jsx(Chip, { color: "yellow", children: status }), extraTitle] }), _jsx(Text, { variant: "bold", size: "sm", children: showName && serviceName })] })), children] }), serviceType === 'Excursion' && (_jsx(ExtraContent, { label: "Pick up point", children: extraContent })), offers && offers.length > 0 && (_jsx(ExtraContent, { label: "Applicable offers:", children: offers.map(function (o) {
|
|
15
|
+
var offerValue = o.OfferType === 'GIFT' ? o.OfferName : "".concat(o.OfferValue, "% offers applied");
|
|
16
|
+
return _jsx("span", { children: offerValue });
|
|
17
|
+
}) }))] }));
|
|
13
18
|
}
|
|
@@ -15,8 +15,8 @@ export function DetailsCol(props) {
|
|
|
15
15
|
] }));
|
|
16
16
|
}
|
|
17
17
|
function FirstCol(props) {
|
|
18
|
-
var serviceName = props.serviceName,
|
|
19
|
-
return (_jsx(ItemCol, { serviceType: "Excursion", serviceName: serviceName,
|
|
18
|
+
var serviceName = props.serviceName, extraContent = props.extraContent;
|
|
19
|
+
return (_jsx(ItemCol, { serviceType: "Excursion", serviceName: serviceName, extraContent: extraContent, iconName: "map" }));
|
|
20
20
|
}
|
|
21
21
|
RowExcursion.FirstCol = FirstCol;
|
|
22
22
|
RowExcursion.DetailsCol = DetailsCol;
|
|
@@ -23,7 +23,7 @@ export var detailResumeColumns = function (params) {
|
|
|
23
23
|
}
|
|
24
24
|
if (value === ServiceType.EXCURSION) {
|
|
25
25
|
var excursion = raw;
|
|
26
|
-
return (_jsx(RowExcursion.FirstCol, { serviceName: excursion.ExcursionName }));
|
|
26
|
+
return (_jsx(RowExcursion.FirstCol, { serviceName: excursion.ExcursionName, extraContent: excursion.LocationToName }));
|
|
27
27
|
}
|
|
28
28
|
if (value === ServiceType.TRANSFER) {
|
|
29
29
|
var transfer = raw;
|
|
@@ -60,7 +60,7 @@ export interface DetailResumeAccommodation extends TableRowData<DetailResumeItem
|
|
|
60
60
|
Description: string;
|
|
61
61
|
TitleDescription: string;
|
|
62
62
|
Rooms: Room[];
|
|
63
|
-
RoomIndex
|
|
63
|
+
RoomIndex?: number;
|
|
64
64
|
}
|
|
65
65
|
export interface DetailResumeTransfer extends TableRowData<DetailResumeItem> {
|
|
66
66
|
Type: ServiceType;
|
package/package.json
CHANGED
|
@@ -13,8 +13,22 @@ export interface ItemColProps {
|
|
|
13
13
|
iconName?: IconName;
|
|
14
14
|
showName?: boolean;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
+
extraContent?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
const ExtraContent = (props: { label: string; children: React.ReactNode }) => {
|
|
20
|
+
return (
|
|
21
|
+
<div>
|
|
22
|
+
<Text variant="bold" size="sm" leading="5">
|
|
23
|
+
{props.label}
|
|
24
|
+
</Text>
|
|
25
|
+
<Text variant="regular" size="sm" leading="5">
|
|
26
|
+
{props.children}
|
|
27
|
+
</Text>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
18
32
|
export function ItemCol(props: ItemColProps) {
|
|
19
33
|
const {
|
|
20
34
|
serviceType,
|
|
@@ -24,13 +38,17 @@ export function ItemCol(props: ItemColProps) {
|
|
|
24
38
|
iconName = 'accom',
|
|
25
39
|
showName = true,
|
|
26
40
|
extraTitle,
|
|
41
|
+
extraContent,
|
|
27
42
|
children,
|
|
28
43
|
} = props;
|
|
29
44
|
|
|
30
45
|
const isOnRequest = status?.toLowerCase() === 'on request';
|
|
31
46
|
|
|
32
47
|
return (
|
|
33
|
-
<div
|
|
48
|
+
<div
|
|
49
|
+
className={cn('grid', {
|
|
50
|
+
'gap-y-3': offers?.length || !!extraContent,
|
|
51
|
+
})}>
|
|
34
52
|
<div>
|
|
35
53
|
{serviceName && (
|
|
36
54
|
<div className="grid gap-y-1">
|
|
@@ -48,20 +66,18 @@ export function ItemCol(props: ItemColProps) {
|
|
|
48
66
|
)}
|
|
49
67
|
{children}
|
|
50
68
|
</div>
|
|
69
|
+
{serviceType === 'Excursion' && (
|
|
70
|
+
<ExtraContent label="Pick up point">{extraContent}</ExtraContent>
|
|
71
|
+
)}
|
|
51
72
|
{offers && offers.length > 0 && (
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<Text variant="regular" size="sm" leading="5">
|
|
57
|
-
{offers.map((o) => {
|
|
58
|
-
const offerValue =
|
|
59
|
-
o.OfferType === 'GIFT' ? o.OfferName : `${o.OfferValue}% offers applied`;
|
|
73
|
+
<ExtraContent label="Applicable offers:">
|
|
74
|
+
{offers.map((o) => {
|
|
75
|
+
const offerValue =
|
|
76
|
+
o.OfferType === 'GIFT' ? o.OfferName : `${o.OfferValue}% offers applied`;
|
|
60
77
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</div>
|
|
78
|
+
return <span>{offerValue}</span>;
|
|
79
|
+
})}
|
|
80
|
+
</ExtraContent>
|
|
65
81
|
)}
|
|
66
82
|
</div>
|
|
67
83
|
);
|
|
@@ -30,13 +30,13 @@ export function DetailsCol(props: RowExcursionProps) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function FirstCol(props: Omit<ItemColProps, 'serviceType' | 'status'>) {
|
|
33
|
-
const { serviceName,
|
|
33
|
+
const { serviceName, extraContent } = props;
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
36
|
<ItemCol
|
|
37
37
|
serviceType="Excursion"
|
|
38
38
|
serviceName={serviceName}
|
|
39
|
-
|
|
39
|
+
extraContent={extraContent}
|
|
40
40
|
iconName="map"
|
|
41
41
|
/>
|
|
42
42
|
);
|
|
@@ -40,7 +40,10 @@ export const detailResumeColumns: (params?: {
|
|
|
40
40
|
if (value === ServiceType.EXCURSION) {
|
|
41
41
|
const excursion = raw as DetailResumeExcursion;
|
|
42
42
|
return (
|
|
43
|
-
<RowExcursion.FirstCol
|
|
43
|
+
<RowExcursion.FirstCol
|
|
44
|
+
serviceName={excursion.ExcursionName as string}
|
|
45
|
+
extraContent={excursion.LocationToName}
|
|
46
|
+
/>
|
|
44
47
|
);
|
|
45
48
|
}
|
|
46
49
|
if (value === ServiceType.TRANSFER) {
|