@homebound/beam 3.52.0 → 3.53.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
@@ -20415,6 +20415,27 @@ function invertSpacing(value) {
20415
20415
  var import_utils131 = require("@react-aria/utils");
20416
20416
  var import_react113 = __toESM(require("react"), 1);
20417
20417
 
20418
+ // src/components/Filters/utils.tsx
20419
+ function getActiveFilterCount(filter) {
20420
+ return safeKeys(filter).filter((key) => isDefined(filter[key])).length;
20421
+ }
20422
+ function updateFilter(currentFilter, key, value) {
20423
+ if (value === void 0) {
20424
+ return omitKey(key, currentFilter);
20425
+ } else {
20426
+ return { ...currentFilter, [key]: value };
20427
+ }
20428
+ }
20429
+ var filterTestIdPrefix = "filter";
20430
+
20431
+ // src/components/Layout/layoutTypes.ts
20432
+ function isGridTableProps(props) {
20433
+ return "rows" in props;
20434
+ }
20435
+
20436
+ // src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
20437
+ var import_react110 = require("react");
20438
+
20418
20439
  // src/components/ButtonMenu.tsx
20419
20440
  var import_react105 = require("react");
20420
20441
  var import_react_aria51 = require("react-aria");
@@ -20452,27 +20473,6 @@ function isSelectionButtonMenuProps(props) {
20452
20473
  return typeof props === "object" && "selectedItem" in props && "onChange" in props;
20453
20474
  }
20454
20475
 
20455
- // src/components/Filters/utils.tsx
20456
- function getActiveFilterCount(filter) {
20457
- return safeKeys(filter).filter((key) => isDefined(filter[key])).length;
20458
- }
20459
- function updateFilter(currentFilter, key, value) {
20460
- if (value === void 0) {
20461
- return omitKey(key, currentFilter);
20462
- } else {
20463
- return { ...currentFilter, [key]: value };
20464
- }
20465
- }
20466
- var filterTestIdPrefix = "filter";
20467
-
20468
- // src/components/Layout/layoutTypes.ts
20469
- function isGridTableProps(props) {
20470
- return "rows" in props;
20471
- }
20472
-
20473
- // src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
20474
- var import_react110 = require("react");
20475
-
20476
20476
  // src/components/CountBadge.tsx
20477
20477
  var import_runtime81 = require("@homebound/truss/runtime");
20478
20478
  var import_jsx_runtime140 = require("react/jsx-runtime");
@@ -21342,7 +21342,8 @@ function GridTableLayoutActionsComponent(props) {
21342
21342
  view,
21343
21343
  setView,
21344
21344
  clearFilters,
21345
- searchApi
21345
+ searchApi,
21346
+ actionMenu
21346
21347
  } = props;
21347
21348
  const testId = useTestIds(props, "gridTableLayoutActions");
21348
21349
  const {
@@ -21412,9 +21413,12 @@ function GridTableLayoutActionsComponent(props) {
21412
21413
  /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { icon: showFilters ? "chevronUp" : "chevronDown" })
21413
21414
  ] }), variant: "secondaryBlack", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterButton })
21414
21415
  ] }),
21415
- (hasHideableColumns || withCardView) && /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "df gap_12px", children: [
21416
+ (hasHideableColumns || withCardView || actionMenu) && /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "df aic gap_12px", children: [
21416
21417
  hasHideableColumns && view === "list" && columns && api && /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(EditColumnsButton, { columns, api, tooltip: "Display columns" }),
21417
- withCardView && view !== void 0 && setView && /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(ViewToggleButton, { view, onChange: setView })
21418
+ withCardView && view !== void 0 && setView && /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(ViewToggleButton, { view, onChange: setView }),
21419
+ actionMenu && /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(ButtonMenu, { ...actionMenu, trigger: {
21420
+ icon: "verticalDots"
21421
+ } })
21418
21422
  ] })
21419
21423
  ] }),
21420
21424
  sm && showSearch && /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "pl3 pr3", children: searchTextField }),
@@ -21543,13 +21547,8 @@ var __maybeInc15 = (inc) => {
21543
21547
  };
21544
21548
  function GridTableLayoutComponent(props) {
21545
21549
  const {
21546
- pageTitle,
21547
- breadCrumb,
21548
21550
  tableProps,
21549
21551
  layoutState,
21550
- primaryAction,
21551
- secondaryAction,
21552
- tertiaryAction,
21553
21552
  actionMenu,
21554
21553
  hideEditColumns = false,
21555
21554
  withCardView,
@@ -21566,7 +21565,7 @@ function GridTableLayoutComponent(props) {
21566
21565
  const api = (0, import_react113.useMemo)(() => tableProps.api ?? new GridTableApiImpl(), [tableProps.api]);
21567
21566
  const [view, setView] = usePersistedTableView(defaultView, !!withCardView);
21568
21567
  const clientSearch = layoutState?.search === "client" ? layoutState.searchString : void 0;
21569
- const showTableActions = !!(layoutState?.filterDefs || layoutState?.search || hasHideableColumns || withCardView);
21568
+ const showTableActions = !!(layoutState?.filterDefs || layoutState?.search || hasHideableColumns || withCardView || actionMenu);
21570
21569
  const isVirtualized = tableProps.as === "virtual" || !!withCardView && view === "card";
21571
21570
  const inDocumentScrollLayout = useDocumentScrollLayout();
21572
21571
  const tableActionsRef = (0, import_react113.useRef)(null);
@@ -21588,7 +21587,7 @@ function GridTableLayoutComponent(props) {
21588
21587
  searchApiRef.current?.clear();
21589
21588
  }, [layoutState]);
21590
21589
  const emptyState = (0, import_react113.useMemo)(() => composeEmptyState(tableProps, layoutState, layoutEmptyFallback, clearFilters), [layoutEmptyFallback, layoutState, tableProps, clearFilters]);
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 });
21590
+ 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, actionMenu });
21592
21591
  const cardAs = withCardView && view === "card" ? "card" : void 0;
21593
21592
  const tableStyle = resolveGridTableLayoutStyle(tableProps.style, inDocumentScrollLayout);
21594
21593
  const tableBody = /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(import_jsx_runtime159.Fragment, { children: isGridTableProps(tableProps) ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(GridTable, { ...tableProps, ...cardAs ? {
@@ -21620,10 +21619,10 @@ function GridTableLayoutComponent(props) {
21620
21619
  }), ...tid.stickyContent, children: tableActionsEl }),
21621
21620
  inDocumentScrollLayout ? tableBody : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ScrollableContent, { virtualized: isVirtualized, children: tableBody })
21622
21621
  ] });
21623
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
21624
- pageTitle && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Header2, { pageTitle, breadCrumb, primaryAction, secondaryAction, tertiaryAction, actionMenu }),
21622
+ return (
21623
+ /* Wrapper sets --beam-table-actions-height so GridTable's sticky header can read it. */
21625
21624
  /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { ref: tableWrapperRef, className: "display_contents", ...tid.tableWrapper, children: tableScrollContent })
21626
- ] });
21625
+ );
21627
21626
  }
21628
21627
  var GridTableLayout = import_react113.default.memo(GridTableLayoutComponent);
21629
21628
  function validateColumns(columns) {
@@ -21711,43 +21710,6 @@ function useSetTableActionsHeight(tableWrapperRef, tableActionsRef, enabled) {
21711
21710
  };
21712
21711
  }, [tableWrapperRef, syncHeightVar]);
21713
21712
  }
21714
- function Header2(props) {
21715
- const {
21716
- pageTitle,
21717
- breadCrumb,
21718
- primaryAction,
21719
- secondaryAction,
21720
- tertiaryAction,
21721
- actionMenu
21722
- } = props;
21723
- const tids = useTestIds(props);
21724
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(FullBleed, { children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("header", { ...(0, import_runtime88.trussProps)({
21725
- ...{
21726
- paddingTop: "pt3",
21727
- paddingBottom: "pb3",
21728
- paddingRight: "pr3",
21729
- paddingLeft: "pl3",
21730
- minHeight: "mh_50px",
21731
- backgroundColor: "bgWhite",
21732
- display: "df",
21733
- justifyContent: "jcsb",
21734
- alignItems: "aic"
21735
- }
21736
- }), ...tids.header, children: [
21737
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { children: [
21738
- breadCrumb && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(PageHeaderBreadcrumbs, { breadcrumb: breadCrumb }),
21739
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("h1", { className: "fw6 fz_30px lh_36px mt1", ...tids.pageTitle, children: pageTitle })
21740
- ] }),
21741
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "df fwr jcfe gap1 aic", children: [
21742
- tertiaryAction && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Button, { ...tertiaryAction, variant: "tertiary" }),
21743
- secondaryAction && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Button, { ...secondaryAction, variant: "secondary" }),
21744
- primaryAction && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Button, { ...primaryAction }),
21745
- actionMenu && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ButtonMenu, { ...actionMenu, trigger: {
21746
- icon: "verticalDots"
21747
- } })
21748
- ] })
21749
- ] }) });
21750
- }
21751
21713
  function resolveGridTableLayoutStyle(userStyle, inDocumentScrollLayout) {
21752
21714
  const layoutDefaults = {
21753
21715
  allWhite: true,