@homebound/beam 3.51.0 → 3.52.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.cjs CHANGED
@@ -312,6 +312,7 @@ __export(index_exports, {
312
312
  px: () => px,
313
313
  recursivelyGetContainingRow: () => recursivelyGetContainingRow,
314
314
  reservedRowKinds: () => reservedRowKinds,
315
+ resolveGridTableLayoutStyle: () => resolveGridTableLayoutStyle,
315
316
  resolveTableContentWidth: () => resolveTableContentWidth,
316
317
  resolveTooltip: () => resolveTooltip,
317
318
  rowClickRenderFn: () => rowClickRenderFn,
@@ -9066,23 +9067,26 @@ var cardStyle = {
9066
9067
  rowIndent: level > 0 ? 24 * level : void 0
9067
9068
  })
9068
9069
  };
9069
- function resolveStyles(style) {
9070
- const defKeysRecord = {
9071
- inlineEditing: true,
9072
- grouped: true,
9073
- rowHeight: true,
9074
- cellHighlight: true,
9075
- allWhite: true,
9076
- bordered: true,
9077
- rowHover: true,
9078
- vAlign: true,
9079
- cellTypography: true,
9080
- highlightOnHover: true,
9081
- roundedHeader: true
9082
- };
9070
+ var gridStyleDefKeysRecord = {
9071
+ inlineEditing: true,
9072
+ grouped: true,
9073
+ rowHeight: true,
9074
+ cellHighlight: true,
9075
+ allWhite: true,
9076
+ bordered: true,
9077
+ rowHover: true,
9078
+ vAlign: true,
9079
+ cellTypography: true,
9080
+ highlightOnHover: true,
9081
+ roundedHeader: true
9082
+ };
9083
+ function isGridStyleDef(style) {
9083
9084
  const keys = safeKeys(style);
9084
- const defKeys = safeKeys(defKeysRecord);
9085
- if (keys.length === 0 || keys.some((k) => defKeys.includes(k))) {
9085
+ const defKeys = safeKeys(gridStyleDefKeysRecord);
9086
+ return keys.length === 0 || keys.some((k) => defKeys.includes(k));
9087
+ }
9088
+ function resolveStyles(style) {
9089
+ if (isGridStyleDef(style)) {
9086
9090
  return getTableStyles(style);
9087
9091
  }
9088
9092
  return style;
@@ -17041,7 +17045,7 @@ function GridTableEmptyState(props) {
17041
17045
  actions
17042
17046
  } = props;
17043
17047
  const tid = useTestIds(props, "gridTableEmptyState");
17044
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "df fdc aic pt8 pb8 gap2", ...tid, children: [
17048
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "df fdc aic pt_12 pb_12 gap2", ...tid, children: [
17045
17049
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "fw6 fz_20px lh_28px", ...tid.title, children: title }),
17046
17050
  description && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "fw4 fz_14px lh_20px gray700", ...tid.description, children: description }),
17047
17051
  actions && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { ...tid.actions, children: actions })
@@ -21586,17 +21590,12 @@ function GridTableLayoutComponent(props) {
21586
21590
  const emptyState = (0, import_react113.useMemo)(() => composeEmptyState(tableProps, layoutState, layoutEmptyFallback, clearFilters), [layoutEmptyFallback, layoutState, tableProps, clearFilters]);
21587
21591
  const tableActionsEl = /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(_GridTableLayoutActions, { filterDefs: layoutState?.filterDefs, filter: layoutState?.filter, setFilter: layoutState?.setFilter, groupBy: layoutState?.groupBy, searchProps: filterSearchProps, hasHideableColumns, columns, api, withCardView, view, setView, clearFilters, searchApi: searchApiRef });
21588
21592
  const cardAs = withCardView && view === "card" ? "card" : void 0;
21593
+ const tableStyle = resolveGridTableLayoutStyle(tableProps.style, inDocumentScrollLayout);
21589
21594
  const tableBody = /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(import_jsx_runtime159.Fragment, { children: isGridTableProps(tableProps) ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(GridTable, { ...tableProps, ...cardAs ? {
21590
21595
  as: cardAs
21591
- } : {}, api, emptyState, filter: clientSearch, style: {
21592
- allWhite: true,
21593
- roundedHeader: !inDocumentScrollLayout
21594
- }, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(QueryTable, { ...tableProps, ...cardAs ? {
21596
+ } : {}, api, emptyState, filter: clientSearch, style: tableStyle, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(QueryTable, { ...tableProps, ...cardAs ? {
21595
21597
  as: cardAs
21596
- } : {}, api, emptyState, filter: clientSearch, style: {
21597
- allWhite: true,
21598
- roundedHeader: !inDocumentScrollLayout
21599
- }, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) });
21598
+ } : {}, api, emptyState, filter: clientSearch, style: tableStyle, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) });
21600
21599
  const tableScrollContent = /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
21601
21600
  showTableActions && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { ref: tableActionsRef, ...(0, import_runtime88.trussProps)({
21602
21601
  ...inDocumentScrollLayout ? {
@@ -21749,6 +21748,22 @@ function Header2(props) {
21749
21748
  ] })
21750
21749
  ] }) });
21751
21750
  }
21751
+ function resolveGridTableLayoutStyle(userStyle, inDocumentScrollLayout) {
21752
+ const layoutDefaults = {
21753
+ allWhite: true,
21754
+ roundedHeader: !inDocumentScrollLayout
21755
+ };
21756
+ if (userStyle === void 0) {
21757
+ return layoutDefaults;
21758
+ }
21759
+ if (isGridStyleDef(userStyle)) {
21760
+ return {
21761
+ ...layoutDefaults,
21762
+ ...userStyle
21763
+ };
21764
+ }
21765
+ return userStyle;
21766
+ }
21752
21767
 
21753
21768
  // src/components/Layout/PreventBrowserScroll.tsx
21754
21769
  var import_jsx_runtime160 = require("react/jsx-runtime");
@@ -26213,6 +26228,7 @@ function PageHeaderLayout(props) {
26213
26228
  px,
26214
26229
  recursivelyGetContainingRow,
26215
26230
  reservedRowKinds,
26231
+ resolveGridTableLayoutStyle,
26216
26232
  resolveTableContentWidth,
26217
26233
  resolveTooltip,
26218
26234
  rowClickRenderFn,