@homebound/beam 4.14.4 → 4.14.6
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 +100 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +64 -44
- package/dist/index.js.map +1 -1
- package/dist/truss.css +4 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7139,6 +7139,10 @@ var pageContentPaddingX = {
|
|
|
7139
7139
|
"--mdandup_paddingRight": maybeCssVar11(__maybeInc6(pageContentPaddingXValue))
|
|
7140
7140
|
}]
|
|
7141
7141
|
};
|
|
7142
|
+
var selfTopSpacedAttr = "data-self-top-spaced";
|
|
7143
|
+
var selfTopSpaced = {
|
|
7144
|
+
[selfTopSpacedAttr]: true
|
|
7145
|
+
};
|
|
7142
7146
|
function headerContentPaddingX(compact = false) {
|
|
7143
7147
|
return compact ? {
|
|
7144
7148
|
paddingLeft: "pl1",
|
|
@@ -13950,7 +13954,7 @@ function GridTable(props) {
|
|
|
13950
13954
|
}
|
|
13951
13955
|
return /* @__PURE__ */ jsx52(TableStateContext.Provider, { value: rowStateContext, children: /* @__PURE__ */ jsxs33(PresentationProvider, { fieldProps, wrap: style?.presentationSettings?.wrap, children: [
|
|
13952
13956
|
/* @__PURE__ */ jsx52("div", { ref: resizeRef, ...trussProps33(getTableRefWidthStyles(as === "virtual", inDocumentScrollLayout)), ...tid.probe }),
|
|
13953
|
-
loading && /* @__PURE__ */ jsx52("div", { ...trussProps33(loadingOverlayCss), ...tid.loadingOverlay, children: /* @__PURE__ */ jsx52(Loader, { ...tid.loadingSpinner }) }),
|
|
13957
|
+
loading && /* @__PURE__ */ jsx52("div", { ...trussProps33(loadingOverlayCss), ...tid.loadingOverlay, children: /* @__PURE__ */ jsx52(Loader, { ...tid.loadingSpinner, size: "md" }) }),
|
|
13954
13958
|
as === "card" ? /* @__PURE__ */ jsx52(CardView, { cardRows: visibleDataRows, id, virtuosoRangeRef, infiniteScroll, persistScrollPosition, loading }) : _as === "virtual" ? /* @__PURE__ */ jsx52(VirtualGridTableView, { style: tableStyle, id, columns, visibleDataRows, keptSelectedRows, pinnedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, stickyOffset, infiniteScroll, persistScrollPosition, loading }) : renders[_as](tableStyle, id, columns, visibleDataRows, keptSelectedRows, pinnedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, stickyOffset, loading, infiniteScroll, tableContainerRef, persistScrollPosition)
|
|
13955
13959
|
] }) });
|
|
13956
13960
|
}
|
|
@@ -24014,7 +24018,9 @@ function useScrollPinnedViewportBounds(anchorRef, enabled, getPinTopPx) {
|
|
|
24014
24018
|
const isPinned = rect.top <= pinTopPx + 1;
|
|
24015
24019
|
const topPx = isPinned ? pinTopPx : Math.round(rect.top);
|
|
24016
24020
|
const heightPx = Math.max(0, Math.round(window.innerHeight - topPx));
|
|
24017
|
-
setBounds(
|
|
24021
|
+
setBounds(
|
|
24022
|
+
(prev) => prev?.topPx === topPx && prev?.heightPx === heightPx && prev?.isPinned === isPinned ? prev : { topPx, heightPx, isPinned }
|
|
24023
|
+
);
|
|
24018
24024
|
}, [anchorRef]);
|
|
24019
24025
|
useLayoutEffect6(() => {
|
|
24020
24026
|
getPinTopPxRef.current = getPinTopPx;
|
|
@@ -24233,7 +24239,10 @@ function DocumentScrollRightPane({
|
|
|
24233
24239
|
borderLeftWidth: "blw_1px",
|
|
24234
24240
|
borderColor: ["bc_var", {
|
|
24235
24241
|
"--borderColor": "var(--b-surface-separator)"
|
|
24236
|
-
}]
|
|
24242
|
+
}],
|
|
24243
|
+
...!!paneBounds?.isPinned ? {
|
|
24244
|
+
transition: "tsn_top_200ms_cubic_bezier_0_4_0_0_2_1_height_200ms_cubic_bezier_0_4_0_0_2_1"
|
|
24245
|
+
} : {}
|
|
24237
24246
|
}),
|
|
24238
24247
|
initial: {
|
|
24239
24248
|
x: slideX
|
|
@@ -24697,6 +24706,7 @@ function GridTableLayoutActionsComponent(props) {
|
|
|
24697
24706
|
display: "df",
|
|
24698
24707
|
flexDirection: "fdc",
|
|
24699
24708
|
gap: "g_1",
|
|
24709
|
+
paddingTop: "pt3",
|
|
24700
24710
|
paddingBottom: "pb2",
|
|
24701
24711
|
...view === "card" ? {
|
|
24702
24712
|
paddingBottom: "pb3"
|
|
@@ -24843,11 +24853,12 @@ function GridTableLayoutComponent(props) {
|
|
|
24843
24853
|
const emptyState = useMemo45(() => composeEmptyState(tableProps, layoutState, layoutEmptyFallback, clearFilters), [layoutEmptyFallback, layoutState, tableProps, clearFilters]);
|
|
24844
24854
|
const tableActionsEl = /* @__PURE__ */ jsx178(_GridTableLayoutActions, { filterDefs: layoutState?.filterDefs, filter: layoutState?.filter, setFilter: layoutState?.setFilter, groupBy: layoutState?.groupBy, searchProps: filterSearchProps, hasHideableColumns, columns, api, withCardView, view, setView, clearFilters, searchApi: searchApiRef, actions });
|
|
24845
24855
|
const cardAs = view === "card" ? "card" : void 0;
|
|
24856
|
+
const tableStyle = useMemo45(() => getDefaultStyle(tableProps.style), [tableProps.style]);
|
|
24846
24857
|
const tableBody = /* @__PURE__ */ jsx178(Fragment40, { children: isGridTableProps(tableProps) ? /* @__PURE__ */ jsx178(GridTable, { ...tableProps, ...cardAs ? {
|
|
24847
24858
|
as: cardAs
|
|
24848
|
-
} : {}, api, emptyState, filter: clientSearch, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) : /* @__PURE__ */ jsx178(QueryTable, { ...tableProps, ...cardAs ? {
|
|
24859
|
+
} : {}, api, emptyState, filter: clientSearch, style: tableStyle, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) : /* @__PURE__ */ jsx178(QueryTable, { ...tableProps, ...cardAs ? {
|
|
24849
24860
|
as: cardAs
|
|
24850
|
-
} : {}, api, emptyState, filter: clientSearch, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) });
|
|
24861
|
+
} : {}, api, emptyState, filter: clientSearch, style: tableStyle, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) });
|
|
24851
24862
|
const tableScrollContent = /* @__PURE__ */ jsxs91(Fragment40, { children: [
|
|
24852
24863
|
showTableActions && /* @__PURE__ */ jsx178("div", { ref: tableActionsRef, ...trussProps101({
|
|
24853
24864
|
...inDocumentScrollLayout ? {
|
|
@@ -24889,10 +24900,17 @@ function GridTableLayoutComponent(props) {
|
|
|
24889
24900
|
} : {
|
|
24890
24901
|
display: "df",
|
|
24891
24902
|
flexDirection: "fdc"
|
|
24892
|
-
}), ...tid.tableWrapper, children: tableScrollContent })
|
|
24903
|
+
}), ...showTableActions ? selfTopSpaced : {}, ...tid.tableWrapper, children: tableScrollContent })
|
|
24893
24904
|
);
|
|
24894
24905
|
}
|
|
24895
24906
|
var GridTableLayout = React18.memo(GridTableLayoutComponent);
|
|
24907
|
+
function getDefaultStyle(style) {
|
|
24908
|
+
if (style !== void 0 && !isGridStyleDef(style)) return style;
|
|
24909
|
+
return {
|
|
24910
|
+
allWhite: true,
|
|
24911
|
+
...style
|
|
24912
|
+
};
|
|
24913
|
+
}
|
|
24896
24914
|
function validateColumns(columns) {
|
|
24897
24915
|
for (const col of columns) {
|
|
24898
24916
|
if (!col.id || !col.name) {
|
|
@@ -29205,49 +29223,41 @@ import { useLayoutEffect as useLayoutEffect14, useRef as useRef71, useState as u
|
|
|
29205
29223
|
var THRESHOLD = 80;
|
|
29206
29224
|
function getInitialAutoHideState() {
|
|
29207
29225
|
if (typeof window === "undefined" || window.scrollY <= 0) {
|
|
29208
|
-
return
|
|
29226
|
+
return "resting";
|
|
29209
29227
|
}
|
|
29210
|
-
return
|
|
29228
|
+
return "hidden";
|
|
29211
29229
|
}
|
|
29212
29230
|
function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
29213
29231
|
const initial = getInitialAutoHideState();
|
|
29214
|
-
const [state, setState] = useState62(initial
|
|
29215
|
-
const stateRef = useRef71(initial
|
|
29216
|
-
const [atTop, setAtTop] = useState62(initial.atTop);
|
|
29217
|
-
const atTopRef = useRef71(initial.atTop);
|
|
29232
|
+
const [state, setState] = useState62(initial);
|
|
29233
|
+
const stateRef = useRef71(initial);
|
|
29218
29234
|
const getTopOffsetRef = useRef71(getTopOffset);
|
|
29219
29235
|
getTopOffsetRef.current = getTopOffset;
|
|
29220
29236
|
const lastScrollY = useRef71(Number.POSITIVE_INFINITY);
|
|
29221
29237
|
const lastScrollHeight = useRef71(0);
|
|
29222
29238
|
useLayoutEffect14(() => {
|
|
29223
29239
|
if (!enabled) {
|
|
29224
|
-
stateRef.current = "
|
|
29225
|
-
atTopRef.current = true;
|
|
29240
|
+
stateRef.current = "resting";
|
|
29226
29241
|
lastScrollY.current = Number.POSITIVE_INFINITY;
|
|
29227
29242
|
lastScrollHeight.current = 0;
|
|
29228
|
-
setState("
|
|
29229
|
-
setAtTop(true);
|
|
29243
|
+
setState("resting");
|
|
29230
29244
|
return;
|
|
29231
29245
|
}
|
|
29232
|
-
const commit = (nextState
|
|
29246
|
+
const commit = (nextState) => {
|
|
29233
29247
|
if (nextState !== stateRef.current) {
|
|
29234
29248
|
stateRef.current = nextState;
|
|
29235
29249
|
setState(nextState);
|
|
29236
29250
|
}
|
|
29237
|
-
if (nextAtTop !== atTopRef.current) {
|
|
29238
|
-
atTopRef.current = nextAtTop;
|
|
29239
|
-
setAtTop(nextAtTop);
|
|
29240
|
-
}
|
|
29241
29251
|
};
|
|
29242
29252
|
const autoHideStateOnLayoutChange = (rect, topOffset) => {
|
|
29243
29253
|
const nextAtTop = rect.top >= topOffset;
|
|
29244
29254
|
let next = stateRef.current;
|
|
29245
29255
|
if (nextAtTop) {
|
|
29246
|
-
next = "
|
|
29256
|
+
next = "resting";
|
|
29247
29257
|
} else if (rect.bottom < -THRESHOLD && next !== "revealed") {
|
|
29248
29258
|
next = "hidden";
|
|
29249
29259
|
}
|
|
29250
|
-
return
|
|
29260
|
+
return next;
|
|
29251
29261
|
};
|
|
29252
29262
|
const updateAutoHideState = () => {
|
|
29253
29263
|
const el = spacerRef.current;
|
|
@@ -29258,7 +29268,7 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
29258
29268
|
lastScrollHeight.current = currentScrollHeight;
|
|
29259
29269
|
if (window.scrollY <= 0) {
|
|
29260
29270
|
lastScrollY.current = 0;
|
|
29261
|
-
commit("
|
|
29271
|
+
commit("resting");
|
|
29262
29272
|
return;
|
|
29263
29273
|
}
|
|
29264
29274
|
const currentY = window.scrollY;
|
|
@@ -29266,8 +29276,7 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
29266
29276
|
const topOffset = getTopOffsetRef.current?.() ?? 0;
|
|
29267
29277
|
if (scrollHeightChanged) {
|
|
29268
29278
|
lastScrollY.current = currentY;
|
|
29269
|
-
|
|
29270
|
-
commit(next2, nextAtTop2);
|
|
29279
|
+
commit(autoHideStateOnLayoutChange(rect, topOffset));
|
|
29271
29280
|
return;
|
|
29272
29281
|
}
|
|
29273
29282
|
const dy = currentY - lastScrollY.current;
|
|
@@ -29276,18 +29285,18 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
29276
29285
|
const nextAtTop = rect.top >= topOffset;
|
|
29277
29286
|
let next = stateRef.current;
|
|
29278
29287
|
if (nextAtTop) {
|
|
29279
|
-
next = "
|
|
29288
|
+
next = "resting";
|
|
29280
29289
|
} else if (rect.bottom < -THRESHOLD) {
|
|
29281
29290
|
if (dy < 0 && !atBottom) next = "revealed";
|
|
29282
29291
|
else if (dy > 0) next = "hidden";
|
|
29283
29292
|
}
|
|
29284
|
-
commit(next
|
|
29293
|
+
commit(next);
|
|
29285
29294
|
};
|
|
29286
29295
|
updateAutoHideState();
|
|
29287
29296
|
window.addEventListener("scroll", updateAutoHideState, { passive: true });
|
|
29288
29297
|
return () => window.removeEventListener("scroll", updateAutoHideState);
|
|
29289
29298
|
}, [enabled, spacerRef]);
|
|
29290
|
-
return { state
|
|
29299
|
+
return { state };
|
|
29291
29300
|
}
|
|
29292
29301
|
|
|
29293
29302
|
// src/layouts/useMeasuredHeight.ts
|
|
@@ -29307,6 +29316,19 @@ function useMeasuredHeight(ref, enabled) {
|
|
|
29307
29316
|
return height;
|
|
29308
29317
|
}
|
|
29309
29318
|
|
|
29319
|
+
// src/layouts/useTransitionAfterPaint.ts
|
|
29320
|
+
import { useLayoutEffect as useLayoutEffect16 } from "react";
|
|
29321
|
+
function useTransitionAfterPaint(ref, transition) {
|
|
29322
|
+
useLayoutEffect16(() => {
|
|
29323
|
+
const el = ref.current;
|
|
29324
|
+
if (!el) return;
|
|
29325
|
+
const id = requestAnimationFrame(() => {
|
|
29326
|
+
el.style.transition = transition;
|
|
29327
|
+
});
|
|
29328
|
+
return () => cancelAnimationFrame(id);
|
|
29329
|
+
}, [ref, transition]);
|
|
29330
|
+
}
|
|
29331
|
+
|
|
29310
29332
|
// src/layouts/NavbarLayout/NavbarLayoutHeightContext.tsx
|
|
29311
29333
|
import { createContext as createContext18, useContext as useContext29 } from "react";
|
|
29312
29334
|
import { jsx as jsx232 } from "react/jsx-runtime";
|
|
@@ -29333,10 +29355,9 @@ function NavbarLayout(props) {
|
|
|
29333
29355
|
const spacerRef = useRef72(null);
|
|
29334
29356
|
const navHeight = useMeasuredHeight(navMetricsRef, true);
|
|
29335
29357
|
const {
|
|
29336
|
-
state: autoHideState
|
|
29337
|
-
atTop
|
|
29358
|
+
state: autoHideState
|
|
29338
29359
|
} = useAutoHideOnScroll(spacerRef, true);
|
|
29339
|
-
const navOccupiesViewportTop = autoHideState
|
|
29360
|
+
const navOccupiesViewportTop = autoHideState !== "hidden";
|
|
29340
29361
|
const navbarOffsetPx = navHeight > 0 && navOccupiesViewportTop ? navHeight : 0;
|
|
29341
29362
|
const cssVars = navbarOffsetPx > 0 ? {
|
|
29342
29363
|
[beamNavbarLayoutHeightVar]: `${navbarOffsetPx}px`
|
|
@@ -29350,9 +29371,9 @@ function NavbarLayout(props) {
|
|
|
29350
29371
|
}],
|
|
29351
29372
|
width: ["w_var", {
|
|
29352
29373
|
"--width": maybeCssVar67(__maybeInc33(innerWidth))
|
|
29353
|
-
}]
|
|
29354
|
-
transition: "transitionTop"
|
|
29374
|
+
}]
|
|
29355
29375
|
};
|
|
29376
|
+
useTransitionAfterPaint(navMetricsRef, "top 200ms cubic-bezier(0.4, 0, 0.2, 1)");
|
|
29356
29377
|
const bannerTop = `var(${beamEnvironmentBannerLayoutHeightVar}, 0px)`;
|
|
29357
29378
|
const innerStyle = {
|
|
29358
29379
|
top: autoHideState === "hidden" ? `calc(${bannerTop} - ${navHeight}px)` : bannerTop
|
|
@@ -29378,11 +29399,11 @@ function NavbarLayout(props) {
|
|
|
29378
29399
|
import { useCallback as useCallback43, useMemo as useMemo58, useRef as useRef73 } from "react";
|
|
29379
29400
|
|
|
29380
29401
|
// src/hooks/useDocumentTitle.tsx
|
|
29381
|
-
import { useLayoutEffect as
|
|
29402
|
+
import { useLayoutEffect as useLayoutEffect17 } from "react";
|
|
29382
29403
|
function useDocumentTitle(...titleSegments) {
|
|
29383
29404
|
const config = useDocumentTitleConfig();
|
|
29384
29405
|
const pageTitle = joinDocumentTitleSegments(...titleSegments);
|
|
29385
|
-
|
|
29406
|
+
useLayoutEffect17(() => {
|
|
29386
29407
|
if (!config || !pageTitle || typeof document === "undefined") {
|
|
29387
29408
|
return;
|
|
29388
29409
|
}
|
|
@@ -29512,10 +29533,9 @@ function PageHeaderLayout(props) {
|
|
|
29512
29533
|
const spacerRef = useRef73(null);
|
|
29513
29534
|
const headerHeight = useMeasuredHeight(headerMetricsRef, true);
|
|
29514
29535
|
const {
|
|
29515
|
-
state: autoHideState
|
|
29516
|
-
atTop
|
|
29536
|
+
state: autoHideState
|
|
29517
29537
|
} = useAutoHideOnScroll(spacerRef, true, getBannerAndNavbarHeight);
|
|
29518
|
-
const headerOccupiesPosition = autoHideState
|
|
29538
|
+
const headerOccupiesPosition = autoHideState !== "hidden";
|
|
29519
29539
|
const cssVars = headerHeight > 0 && headerOccupiesPosition ? {
|
|
29520
29540
|
[beamPageHeaderLayoutHeightVar]: `${headerHeight}px`
|
|
29521
29541
|
} : void 0;
|
|
@@ -29532,9 +29552,9 @@ function PageHeaderLayout(props) {
|
|
|
29532
29552
|
}],
|
|
29533
29553
|
zIndex: ["z_var", {
|
|
29534
29554
|
"--zIndex": maybeCssVar68(zIndices.pageStickyHeader)
|
|
29535
|
-
}]
|
|
29536
|
-
transition: "transitionAll"
|
|
29555
|
+
}]
|
|
29537
29556
|
};
|
|
29557
|
+
useTransitionAfterPaint(headerMetricsRef, "all 200ms cubic-bezier(0.4, 0, 0.2, 1)");
|
|
29538
29558
|
const innerStyle = {
|
|
29539
29559
|
top: autoHideState === "hidden" ? `calc(${outerTop} - ${headerHeight}px)` : outerTop
|
|
29540
29560
|
};
|
|
@@ -29550,12 +29570,12 @@ function PageHeaderLayout(props) {
|
|
|
29550
29570
|
flexShrink: "fs0",
|
|
29551
29571
|
width: "w100"
|
|
29552
29572
|
}), children: /* @__PURE__ */ jsx236("div", { ref: headerMetricsRef, ...mergeProps42(void 0, innerStyle, innerCss), ...tid.pageHeader, children: pageHeaderEl }) }),
|
|
29553
|
-
/* @__PURE__ */ jsx236("div", { className: "df fdc fg1 mh0 w100
|
|
29573
|
+
/* @__PURE__ */ jsx236("div", { className: "df fdc fg1 mh0 w100 first_child_n_data_self_top_spaced_mt3", ...tid.body, children })
|
|
29554
29574
|
] }) });
|
|
29555
29575
|
}
|
|
29556
29576
|
|
|
29557
29577
|
// src/layouts/Workflow/WorkflowPageLayout.tsx
|
|
29558
|
-
import { useLayoutEffect as
|
|
29578
|
+
import { useLayoutEffect as useLayoutEffect18, useRef as useRef75 } from "react";
|
|
29559
29579
|
|
|
29560
29580
|
// src/components/Headers/WorkflowHeader.tsx
|
|
29561
29581
|
import { jsx as jsx237 } from "react/jsx-runtime";
|
|
@@ -29768,7 +29788,7 @@ function WorkflowPageLayout(props) {
|
|
|
29768
29788
|
[beamPageHeaderLayoutHeightVar]: `${headerHeight}px`
|
|
29769
29789
|
} : void 0;
|
|
29770
29790
|
const showFooter = isMobile;
|
|
29771
|
-
|
|
29791
|
+
useLayoutEffect18(() => {
|
|
29772
29792
|
const root = document.documentElement;
|
|
29773
29793
|
const previous = root.style.getPropertyValue(beamWorkflowLayoutFooterHeightVar);
|
|
29774
29794
|
root.style.setProperty(beamWorkflowLayoutFooterHeightVar, showFooter ? `${mobileFooterHeightPx}px` : "0px");
|