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.
package/dist/index.js CHANGED
@@ -6070,6 +6070,7 @@ var BottomPagination = ({
6070
6070
  };
6071
6071
  var defaultHeaderTextColor = "light-dark(var(--mantine-color-dimmed), var(--mantine-color-gray-4))";
6072
6072
  var defaultHeaderHoverBg = "light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-2))";
6073
+ var actionsColumnWidth = 56;
6073
6074
  function normalizeHeaderStyle(value) {
6074
6075
  if (value == null) {
6075
6076
  return {
@@ -6117,8 +6118,9 @@ var TableHeader = ({
6117
6118
  };
6118
6119
  const getColumnStyle = (size) => {
6119
6120
  if (!size || totalColumnsSize <= 0) return void 0;
6121
+ const baseWidth = `${size / totalColumnsSize * 100}%`;
6120
6122
  return {
6121
- width: `${size / totalColumnsSize * 100}%`,
6123
+ width: hasActionsColumn ? `calc((100% - ${actionsColumnWidth}px) * ${size / totalColumnsSize})` : baseWidth,
6122
6124
  minWidth: size
6123
6125
  };
6124
6126
  };
@@ -6192,12 +6194,20 @@ var TableHeader = ({
6192
6194
  header.id
6193
6195
  );
6194
6196
  }),
6195
- hasActionsColumn && /* @__PURE__ */ jsx(Table.Th, { bg: bgColor })
6197
+ hasActionsColumn && /* @__PURE__ */ jsx(
6198
+ Table.Th,
6199
+ {
6200
+ bg: bgColor,
6201
+ style: { width: actionsColumnWidth, minWidth: actionsColumnWidth }
6202
+ }
6203
+ )
6196
6204
  ] }, headerGroup.id)) });
6197
6205
  };
6206
+ var actionsColumnWidth2 = 56;
6198
6207
  var TableBody = ({
6199
6208
  table,
6200
6209
  canCheck = false,
6210
+ hasActionsColumn = false,
6201
6211
  columnActions,
6202
6212
  MenuIcon = MoreVertical,
6203
6213
  listMenuActions,
@@ -6208,8 +6218,9 @@ var TableBody = ({
6208
6218
  const totalColumnsSize = table.getVisibleLeafColumns().reduce((sum, column) => sum + column.getSize(), 0);
6209
6219
  const getColumnStyle = (size) => {
6210
6220
  if (!size || totalColumnsSize <= 0) return void 0;
6221
+ const baseWidth = `${size / totalColumnsSize * 100}%`;
6211
6222
  return {
6212
- width: `${size / totalColumnsSize * 100}%`,
6223
+ width: hasActionsColumn ? `calc((100% - ${actionsColumnWidth2}px) * ${size / totalColumnsSize})` : baseWidth,
6213
6224
  minWidth: size
6214
6225
  };
6215
6226
  };
@@ -6271,7 +6282,7 @@ var TableBody = ({
6271
6282
  },
6272
6283
  cell.id
6273
6284
  )),
6274
- (columnActions || listMenuActions) && /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Flex, { justify: "flex-end", align: "center", gap: "sm", children: [
6285
+ (columnActions || listMenuActions) && /* @__PURE__ */ jsx(Table.Td, { style: { width: actionsColumnWidth2, minWidth: actionsColumnWidth2 }, children: /* @__PURE__ */ jsxs(Flex, { justify: "flex-end", align: "center", gap: "sm", children: [
6275
6286
  columnActions?.(row.original),
6276
6287
  listMenuActions && /* @__PURE__ */ jsxs(Menu, { variant: "subtle", children: [
6277
6288
  /* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "gray", size: "sm", children: /* @__PURE__ */ jsx(MenuIcon, { size: 16 }) }) }),
@@ -6460,6 +6471,7 @@ var SimpleDataTable = ({
6460
6471
  onRowHover,
6461
6472
  table,
6462
6473
  canCheck,
6474
+ hasActionsColumn,
6463
6475
  columnActions,
6464
6476
  listMenuActions
6465
6477
  }