@dloizides/ui-tables 1.23.0 → 1.24.0

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.mjs CHANGED
@@ -333,7 +333,7 @@ function DesktopCell({ column, row, textColor, testID, styleOverrides, inGrid })
333
333
  View,
334
334
  {
335
335
  style: [
336
- { flex: column.weight ?? 1, alignItems: column.numeric ? "flex-end" : "flex-start" },
336
+ { flex: column.weight ?? 1, minWidth: column.minWidth, alignItems: column.numeric ? "flex-end" : "flex-start" },
337
337
  styleOverrides?.cellWrap
338
338
  ],
339
339
  testID,
@@ -635,7 +635,7 @@ function TableHeader({ columns, stickyHeader, selection, inGrid, styleOverrides:
635
635
  columns.map((col) => /* @__PURE__ */ jsx(
636
636
  Text,
637
637
  {
638
- style: [tableStyles.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, textAlign: col.numeric ? "right" : "left" }, o?.headCell],
638
+ style: [tableStyles.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, minWidth: col.minWidth, textAlign: col.numeric ? "right" : "left" }, o?.headCell],
639
639
  ...inGrid ? { role: "columnheader" } : null,
640
640
  children: col.header
641
641
  },
@@ -1853,6 +1853,8 @@ var STATUS_LEDGER_TEST_ID = "ui-status-ledger";
1853
1853
  var STATUS_COLUMN_KEY = "status";
1854
1854
  var ACTIONS_COLUMN_KEY = "actions";
1855
1855
  var ALL_VALUE = "";
1856
+ var STATUS_MIN_WIDTH = 120;
1857
+ var ACTIONS_MIN_WIDTH = 136;
1856
1858
  var TONE_RANK = {
1857
1859
  ["bad" /* Bad */]: 0,
1858
1860
  ["warn" /* Warn */]: 1,
@@ -1975,10 +1977,11 @@ function useLedgerView(props) {
1975
1977
  const status = {
1976
1978
  key: STATUS_COLUMN_KEY,
1977
1979
  header: labels.status,
1980
+ minWidth: STATUS_MIN_WIDTH,
1978
1981
  sortValue: (row) => toneRank(toneOf(row)),
1979
1982
  render: (row) => /* @__PURE__ */ jsx(StatusPill, { color: toneColor(toneOf(row)), label: statusLabel(getStatus(row)), tone: toneOf(row) })
1980
1983
  };
1981
- const actions = renderActions === void 0 ? [] : [{ key: ACTIONS_COLUMN_KEY, header: labels.actions, render: renderActions }];
1984
+ const actions = renderActions === void 0 ? [] : [{ key: ACTIONS_COLUMN_KEY, header: labels.actions, minWidth: ACTIONS_MIN_WIDTH, render: renderActions }];
1982
1985
  return [columns[0], status, ...columns.slice(1), ...actions].filter((c) => c !== void 0);
1983
1986
  }, [columns, labels, toneOf, toneColor, statusLabel, getStatus, renderActions]);
1984
1987
  const fields = useMemo(() => {