@homebound/beam 2.101.0 → 2.101.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.
@@ -8,7 +8,7 @@ export declare type GridTableXss = Xss<Margin>;
8
8
  export declare const ASC: "ASC";
9
9
  export declare const DESC: "DESC";
10
10
  export declare type Direction = "ASC" | "DESC";
11
- export declare const emptyCell: () => ReactNode;
11
+ export declare const emptyCell: GridCellContent;
12
12
  /** Tells GridTable we're running in Jest, which forces as=virtual to be as=div, to work in jsdom. */
13
13
  export declare function setRunningInJest(): void;
14
14
  /** Completely static look & feel, i.e. nothing that is based on row kinds/content. */
@@ -212,7 +212,7 @@ declare type GridRowKind<R extends Kinded, P extends R["kind"]> = DiscriminateUn
212
212
  * column being sorted, in which case we use the GridCellContent.value.
213
213
  */
214
214
  export declare type GridColumn<R extends Kinded, S = {}> = {
215
- [K in R["kind"]]: string | (DiscriminateUnion<R, "kind", K> extends {
215
+ [K in R["kind"]]: string | GridCellContent | (DiscriminateUnion<R, "kind", K> extends {
216
216
  data: infer D;
217
217
  } ? (data: D, row: GridRowKind<R, K>) => ReactNode | GridCellContent : (row: GridRowKind<R, K>) => ReactNode | GridCellContent);
218
218
  } & {
@@ -42,8 +42,7 @@ const tinycolor2_1 = __importDefault(require("tinycolor2"));
42
42
  const _1 = require(".");
43
43
  exports.ASC = "ASC";
44
44
  exports.DESC = "DESC";
45
- const emptyCell = () => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}, void 0);
46
- exports.emptyCell = emptyCell;
45
+ exports.emptyCell = { content: () => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}, void 0), value: "" };
47
46
  let runningInJest = false;
48
47
  /** Tells GridTable we're running in Jest, which forces as=virtual to be as=div, to work in jsdom. */
49
48
  function setRunningInJest() {
@@ -247,6 +246,8 @@ function renderDiv(style, id, columns, headerRows, filteredRows, firstRowMessage
247
246
  */
248
247
  const firstNonHeaderRowIndex = (!isNestedCardStyleHeader ? 1 : 3) + 1;
249
248
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: {
249
+ // Ensure all rows extend the same width
250
+ ...Css_1.Css.mw("fit-content").$,
250
251
  /*
251
252
  Using n + (firstNonHeaderRowIndex + 1) here to target all rows that
252
253
  are after the first non-header row. Since n starts at 0, we can use
@@ -302,7 +303,9 @@ function renderVirtual(style, id, columns, headerRows, filteredRows, firstRowMes
302
303
  const { paddingBottom, ...otherRootStyles } = (_a = style.rootCss) !== null && _a !== void 0 ? _a : {};
303
304
  return { footerStyle: { paddingBottom }, listStyle: { ...style, rootCss: otherRootStyles } };
304
305
  }, [style]);
305
- return ((0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { overscan: 5, ref: virtuosoRef, components: {
306
+ return ((0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { overscan: 5, ref: virtuosoRef,
307
+ // Add `minWidth: fit-content` to ensure a sticky header and the virtualized table body maintain same width
308
+ style: { minWidth: "fit-content" }, components: {
306
309
  List: VirtualRoot(listStyle, columns, id, firstLastColumnWidth, xss),
307
310
  Footer: () => (0, jsx_runtime_1.jsx)("div", { css: footerStyle }, void 0),
308
311
  },
@@ -358,7 +361,7 @@ const VirtualRoot = (0, memoize_one_1.default)((gs, _columns, id, _firstLastColu
358
361
  // table list generally has styles to scroll the page for windowing.
359
362
  const isHeader = Object.keys(style || {}).length === 0;
360
363
  // This re-renders each time we have new children in the viewport
361
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, style: { ...style, ...(gs.nestedCards ? { minWidth: "fit-content" } : {}) }, css: {
364
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, style: { ...style, ...{ minWidth: "fit-content" } }, css: {
362
365
  // Add an extra `> div` due to Item + itemContent both having divs
363
366
  ...Css_1.Css.addIn("& > div + div > div > *", gs.betweenRowsCss || {}).$,
364
367
  // Table list styles only
@@ -33,7 +33,7 @@ function TextFieldBase(props) {
33
33
  const fieldHeight = 40;
34
34
  const compactFieldHeight = 32;
35
35
  const fieldStyles = {
36
- container: Css_1.Css.df.fdc.w100.maxw((0, Css_1.px)(550)).$,
36
+ container: Css_1.Css.df.fdc.w100.maxw((0, Css_1.px)(550)).relative.$,
37
37
  inputWrapper: {
38
38
  ...Css_1.Css[typeScale].df.aic.br4.px1.w100
39
39
  .hPx(fieldHeight - maybeSmaller)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.101.0",
3
+ "version": "2.101.4",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",