@homebound/beam 2.105.3 → 2.105.4

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.
@@ -1,7 +1,7 @@
1
1
  import React, { MutableRefObject, ReactElement, ReactNode } from "react";
2
2
  import { PresentationContextProps, PresentationFieldProps } from "../PresentationContext";
3
3
  import { GridRowLookup } from "./GridRowLookup";
4
- import { Margin, Only, Properties, Xss } from "../../Css";
4
+ import { Margin, Only, Properties, Typography, Xss } from "../../Css";
5
5
  export declare type Kinded = {
6
6
  kind: string;
7
7
  };
@@ -225,6 +225,8 @@ export declare type GridColumn<R extends Kinded, S = {}> = {
225
225
  * - The default value is `1fr`
226
226
  */
227
227
  w?: number | string;
228
+ /** The minimum width the column can shrink to */
229
+ mw?: string;
228
230
  /** The column's default alignment for each cell. */
229
231
  align?: GridCellAlignment;
230
232
  /** Whether the column can be sorted (if client-side sorting). Defaults to true if sorting client-side. */
@@ -268,6 +270,7 @@ export declare type GridCellContent = {
268
270
  /** Whether to indent the cell. */
269
271
  indent?: 1 | 2;
270
272
  colspan?: number;
273
+ typeScale?: Typography;
271
274
  };
272
275
  declare type MaybeFn<T> = T | (() => T);
273
276
  /**
@@ -438,6 +438,12 @@ function GridRow(props) {
438
438
  let currentColspan = 1;
439
439
  const rowNode = ((0, jsx_runtime_1.jsx)(Row, Object.assign({ css: rowCss }, others, { "data-gridrow": true }, { children: columns.map((column, columnIndex) => {
440
440
  var _a;
441
+ if (column.mw) {
442
+ // Validate the column's minWidth definition if set.
443
+ if (!column.mw.endsWith("px") && !column.mw.endsWith("%")) {
444
+ throw new Error("Beam Table column min-width definition only supports px or percentage values");
445
+ }
446
+ }
441
447
  // Decrement colspan count and skip if greater than 1.
442
448
  if (currentColspan > 1) {
443
449
  currentColspan -= 1;
@@ -473,13 +479,16 @@ function GridRow(props) {
473
479
  ...getIndentationCss(style, rowStyle, columnIndex, maybeContent),
474
480
  // Then apply any header-specific override
475
481
  ...(isHeader && style.headerCellCss),
476
- // And finally the specific cell's css (if any from GridCellContent)
482
+ // The specific cell's css (if any from GridCellContent)
477
483
  ...rowStyleCellCss,
484
+ // Add any cell specific style overrides
485
+ ...(isGridCellContent(maybeContent) && maybeContent.typeScale ? Css_1.Css[maybeContent.typeScale].$ : {}),
478
486
  // Define the width of the column on each cell. Supports col spans.
479
487
  ...(columnSizes && {
480
488
  width: `calc(${columnSizes
481
489
  .slice(maybeNestedCardColumnIndex, maybeNestedCardColumnIndex + currentColspan)
482
490
  .join(" + ")})`,
491
+ ...(column.mw ? Css_1.Css.mw(column.mw).$ : {}),
483
492
  }),
484
493
  };
485
494
  const renderFn = (rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.renderCell) || (rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.rowLink)
@@ -52,7 +52,7 @@ exports.beamFlexibleStyle = {
52
52
  cellCss: Css_1.Css.xs.bgWhite.aic.p2.boxShadow(`inset 0 -1px 0 ${Css_1.Palette.Gray100}`).$,
53
53
  presentationSettings: { borderless: false, typeScale: "xs", wrap: true },
54
54
  };
55
- exports.beamGroupRowStyle = Css_1.Css.smEm
55
+ exports.beamGroupRowStyle = Css_1.Css.xsEm
56
56
  .mhPx(56)
57
57
  .gray700.bgGray100.boxShadow(`inset 0 -1px 0 ${Css_1.Palette.Gray200}`).$;
58
58
  exports.beamTotalsRowStyle = Css_1.Css.gray700.smEm.hPx(40).mb1.bgWhite.boxShadow("none").$;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.105.3",
3
+ "version": "2.105.4",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",