@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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.24.0
4
+
5
+ **`StatusLedger` floors its status and actions columns, so a row's button and status pill are never clipped (JOBS-POLISH-1 "Jobs page visual fixes").**
6
+
7
+ Every desktop cell was `flex: weight` with react-native-web's `min-width: 0`, so on a crowded row the
8
+ actions cell shrank below its button and the table wrap's `overflow: hidden` cut "Run now" in half
9
+ (63 of 100 px visible at 1024); the status pill could spill into the next cell the same way.
10
+ `DataTableColumn` gains an optional `minWidth` (px), applied to the header and body cell alike so
11
+ they stay aligned; the ledger sets 120 on status and 136 on actions. Additive.
12
+
3
13
  ## 1.23.0
4
14
 
5
15
  **A press anywhere on an interactive `DataTable` / `StatusLedger` row opens it, including on a time cell (JOBS-NOLOSS-1 "Restore everything the old Jobs page showed").**
package/dist/index.d.mts CHANGED
@@ -78,6 +78,8 @@ interface DataTableColumn<T> {
78
78
  numeric?: boolean;
79
79
  /** Flex weight on desktop. Default 1. */
80
80
  weight?: number;
81
+ /** Desktop width floor (px): the column never shrinks below it, so a button or pill in it is not clipped. */
82
+ minWidth?: number;
81
83
  render: (row: T) => React.ReactNode;
82
84
  }
83
85
  interface DataTableProps<T> {
package/dist/index.d.ts CHANGED
@@ -78,6 +78,8 @@ interface DataTableColumn<T> {
78
78
  numeric?: boolean;
79
79
  /** Flex weight on desktop. Default 1. */
80
80
  weight?: number;
81
+ /** Desktop width floor (px): the column never shrinks below it, so a button or pill in it is not clipped. */
82
+ minWidth?: number;
81
83
  render: (row: T) => React.ReactNode;
82
84
  }
83
85
  interface DataTableProps<T> {
package/dist/index.js CHANGED
@@ -338,7 +338,7 @@ function DesktopCell({ column, row, textColor, testID, styleOverrides, inGrid })
338
338
  reactNative.View,
339
339
  {
340
340
  style: [
341
- { flex: column.weight ?? 1, alignItems: column.numeric ? "flex-end" : "flex-start" },
341
+ { flex: column.weight ?? 1, minWidth: column.minWidth, alignItems: column.numeric ? "flex-end" : "flex-start" },
342
342
  styleOverrides?.cellWrap
343
343
  ],
344
344
  testID,
@@ -640,7 +640,7 @@ function TableHeader({ columns, stickyHeader, selection, inGrid, styleOverrides:
640
640
  columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
641
641
  reactNative.Text,
642
642
  {
643
- style: [tableStyles.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, textAlign: col.numeric ? "right" : "left" }, o?.headCell],
643
+ style: [tableStyles.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, minWidth: col.minWidth, textAlign: col.numeric ? "right" : "left" }, o?.headCell],
644
644
  ...inGrid ? { role: "columnheader" } : null,
645
645
  children: col.header
646
646
  },
@@ -1858,6 +1858,8 @@ var STATUS_LEDGER_TEST_ID = "ui-status-ledger";
1858
1858
  var STATUS_COLUMN_KEY = "status";
1859
1859
  var ACTIONS_COLUMN_KEY = "actions";
1860
1860
  var ALL_VALUE = "";
1861
+ var STATUS_MIN_WIDTH = 120;
1862
+ var ACTIONS_MIN_WIDTH = 136;
1861
1863
  var TONE_RANK = {
1862
1864
  ["bad" /* Bad */]: 0,
1863
1865
  ["warn" /* Warn */]: 1,
@@ -1980,10 +1982,11 @@ function useLedgerView(props) {
1980
1982
  const status = {
1981
1983
  key: STATUS_COLUMN_KEY,
1982
1984
  header: labels.status,
1985
+ minWidth: STATUS_MIN_WIDTH,
1983
1986
  sortValue: (row) => toneRank(toneOf(row)),
1984
1987
  render: (row) => /* @__PURE__ */ jsxRuntime.jsx(StatusPill, { color: toneColor(toneOf(row)), label: statusLabel(getStatus(row)), tone: toneOf(row) })
1985
1988
  };
1986
- const actions = renderActions === void 0 ? [] : [{ key: ACTIONS_COLUMN_KEY, header: labels.actions, render: renderActions }];
1989
+ const actions = renderActions === void 0 ? [] : [{ key: ACTIONS_COLUMN_KEY, header: labels.actions, minWidth: ACTIONS_MIN_WIDTH, render: renderActions }];
1987
1990
  return [columns[0], status, ...columns.slice(1), ...actions].filter((c) => c !== void 0);
1988
1991
  }, [columns, labels, toneOf, toneColor, statusLabel, getStatus, renderActions]);
1989
1992
  const fields = React2.useMemo(() => {