erp-pos-ecommerce-shared 0.2.20 → 0.2.21

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.
@@ -1296,6 +1296,7 @@ function useDataTable({
1296
1296
  }
1297
1297
  var defaultHeaderTextColor = "light-dark(var(--mantine-color-dimmed), var(--mantine-color-gray-4))";
1298
1298
  var defaultHeaderHoverBg = "light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-2))";
1299
+ var actionsColumnWidth = 56;
1299
1300
  function normalizeHeaderStyle(value) {
1300
1301
  if (value == null) {
1301
1302
  return {
@@ -1343,8 +1344,9 @@ var TableHeader = ({
1343
1344
  };
1344
1345
  const getColumnStyle = (size) => {
1345
1346
  if (!size || totalColumnsSize <= 0) return void 0;
1347
+ const baseWidth = `${size / totalColumnsSize * 100}%`;
1346
1348
  return {
1347
- width: `${size / totalColumnsSize * 100}%`,
1349
+ width: hasActionsColumn ? `calc((100% - ${actionsColumnWidth}px) * ${size / totalColumnsSize})` : baseWidth,
1348
1350
  minWidth: size
1349
1351
  };
1350
1352
  };
@@ -1418,12 +1420,20 @@ var TableHeader = ({
1418
1420
  header.id
1419
1421
  );
1420
1422
  }),
1421
- hasActionsColumn && /* @__PURE__ */ jsx(Table.Th, { bg: bgColor })
1423
+ hasActionsColumn && /* @__PURE__ */ jsx(
1424
+ Table.Th,
1425
+ {
1426
+ bg: bgColor,
1427
+ style: { width: actionsColumnWidth, minWidth: actionsColumnWidth }
1428
+ }
1429
+ )
1422
1430
  ] }, headerGroup.id)) });
1423
1431
  };
1432
+ var actionsColumnWidth2 = 56;
1424
1433
  var TableBody = ({
1425
1434
  table,
1426
1435
  canCheck = false,
1436
+ hasActionsColumn = false,
1427
1437
  columnActions,
1428
1438
  MenuIcon = MoreVertical,
1429
1439
  listMenuActions,
@@ -1434,8 +1444,9 @@ var TableBody = ({
1434
1444
  const totalColumnsSize = table.getVisibleLeafColumns().reduce((sum, column) => sum + column.getSize(), 0);
1435
1445
  const getColumnStyle = (size) => {
1436
1446
  if (!size || totalColumnsSize <= 0) return void 0;
1447
+ const baseWidth = `${size / totalColumnsSize * 100}%`;
1437
1448
  return {
1438
- width: `${size / totalColumnsSize * 100}%`,
1449
+ width: hasActionsColumn ? `calc((100% - ${actionsColumnWidth2}px) * ${size / totalColumnsSize})` : baseWidth,
1439
1450
  minWidth: size
1440
1451
  };
1441
1452
  };
@@ -1497,7 +1508,7 @@ var TableBody = ({
1497
1508
  },
1498
1509
  cell.id
1499
1510
  )),
1500
- (columnActions || listMenuActions) && /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Flex, { justify: "flex-end", align: "center", gap: "sm", children: [
1511
+ (columnActions || listMenuActions) && /* @__PURE__ */ jsx(Table.Td, { style: { width: actionsColumnWidth2, minWidth: actionsColumnWidth2 }, children: /* @__PURE__ */ jsxs(Flex, { justify: "flex-end", align: "center", gap: "sm", children: [
1501
1512
  columnActions?.(row.original),
1502
1513
  listMenuActions && /* @__PURE__ */ jsxs(Menu, { variant: "subtle", children: [
1503
1514
  /* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "gray", size: "sm", children: /* @__PURE__ */ jsx(MenuIcon, { size: 16 }) }) }),
@@ -1686,6 +1697,7 @@ var SimpleDataTable = ({
1686
1697
  onRowHover,
1687
1698
  table,
1688
1699
  canCheck,
1700
+ hasActionsColumn,
1689
1701
  columnActions,
1690
1702
  listMenuActions
1691
1703
  }