mautourco-components 0.2.12 → 0.2.13

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.
Files changed (133) hide show
  1. package/dist/components/atoms/Icon/Icon.d.ts +1 -1
  2. package/dist/components/atoms/Icon/Icon.js +1 -1
  3. package/dist/components/atoms/Icon/icons/AccomIcon.d.ts +12 -0
  4. package/dist/components/atoms/Icon/icons/AccomIcon.js +36 -0
  5. package/dist/components/atoms/Icon/icons/ArrowDownOutlineIcon.d.ts +8 -0
  6. package/dist/components/atoms/Icon/icons/ArrowDownOutlineIcon.js +36 -0
  7. package/dist/components/atoms/Icon/icons/ArrowRightOutlineIcon.js +1 -1
  8. package/dist/components/atoms/Icon/icons/BusIcon.d.ts +12 -0
  9. package/dist/components/atoms/Icon/icons/BusIcon.js +36 -0
  10. package/dist/components/atoms/Icon/icons/Calendar2Icon.d.ts +12 -0
  11. package/dist/components/atoms/Icon/icons/Calendar2Icon.js +36 -0
  12. package/dist/components/atoms/Icon/icons/MapIcon.d.ts +8 -0
  13. package/dist/components/atoms/Icon/icons/MapIcon.js +36 -0
  14. package/dist/components/atoms/Icon/icons/MicroIcon.d.ts +12 -0
  15. package/dist/components/atoms/Icon/icons/MicroIcon.js +36 -0
  16. package/dist/components/atoms/Icon/icons/MoreVerticalIcon.d.ts +12 -0
  17. package/dist/components/atoms/Icon/icons/MoreVerticalIcon.js +36 -0
  18. package/dist/components/atoms/Icon/icons/NightIcon.d.ts +12 -0
  19. package/dist/components/atoms/Icon/icons/NightIcon.js +36 -0
  20. package/dist/components/atoms/Icon/icons/RowExcursion.d.ts +16 -0
  21. package/dist/components/atoms/Icon/icons/RowExcursion.js +28 -0
  22. package/dist/components/atoms/Icon/icons/StopWatchIcon.d.ts +12 -0
  23. package/dist/components/atoms/Icon/icons/StopWatchIcon.js +36 -0
  24. package/dist/components/atoms/Icon/icons/Utensils.d.ts +12 -0
  25. package/dist/components/atoms/Icon/icons/Utensils.js +36 -0
  26. package/dist/components/atoms/Icon/icons/WalletIcon.d.ts +12 -0
  27. package/dist/components/atoms/Icon/icons/WalletIcon.js +36 -0
  28. package/dist/components/atoms/Icon/icons/registry.d.ts +11 -0
  29. package/dist/components/atoms/Icon/icons/registry.js +49 -27
  30. package/dist/components/atoms/Typography/Typography.d.ts +3 -1
  31. package/dist/components/atoms/Typography/Typography.js +3 -15
  32. package/dist/components/molecules/ActionDropdown/ActionDropdown.css +2119 -0
  33. package/dist/components/molecules/ActionDropdown/ActionDropdown.d.ts +21 -0
  34. package/dist/components/molecules/ActionDropdown/ActionDropdown.js +34 -0
  35. package/dist/components/molecules/DateDisplay/DateDisplay.d.ts +14 -0
  36. package/dist/components/molecules/DateDisplay/DateDisplay.js +39 -0
  37. package/dist/components/molecules/FromTo/FromTo.d.ts +8 -0
  38. package/dist/components/molecules/FromTo/FromTo.js +24 -0
  39. package/dist/components/molecules/TableServiceItem/DetailsCol.d.ts +12 -0
  40. package/dist/components/molecules/TableServiceItem/DetailsCol.js +17 -0
  41. package/dist/components/molecules/TableServiceItem/ItemCol.d.ts +13 -0
  42. package/dist/components/molecules/TableServiceItem/ItemCol.js +24 -0
  43. package/dist/components/molecules/TableServiceItem/RowAccommodation.d.ts +16 -0
  44. package/dist/components/molecules/TableServiceItem/RowAccommodation.js +37 -0
  45. package/dist/components/molecules/TableServiceItem/RowExcursion.d.ts +16 -0
  46. package/dist/components/molecules/TableServiceItem/RowExcursion.js +22 -0
  47. package/dist/components/molecules/TableServiceItem/RowOtherServices.d.ts +9 -0
  48. package/dist/components/molecules/TableServiceItem/RowOtherServices.js +34 -0
  49. package/dist/components/molecules/TableServiceItem/RowTransfer.d.ts +15 -0
  50. package/dist/components/molecules/TableServiceItem/RowTransfer.js +37 -0
  51. package/dist/components/molecules/TableServiceItem/index.d.ts +17 -0
  52. package/dist/components/molecules/TableServiceItem/index.js +15 -0
  53. package/dist/components/molecules/TextWithIcon/TextWithIcon.d.ts +30 -0
  54. package/dist/components/molecules/TextWithIcon/TextWithIcon.js +31 -0
  55. package/dist/components/molecules/TooltipDisplay/TooltipDisplay.d.ts +13 -0
  56. package/dist/components/molecules/TooltipDisplay/TooltipDisplay.js +18 -0
  57. package/dist/components/organisms/Table/Table.css +2280 -0
  58. package/dist/components/organisms/Table/Table.d.ts +50 -0
  59. package/dist/components/organisms/Table/Table.js +95 -0
  60. package/dist/components/organisms/Table/TableCell.d.ts +15 -0
  61. package/dist/components/organisms/Table/TableCell.js +16 -0
  62. package/dist/components/organisms/Table/columns/booking-columns.d.ts +7 -0
  63. package/dist/components/organisms/Table/columns/booking-columns.js +83 -0
  64. package/dist/components/organisms/Table/columns/detail-resume-columns.d.ts +3 -0
  65. package/dist/components/organisms/Table/columns/detail-resume-columns.js +178 -0
  66. package/dist/components/organisms/Table/columns/index.d.ts +12 -0
  67. package/dist/components/organisms/Table/columns/index.js +9 -0
  68. package/dist/components/organisms/Table/columns/quotation-columns.d.ts +7 -0
  69. package/dist/components/organisms/Table/columns/quotation-columns.js +91 -0
  70. package/dist/components/organisms/Table/constant.d.ts +6 -0
  71. package/dist/components/organisms/Table/constant.js +24 -0
  72. package/dist/components/organisms/Table/index.d.ts +2 -0
  73. package/dist/components/organisms/Table/index.js +2 -0
  74. package/dist/components/ui/popover.d.ts +3 -3
  75. package/dist/components/ui/popover.js +5 -5
  76. package/dist/components/ui/tooltip.d.ts +7 -0
  77. package/dist/components/ui/tooltip.js +42 -0
  78. package/dist/index.d.ts +41 -33
  79. package/dist/index.js +26 -20
  80. package/dist/styles/components/typography.css +1 -0
  81. package/dist/types/table/action-dropdown-type.types.d.ts +5 -0
  82. package/dist/types/table/action-dropdown-type.types.js +6 -0
  83. package/dist/types/table/booking.types.d.ts +16 -0
  84. package/dist/types/table/booking.types.js +1 -0
  85. package/dist/types/table/detail-resume.types.d.ts +155 -0
  86. package/dist/types/table/detail-resume.types.js +7 -0
  87. package/dist/types/table/index.d.ts +3 -0
  88. package/dist/types/table/index.js +3 -0
  89. package/dist/types/table/quotation.types.d.ts +23 -0
  90. package/dist/types/table/quotation.types.js +1 -0
  91. package/package.json +6 -1
  92. package/src/components/atoms/Icon/Icon.tsx +2 -8
  93. package/src/components/atoms/Icon/icons/AccomIcon.tsx +45 -0
  94. package/src/components/atoms/Icon/icons/ArrowDownOutlineIcon.tsx +41 -0
  95. package/src/components/atoms/Icon/icons/ArrowRightOutlineIcon.tsx +2 -7
  96. package/src/components/atoms/Icon/icons/BusIcon.tsx +52 -0
  97. package/src/components/atoms/Icon/icons/Calendar2Icon.tsx +54 -0
  98. package/src/components/atoms/Icon/icons/MapIcon.tsx +48 -0
  99. package/src/components/atoms/Icon/icons/MicroIcon.tsx +45 -0
  100. package/src/components/atoms/Icon/icons/MoreVerticalIcon.tsx +53 -0
  101. package/src/components/atoms/Icon/icons/NightIcon.tsx +45 -0
  102. package/src/components/atoms/Icon/icons/RowExcursion.tsx +54 -0
  103. package/src/components/atoms/Icon/icons/StopWatchIcon.tsx +45 -0
  104. package/src/components/atoms/Icon/icons/Utensils.tsx +45 -0
  105. package/src/components/atoms/Icon/icons/WalletIcon.tsx +45 -0
  106. package/src/components/atoms/Icon/icons/registry.tsx +50 -28
  107. package/src/components/atoms/Typography/Typography.tsx +22 -30
  108. package/src/components/molecules/ActionDropdown/ActionDropdown.css +23 -0
  109. package/src/components/molecules/ActionDropdown/ActionDropdown.tsx +53 -0
  110. package/src/components/molecules/DateDisplay/DateDisplay.tsx +47 -0
  111. package/src/components/molecules/FromTo/FromTo.tsx +31 -0
  112. package/src/components/molecules/TableServiceItem/DetailsCol.tsx +25 -0
  113. package/src/components/molecules/TableServiceItem/ItemCol.tsx +68 -0
  114. package/src/components/molecules/TableServiceItem/RowAccommodation.tsx +56 -0
  115. package/src/components/molecules/TableServiceItem/RowExcursion.tsx +40 -0
  116. package/src/components/molecules/TableServiceItem/RowOtherServices.tsx +50 -0
  117. package/src/components/molecules/TableServiceItem/RowTransfer.tsx +60 -0
  118. package/src/components/molecules/TableServiceItem/index.ts +24 -0
  119. package/src/components/molecules/TextWithIcon/TextWithIcon.tsx +62 -0
  120. package/src/components/molecules/TooltipDisplay/TooltipDisplay.tsx +32 -0
  121. package/src/components/organisms/CarBookingCard/index.ts +2 -0
  122. package/src/components/organisms/Table/Table.css +185 -0
  123. package/src/components/organisms/Table/Table.tsx +273 -0
  124. package/src/components/organisms/Table/TableCell.tsx +40 -0
  125. package/src/components/organisms/Table/columns/booking-columns.tsx +118 -0
  126. package/src/components/organisms/Table/columns/detail-resume-columns.tsx +226 -0
  127. package/src/components/organisms/Table/columns/index.ts +11 -0
  128. package/src/components/organisms/Table/columns/quotation-columns.tsx +150 -0
  129. package/src/components/organisms/Table/constant.ts +31 -0
  130. package/src/components/organisms/Table/index.ts +2 -0
  131. package/src/components/ui/popover.tsx +10 -10
  132. package/src/components/ui/tooltip.tsx +45 -0
  133. package/src/styles/components/typography.css +4 -0
