mautourco-components 0.2.140 → 0.2.142

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.
@@ -48,7 +48,7 @@ var NestedContent = function (_a) {
48
48
  opacity: { duration: 0.15, ease: 'easeInOut' },
49
49
  }, className: "table__nested-wrapper", children: _jsx("table", { className: "table", children: _jsx("tbody", { children: children.map(function (child, childIndex) { return (_jsx("tr", { className: cn(child.className, {
50
50
  'table__row-clickable': onClickRow,
51
- }), onClick: function (e) { return onClickRow === null || onClickRow === void 0 ? void 0 : onClickRow(e, child, { parentIndex: parentIndex, childIndex: childIndex }); }, children: _jsx(TableCell, { columns: columns, row: child, rowIndex: childIndex, childIndex: childIndex }) }, "ch-".concat(rowIndex, "-").concat(childIndex))); }) }) }) }));
51
+ }), onClick: function (e) { return onClickRow === null || onClickRow === void 0 ? void 0 : onClickRow(e, child, { parentIndex: parentIndex, childIndex: childIndex }); }, children: _jsx(TableCell, { columns: columns, row: child, rowIndex: childIndex, childIndex: childIndex }) }, "ch-".concat(child.id, "-").concat(rowIndex, "-").concat(childIndex))); }) }) }) }));
52
52
  };
53
53
  /**
54
54
  * A table component for displaying structured data in rows and columns. Supports customizable column definitions and data rows.
@@ -92,13 +92,13 @@ export function Table(props) {
92
92
  'table__children--visible': hasVisibleChildren,
93
93
  }), children: _jsx("div", { className: "table__children-wrapper", children: _jsx("table", { className: "table", children: _jsxs("tbody", { children: [defaultTable, _jsx(AnimatePresence, { initial: false, children: hasVisibleChildren && (_jsx("tr", { className: cn('table__no-hover', {
94
94
  'table__row-nested': row.children && row.children.length > 0,
95
- }), children: _jsx("td", { colSpan: columns.length, className: "table__cell-nested", children: _jsx(NestedContent, { rowIndex: rowIndex, columns: columns, parentIndex: rowIndex, children: row.children || [], onClickRow: onClickRow }) }) }, "nested-".concat(rowIndex))) })] }) }) }) }) })) }, "rw-".concat(rowIndex)));
95
+ }), children: _jsx("td", { colSpan: columns.length, className: "table__cell-nested", children: _jsx(NestedContent, { rowIndex: rowIndex, columns: columns, parentIndex: rowIndex, children: row.children || [], onClickRow: onClickRow }) }) }, "nested-".concat(row.id, "-").concat(rowIndex))) })] }) }) }) }) })) }, "rw-".concat(row.id, "-").concat(rowIndex)));
96
96
  }), data.length === 0 && (_jsx("tr", { children: _jsx("td", { colSpan: columns.length, className: "table__cell-empty", children: _jsx(Text, { size: "md", variant: "bold", className: "text-center", children: "No data found" }) }) }))] })] }) }), hasTotal && (_jsx("div", { className: 'table__total-container', children: _jsx("table", { className: "table", children: _jsx("tbody", { className: cn('table__total', {
97
97
  'table__total--dashed': isTotalBorderDash,
98
98
  }), children: _jsxs("tr", { children: [_jsx("td", { colSpan: columns.length - 1 }), _jsx("td", { style: {
99
99
  '--last-column-width': normalizeLastColumnWidth(),
100
100
  }, children: _jsxs("div", { className: "relative", children: [_jsxs(Text, { size: "md", variant: "bold", className: "absolute top-0 -left-3 -translate-x-full", children: ["Total :", ' '] }), _jsx("div", { children: Object.entries(totalRows).map(function (_a) {
101
101
  var currency = _a[0], total = _a[1];
102
- return (_jsx("div", { children: _jsx(Text, { size: "md", variant: "bold", children: priceFormatter(total, currency) }) }, currency));
102
+ return (_jsx("div", { children: _jsx(Text, { size: "md", variant: "bold", children: priceFormatter(total, currency) }) }, "total-".concat(total, "-").concat(currency)));
103
103
  }) })] }) })] }) }) }) })), pagination && (_jsx("div", { className: "flex justify-end mt-4", children: _jsx(Pagination, __assign({}, pagination)) }))] }) }));
104
104
  }
@@ -19,7 +19,7 @@ export var comparisonColumns = function () {
19
19
  return (_jsx(RowAccommodation.FirstCol, { serviceName: raw.hotelName, offers: raw.offers, status: raw.roomName }));
20
20
  }
21
21
  if (isComparisonExcursion(raw)) {
22
- return _jsx(RowExcursion.FirstCol, { serviceName: raw.name });
22
+ return (_jsx(RowExcursion.FirstCol, { serviceName: raw.name, extraContent: raw.pickUpPoint }));
23
23
  }
24
24
  if (isComparisonTransfer(raw)) {
25
25
  var transfer = raw;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mautourco-components",
3
- "version": "0.2.140",
3
+ "version": "0.2.142",
4
4
  "private": false,
5
5
  "description": "Bibliothèque de composants Mautourco pour le redesign",
6
6
  "main": "dist/index.js",
@@ -119,7 +119,7 @@ const NestedContent = <T extends TableRowData<T>>({
119
119
  <tbody>
120
120
  {children.map((child, childIndex) => (
121
121
  <tr
122
- key={`ch-${rowIndex}-${childIndex}`}
122
+ key={`ch-${child.id}-${rowIndex}-${childIndex}`}
123
123
  className={cn(child.className, {
124
124
  'table__row-clickable': onClickRow,
125
125
  })}
@@ -236,7 +236,7 @@ export function Table<T extends TableRowData<T>>(props: TableProps<T>) {
236
236
  );
237
237
 
238
238
  return (
239
- <Fragment key={`rw-${rowIndex}`}>
239
+ <Fragment key={`rw-${row.id}-${rowIndex}`}>
240
240
  {isGrouped ? (
241
241
  row.children && row.children.length > 0 ? (
242
242
  <tr
@@ -273,7 +273,7 @@ export function Table<T extends TableRowData<T>>(props: TableProps<T>) {
273
273
  <AnimatePresence initial={false}>
274
274
  {hasVisibleChildren && (
275
275
  <tr
276
- key={`nested-${rowIndex}`}
276
+ key={`nested-${row.id}-${rowIndex}`}
277
277
  className={cn('table__no-hover', {
278
278
  'table__row-nested':
279
279
  row.children && row.children.length > 0,
@@ -337,7 +337,7 @@ export function Table<T extends TableRowData<T>>(props: TableProps<T>) {
337
337
  </Text>
338
338
  <div>
339
339
  {Object.entries(totalRows).map(([currency, total]) => (
340
- <div key={currency}>
340
+ <div key={`total-${total}-${currency}`}>
341
341
  <Text size="md" variant="bold">
342
342
  {priceFormatter(total, currency)}
343
343
  </Text>
@@ -32,7 +32,12 @@ export const comparisonColumns: () => ColumnType<ComparisonData>[] = () => {
32
32
  );
33
33
  }
34
34
  if (isComparisonExcursion(raw)) {
35
- return <RowExcursion.FirstCol serviceName={raw.name as string} />;
35
+ return (
36
+ <RowExcursion.FirstCol
37
+ serviceName={raw.name as string}
38
+ extraContent={raw.pickUpPoint}
39
+ />
40
+ );
36
41
  }
37
42
  if (isComparisonTransfer(raw)) {
38
43
  const transfer = raw;