@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 +33 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.js +33 -71
- package/dist/index.js.map +1 -1
- package/dist/truss.css +0 -4
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -9374,22 +9374,18 @@ type UseSessionStorage<T> = [T, (value: T) => void];
|
|
|
9374
9374
|
declare function useSessionStorage<T>(key: string, defaultValue: T): UseSessionStorage<T>;
|
|
9375
9375
|
|
|
9376
9376
|
type ActionButtonMenuProps = Omit<ButtonMenuProps, "trigger">;
|
|
9377
|
+
|
|
9377
9378
|
type QueryTablePropsWithQuery<R extends Kinded, X extends Only<GridTableXss, X>, QData> = BaseQueryTableProps<R, X, QData> & {
|
|
9378
9379
|
emptyFallback?: string;
|
|
9379
9380
|
keepHeaderWhenLoading?: boolean;
|
|
9380
9381
|
};
|
|
9381
9382
|
type GridTableLayoutProps<F extends Record<string, unknown>, R extends Kinded, X extends Only<GridTableXss, X>, QData> = {
|
|
9382
|
-
pageTitle?: ReactNode;
|
|
9383
9383
|
tableProps: GridTablePropsWithRows<R, X> | QueryTablePropsWithQuery<R, X, QData>;
|
|
9384
|
-
breadCrumb?: HeaderBreadcrumb | HeaderBreadcrumb[];
|
|
9385
9384
|
layoutState?: ReturnType<typeof useGridTableLayoutState<F>>;
|
|
9386
9385
|
/** Title for the empty state when the table has no data rows. */
|
|
9387
9386
|
emptyFallback?: string;
|
|
9388
9387
|
/** Renders a ButtonMenu with "verticalDots" icon as trigger */
|
|
9389
9388
|
actionMenu?: ActionButtonMenuProps;
|
|
9390
|
-
primaryAction?: ActionButtonProps;
|
|
9391
|
-
secondaryAction?: ActionButtonProps;
|
|
9392
|
-
tertiaryAction?: ActionButtonProps;
|
|
9393
9389
|
hideEditColumns?: boolean;
|
|
9394
9390
|
totalCount?: number;
|
|
9395
9391
|
/** When true, shows a view toggle button and renders the table with `as="card"` when in card view. */
|
package/dist/index.d.ts
CHANGED
|
@@ -9374,22 +9374,18 @@ type UseSessionStorage<T> = [T, (value: T) => void];
|
|
|
9374
9374
|
declare function useSessionStorage<T>(key: string, defaultValue: T): UseSessionStorage<T>;
|
|
9375
9375
|
|
|
9376
9376
|
type ActionButtonMenuProps = Omit<ButtonMenuProps, "trigger">;
|
|
9377
|
+
|
|
9377
9378
|
type QueryTablePropsWithQuery<R extends Kinded, X extends Only<GridTableXss, X>, QData> = BaseQueryTableProps<R, X, QData> & {
|
|
9378
9379
|
emptyFallback?: string;
|
|
9379
9380
|
keepHeaderWhenLoading?: boolean;
|
|
9380
9381
|
};
|
|
9381
9382
|
type GridTableLayoutProps<F extends Record<string, unknown>, R extends Kinded, X extends Only<GridTableXss, X>, QData> = {
|
|
9382
|
-
pageTitle?: ReactNode;
|
|
9383
9383
|
tableProps: GridTablePropsWithRows<R, X> | QueryTablePropsWithQuery<R, X, QData>;
|
|
9384
|
-
breadCrumb?: HeaderBreadcrumb | HeaderBreadcrumb[];
|
|
9385
9384
|
layoutState?: ReturnType<typeof useGridTableLayoutState<F>>;
|
|
9386
9385
|
/** Title for the empty state when the table has no data rows. */
|
|
9387
9386
|
emptyFallback?: string;
|
|
9388
9387
|
/** Renders a ButtonMenu with "verticalDots" icon as trigger */
|
|
9389
9388
|
actionMenu?: ActionButtonMenuProps;
|
|
9390
|
-
primaryAction?: ActionButtonProps;
|
|
9391
|
-
secondaryAction?: ActionButtonProps;
|
|
9392
|
-
tertiaryAction?: ActionButtonProps;
|
|
9393
9389
|
hideEditColumns?: boolean;
|
|
9394
9390
|
totalCount?: number;
|
|
9395
9391
|
/** When true, shows a view toggle button and renders the table with `as="card"` when in card view. */
|
package/dist/index.js
CHANGED
|
@@ -19948,6 +19948,27 @@ function invertSpacing(value) {
|
|
|
19948
19948
|
import { useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
|
|
19949
19949
|
import React17, { useCallback as useCallback28, useEffect as useEffect28, useLayoutEffect as useLayoutEffect6, useMemo as useMemo41, useRef as useRef50, useState as useState45 } from "react";
|
|
19950
19950
|
|
|
19951
|
+
// src/components/Filters/utils.tsx
|
|
19952
|
+
function getActiveFilterCount(filter) {
|
|
19953
|
+
return safeKeys(filter).filter((key) => isDefined(filter[key])).length;
|
|
19954
|
+
}
|
|
19955
|
+
function updateFilter(currentFilter, key, value) {
|
|
19956
|
+
if (value === void 0) {
|
|
19957
|
+
return omitKey(key, currentFilter);
|
|
19958
|
+
} else {
|
|
19959
|
+
return { ...currentFilter, [key]: value };
|
|
19960
|
+
}
|
|
19961
|
+
}
|
|
19962
|
+
var filterTestIdPrefix = "filter";
|
|
19963
|
+
|
|
19964
|
+
// src/components/Layout/layoutTypes.ts
|
|
19965
|
+
function isGridTableProps(props) {
|
|
19966
|
+
return "rows" in props;
|
|
19967
|
+
}
|
|
19968
|
+
|
|
19969
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
19970
|
+
import { memo as memo2, useMemo as useMemo39, useState as useState43 } from "react";
|
|
19971
|
+
|
|
19951
19972
|
// src/components/ButtonMenu.tsx
|
|
19952
19973
|
import { useRef as useRef48 } from "react";
|
|
19953
19974
|
import { useMenuTrigger as useMenuTrigger2 } from "react-aria";
|
|
@@ -19985,27 +20006,6 @@ function isSelectionButtonMenuProps(props) {
|
|
|
19985
20006
|
return typeof props === "object" && "selectedItem" in props && "onChange" in props;
|
|
19986
20007
|
}
|
|
19987
20008
|
|
|
19988
|
-
// src/components/Filters/utils.tsx
|
|
19989
|
-
function getActiveFilterCount(filter) {
|
|
19990
|
-
return safeKeys(filter).filter((key) => isDefined(filter[key])).length;
|
|
19991
|
-
}
|
|
19992
|
-
function updateFilter(currentFilter, key, value) {
|
|
19993
|
-
if (value === void 0) {
|
|
19994
|
-
return omitKey(key, currentFilter);
|
|
19995
|
-
} else {
|
|
19996
|
-
return { ...currentFilter, [key]: value };
|
|
19997
|
-
}
|
|
19998
|
-
}
|
|
19999
|
-
var filterTestIdPrefix = "filter";
|
|
20000
|
-
|
|
20001
|
-
// src/components/Layout/layoutTypes.ts
|
|
20002
|
-
function isGridTableProps(props) {
|
|
20003
|
-
return "rows" in props;
|
|
20004
|
-
}
|
|
20005
|
-
|
|
20006
|
-
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
20007
|
-
import { memo as memo2, useMemo as useMemo39, useState as useState43 } from "react";
|
|
20008
|
-
|
|
20009
20009
|
// src/components/CountBadge.tsx
|
|
20010
20010
|
import { trussProps as trussProps73, maybeCssVar as maybeCssVar42 } from "@homebound/truss/runtime";
|
|
20011
20011
|
import { jsx as jsx140 } from "react/jsx-runtime";
|
|
@@ -20875,7 +20875,8 @@ function GridTableLayoutActionsComponent(props) {
|
|
|
20875
20875
|
view,
|
|
20876
20876
|
setView,
|
|
20877
20877
|
clearFilters,
|
|
20878
|
-
searchApi
|
|
20878
|
+
searchApi,
|
|
20879
|
+
actionMenu
|
|
20879
20880
|
} = props;
|
|
20880
20881
|
const testId = useTestIds(props, "gridTableLayoutActions");
|
|
20881
20882
|
const {
|
|
@@ -20945,9 +20946,12 @@ function GridTableLayoutActionsComponent(props) {
|
|
|
20945
20946
|
/* @__PURE__ */ jsx156(Icon, { icon: showFilters ? "chevronUp" : "chevronDown" })
|
|
20946
20947
|
] }), variant: "secondaryBlack", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterButton })
|
|
20947
20948
|
] }),
|
|
20948
|
-
(hasHideableColumns || withCardView) && /* @__PURE__ */ jsxs75("div", { className: "df gap_12px", children: [
|
|
20949
|
+
(hasHideableColumns || withCardView || actionMenu) && /* @__PURE__ */ jsxs75("div", { className: "df aic gap_12px", children: [
|
|
20949
20950
|
hasHideableColumns && view === "list" && columns && api && /* @__PURE__ */ jsx156(EditColumnsButton, { columns, api, tooltip: "Display columns" }),
|
|
20950
|
-
withCardView && view !== void 0 && setView && /* @__PURE__ */ jsx156(ViewToggleButton, { view, onChange: setView })
|
|
20951
|
+
withCardView && view !== void 0 && setView && /* @__PURE__ */ jsx156(ViewToggleButton, { view, onChange: setView }),
|
|
20952
|
+
actionMenu && /* @__PURE__ */ jsx156(ButtonMenu, { ...actionMenu, trigger: {
|
|
20953
|
+
icon: "verticalDots"
|
|
20954
|
+
} })
|
|
20951
20955
|
] })
|
|
20952
20956
|
] }),
|
|
20953
20957
|
sm && showSearch && /* @__PURE__ */ jsx156("div", { className: "pl3 pr3", children: searchTextField }),
|
|
@@ -21076,13 +21080,8 @@ var __maybeInc15 = (inc) => {
|
|
|
21076
21080
|
};
|
|
21077
21081
|
function GridTableLayoutComponent(props) {
|
|
21078
21082
|
const {
|
|
21079
|
-
pageTitle,
|
|
21080
|
-
breadCrumb,
|
|
21081
21083
|
tableProps,
|
|
21082
21084
|
layoutState,
|
|
21083
|
-
primaryAction,
|
|
21084
|
-
secondaryAction,
|
|
21085
|
-
tertiaryAction,
|
|
21086
21085
|
actionMenu,
|
|
21087
21086
|
hideEditColumns = false,
|
|
21088
21087
|
withCardView,
|
|
@@ -21099,7 +21098,7 @@ function GridTableLayoutComponent(props) {
|
|
|
21099
21098
|
const api = useMemo41(() => tableProps.api ?? new GridTableApiImpl(), [tableProps.api]);
|
|
21100
21099
|
const [view, setView] = usePersistedTableView(defaultView, !!withCardView);
|
|
21101
21100
|
const clientSearch = layoutState?.search === "client" ? layoutState.searchString : void 0;
|
|
21102
|
-
const showTableActions = !!(layoutState?.filterDefs || layoutState?.search || hasHideableColumns || withCardView);
|
|
21101
|
+
const showTableActions = !!(layoutState?.filterDefs || layoutState?.search || hasHideableColumns || withCardView || actionMenu);
|
|
21103
21102
|
const isVirtualized = tableProps.as === "virtual" || !!withCardView && view === "card";
|
|
21104
21103
|
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
21105
21104
|
const tableActionsRef = useRef50(null);
|
|
@@ -21121,7 +21120,7 @@ function GridTableLayoutComponent(props) {
|
|
|
21121
21120
|
searchApiRef.current?.clear();
|
|
21122
21121
|
}, [layoutState]);
|
|
21123
21122
|
const emptyState = useMemo41(() => composeEmptyState(tableProps, layoutState, layoutEmptyFallback, clearFilters), [layoutEmptyFallback, layoutState, tableProps, clearFilters]);
|
|
21124
|
-
const tableActionsEl = /* @__PURE__ */ jsx159(_GridTableLayoutActions, { filterDefs: layoutState?.filterDefs, filter: layoutState?.filter, setFilter: layoutState?.setFilter, groupBy: layoutState?.groupBy, searchProps: filterSearchProps, hasHideableColumns, columns, api, withCardView, view, setView, clearFilters, searchApi: searchApiRef });
|
|
21123
|
+
const tableActionsEl = /* @__PURE__ */ jsx159(_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 });
|
|
21125
21124
|
const cardAs = withCardView && view === "card" ? "card" : void 0;
|
|
21126
21125
|
const tableStyle = resolveGridTableLayoutStyle(tableProps.style, inDocumentScrollLayout);
|
|
21127
21126
|
const tableBody = /* @__PURE__ */ jsx159(Fragment36, { children: isGridTableProps(tableProps) ? /* @__PURE__ */ jsx159(GridTable, { ...tableProps, ...cardAs ? {
|
|
@@ -21153,10 +21152,10 @@ function GridTableLayoutComponent(props) {
|
|
|
21153
21152
|
}), ...tid.stickyContent, children: tableActionsEl }),
|
|
21154
21153
|
inDocumentScrollLayout ? tableBody : /* @__PURE__ */ jsx159(ScrollableContent, { virtualized: isVirtualized, children: tableBody })
|
|
21155
21154
|
] });
|
|
21156
|
-
return
|
|
21157
|
-
|
|
21155
|
+
return (
|
|
21156
|
+
/* Wrapper sets --beam-table-actions-height so GridTable's sticky header can read it. */
|
|
21158
21157
|
/* @__PURE__ */ jsx159("div", { ref: tableWrapperRef, className: "display_contents", ...tid.tableWrapper, children: tableScrollContent })
|
|
21159
|
-
|
|
21158
|
+
);
|
|
21160
21159
|
}
|
|
21161
21160
|
var GridTableLayout = React17.memo(GridTableLayoutComponent);
|
|
21162
21161
|
function validateColumns(columns) {
|
|
@@ -21244,43 +21243,6 @@ function useSetTableActionsHeight(tableWrapperRef, tableActionsRef, enabled) {
|
|
|
21244
21243
|
};
|
|
21245
21244
|
}, [tableWrapperRef, syncHeightVar]);
|
|
21246
21245
|
}
|
|
21247
|
-
function Header2(props) {
|
|
21248
|
-
const {
|
|
21249
|
-
pageTitle,
|
|
21250
|
-
breadCrumb,
|
|
21251
|
-
primaryAction,
|
|
21252
|
-
secondaryAction,
|
|
21253
|
-
tertiaryAction,
|
|
21254
|
-
actionMenu
|
|
21255
|
-
} = props;
|
|
21256
|
-
const tids = useTestIds(props);
|
|
21257
|
-
return /* @__PURE__ */ jsx159(FullBleed, { children: /* @__PURE__ */ jsxs77("header", { ...trussProps80({
|
|
21258
|
-
...{
|
|
21259
|
-
paddingTop: "pt3",
|
|
21260
|
-
paddingBottom: "pb3",
|
|
21261
|
-
paddingRight: "pr3",
|
|
21262
|
-
paddingLeft: "pl3",
|
|
21263
|
-
minHeight: "mh_50px",
|
|
21264
|
-
backgroundColor: "bgWhite",
|
|
21265
|
-
display: "df",
|
|
21266
|
-
justifyContent: "jcsb",
|
|
21267
|
-
alignItems: "aic"
|
|
21268
|
-
}
|
|
21269
|
-
}), ...tids.header, children: [
|
|
21270
|
-
/* @__PURE__ */ jsxs77("div", { children: [
|
|
21271
|
-
breadCrumb && /* @__PURE__ */ jsx159(PageHeaderBreadcrumbs, { breadcrumb: breadCrumb }),
|
|
21272
|
-
/* @__PURE__ */ jsx159("h1", { className: "fw6 fz_30px lh_36px mt1", ...tids.pageTitle, children: pageTitle })
|
|
21273
|
-
] }),
|
|
21274
|
-
/* @__PURE__ */ jsxs77("div", { className: "df fwr jcfe gap1 aic", children: [
|
|
21275
|
-
tertiaryAction && /* @__PURE__ */ jsx159(Button, { ...tertiaryAction, variant: "tertiary" }),
|
|
21276
|
-
secondaryAction && /* @__PURE__ */ jsx159(Button, { ...secondaryAction, variant: "secondary" }),
|
|
21277
|
-
primaryAction && /* @__PURE__ */ jsx159(Button, { ...primaryAction }),
|
|
21278
|
-
actionMenu && /* @__PURE__ */ jsx159(ButtonMenu, { ...actionMenu, trigger: {
|
|
21279
|
-
icon: "verticalDots"
|
|
21280
|
-
} })
|
|
21281
|
-
] })
|
|
21282
|
-
] }) });
|
|
21283
|
-
}
|
|
21284
21246
|
function resolveGridTableLayoutStyle(userStyle, inDocumentScrollLayout) {
|
|
21285
21247
|
const layoutDefaults = {
|
|
21286
21248
|
allWhite: true,
|