@@ -0,0 +1,50 @@
1
+ /// <reference types="react" />
2
+ import { PaginationProps } from '../../molecules/Pagination/Pagination';
3
+ import './Table.css';
4
+ import { ColumnType } from './TableCell';
5
+ export type TableRowData<T = any> = {
6
+ /** Unique identifier for the row */
7
+ id?: string;
8
+ /** Whether the row is visible */
9
+ visible?: boolean;
10
+ /**
11
+ * Class name for the row
12
+ *
13
+ * Available classes:
14
+ * - table__row-yellow: For yellow rows
15
+ * - table__row-border-0: For no border
16
+ */
17
+ className?: string;
18
+ /** Children rows for the row */
19
+ children?: T[];
20
+ };
21
+ export interface TableProps<T extends TableRowData<T>> {
22
+ /** Columns definitions for the table */
23
+ columns: ColumnType<T>[];
24
+ /** Data for the table */
25
+ data: T[];
26
+ /** Callback function to be called when a row is clicked */
27
+ onClickRow?: (e: React.MouseEvent<HTMLTableRowElement>, row: T) => void;
28
+ /** Pagination configuration for the table */
29
+ pagination?: PaginationProps;
30
+ /** Total rows in the table */
31
+ totalRows?: Record<string, string | number>;
32
+ /** Whether the child rows are visible */
33
+ isGrouped?: boolean;
34
+ }
35
+ /**
36
+ * A table component for displaying structured data in rows and columns. Supports customizable column definitions and data rows.
37
+ *
38
+ * @example
39
+ * <Table
40
+ * columns={columns}
41
+ * data={data}
42
+ * pagination={pagination}
43
+ * onClickRow={onClickRow}
44
+ * />
45
+ *
46
+ * @param props TableProps<T>
47
+ * @returns React.ReactNode
48
+ *
49
+ */
50
+ export declare const Table: <T extends TableRowData<T>>(props: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,95 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { cn } from '@/src/lib/utils';
14
+ import { AnimatePresence, domAnimation, LazyMotion } from 'motion/react';
15
+ import * as motion from 'motion/react-m';
16
+ import { Fragment, useEffect, useRef, useState } from 'react';
17
+ import { Text } from '../../atoms/Typography/Typography';
18
+ import Pagination from '../../molecules/Pagination/Pagination';
19
+ import './Table.css';
20
+ import { TableCell } from './TableCell';
21
+ /**
22
+ * A component for displaying nested content in a table row.
23
+ *
24
+ * @example
25
+ * <NestedContent
26
+ * rowIndex={rowIndex}
27
+ * columns={columns}
28
+ * children={children}
29
+ * onClickRow={onClickRow}
30
+ * />
31
+ * @param NestedContentProps<T>
32
+ * @returns
33
+ */
34
+ var NestedContent = function (_a) {
35
+ var rowIndex = _a.rowIndex, columns = _a.columns, children = _a.children, isGrouped = _a.isGrouped, onClickRow = _a.onClickRow;
36
+ var contentRef = useRef(null);
37
+ var _b = useState(0), height = _b[0], setHeight = _b[1];
38
+ useEffect(function () {
39
+ if (contentRef.current) {
40
+ var measuredHeight = contentRef.current.scrollHeight;
41
+ setHeight(measuredHeight);
42
+ }
43
+ }, [children]);
44
+ var Tag = isGrouped ? 'div' : motion.div;
45
+ return (_jsx(Tag, __assign({ ref: contentRef, initial: { height: 0, opacity: 0 }, animate: { height: height, opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: {
46
+ height: { duration: 0.2, ease: 'easeInOut' },
47
+ opacity: { duration: 0.15, ease: 'easeInOut' },
48
+ }, className: "table__nested-wrapper" }, { children: _jsx("table", __assign({ className: "table" }, { children: _jsx("tbody", { children: children.map(function (child, childIndex) { return (_jsx("tr", __assign({ className: cn(child.className, {
49
+ 'table__row-clickable': onClickRow,
50
+ }), onClick: function (e) { return onClickRow === null || onClickRow === void 0 ? void 0 : onClickRow(e, child); } }, { children: _jsx(TableCell, { columns: columns, row: child, rowIndex: childIndex }) }), "ch-".concat(rowIndex, "-").concat(childIndex))); }) }) })) })));
51
+ };
52
+ /**
53
+ * A table component for displaying structured data in rows and columns. Supports customizable column definitions and data rows.
54
+ *
55
+ * @example
56
+ * <Table
57
+ * columns={columns}
58
+ * data={data}
59
+ * pagination={pagination}
60
+ * onClickRow={onClickRow}
61
+ * />
62
+ *
63
+ * @param props TableProps<T>
64
+ * @returns React.ReactNode
65
+ *
66
+ */
67
+ export var Table = function (props) {
68
+ var columns = props.columns, data = props.data, pagination = props.pagination, isGrouped = props.isGrouped, _a = props.totalRows, totalRows = _a === void 0 ? {} : _a, onClickRow = props.onClickRow;
69
+ var normalizeLastColumnWidth = function () {
70
+ var width = columns[columns.length - 1].width;
71
+ if (typeof width === 'number') {
72
+ return "".concat(width - 10, "px");
73
+ }
74
+ return width;
75
+ };
76
+ var hasTotal = Object.keys(totalRows).length > 0;
77
+ return (_jsx(LazyMotion, __assign({ features: domAnimation }, { children: _jsxs("div", { children: [_jsx("div", __assign({ className: cn('table-container', { 'table-container--no-total': !hasTotal }) }, { children: _jsxs("table", __assign({ className: "table" }, { children: [_jsx("thead", __assign({ className: "table__header" }, { children: _jsx("tr", { children: columns.map(function (column, columnIndex) { return (_jsx("th", __assign({ className: column.className, style: column.width
78
+ ? { minWidth: column.width, width: column.width }
79
+ : undefined }, { children: _jsx(Text, __assign({ variant: "bold", size: "sm" }, { children: column.header })) }), "hd-".concat(columnIndex))); }) }) })), _jsx("tbody", __assign({ className: "table__body" }, { children: data.map(function (row, rowIndex) {
80
+ var _a, _b;
81
+ var hasVisibleChildren = (_a = row.children) === null || _a === void 0 ? void 0 : _a.some(function (child) { return child.visible; });
82
+ var defaultTable = (_jsx("tr", __assign({ className: cn(row.className, {
83
+ 'table__row-nested': (_b = row.children) === null || _b === void 0 ? void 0 : _b.length,
84
+ 'table__row-clickable': onClickRow,
85
+ }), onClick: function (e) { return onClickRow === null || onClickRow === void 0 ? void 0 : onClickRow(e, row); } }, { children: _jsx(TableCell, { columns: columns, row: row, rowIndex: rowIndex }) })));
86
+ return (_jsx(Fragment, { children: isGrouped ? (row.children && row.children.length > 0 ? (_jsx("tr", __assign({ className: "table__row-grouped" }, { children: _jsx("td", __assign({ colSpan: columns.length }, { children: _jsx(NestedContent, { isGrouped: isGrouped, rowIndex: rowIndex, columns: columns, children: row.children || [], onClickRow: onClickRow }) })) }))) : (defaultTable)) : (_jsxs(_Fragment, { children: [defaultTable, _jsx(AnimatePresence, __assign({ initial: false }, { children: hasVisibleChildren && (_jsx("tr", __assign({ className: cn('table__no-hover', {
87
+ 'table__row-nested': row.children && row.children.length > 0,
88
+ }) }, { children: _jsx("td", __assign({ colSpan: columns.length, className: "table__cell-nested" }, { children: _jsx(NestedContent, { rowIndex: rowIndex, columns: columns, children: row.children || [], onClickRow: onClickRow }) })) }), "nested-".concat(rowIndex))) }))] })) }, "rw-".concat(rowIndex)));
89
+ }) }))] })) })), hasTotal && (_jsx("div", __assign({ className: "table__total-container" }, { children: _jsx("table", __assign({ className: "table" }, { children: _jsx("tbody", __assign({ className: "table__total" }, { children: _jsxs("tr", { children: [_jsx("td", { colSpan: columns.length - 1 }), _jsx("td", __assign({ style: {
90
+ '--last-column-width': normalizeLastColumnWidth(),
91
+ } }, { children: _jsxs("div", __assign({ className: "relative" }, { children: [_jsxs(Text, __assign({ size: "md", variant: "bold", className: "absolute top-0 -left-3 -translate-x-full" }, { children: ["Total :", ' '] })), _jsx("div", { children: Object.entries(totalRows).map(function (_a) {
92
+ var currency = _a[0], total = _a[1];
93
+ return (_jsx("div", { children: _jsxs(Text, __assign({ size: "md", variant: "bold" }, { children: [currency, " ", total] })) }, currency));
94
+ }) })] })) }))] }) })) })) }))), pagination && (_jsx("div", __assign({ className: "flex justify-end mt-4" }, { children: _jsx(Pagination, __assign({}, pagination)) })))] }) })));
95
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { TableRowData } from './Table';
3
+ export type ColumnType<T = TableRowData> = {
4
+ header: string;
5
+ key: Extract<keyof T, string> | 'actions';
6
+ className?: string;
7
+ width?: number | string;
8
+ cell: (value: T[Extract<keyof T, string>], rawData: T, index?: number) => React.ReactNode;
9
+ };
10
+ export interface TableCellProps<T = TableRowData> {
11
+ columns: ColumnType<T>[];
12
+ row: T;
13
+ rowIndex: number;
14
+ }
15
+ export declare const TableCell: <T extends TableRowData<any>>(props: TableCellProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
13
+ export var TableCell = function (props) {
14
+ var columns = props.columns, row = props.row, rowIndex = props.rowIndex;
15
+ return (_jsx(_Fragment, { children: columns.map(function (column, columnIndex) { return (_jsx("td", __assign({ style: column.width ? { minWidth: column.width, width: column.width } : undefined }, { children: column.key === 'actions' ? (_jsx("div", { children: column.cell({}, row, rowIndex) })) : (column.cell(row[column.key], row, rowIndex)) }), "cl-".concat(rowIndex, "-").concat(columnIndex))); }) }));
16
+ };
@@ -0,0 +1,7 @@
1
+ import { ActionDropdownType } from '@/src/types/table';
2
+ import { BookingListItem } from '@/src/types/table/booking.types';
3
+ import { ColumnType } from '../TableCell';
4
+ export declare const bookingColumns: (params: {
5
+ onExpand: (value?: BookingListItem) => void;
6
+ onAction: (action: ActionDropdownType) => void;
7
+ }) => ColumnType<BookingListItem>[];
@@ -0,0 +1,83 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Button from '@/src/components/atoms/Button/Button';
14
+ import Chip from '@/src/components/atoms/Chip/Chip';
15
+ import { Text } from '@/src/components/atoms/Typography/Typography';
16
+ import { ActionDropdown } from '@/src/components/molecules/ActionDropdown/ActionDropdown';
17
+ import { DateDisplay } from '@/src/components/molecules/DateDisplay/DateDisplay';
18
+ import { actionDropdownData } from '../constant';
19
+ export var bookingColumns = function (_a) {
20
+ var onExpand = _a.onExpand, onAction = _a.onAction;
21
+ return [
22
+ {
23
+ header: 'Quote nb.',
24
+ key: 'booking_id',
25
+ width: 150,
26
+ cell: function (value) { return (_jsx(Text, __assign({ variant: "medium", size: "sm" }, { children: value }))); },
27
+ },
28
+ {
29
+ header: 'Client name',
30
+ key: 'agency_name',
31
+ width: 150,
32
+ cell: function (value) { return (_jsx(Text, __assign({ variant: "medium", size: "sm" }, { children: value }))); },
33
+ },
34
+ {
35
+ header: 'Type',
36
+ key: 'status',
37
+ width: 145,
38
+ cell: function (value) {
39
+ return (_jsx(Text, __assign({ variant: "medium", size: "sm" }, { children: "STD" })));
40
+ },
41
+ },
42
+ {
43
+ header: 'From → To',
44
+ key: 'date',
45
+ width: 260,
46
+ cell: function (value) {
47
+ var dates = value;
48
+ return _jsx(DateDisplay, { date: dates });
49
+ },
50
+ },
51
+ {
52
+ header: 'No. of services',
53
+ key: 'pax_details',
54
+ width: 350,
55
+ cell: function (value) {
56
+ var paxDetails = value;
57
+ var paxDetailsKeys = Object.keys(paxDetails);
58
+ if (paxDetailsKeys.length) {
59
+ return (_jsx("div", __assign({ className: "flex flex-wrap gap-2" }, { children: paxDetailsKeys.map(function (key) {
60
+ return (_jsx(Chip, { label: "".concat(key, " ").concat(paxDetails[key]), type: paxDetails[key] > 0
61
+ ? 'filled'
62
+ : 'outline', color: "accent", size: "sm" }));
63
+ }) })));
64
+ }
65
+ return _jsx(_Fragment, {});
66
+ },
67
+ },
68
+ {
69
+ header: 'Created by',
70
+ key: 'created_by',
71
+ width: 160,
72
+ cell: function (value) { return (_jsx(Text, __assign({ variant: "medium", size: "sm" }, { children: value }))); },
73
+ },
74
+ {
75
+ header: '',
76
+ key: 'actions',
77
+ width: 232,
78
+ cell: function (_value, raw) {
79
+ return (_jsx("div", { children: _jsxs("div", __assign({ className: "flex items-center gap-x-8" }, { children: [_jsxs("div", __assign({ className: "flex items-center gap-x-3" }, { children: [_jsx(Button, __assign({ variant: "secondary", size: "sm", className: "w-[89px]" }, { children: "Proforma" })), _jsx(Button, __assign({ variant: "outline-secondary", size: "sm", className: "w-[89px]" }, { children: "Voucher" }))] })), _jsx(ActionDropdown, { data: actionDropdownData(onAction) })] })) }));
80
+ },
81
+ },
82
+ ];
83
+ };
@@ -0,0 +1,3 @@
1
+ import { DetailResumeItem } from '@/src/types/table';
2
+ import { ColumnType } from '../TableCell';
3
+ export declare const detailResumeColumns: () => ColumnType<DetailResumeItem>[];
@@ -0,0 +1,178 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Chip from '@/src/components/atoms/Chip/Chip';
14
+ import { Text } from '@/src/components/atoms/Typography/Typography';
15
+ import { DateDisplay } from '@/src/components/molecules/DateDisplay/DateDisplay';
16
+ import { ServiceType, } from '@/src/types/table';
17
+ import { RowAccommodation } from '../../../molecules/TableServiceItem/RowAccommodation';
18
+ import { RowExcursion } from '../../../molecules/TableServiceItem/RowExcursion';
19
+ import { RowOtherServices } from '../../../molecules/TableServiceItem/RowOtherServices';
20
+ import { RowTransfer } from '../../../molecules/TableServiceItem/RowTransfer';
21
+ export var detailResumeColumns = function () {
22
+ return [
23
+ {
24
+ header: 'Item',
25
+ key: 'Type',
26
+ width: 268,
27
+ cell: function (value, raw) {
28
+ if (value === ServiceType.ACCOMMODATION) {
29
+ var accom = raw;
30
+ console.log(accom);
31
+ return (_jsx(RowAccommodation.FirstCol, { serviceName: accom.HotelName, offers: accom.Offers, status: accom.RoomStatus }));
32
+ }
33
+ if (value === ServiceType.EXCURSION) {
34
+ var excursion = raw;
35
+ return (_jsx(RowExcursion.FirstCol, { serviceName: excursion.ExcursionName }));
36
+ }
37
+ if (value === ServiceType.TRANSFER) {
38
+ var transfer = raw;
39
+ return (_jsx(RowTransfer.FirstCol, { serviceName: transfer.VehicleTypeName, transferType: transfer.TransferType, from: transfer.LocationFromName, to: transfer.LocationToName }));
40
+ }
41
+ if (value === ServiceType.OTHER_SERVICE) {
42
+ return _jsx(RowOtherServices.FirstCol, {});
43
+ }
44
+ return _jsx(_Fragment, {});
45
+ },
46
+ },
47
+ {
48
+ header: 'Details',
49
+ key: 'Type',
50
+ width: 400,
51
+ cell: function (value, raw, index) {
52
+ if (value === ServiceType.ACCOMMODATION) {
53
+ var accom = raw;
54
+ return (_jsx(RowAccommodation.DetailsCol, { data: {
55
+ RoomName: accom.RoomName,
56
+ Dates: accom.Dates,
57
+ ClientCategory: accom.ClientCategory,
58
+ MealPlan: accom.MealPlan,
59
+ }, index: (index || 0) + 1 }));
60
+ }
61
+ if (value === ServiceType.EXCURSION) {
62
+ var excursion = raw;
63
+ return (_jsx(RowExcursion.DetailsCol, { data: {
64
+ languages: excursion.AvailableLanguages,
65
+ duration: excursion.Duration,
66
+ accessibility: excursion.Accessibility,
67
+ transferType: excursion.TransferType,
68
+ } }));
69
+ }
70
+ if (value === ServiceType.TRANSFER) {
71
+ var transfer = raw;
72
+ return (_jsx(RowTransfer.DetailsCol, { data: {
73
+ carType: transfer.VehicleTypeName,
74
+ clientType: 'STD',
75
+ } }));
76
+ }
77
+ if (value === ServiceType.OTHER_SERVICE) {
78
+ return _jsx(RowOtherServices.DetailsCol, {});
79
+ }
80
+ return _jsx(_Fragment, {});
81
+ },
82
+ },
83
+ {
84
+ header: 'Date',
85
+ key: 'Type',
86
+ width: 307,
87
+ cell: function (value, raw) {
88
+ var date = [];
89
+ switch (value) {
90
+ case ServiceType.ACCOMMODATION:
91
+ var accom = raw;
92
+ date = accom.Dates;
93
+ break;
94
+ case ServiceType.EXCURSION:
95
+ var excursion = raw;
96
+ date = [excursion.ServiceDate];
97
+ break;
98
+ case ServiceType.TRANSFER:
99
+ var transfer = raw;
100
+ date = [transfer.TransferDate];
101
+ break;
102
+ case ServiceType.OTHER_SERVICE:
103
+ var otherService = raw;
104
+ date = [otherService.service_date];
105
+ break;
106
+ }
107
+ return _jsx(DateDisplay, { date: date });
108
+ },
109
+ },
110
+ {
111
+ header: 'No. of pax',
112
+ key: 'Type',
113
+ width: 396,
114
+ cell: function (value, raw) {
115
+ var pax = {
116
+ Adult: 0,
117
+ Teen: 0,
118
+ Infant: 0,
119
+ Child: 0,
120
+ };
121
+ switch (value) {
122
+ case ServiceType.ACCOMMODATION:
123
+ case ServiceType.EXCURSION:
124
+ case ServiceType.TRANSFER:
125
+ var item = raw;
126
+ pax.Adult = item.AdultCount;
127
+ pax.Teen = item.TeenCount;
128
+ pax.Infant = item.InfantCount;
129
+ pax.Child = item.ChildCount;
130
+ break;
131
+ case ServiceType.OTHER_SERVICE:
132
+ var otherService = raw;
133
+ pax.Adult = otherService.adult_pax;
134
+ pax.Teen = otherService.teen_pax;
135
+ pax.Infant = otherService.infant_pax;
136
+ pax.Child = otherService.child_pax;
137
+ break;
138
+ }
139
+ return (_jsx("div", __assign({ className: "flex items-center gap-x-3" }, { children: Object.keys(pax).map(function (k, index) {
140
+ var _a;
141
+ var count = (_a = pax[k]) !== null && _a !== void 0 ? _a : 0;
142
+ var type = count > 0 ? 'filled' : 'outline';
143
+ return (_jsx(Chip, { label: "".concat(k, " ").concat(count), size: "sm", color: "accent", type: type, className: "!px-3" }, "pax-".concat(index)));
144
+ }) })));
145
+ },
146
+ },
147
+ {
148
+ header: 'Price',
149
+ key: 'Type',
150
+ width: 299,
151
+ cell: function (value, raw) {
152
+ var total = {
153
+ currency: undefined,
154
+ total: undefined,
155
+ };
156
+ switch (value) {
157
+ case ServiceType.ACCOMMODATION:
158
+ var accom = raw;
159
+ total.currency = accom.Currency;
160
+ total.total = accom.Total;
161
+ break;
162
+ case ServiceType.EXCURSION:
163
+ case ServiceType.TRANSFER:
164
+ var item = raw;
165
+ total.currency = item.Currency;
166
+ total.total = item.TotalPrice;
167
+ break;
168
+ case ServiceType.OTHER_SERVICE:
169
+ var otherService = raw;
170
+ total.currency = otherService.currency;
171
+ total.total = otherService.total_price;
172
+ break;
173
+ }
174
+ return (_jsxs(Text, __assign({ size: "sm", variant: "bold" }, { children: [total.currency, " ", total.total] })));
175
+ },
176
+ },
177
+ ];
178
+ };
@@ -0,0 +1,12 @@
1
+ declare const columns: {
2
+ quotation: (params: {
3
+ onExpand: (value?: import("../../../..").QuotationListItem | undefined) => void;
4
+ onAction: (action: import("../../../..").ActionDropdownType) => void;
5
+ }) => import("../TableCell").ColumnType<import("../../../..").QuotationListItem>[];
6
+ detailResume: () => import("../TableCell").ColumnType<import("../../../..").DetailResumeItem>[];
7
+ booking: (params: {
8
+ onExpand: (value?: import("../../../../types/table/booking.types").BookingListItem | undefined) => void;
9
+ onAction: (action: import("../../../..").ActionDropdownType) => void;
10
+ }) => import("../TableCell").ColumnType<import("../../../../types/table/booking.types").BookingListItem>[];
11
+ };
12
+ export { columns };
@@ -0,0 +1,9 @@
1
+ import { bookingColumns } from './booking-columns';
2
+ import { detailResumeColumns } from './detail-resume-columns';
3
+ import { quotationColumns } from './quotation-columns';
4
+ var columns = {
5
+ quotation: quotationColumns,
6
+ detailResume: detailResumeColumns,
7
+ booking: bookingColumns,
8
+ };
9
+ export { columns };
@@ -0,0 +1,7 @@
1
+ import { ActionDropdownType } from '@/src/types/table/action-dropdown-type.types';
2
+ import { QuotationListItem } from '@/src/types/table/quotation.types';
3
+ import { ColumnType } from '../TableCell';
4
+ export declare const quotationColumns: (params: {
5
+ onExpand: (value?: QuotationListItem) => void;
6
+ onAction: (action: ActionDropdownType) => void;
7
+ }) => ColumnType<QuotationListItem>[];
@@ -0,0 +1,91 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Button from '@/src/components/atoms/Button/Button';
14
+ import Chip from '@/src/components/atoms/Chip/Chip';
15
+ import { Text } from '@/src/components/atoms/Typography/Typography';
16
+ import { ActionDropdown } from '@/src/components/molecules/ActionDropdown/ActionDropdown';
17
+ import { DateDisplay } from '@/src/components/molecules/DateDisplay/DateDisplay';
18
+ import { cn } from '@/src/lib/utils';
19
+ import { actionDropdownData, chipVariant, clientTypeMap } from '../constant';
20
+ export var quotationColumns = function (_a) {
21
+ var onExpand = _a.onExpand, onAction = _a.onAction;
22
+ return [
23
+ {
24
+ header: 'Quote nb.',
25
+ key: 'file_nb',
26
+ width: 150,
27
+ cell: function (value) { return (_jsx(Text, __assign({ variant: "medium", size: "sm" }, { children: value }))); },
28
+ },
29
+ {
30
+ header: 'Client name',
31
+ key: 'agency_name',
32
+ width: 150,
33
+ cell: function (value) { return (_jsx(Text, __assign({ variant: "medium", size: "sm" }, { children: value }))); },
34
+ },
35
+ {
36
+ header: 'File status',
37
+ key: 'status',
38
+ width: 160,
39
+ cell: function (value, raw) {
40
+ var isMultiple = raw.children && raw.children.length > 0;
41
+ return (_jsx(Chip, __assign({ color: isMultiple ? 'blue' : chipVariant[value.toLowerCase()], size: "sm" }, { children: isMultiple ? 'Multiple' : value })));
42
+ },
43
+ },
44
+ {
45
+ header: 'Type',
46
+ key: 'client_type',
47
+ width: 145,
48
+ cell: function (value) {
49
+ var clientType = clientTypeMap[value];
50
+ return (_jsx(Text, __assign({ variant: "medium", size: "sm" }, { children: clientType !== null && clientType !== void 0 ? clientType : value })));
51
+ },
52
+ },
53
+ {
54
+ header: 'From → To',
55
+ key: 'date',
56
+ width: 260,
57
+ cell: function (value) {
58
+ var dates = value;
59
+ return _jsx(DateDisplay, { date: dates });
60
+ },
61
+ },
62
+ {
63
+ header: 'No. of services',
64
+ key: 'service_count',
65
+ width: 350,
66
+ cell: function (value) {
67
+ var _a = value, accom_count = _a.accom_count, transfer_count = _a.transfer_count, tours_count = _a.tours_count;
68
+ return (_jsxs("div", __assign({ className: "flex flex-wrap gap-2" }, { children: [_jsx(Chip, { label: "Accomodation ".concat(accom_count), type: accom_count > 0 ? 'filled' : 'outline', color: "accent", size: "sm" }), _jsx(Chip, { label: "Transfer ".concat(transfer_count), type: transfer_count > 0 ? 'filled' : 'outline', color: "accent", size: "sm" }), _jsx(Chip, { label: "Excursion ".concat(tours_count), type: tours_count > 0 ? 'filled' : 'outline', color: "accent", size: "sm" })] })));
69
+ },
70
+ },
71
+ {
72
+ header: 'Created by',
73
+ key: 'created_by',
74
+ width: 160,
75
+ cell: function (value) { return (_jsx(Text, __assign({ variant: "medium", size: "sm" }, { children: value }))); },
76
+ },
77
+ {
78
+ header: '',
79
+ key: 'actions',
80
+ width: 232,
81
+ cell: function (_value, raw) {
82
+ var _a;
83
+ var hasChildren = raw.children && raw.children.length > 0;
84
+ var isExpanded = (_a = raw.children) === null || _a === void 0 ? void 0 : _a.some(function (child) { return child.visible; });
85
+ var buttonLabel = isExpanded ? 'See less' : 'See more';
86
+ var isOnRequest = raw.status.toLowerCase() === 'on request';
87
+ return (_jsx("div", { children: hasChildren ? (_jsx(Button, __assign({ variant: "outline-primary", size: "sm", trailingIcon: "chevron-down", className: cn('table__button', isExpanded && 'table__button-expanded'), onClick: function () { return onExpand(raw); } }, { children: buttonLabel }))) : (_jsxs("div", __assign({ className: "flex itemes-center gap-x-8" }, { children: [_jsx(Button, __assign({ variant: isOnRequest ? 'outline-secondary' : 'secondary', size: "sm", className: "table__button" }, { children: isOnRequest ? 'Request to book' : 'Book now' })), _jsx(ActionDropdown, { data: actionDropdownData(onAction) })] }))) }));
88
+ },
89
+ },
90
+ ];
91
+ };
@@ -0,0 +1,6 @@
1
+ import { ActionDropdownType } from '@/src/types/table';
2
+ import { ChipProps } from '../../atoms/Chip/Chip';
3
+ import { ActionDropdownItem } from '../../molecules/ActionDropdown/ActionDropdown';
4
+ export declare const actionDropdownData: (onAction: (action: ActionDropdownType) => void) => ActionDropdownItem[];
5
+ export declare const chipVariant: Record<string, ChipProps['color']>;
6
+ export declare const clientTypeMap: Record<string, string>;
@@ -0,0 +1,24 @@
1
+ import { ActionDropdownType } from '@/src/types/table';
2
+ export var actionDropdownData = function (onAction) { return [
3
+ {
4
+ label: 'Add item',
5
+ onClick: function () { return onAction(ActionDropdownType.ADD_ITEM); },
6
+ },
7
+ {
8
+ label: 'Send via mail',
9
+ onClick: function () { return onAction(ActionDropdownType.SEND_VIA_MAIL); },
10
+ },
11
+ {
12
+ label: 'Delete quote',
13
+ onClick: function () { return onAction(ActionDropdownType.DELETE_QUOTE); },
14
+ },
15
+ ]; };
16
+ export var chipVariant = {
17
+ 'free sales': 'accent',
18
+ 'on request': 'yellow',
19
+ };
20
+ export var clientTypeMap = {
21
+ 'standard-client': 'STD',
22
+ honeymooners: 'HMN',
23
+ vip: 'VIP',
24
+ };
@@ -0,0 +1,2 @@
1
+ export * from './columns';
2
+ export * from './Table';
@@ -0,0 +1,2 @@
1
+ export * from './columns';
2
+ export * from './Table';
@@ -1,7 +1,7 @@
1
- import * as React from "react";
2
- import * as PopoverPrimitive from "@radix-ui/react-popover";
1
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
2
+ import * as React from 'react';
3
3
  declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
4
  declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
5
  declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
6
  declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
7
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
7
+ export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };