@homebound/beam 4.52.0 → 4.53.1
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/Css.json +4 -4
- package/dist/index.cjs +410 -335
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -6
- package/dist/index.d.ts +22 -6
- package/dist/index.js +311 -236
- package/dist/index.js.map +1 -1
- package/dist/truss.css +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -247,9 +247,9 @@ var CssBuilder = class _CssBuilder {
|
|
|
247
247
|
get bcBlack() {
|
|
248
248
|
return this.add("borderColor", "rgba(0, 0, 0, 1)");
|
|
249
249
|
}
|
|
250
|
-
/** Sets `borderColor: "rgba(
|
|
250
|
+
/** Sets `borderColor: "rgba(250, 250, 250, 1)"`. */
|
|
251
251
|
get bcGray50() {
|
|
252
|
-
return this.add("borderColor", "rgba(
|
|
252
|
+
return this.add("borderColor", "rgba(250, 250, 250, 1)");
|
|
253
253
|
}
|
|
254
254
|
/** Sets `borderColor: "rgba(247, 245, 245, 1)"`. */
|
|
255
255
|
get bcGray100() {
|
|
@@ -2193,9 +2193,9 @@ var CssBuilder = class _CssBuilder {
|
|
|
2193
2193
|
get black() {
|
|
2194
2194
|
return this.add("color", "rgba(0, 0, 0, 1)");
|
|
2195
2195
|
}
|
|
2196
|
-
/** Sets `color: "rgba(
|
|
2196
|
+
/** Sets `color: "rgba(250, 250, 250, 1)"`. */
|
|
2197
2197
|
get gray50() {
|
|
2198
|
-
return this.add("color", "rgba(
|
|
2198
|
+
return this.add("color", "rgba(250, 250, 250, 1)");
|
|
2199
2199
|
}
|
|
2200
2200
|
/** Sets `color: "rgba(247, 245, 245, 1)"`. */
|
|
2201
2201
|
get gray100() {
|
|
@@ -2489,9 +2489,9 @@ var CssBuilder = class _CssBuilder {
|
|
|
2489
2489
|
get bgBlack() {
|
|
2490
2490
|
return this.add("backgroundColor", "rgba(0, 0, 0, 1)");
|
|
2491
2491
|
}
|
|
2492
|
-
/** Sets `backgroundColor: "rgba(
|
|
2492
|
+
/** Sets `backgroundColor: "rgba(250, 250, 250, 1)"`. */
|
|
2493
2493
|
get bgGray50() {
|
|
2494
|
-
return this.add("backgroundColor", "rgba(
|
|
2494
|
+
return this.add("backgroundColor", "rgba(250, 250, 250, 1)");
|
|
2495
2495
|
}
|
|
2496
2496
|
/** Sets `backgroundColor: "rgba(247, 245, 245, 1)"`. */
|
|
2497
2497
|
get bgGray100() {
|
|
@@ -2785,9 +2785,9 @@ var CssBuilder = class _CssBuilder {
|
|
|
2785
2785
|
get fBlack() {
|
|
2786
2786
|
return this.add("fill", "rgba(0, 0, 0, 1)");
|
|
2787
2787
|
}
|
|
2788
|
-
/** Sets `fill: "rgba(
|
|
2788
|
+
/** Sets `fill: "rgba(250, 250, 250, 1)"`. */
|
|
2789
2789
|
get fGray50() {
|
|
2790
|
-
return this.add("fill", "rgba(
|
|
2790
|
+
return this.add("fill", "rgba(250, 250, 250, 1)");
|
|
2791
2791
|
}
|
|
2792
2792
|
/** Sets `fill: "rgba(247, 245, 245, 1)"`. */
|
|
2793
2793
|
get fGray100() {
|
|
@@ -4747,7 +4747,7 @@ var Palette = /* @__PURE__ */ ((Palette2) => {
|
|
|
4747
4747
|
Palette2["White"] = "rgba(255, 255, 255, 1)";
|
|
4748
4748
|
Palette2["Transparent"] = "rgba(0,0,0,0)";
|
|
4749
4749
|
Palette2["Black"] = "rgba(0, 0, 0, 1)";
|
|
4750
|
-
Palette2["Gray50"] = "rgba(
|
|
4750
|
+
Palette2["Gray50"] = "rgba(250, 250, 250, 1)";
|
|
4751
4751
|
Palette2["Gray100"] = "rgba(247, 245, 245, 1)";
|
|
4752
4752
|
Palette2["Gray200"] = "rgba(236, 235, 235, 1)";
|
|
4753
4753
|
Palette2["Gray300"] = "rgba(221, 220, 220, 1)";
|
|
@@ -16724,7 +16724,8 @@ function ButtonGroup(props) {
|
|
|
16724
16724
|
const {
|
|
16725
16725
|
buttons,
|
|
16726
16726
|
disabled = false,
|
|
16727
|
-
size = "sm"
|
|
16727
|
+
size = "sm",
|
|
16728
|
+
fullWidth = false
|
|
16728
16729
|
} = props;
|
|
16729
16730
|
const tid = useTestIds(props, "buttonGroup");
|
|
16730
16731
|
return (
|
|
@@ -16732,7 +16733,10 @@ function ButtonGroup(props) {
|
|
|
16732
16733
|
/* @__PURE__ */ jsx86("div", { ...tid, ...trussProps56({
|
|
16733
16734
|
...{
|
|
16734
16735
|
display: "df",
|
|
16735
|
-
lineHeight: "lh_0"
|
|
16736
|
+
lineHeight: "lh_0",
|
|
16737
|
+
...fullWidth ? {
|
|
16738
|
+
width: "w100"
|
|
16739
|
+
} : {}
|
|
16736
16740
|
},
|
|
16737
16741
|
...sizeStyles2[size]
|
|
16738
16742
|
}), children: buttons.map(({
|
|
@@ -16740,7 +16744,7 @@ function ButtonGroup(props) {
|
|
|
16740
16744
|
...buttonProps
|
|
16741
16745
|
}, i) => (
|
|
16742
16746
|
// Disable the button if the ButtonGroup is disabled or if the current button is disabled.
|
|
16743
|
-
/* @__PURE__ */ jsx86(GroupButton, { ...buttonProps, disabled: disabled || buttonDisabled, size, isFirst: i === 0, isLast: i === buttons.length - 1, ...tid }, i)
|
|
16747
|
+
/* @__PURE__ */ jsx86(GroupButton, { ...buttonProps, disabled: disabled || buttonDisabled, size, isFirst: i === 0, isLast: i === buttons.length - 1, fullWidth, ...tid }, i)
|
|
16744
16748
|
)) })
|
|
16745
16749
|
);
|
|
16746
16750
|
}
|
|
@@ -16757,6 +16761,7 @@ function GroupButton(props) {
|
|
|
16757
16761
|
tooltip,
|
|
16758
16762
|
isFirst,
|
|
16759
16763
|
isLast,
|
|
16764
|
+
fullWidth,
|
|
16760
16765
|
...otherProps
|
|
16761
16766
|
} = props;
|
|
16762
16767
|
const ariaProps = {
|
|
@@ -16778,7 +16783,15 @@ function GroupButton(props) {
|
|
|
16778
16783
|
isHovered
|
|
16779
16784
|
} = useHover9(ariaProps);
|
|
16780
16785
|
const tid = useTestIds(props);
|
|
16781
|
-
return /* @__PURE__ */ jsx86("span", { ...trussProps56(
|
|
16786
|
+
return /* @__PURE__ */ jsx86("span", { ...trussProps56({
|
|
16787
|
+
...getButtonStyles2(isFirst, isLast),
|
|
16788
|
+
...{
|
|
16789
|
+
...fullWidth ? {
|
|
16790
|
+
flexGrow: "fg1",
|
|
16791
|
+
flexBasis: "fb0"
|
|
16792
|
+
} : {}
|
|
16793
|
+
}
|
|
16794
|
+
}), children: maybeTooltip({
|
|
16782
16795
|
title: resolveTooltip(disabled, tooltip),
|
|
16783
16796
|
placement: "top",
|
|
16784
16797
|
children: /* @__PURE__ */ jsxs54("button", { ref, ...buttonProps, ...focusProps, ...hoverProps, ...trussProps56({
|
|
@@ -16795,6 +16808,10 @@ function GroupButton(props) {
|
|
|
16795
16808
|
paddingLeft: "pl2",
|
|
16796
16809
|
paddingRight: "pr2",
|
|
16797
16810
|
height: "h100",
|
|
16811
|
+
...fullWidth ? {
|
|
16812
|
+
width: "w100",
|
|
16813
|
+
justifyContent: "jcc"
|
|
16814
|
+
} : {},
|
|
16798
16815
|
color: ["d_color_var", {
|
|
16799
16816
|
"--d_color": "var(--b-text-disabled)"
|
|
16800
16817
|
}],
|
|
@@ -27145,10 +27162,10 @@ function invertSpacing(value) {
|
|
|
27145
27162
|
}
|
|
27146
27163
|
|
|
27147
27164
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
27148
|
-
import React17, { useCallback as
|
|
27165
|
+
import React17, { useCallback as useCallback37, useEffect as useEffect29, useMemo as useMemo50, useRef as useRef66, useState as useState55 } from "react";
|
|
27149
27166
|
|
|
27150
27167
|
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
27151
|
-
import { memo as memo2, useMemo as useMemo46, useState as
|
|
27168
|
+
import { memo as memo2, useMemo as useMemo46, useState as useState48 } from "react";
|
|
27152
27169
|
|
|
27153
27170
|
// src/components/Pills/SelectionSummaryPill/SelectionSummaryPill.tsx
|
|
27154
27171
|
import { useHover as useHover21 } from "react-aria";
|
|
@@ -27232,7 +27249,14 @@ function EditColumnsButton(props) {
|
|
|
27232
27249
|
disabled,
|
|
27233
27250
|
columns,
|
|
27234
27251
|
api,
|
|
27235
|
-
shareColumnVisibility = false
|
|
27252
|
+
shareColumnVisibility = false,
|
|
27253
|
+
viewToggle
|
|
27254
|
+
} = props;
|
|
27255
|
+
const {
|
|
27256
|
+
sm
|
|
27257
|
+
} = useBreakpoint();
|
|
27258
|
+
const {
|
|
27259
|
+
compact = sm
|
|
27236
27260
|
} = props;
|
|
27237
27261
|
const state = useMenuTriggerState4({
|
|
27238
27262
|
defaultOpen
|
|
@@ -27244,9 +27268,6 @@ function EditColumnsButton(props) {
|
|
|
27244
27268
|
isDisabled: !!disabled
|
|
27245
27269
|
}, state, buttonRef);
|
|
27246
27270
|
const tid = useTestIds(props, "columns");
|
|
27247
|
-
const {
|
|
27248
|
-
sm
|
|
27249
|
-
} = useBreakpoint();
|
|
27250
27271
|
const options = useMemo45(() => buildColumnOptions(columns, shareColumnVisibility), [columns, shareColumnVisibility]);
|
|
27251
27272
|
const selectedValues = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
27252
27273
|
const setSelectedValues = useCallback28((ids) => {
|
|
@@ -27254,7 +27275,7 @@ function EditColumnsButton(props) {
|
|
|
27254
27275
|
api.setVisibleColumns(columns.filter((column2) => column2.canHide ? ids.includes(column2.id) : true).map((c) => c.id));
|
|
27255
27276
|
}, [columns, api]);
|
|
27256
27277
|
const hasHiddenColumn = useMemo45(() => options.some((option) => option.ids.some((id) => !selectedValues.includes(id))), [options, selectedValues]);
|
|
27257
|
-
return /* @__PURE__ */ jsx196(OverlayTrigger, { ...props, trigger:
|
|
27278
|
+
return /* @__PURE__ */ jsx196(OverlayTrigger, { ...props, trigger: compact ? {
|
|
27258
27279
|
icon: hasHiddenColumn ? "columnsBadged" : "columns",
|
|
27259
27280
|
variant: "outline"
|
|
27260
27281
|
} : {
|
|
@@ -27276,6 +27297,7 @@ function EditColumnsButton(props) {
|
|
|
27276
27297
|
maxHeight: "maxh_512px",
|
|
27277
27298
|
boxShadow: "bshBasic h_bshHover"
|
|
27278
27299
|
}), children: [
|
|
27300
|
+
viewToggle && /* @__PURE__ */ jsx196("div", { className: "pt2 pb0 pr2 pl2", children: /* @__PURE__ */ jsx196(ButtonGroup, { ...viewToggle, size: "md", fullWidth: true, ...tid.header }) }),
|
|
27279
27301
|
/* @__PURE__ */ jsx196("div", { className: "dg gtc_1fr_auto g_2 pt2 pb2 pr2 pl2 fg1 mh0 oya", children: options.map((option) => /* @__PURE__ */ jsxs103(Fragment41, { children: [
|
|
27280
27302
|
/* @__PURE__ */ jsxs103("div", { className: "df aic g_4px mw0 pr1", children: [
|
|
27281
27303
|
/* @__PURE__ */ jsx196("span", { className: "fw4 fz_14px lh_20px mw0", children: option.label }),
|
|
@@ -27356,8 +27378,9 @@ function closeMenuOnClickTooltip(tooltip, closeMenu) {
|
|
|
27356
27378
|
|
|
27357
27379
|
// src/components/Table/components/ViewToggleButton.tsx
|
|
27358
27380
|
import { jsx as jsx197 } from "react/jsx-runtime";
|
|
27359
|
-
function ViewToggleButton({ view, onChange, defaultOpen }) {
|
|
27381
|
+
function ViewToggleButton({ view, onChange, defaultOpen, ...props }) {
|
|
27360
27382
|
const { sm } = useBreakpoint();
|
|
27383
|
+
const { compact = sm } = props;
|
|
27361
27384
|
const tid = useTestIds({}, "viewToggleButton");
|
|
27362
27385
|
const menuItems = [
|
|
27363
27386
|
{ label: "List", icon: "projects", onClick: () => onChange("list") },
|
|
@@ -27367,7 +27390,7 @@ function ViewToggleButton({ view, onChange, defaultOpen }) {
|
|
|
27367
27390
|
return /* @__PURE__ */ jsx197(
|
|
27368
27391
|
ButtonMenu,
|
|
27369
27392
|
{
|
|
27370
|
-
trigger:
|
|
27393
|
+
trigger: compact ? { icon, variant: "outline" } : { icon, label: "", size: "md", variant: "secondaryBlack" },
|
|
27371
27394
|
items: menuItems,
|
|
27372
27395
|
defaultOpen,
|
|
27373
27396
|
...tid
|
|
@@ -27502,6 +27525,37 @@ function filterPillsForKey(key, f, filter) {
|
|
|
27502
27525
|
}];
|
|
27503
27526
|
}
|
|
27504
27527
|
|
|
27528
|
+
// src/components/Layout/GridTableLayout/useToolbarCompact.ts
|
|
27529
|
+
import { useResizeObserver as useResizeObserver9 } from "@react-aria/utils";
|
|
27530
|
+
import { useCallback as useCallback29, useLayoutEffect as useLayoutEffect10, useRef as useRef59, useState as useState47 } from "react";
|
|
27531
|
+
function useToolbarCompact(enabled) {
|
|
27532
|
+
const rowRef = useRef59(null);
|
|
27533
|
+
const leftRef = useRef59(null);
|
|
27534
|
+
const rightRef = useRef59(null);
|
|
27535
|
+
const [compact, setCompact] = useState47(false);
|
|
27536
|
+
const fullSlotsWidth = useRef59(0);
|
|
27537
|
+
const measure = useCallback29(() => {
|
|
27538
|
+
const row = rowRef.current;
|
|
27539
|
+
const left = leftRef.current;
|
|
27540
|
+
const right = rightRef.current;
|
|
27541
|
+
if (!enabled || !row || !left || !right || row.clientWidth === 0) {
|
|
27542
|
+
setCompact(false);
|
|
27543
|
+
return;
|
|
27544
|
+
}
|
|
27545
|
+
if (!compact) {
|
|
27546
|
+
const gap = right.getBoundingClientRect().left - left.getBoundingClientRect().right;
|
|
27547
|
+
fullSlotsWidth.current = row.clientWidth - gap;
|
|
27548
|
+
}
|
|
27549
|
+
setCompact(row.clientWidth - fullSlotsWidth.current < toolbarMinSlotGapPx);
|
|
27550
|
+
}, [enabled, compact]);
|
|
27551
|
+
useLayoutEffect10(measure, [measure]);
|
|
27552
|
+
useResizeObserver9({ ref: rowRef, onResize: measure });
|
|
27553
|
+
useResizeObserver9({ ref: leftRef, onResize: measure });
|
|
27554
|
+
useResizeObserver9({ ref: rightRef, onResize: measure });
|
|
27555
|
+
return { rowRef, leftRef, rightRef, compact };
|
|
27556
|
+
}
|
|
27557
|
+
var toolbarMinSlotGapPx = 40;
|
|
27558
|
+
|
|
27505
27559
|
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
27506
27560
|
import { trussProps as trussProps116 } from "@homebound/truss/runtime";
|
|
27507
27561
|
import { jsx as jsx200, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
@@ -27522,27 +27576,37 @@ function GridTableLayoutActionsComponent(props) {
|
|
|
27522
27576
|
clearFilters,
|
|
27523
27577
|
searchApi,
|
|
27524
27578
|
actions,
|
|
27579
|
+
viewModeToggle,
|
|
27525
27580
|
selectionSummary = false
|
|
27526
27581
|
} = props;
|
|
27527
27582
|
const testId = useTestIds(props, "gridTableLayoutActions");
|
|
27528
27583
|
const filterTid = useTestIds({}, filterTestIdPrefix);
|
|
27584
|
+
const showEditColumns = !!(hasHideableColumns && view === "list" && columns && api);
|
|
27585
|
+
const hasRightItems = selectionSummary && !!api || !!viewModeToggle?.length || showEditColumns || !!withCardView && view !== void 0 && !!setView || !!actions?.length;
|
|
27529
27586
|
const {
|
|
27530
|
-
sm
|
|
27587
|
+
sm: smBreakpoint
|
|
27531
27588
|
} = useBreakpoint();
|
|
27589
|
+
const {
|
|
27590
|
+
rowRef,
|
|
27591
|
+
leftRef,
|
|
27592
|
+
rightRef,
|
|
27593
|
+
compact
|
|
27594
|
+
} = useToolbarCompact(!smBreakpoint && hasRightItems);
|
|
27595
|
+
const sm = smBreakpoint || compact;
|
|
27532
27596
|
const {
|
|
27533
27597
|
inModal
|
|
27534
27598
|
} = useModalContext();
|
|
27535
27599
|
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
27536
27600
|
const insetHandled = useContentInsetHandled();
|
|
27537
27601
|
const withPagePadding = inDocumentScrollLayout && !insetHandled;
|
|
27538
|
-
const [showSearch, setShowSearch] =
|
|
27539
|
-
const [showFilters, setShowFilters] =
|
|
27602
|
+
const [showSearch, setShowSearch] = useState48(false);
|
|
27603
|
+
const [showFilters, setShowFilters] = useState48(false);
|
|
27540
27604
|
const [{
|
|
27541
27605
|
search: initialValue
|
|
27542
27606
|
}, setQueryParams] = useQueryParams({
|
|
27543
27607
|
search: StringParam
|
|
27544
27608
|
});
|
|
27545
|
-
const [searchValue, setSearchValue] =
|
|
27609
|
+
const [searchValue, setSearchValue] = useState48(inModal ? "" : initialValue || "");
|
|
27546
27610
|
const handleSearchDebounced = useDebouncedCallback6((value) => {
|
|
27547
27611
|
if (searchProps) {
|
|
27548
27612
|
searchProps.onSearch(value);
|
|
@@ -27556,9 +27620,13 @@ function GridTableLayoutActionsComponent(props) {
|
|
|
27556
27620
|
const hasGroupBy = !!groupBy;
|
|
27557
27621
|
const controlCount = filterCount + (hasGroupBy ? 1 : 0);
|
|
27558
27622
|
const hasFilterControls = controlCount > 0;
|
|
27559
|
-
const
|
|
27623
|
+
const canInline = !inModal && !sm;
|
|
27624
|
+
const groupByInline = canInline && hasGroupBy;
|
|
27625
|
+
const filtersInline = canInline && filterCount > 0 && controlCount <= 2 && !!(filter && setFilter);
|
|
27626
|
+
const showFilterPanel = filterCount > 0 && !filtersInline || hasGroupBy && !groupByInline;
|
|
27560
27627
|
const filterImpls = useMemo46(() => filterDefs ? buildFilterImpls(filterDefs) : {}, [filterDefs]);
|
|
27561
27628
|
const activeFilterCount = useMemo46(() => filter ? getFilterPills(filterImpls, filter).length : 0, [filter, filterImpls]);
|
|
27629
|
+
const viewModeToggleInColumnsMenu = !!viewModeToggle?.length && sm && showEditColumns;
|
|
27562
27630
|
const searchTextField = /* @__PURE__ */ jsx200(TextField, { label: "Search", labelStyle: "hidden", value: searchValue, onChange: (v) => {
|
|
27563
27631
|
setSearchValue(v ?? "");
|
|
27564
27632
|
handleSearchDebounced(v ?? "");
|
|
@@ -27584,7 +27652,7 @@ function GridTableLayoutActionsComponent(props) {
|
|
|
27584
27652
|
paddingBottom: "pb3"
|
|
27585
27653
|
} : {}
|
|
27586
27654
|
}), children: [
|
|
27587
|
-
/* @__PURE__ */ jsxs105("div", { ...trussProps116({
|
|
27655
|
+
/* @__PURE__ */ jsxs105("div", { ref: rowRef, ...trussProps116({
|
|
27588
27656
|
// Holds the row at the 40px button height, so a pill alone in it doesn't shift the table when it appears
|
|
27589
27657
|
...{
|
|
27590
27658
|
display: "df",
|
|
@@ -27596,25 +27664,30 @@ function GridTableLayoutActionsComponent(props) {
|
|
|
27596
27664
|
},
|
|
27597
27665
|
...withPagePadding ? pageContentPaddingX : void 0
|
|
27598
27666
|
}), ...testId.toolbar, children: [
|
|
27599
|
-
/* @__PURE__ */ jsxs105("div", { className: "df g_12px aic", children: [
|
|
27667
|
+
/* @__PURE__ */ jsxs105("div", { ref: leftRef, className: "df fs0 g_12px aic", children: [
|
|
27600
27668
|
!sm && hasSearch && /* @__PURE__ */ jsx200("div", { className: "w_244px", children: searchTextField }),
|
|
27601
27669
|
sm && hasSearch && /* @__PURE__ */ jsx200(IconButton, { variant: "outline", icon: searchValue ? "searchBadged" : "search", label: "Search", onClick: () => setShowSearch(!showSearch), active: showSearch, ...testId.searchButton }),
|
|
27602
27670
|
sm && hasFilterControls && /* @__PURE__ */ jsx200(IconButton, { variant: "outline", icon: activeFilterCount > 0 ? "filterBadged" : "filter", label: "Filter", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterSmallButton }),
|
|
27603
|
-
|
|
27604
|
-
!sm &&
|
|
27671
|
+
filtersInline && filter && setFilter && buildFilterControls(filterImpls, filter, setFilter, filterTid),
|
|
27672
|
+
!sm && showFilterPanel && /* @__PURE__ */ jsx200(Button, { label: "Filter", icon: "filter", size: "md", endAdornment: /* @__PURE__ */ jsxs105("div", { className: "df aic g_1", children: [
|
|
27605
27673
|
activeFilterCount > 0 && /* @__PURE__ */ jsx200(CountBadge, { count: activeFilterCount }),
|
|
27606
27674
|
/* @__PURE__ */ jsx200(Icon, { icon: showFilters ? "chevronUp" : "chevronDown" })
|
|
27607
|
-
] }), variant: "secondaryBlack", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterButton })
|
|
27675
|
+
] }), variant: "secondaryBlack", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterButton }),
|
|
27676
|
+
groupByInline && groupBy && /* @__PURE__ */ jsx200(GroupByField, { ...groupBy }),
|
|
27677
|
+
filtersInline && activeFilterCount > 0 && /* @__PURE__ */ jsx200(Button, { label: "Clear", variant: "tertiary", onClick: () => maybeCall(clearFilters), ...filterTid.clearBtn })
|
|
27608
27678
|
] }),
|
|
27609
|
-
|
|
27679
|
+
hasRightItems && /* @__PURE__ */ jsxs105("div", { ref: rightRef, className: "df fs0 aic g_12px", children: [
|
|
27610
27680
|
selectionSummary && api && /* @__PURE__ */ jsx200(SelectionSummaryAction, { api, numberOnly: sm }),
|
|
27611
|
-
|
|
27612
|
-
|
|
27681
|
+
!!viewModeToggle?.length && !viewModeToggleInColumnsMenu && /* @__PURE__ */ jsx200(ButtonGroup, { size: "md", buttons: viewModeToggle, ...testId.viewModeToggle }),
|
|
27682
|
+
showEditColumns && columns && api && /* @__PURE__ */ jsx200(EditColumnsButton, { columns, api, shareColumnVisibility, tooltip: "Display columns", compact: sm, viewToggle: viewModeToggleInColumnsMenu ? {
|
|
27683
|
+
buttons: viewModeToggle
|
|
27684
|
+
} : void 0 }),
|
|
27685
|
+
withCardView && view !== void 0 && setView && /* @__PURE__ */ jsx200(ViewToggleButton, { view, onChange: setView, compact: sm }),
|
|
27613
27686
|
!!actions?.length && /* @__PURE__ */ jsx200(HeaderActions, { actions, ...testId.actions })
|
|
27614
27687
|
] })
|
|
27615
27688
|
] }),
|
|
27616
27689
|
sm && showSearch && /* @__PURE__ */ jsx200("div", { ...trussProps116(withPagePadding ? pageContentPaddingX : void 0), children: searchTextField }),
|
|
27617
|
-
|
|
27690
|
+
showFilterPanel && /* @__PURE__ */ jsx200(FilterPanel, { isOpen: showFilters, groupBy: groupByInline ? void 0 : groupBy, filterImpls, filter, setFilter, onClear: clearFilters })
|
|
27618
27691
|
] });
|
|
27619
27692
|
}
|
|
27620
27693
|
var _GridTableLayoutActions = memo2(GridTableLayoutActionsComponent);
|
|
@@ -27629,16 +27702,16 @@ function SelectionSummaryAction(props) {
|
|
|
27629
27702
|
}
|
|
27630
27703
|
|
|
27631
27704
|
// src/components/Layout/GridTableLayout/GridTableLayoutHost.tsx
|
|
27632
|
-
import { useResizeObserver as
|
|
27633
|
-
import { useCallback as
|
|
27705
|
+
import { useResizeObserver as useResizeObserver10 } from "@react-aria/utils";
|
|
27706
|
+
import { useCallback as useCallback33, useLayoutEffect as useLayoutEffect14, useRef as useRef64 } from "react";
|
|
27634
27707
|
|
|
27635
27708
|
// src/components/Layout/RightPaneLayout/DocumentScrollOverlayRightPaneLayout.tsx
|
|
27636
|
-
import { useContext as useContext23, useEffect as useEffect27, useLayoutEffect as
|
|
27709
|
+
import { useContext as useContext23, useEffect as useEffect27, useLayoutEffect as useLayoutEffect13, useRef as useRef63, useState as useState51 } from "react";
|
|
27637
27710
|
import { mergeProps as mergeProps33 } from "@homebound/truss/runtime";
|
|
27638
27711
|
|
|
27639
27712
|
// src/components/Layout/RightPaneLayout/DocumentScrollRightPane.tsx
|
|
27640
27713
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "framer-motion";
|
|
27641
|
-
import { useCallback as
|
|
27714
|
+
import { useCallback as useCallback31, useLayoutEffect as useLayoutEffect12, useRef as useRef61, useState as useState50 } from "react";
|
|
27642
27715
|
import { usePreventScroll as usePreventScroll3 } from "react-aria";
|
|
27643
27716
|
import { createPortal as createPortal7 } from "react-dom";
|
|
27644
27717
|
|
|
@@ -27654,11 +27727,11 @@ function useEnvironmentBannerLayoutHeight() {
|
|
|
27654
27727
|
}
|
|
27655
27728
|
|
|
27656
27729
|
// src/layouts/useScrollPinnedViewportBounds.ts
|
|
27657
|
-
import { useCallback as
|
|
27730
|
+
import { useCallback as useCallback30, useLayoutEffect as useLayoutEffect11, useRef as useRef60, useState as useState49 } from "react";
|
|
27658
27731
|
function useScrollPinnedViewportBounds(anchorRef, enabled, getPinTopPx) {
|
|
27659
|
-
const [bounds, setBounds] =
|
|
27660
|
-
const getPinTopPxRef =
|
|
27661
|
-
const syncBounds =
|
|
27732
|
+
const [bounds, setBounds] = useState49();
|
|
27733
|
+
const getPinTopPxRef = useRef60(getPinTopPx);
|
|
27734
|
+
const syncBounds = useCallback30(() => {
|
|
27662
27735
|
const el = anchorRef.current;
|
|
27663
27736
|
if (!el) return;
|
|
27664
27737
|
const rect = el.getBoundingClientRect();
|
|
@@ -27667,10 +27740,10 @@ function useScrollPinnedViewportBounds(anchorRef, enabled, getPinTopPx) {
|
|
|
27667
27740
|
const topPx = isPinned ? pinTopPx : Math.round(rect.top);
|
|
27668
27741
|
setBounds((prev) => prev?.topPx === topPx && prev?.isPinned === isPinned ? prev : { topPx, isPinned });
|
|
27669
27742
|
}, [anchorRef]);
|
|
27670
|
-
|
|
27743
|
+
useLayoutEffect11(() => {
|
|
27671
27744
|
getPinTopPxRef.current = getPinTopPx;
|
|
27672
27745
|
}, [getPinTopPx]);
|
|
27673
|
-
|
|
27746
|
+
useLayoutEffect11(() => {
|
|
27674
27747
|
if (!enabled) {
|
|
27675
27748
|
setBounds(void 0);
|
|
27676
27749
|
return;
|
|
@@ -27851,25 +27924,25 @@ function DocumentScrollRightPane({
|
|
|
27851
27924
|
} = useRightPaneOpenState();
|
|
27852
27925
|
const rightPaneContent = useRightPaneContent();
|
|
27853
27926
|
const tid = useTestIds({}, "rightPaneContent");
|
|
27854
|
-
const paneRef =
|
|
27855
|
-
const [keepPaneLayout, setKeepPaneLayout] =
|
|
27856
|
-
const exitReleasedRef =
|
|
27927
|
+
const paneRef = useRef61(null);
|
|
27928
|
+
const [keepPaneLayout, setKeepPaneLayout] = useState50(false);
|
|
27929
|
+
const exitReleasedRef = useRef61(false);
|
|
27857
27930
|
const bannerHeightPx = useEnvironmentBannerLayoutHeight();
|
|
27858
27931
|
const isFixedOverlay = !mobile;
|
|
27859
|
-
|
|
27932
|
+
useLayoutEffect12(() => {
|
|
27860
27933
|
if (isRightPaneOpen) {
|
|
27861
27934
|
setKeepPaneLayout(true);
|
|
27862
27935
|
exitReleasedRef.current = false;
|
|
27863
27936
|
}
|
|
27864
27937
|
}, [isRightPaneOpen]);
|
|
27865
27938
|
const paneLayoutActive = isRightPaneOpen || keepPaneLayout;
|
|
27866
|
-
const releaseAfterExit =
|
|
27939
|
+
const releaseAfterExit = useCallback31(() => {
|
|
27867
27940
|
if (exitReleasedRef.current) return;
|
|
27868
27941
|
exitReleasedRef.current = true;
|
|
27869
27942
|
clearPane2();
|
|
27870
27943
|
setKeepPaneLayout(false);
|
|
27871
27944
|
}, [clearPane2]);
|
|
27872
|
-
|
|
27945
|
+
useLayoutEffect12(() => {
|
|
27873
27946
|
if (isRightPaneOpen || !keepPaneLayout) return;
|
|
27874
27947
|
return waitForRightPaneExit(releaseAfterExit);
|
|
27875
27948
|
}, [isRightPaneOpen, keepPaneLayout, releaseAfterExit]);
|
|
@@ -27987,10 +28060,10 @@ function DocumentScrollRightPaneLayoutRoot(props) {
|
|
|
27987
28060
|
}
|
|
27988
28061
|
|
|
27989
28062
|
// src/components/Layout/RightPaneLayout/useDocumentScrollRightPaneAnchorRef.ts
|
|
27990
|
-
import { useCallback as
|
|
28063
|
+
import { useCallback as useCallback32, useRef as useRef62 } from "react";
|
|
27991
28064
|
function useDocumentScrollRightPaneAnchorRef() {
|
|
27992
|
-
const ref =
|
|
27993
|
-
const setRef =
|
|
28065
|
+
const ref = useRef62(null);
|
|
28066
|
+
const setRef = useCallback32((node) => {
|
|
27994
28067
|
if (!node && ref.current) {
|
|
27995
28068
|
hideRightPane();
|
|
27996
28069
|
}
|
|
@@ -28025,7 +28098,7 @@ function DocumentScrollOverlayRightPaneLayout({
|
|
|
28025
28098
|
} = useBreakpoint();
|
|
28026
28099
|
const tid = useTestIds({}, "documentScrollRightPaneLayout");
|
|
28027
28100
|
const anchorRef = useDocumentScrollRightPaneAnchorRef();
|
|
28028
|
-
const spacerRef =
|
|
28101
|
+
const spacerRef = useRef63(null);
|
|
28029
28102
|
useEffect27(() => {
|
|
28030
28103
|
if (nestedInLayout && process.env.NODE_ENV !== "production") {
|
|
28031
28104
|
console.warn("DocumentScrollOverlayRightPaneLayout is nested inside another document-scroll right-pane layout. Use a single layout (compose at the body; do not set withRightPane on both a parent and a nested layout).");
|
|
@@ -28060,20 +28133,20 @@ function DocumentScrollOverlayRightPaneHost(props) {
|
|
|
28060
28133
|
isRightPaneOpen
|
|
28061
28134
|
} = useRightPaneOpenState();
|
|
28062
28135
|
const paneWidthCss = documentScrollRightPaneWidthCss(paneWidth);
|
|
28063
|
-
const [keepOverlayChrome, setKeepOverlayChrome] =
|
|
28064
|
-
|
|
28136
|
+
const [keepOverlayChrome, setKeepOverlayChrome] = useState51(isRightPaneOpen);
|
|
28137
|
+
useLayoutEffect13(() => {
|
|
28065
28138
|
if (isRightPaneOpen) {
|
|
28066
28139
|
setKeepOverlayChrome(true);
|
|
28067
28140
|
return;
|
|
28068
28141
|
}
|
|
28069
28142
|
return waitForRightPaneExit(() => setKeepOverlayChrome(false));
|
|
28070
28143
|
}, [isRightPaneOpen]);
|
|
28071
|
-
|
|
28144
|
+
useLayoutEffect13(() => {
|
|
28072
28145
|
const spacer = spacerRef.current;
|
|
28073
28146
|
if (!spacer) return;
|
|
28074
28147
|
spacer.style.width = isRightPaneOpen ? paneWidthCss : "0px";
|
|
28075
28148
|
}, [isRightPaneOpen, paneWidthCss, spacerRef]);
|
|
28076
|
-
|
|
28149
|
+
useLayoutEffect13(() => {
|
|
28077
28150
|
const layoutRoot = anchorRef.current;
|
|
28078
28151
|
if (!layoutRoot) return;
|
|
28079
28152
|
const openPaneWidth = keepOverlayChrome ? paneWidthCss : "0px";
|
|
@@ -28129,8 +28202,8 @@ function GridTableLayoutHost(props) {
|
|
|
28129
28202
|
testIds,
|
|
28130
28203
|
children
|
|
28131
28204
|
} = props;
|
|
28132
|
-
const tableWrapperRef =
|
|
28133
|
-
const tableActionsRef =
|
|
28205
|
+
const tableWrapperRef = useRef64(null);
|
|
28206
|
+
const tableActionsRef = useRef64(null);
|
|
28134
28207
|
const hasActions = actions !== void 0;
|
|
28135
28208
|
useSetTableActionsHeight(tableWrapperRef, tableActionsRef, host.kind !== "scrollable-parent" && hasActions);
|
|
28136
28209
|
const shared = {
|
|
@@ -28233,7 +28306,7 @@ function ActionsBar({
|
|
|
28233
28306
|
return /* @__PURE__ */ jsx205("div", { ref: actionsRef, ...trussProps117(xss), ...testIds.stickyContent, children });
|
|
28234
28307
|
}
|
|
28235
28308
|
function useSetTableActionsHeight(tableWrapperRef, tableActionsRef, enabled) {
|
|
28236
|
-
const syncHeightVar =
|
|
28309
|
+
const syncHeightVar = useCallback33(() => {
|
|
28237
28310
|
const tableWrapper = tableWrapperRef.current;
|
|
28238
28311
|
if (!tableWrapper) return;
|
|
28239
28312
|
if (!enabled) {
|
|
@@ -28247,11 +28320,11 @@ function useSetTableActionsHeight(tableWrapperRef, tableActionsRef, enabled) {
|
|
|
28247
28320
|
tableWrapper.style.removeProperty(beamTableActionsHeightVar);
|
|
28248
28321
|
}
|
|
28249
28322
|
}, [enabled, tableActionsRef, tableWrapperRef]);
|
|
28250
|
-
|
|
28323
|
+
useResizeObserver10({
|
|
28251
28324
|
ref: tableActionsRef,
|
|
28252
28325
|
onResize: enabled ? syncHeightVar : noop
|
|
28253
28326
|
});
|
|
28254
|
-
|
|
28327
|
+
useLayoutEffect14(() => {
|
|
28255
28328
|
syncHeightVar();
|
|
28256
28329
|
const tableWrapper = tableWrapperRef.current;
|
|
28257
28330
|
return () => {
|
|
@@ -28297,10 +28370,10 @@ function useGridTableLayoutHost() {
|
|
|
28297
28370
|
}
|
|
28298
28371
|
|
|
28299
28372
|
// src/components/Layout/GridTableLayout/usePersistedTableView.ts
|
|
28300
|
-
import { useCallback as
|
|
28373
|
+
import { useCallback as useCallback34, useState as useState52 } from "react";
|
|
28301
28374
|
function usePersistedTableView(defaultView, persist) {
|
|
28302
28375
|
const storageKey = persist ? getGridTableViewStorageKey(window.location.pathname) : void 0;
|
|
28303
|
-
const [view, setView] =
|
|
28376
|
+
const [view, setView] = useState52(() => {
|
|
28304
28377
|
if (!storageKey) return defaultView;
|
|
28305
28378
|
try {
|
|
28306
28379
|
return parseStoredTableView(localStorage.getItem(storageKey)) ?? defaultView;
|
|
@@ -28308,7 +28381,7 @@ function usePersistedTableView(defaultView, persist) {
|
|
|
28308
28381
|
return defaultView;
|
|
28309
28382
|
}
|
|
28310
28383
|
});
|
|
28311
|
-
const setViewAndPersist =
|
|
28384
|
+
const setViewAndPersist = useCallback34(
|
|
28312
28385
|
(next) => {
|
|
28313
28386
|
setView(next);
|
|
28314
28387
|
if (storageKey) {
|
|
@@ -28335,15 +28408,15 @@ function isGridTableProps(props) {
|
|
|
28335
28408
|
}
|
|
28336
28409
|
|
|
28337
28410
|
// src/hooks/useGroupBy.ts
|
|
28338
|
-
import { useMemo as useMemo48, useState as
|
|
28411
|
+
import { useMemo as useMemo48, useState as useState53 } from "react";
|
|
28339
28412
|
|
|
28340
28413
|
// src/hooks/useQueryState.ts
|
|
28341
|
-
import { useCallback as
|
|
28414
|
+
import { useCallback as useCallback35 } from "react";
|
|
28342
28415
|
import { StringParam as StringParam2, useQueryParams as useQueryParams2 } from "use-query-params";
|
|
28343
28416
|
function useQueryState(name, initialValue) {
|
|
28344
28417
|
const [params, setParams] = useQueryParams2({ [name]: StringParam2 });
|
|
28345
28418
|
const value = params[name] || initialValue;
|
|
28346
|
-
const setValue =
|
|
28419
|
+
const setValue = useCallback35((value2) => setParams({ [name]: value2 }, "pushIn"), [name, setParams]);
|
|
28347
28420
|
return [value, setValue];
|
|
28348
28421
|
}
|
|
28349
28422
|
|
|
@@ -28356,7 +28429,7 @@ function useGroupBy(opts) {
|
|
|
28356
28429
|
[]
|
|
28357
28430
|
);
|
|
28358
28431
|
const [queryValue, setQueryValue] = useQueryState("groupBy", options[0].id);
|
|
28359
|
-
const [localValue, setLocalValue] =
|
|
28432
|
+
const [localValue, setLocalValue] = useState53(options[0].id);
|
|
28360
28433
|
return {
|
|
28361
28434
|
value: inModal ? localValue : queryValue,
|
|
28362
28435
|
setValue: inModal ? setLocalValue : setQueryValue,
|
|
@@ -28365,17 +28438,17 @@ function useGroupBy(opts) {
|
|
|
28365
28438
|
}
|
|
28366
28439
|
|
|
28367
28440
|
// src/hooks/usePersistedFilter.ts
|
|
28368
|
-
import { useEffect as useEffect28, useMemo as useMemo49, useRef as
|
|
28441
|
+
import { useEffect as useEffect28, useMemo as useMemo49, useRef as useRef65 } from "react";
|
|
28369
28442
|
|
|
28370
28443
|
// src/hooks/useSessionStorage.ts
|
|
28371
|
-
import { useCallback as
|
|
28444
|
+
import { useCallback as useCallback36, useState as useState54 } from "react";
|
|
28372
28445
|
function useSessionStorage(key, defaultValue) {
|
|
28373
28446
|
let hasSessionStorage = false;
|
|
28374
28447
|
try {
|
|
28375
28448
|
hasSessionStorage = !!window.sessionStorage;
|
|
28376
28449
|
} catch (e) {
|
|
28377
28450
|
}
|
|
28378
|
-
const [state, setState] =
|
|
28451
|
+
const [state, setState] = useState54(() => {
|
|
28379
28452
|
if (!hasSessionStorage) {
|
|
28380
28453
|
return defaultValue;
|
|
28381
28454
|
}
|
|
@@ -28386,7 +28459,7 @@ function useSessionStorage(key, defaultValue) {
|
|
|
28386
28459
|
sessionStorage.setItem(key, JSON.stringify(defaultValue));
|
|
28387
28460
|
return defaultValue;
|
|
28388
28461
|
});
|
|
28389
|
-
const setAndSave =
|
|
28462
|
+
const setAndSave = useCallback36(
|
|
28390
28463
|
(value) => {
|
|
28391
28464
|
if (hasSessionStorage && value) {
|
|
28392
28465
|
sessionStorage.setItem(key, JSON.stringify(value));
|
|
@@ -28502,8 +28575,8 @@ function parseSerializedValue(value) {
|
|
|
28502
28575
|
return value === void 0 ? void 0 : JSON.parse(value);
|
|
28503
28576
|
}
|
|
28504
28577
|
function useStableValue(value) {
|
|
28505
|
-
const stableValue =
|
|
28506
|
-
const stableKey =
|
|
28578
|
+
const stableValue = useRef65(value);
|
|
28579
|
+
const stableKey = useRef65(JSON.stringify(value));
|
|
28507
28580
|
const nextKey = JSON.stringify(value);
|
|
28508
28581
|
if (stableKey.current !== nextKey) {
|
|
28509
28582
|
stableValue.current = value;
|
|
@@ -28519,6 +28592,7 @@ function GridTableLayoutComponent(props) {
|
|
|
28519
28592
|
tableProps,
|
|
28520
28593
|
layoutState,
|
|
28521
28594
|
actions,
|
|
28595
|
+
viewModeToggle,
|
|
28522
28596
|
selectionSummary = false,
|
|
28523
28597
|
hideEditColumns = false,
|
|
28524
28598
|
shareColumnVisibility = false,
|
|
@@ -28544,7 +28618,7 @@ function GridTableLayoutComponent(props) {
|
|
|
28544
28618
|
);
|
|
28545
28619
|
const [view, setView] = usePersistedTableView(defaultView, !!withCardView);
|
|
28546
28620
|
const clientSearch = layoutState?.search === "client" ? layoutState.searchString : void 0;
|
|
28547
|
-
const showTableActions = !!(layoutState?.filterDefs || layoutState?.search || hasHideableColumns || withCardView || actions?.length || // Rendered before anything's selected, so the pill doesn't shift the table
|
|
28621
|
+
const showTableActions = !!(layoutState?.filterDefs || layoutState?.search || hasHideableColumns || withCardView || actions?.length || viewModeToggle?.length || // Rendered before anything's selected, so the pill doesn't shift the table
|
|
28548
28622
|
selectionSummary);
|
|
28549
28623
|
const isVirtualized = tableProps.as === "virtual" || view === "card";
|
|
28550
28624
|
const visibleColumnIds = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
@@ -28558,8 +28632,8 @@ function GridTableLayoutComponent(props) {
|
|
|
28558
28632
|
() => layoutState?.search ? { onSearch: layoutState.setSearchString } : void 0,
|
|
28559
28633
|
[layoutState?.search, layoutState?.setSearchString]
|
|
28560
28634
|
);
|
|
28561
|
-
const searchApiRef =
|
|
28562
|
-
const clearFilters =
|
|
28635
|
+
const searchApiRef = useRef66(void 0);
|
|
28636
|
+
const clearFilters = useCallback37(() => {
|
|
28563
28637
|
layoutState?.clearFilters();
|
|
28564
28638
|
searchApiRef.current?.clear();
|
|
28565
28639
|
}, [layoutState]);
|
|
@@ -28585,6 +28659,7 @@ function GridTableLayoutComponent(props) {
|
|
|
28585
28659
|
clearFilters,
|
|
28586
28660
|
searchApi: searchApiRef,
|
|
28587
28661
|
actions,
|
|
28662
|
+
viewModeToggle,
|
|
28588
28663
|
selectionSummary
|
|
28589
28664
|
}
|
|
28590
28665
|
);
|
|
@@ -28652,14 +28727,14 @@ function useGridTableLayoutState({
|
|
|
28652
28727
|
const filterFallback = { filterDefs: {}, storageKey: "unset-filter" };
|
|
28653
28728
|
const { filter, setFilter } = usePersistedFilter(persistedFilter ?? filterFallback);
|
|
28654
28729
|
const groupBy = useGroupBy(maybeGroupBy ?? { none: "none" });
|
|
28655
|
-
const [searchString, setSearchString] =
|
|
28730
|
+
const [searchString, setSearchString] = useState55("");
|
|
28656
28731
|
const columnsFallback = "unset-columns";
|
|
28657
28732
|
const [visibleColumnIds, setVisibleColumnIds] = useSessionStorage(
|
|
28658
28733
|
persistedColumns?.storageKey ?? columnsFallback,
|
|
28659
28734
|
void 0
|
|
28660
28735
|
);
|
|
28661
28736
|
const filteringActive = getActiveFilterCount(filter) > 0 || !!searchString;
|
|
28662
|
-
const clearFilters =
|
|
28737
|
+
const clearFilters = useCallback37(() => {
|
|
28663
28738
|
setFilter({});
|
|
28664
28739
|
setSearchString("");
|
|
28665
28740
|
}, [setFilter]);
|
|
@@ -28814,12 +28889,12 @@ function RightPaneLayout(props) {
|
|
|
28814
28889
|
}
|
|
28815
28890
|
|
|
28816
28891
|
// src/components/Layout/RightPaneLayout/RightPanePanel.tsx
|
|
28817
|
-
import { createContext as createContext14, useContext as useContext24, useEffect as useEffect31, useState as
|
|
28892
|
+
import { createContext as createContext14, useContext as useContext24, useEffect as useEffect31, useState as useState57 } from "react";
|
|
28818
28893
|
import { createPortal as createPortal8 } from "react-dom";
|
|
28819
28894
|
|
|
28820
28895
|
// src/components/Layout/RightPaneLayout/internal/DeleteAction.tsx
|
|
28821
|
-
import { useResizeObserver as
|
|
28822
|
-
import { useRef as
|
|
28896
|
+
import { useResizeObserver as useResizeObserver11 } from "@react-aria/utils";
|
|
28897
|
+
import { useRef as useRef67, useState as useState56 } from "react";
|
|
28823
28898
|
import { trussProps as trussProps119 } from "@homebound/truss/runtime";
|
|
28824
28899
|
import { jsx as jsx210, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
28825
28900
|
function MaybeDeleteAction(props) {
|
|
@@ -28836,18 +28911,18 @@ function BulkDeleteAction(props) {
|
|
|
28836
28911
|
count,
|
|
28837
28912
|
...buttonProps
|
|
28838
28913
|
} = props;
|
|
28839
|
-
const containerRef =
|
|
28840
|
-
const contentRef =
|
|
28841
|
-
const [overflows, setOverflows] =
|
|
28914
|
+
const containerRef = useRef67(null);
|
|
28915
|
+
const contentRef = useRef67(null);
|
|
28916
|
+
const [overflows, setOverflows] = useState56(false);
|
|
28842
28917
|
const onResize = () => {
|
|
28843
28918
|
if (!containerRef.current || !contentRef.current) return;
|
|
28844
28919
|
setOverflows(contentRef.current.offsetWidth > containerRef.current.clientWidth);
|
|
28845
28920
|
};
|
|
28846
|
-
|
|
28921
|
+
useResizeObserver11({
|
|
28847
28922
|
ref: containerRef,
|
|
28848
28923
|
onResize
|
|
28849
28924
|
});
|
|
28850
|
-
|
|
28925
|
+
useResizeObserver11({
|
|
28851
28926
|
ref: contentRef,
|
|
28852
28927
|
onResize
|
|
28853
28928
|
});
|
|
@@ -28905,7 +28980,7 @@ function RightPanePanel(props) {
|
|
|
28905
28980
|
const {
|
|
28906
28981
|
closeRightPane
|
|
28907
28982
|
} = useRightPaneActions();
|
|
28908
|
-
const [bannerSlot, setBannerSlot] =
|
|
28983
|
+
const [bannerSlot, setBannerSlot] = useState57(null);
|
|
28909
28984
|
const {
|
|
28910
28985
|
openModal
|
|
28911
28986
|
} = useModal();
|
|
@@ -28992,7 +29067,7 @@ function ScrollableFooter(props) {
|
|
|
28992
29067
|
|
|
28993
29068
|
// src/components/Layout/TableReviewLayout/TableReviewLayout.tsx
|
|
28994
29069
|
import { AnimatePresence as AnimatePresence5, motion as motion5 } from "framer-motion";
|
|
28995
|
-
import { useEffect as useEffect32, useState as
|
|
29070
|
+
import { useEffect as useEffect32, useState as useState58 } from "react";
|
|
28996
29071
|
|
|
28997
29072
|
// src/components/Layout/TableReviewLayout/SidePanel.tsx
|
|
28998
29073
|
import { jsx as jsx213, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
@@ -29032,7 +29107,7 @@ function TableReviewLayout(props) {
|
|
|
29032
29107
|
rightPaneWidth = defaultRightPaneWidth
|
|
29033
29108
|
} = props;
|
|
29034
29109
|
const tid = useTestIds(props, "tableReviewLayout");
|
|
29035
|
-
const [isPanelVisible, setIsPanelVisible] =
|
|
29110
|
+
const [isPanelVisible, setIsPanelVisible] = useState58(!!panelContent);
|
|
29036
29111
|
useEffect32(() => {
|
|
29037
29112
|
setIsPanelVisible(!!panelContent);
|
|
29038
29113
|
}, [panelContent]);
|
|
@@ -29192,29 +29267,29 @@ function HomeboundLogo(props) {
|
|
|
29192
29267
|
}
|
|
29193
29268
|
|
|
29194
29269
|
// src/components/MaxLines.tsx
|
|
29195
|
-
import { useLayoutEffect as
|
|
29196
|
-
import { useCallback as
|
|
29270
|
+
import { useLayoutEffect as useLayoutEffect15, useResizeObserver as useResizeObserver12 } from "@react-aria/utils";
|
|
29271
|
+
import { useCallback as useCallback38, useEffect as useEffect33, useRef as useRef68, useState as useState59 } from "react";
|
|
29197
29272
|
import { trussProps as trussProps124, maybeCssVar as maybeCssVar59 } from "@homebound/truss/runtime";
|
|
29198
29273
|
import { jsx as jsx217, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
29199
29274
|
function MaxLines({
|
|
29200
29275
|
maxLines,
|
|
29201
29276
|
children
|
|
29202
29277
|
}) {
|
|
29203
|
-
const elRef =
|
|
29204
|
-
const [hasMore, setHasMore] =
|
|
29205
|
-
const [expanded, setExpanded] =
|
|
29206
|
-
|
|
29278
|
+
const elRef = useRef68(null);
|
|
29279
|
+
const [hasMore, setHasMore] = useState59(false);
|
|
29280
|
+
const [expanded, setExpanded] = useState59(false);
|
|
29281
|
+
useLayoutEffect15(() => {
|
|
29207
29282
|
if (!elRef.current) return;
|
|
29208
29283
|
setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
29209
29284
|
}, []);
|
|
29210
29285
|
useEffect33(() => {
|
|
29211
29286
|
setExpanded(false);
|
|
29212
29287
|
}, [children]);
|
|
29213
|
-
const onResize =
|
|
29288
|
+
const onResize = useCallback38(() => {
|
|
29214
29289
|
if (!elRef.current) return;
|
|
29215
29290
|
!expanded && setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
29216
29291
|
}, [expanded]);
|
|
29217
|
-
|
|
29292
|
+
useResizeObserver12({
|
|
29218
29293
|
ref: elRef,
|
|
29219
29294
|
onResize
|
|
29220
29295
|
});
|
|
@@ -29324,8 +29399,8 @@ function toPageNumberSize(page) {
|
|
|
29324
29399
|
}
|
|
29325
29400
|
|
|
29326
29401
|
// src/components/ScrollShadows.tsx
|
|
29327
|
-
import { useResizeObserver as
|
|
29328
|
-
import { useCallback as
|
|
29402
|
+
import { useResizeObserver as useResizeObserver13 } from "@react-aria/utils";
|
|
29403
|
+
import { useCallback as useCallback39, useMemo as useMemo51, useRef as useRef69, useState as useState60 } from "react";
|
|
29329
29404
|
import { trussProps as trussProps126, maybeCssVar as maybeCssVar60 } from "@homebound/truss/runtime";
|
|
29330
29405
|
import { jsx as jsx219, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
29331
29406
|
function ScrollShadows(props) {
|
|
@@ -29343,9 +29418,9 @@ function ScrollShadows(props) {
|
|
|
29343
29418
|
if (!bgColor.includes("rgba")) {
|
|
29344
29419
|
throw new Error("ScrollShadows: bgColor prop must be in the format 'rgba(255, 255, 255, 1)'");
|
|
29345
29420
|
}
|
|
29346
|
-
const [showStartShadow, setShowStartShadow] =
|
|
29347
|
-
const [showEndShadow, setShowEndShadow] =
|
|
29348
|
-
const scrollRef =
|
|
29421
|
+
const [showStartShadow, setShowStartShadow] = useState60(false);
|
|
29422
|
+
const [showEndShadow, setShowEndShadow] = useState60(false);
|
|
29423
|
+
const scrollRef = useRef69(null);
|
|
29349
29424
|
const [startShadowStyles, endShadowStyles] = useMemo51(() => {
|
|
29350
29425
|
const transparentBgColor = bgColor.replace(/,1\)$/, ",0)");
|
|
29351
29426
|
const commonStyles = {
|
|
@@ -29397,7 +29472,7 @@ function ScrollShadows(props) {
|
|
|
29397
29472
|
}
|
|
29398
29473
|
}];
|
|
29399
29474
|
}, [horizontal, bgColor]);
|
|
29400
|
-
const updateScrollProps =
|
|
29475
|
+
const updateScrollProps = useCallback39((el) => {
|
|
29401
29476
|
const {
|
|
29402
29477
|
scrollTop,
|
|
29403
29478
|
scrollHeight,
|
|
@@ -29412,8 +29487,8 @@ function ScrollShadows(props) {
|
|
|
29412
29487
|
setShowStartShadow(start > 0);
|
|
29413
29488
|
setShowEndShadow(start + boxSize < end);
|
|
29414
29489
|
}, [horizontal]);
|
|
29415
|
-
const onResize =
|
|
29416
|
-
|
|
29490
|
+
const onResize = useCallback39(() => scrollRef.current && updateScrollProps(scrollRef.current), [updateScrollProps]);
|
|
29491
|
+
useResizeObserver13({
|
|
29417
29492
|
ref: scrollRef,
|
|
29418
29493
|
onResize
|
|
29419
29494
|
});
|
|
@@ -29464,12 +29539,12 @@ function ScrollShadows(props) {
|
|
|
29464
29539
|
import { camelCase as camelCase7 } from "change-case";
|
|
29465
29540
|
|
|
29466
29541
|
// src/components/AppNav/AppNavGroup.tsx
|
|
29467
|
-
import { useResizeObserver as
|
|
29542
|
+
import { useResizeObserver as useResizeObserver14 } from "@react-aria/utils";
|
|
29468
29543
|
import { camelCase as camelCase6, kebabCase } from "change-case";
|
|
29469
|
-
import { useCallback as
|
|
29544
|
+
import { useCallback as useCallback41, useEffect as useEffect34, useMemo as useMemo53, useState as useState62 } from "react";
|
|
29470
29545
|
|
|
29471
29546
|
// src/components/AppNav/AppNavGroupTrigger.tsx
|
|
29472
|
-
import { useMemo as useMemo52, useRef as
|
|
29547
|
+
import { useMemo as useMemo52, useRef as useRef70 } from "react";
|
|
29473
29548
|
import { mergeProps as mergeProps35, useButton as useButton11, useFocusRing as useFocusRing17, useHover as useHover22 } from "react-aria";
|
|
29474
29549
|
import { trussProps as trussProps127, mergeProps as mergeProps_15 } from "@homebound/truss/runtime";
|
|
29475
29550
|
import { jsx as jsx220, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
@@ -29482,7 +29557,7 @@ function AppNavGroupTrigger(props) {
|
|
|
29482
29557
|
active = false
|
|
29483
29558
|
} = props;
|
|
29484
29559
|
const tid = useTestIds(props, "trigger");
|
|
29485
|
-
const ref =
|
|
29560
|
+
const ref = useRef70(null);
|
|
29486
29561
|
const {
|
|
29487
29562
|
buttonProps,
|
|
29488
29563
|
isPressed
|
|
@@ -29641,7 +29716,7 @@ function entryHasIcons(item) {
|
|
|
29641
29716
|
}
|
|
29642
29717
|
|
|
29643
29718
|
// src/components/AppNav/useAppNavGroupExpanded.ts
|
|
29644
|
-
import { useCallback as
|
|
29719
|
+
import { useCallback as useCallback40, useState as useState61 } from "react";
|
|
29645
29720
|
var APP_NAV_EXPANDED_LINK_GROUPS_STORAGE_KEY = "beam.appNav.expandedLinkGroups";
|
|
29646
29721
|
function loadStored() {
|
|
29647
29722
|
try {
|
|
@@ -29660,13 +29735,13 @@ function persistLabel(label, expanded) {
|
|
|
29660
29735
|
}
|
|
29661
29736
|
function useAppNavGroupExpanded(linkGroup) {
|
|
29662
29737
|
const { label } = linkGroup;
|
|
29663
|
-
const [userExpanded, setUserExpanded] =
|
|
29738
|
+
const [userExpanded, setUserExpanded] = useState61(() => {
|
|
29664
29739
|
const stored = loadStored();
|
|
29665
29740
|
return label in stored ? stored[label] : null;
|
|
29666
29741
|
});
|
|
29667
29742
|
const hasActiveLink = appNavLinkGroupLinks(linkGroup).some((l) => l.active);
|
|
29668
29743
|
const expanded = userExpanded !== null ? userExpanded : hasActiveLink ? true : linkGroup.defaultExpanded ?? false;
|
|
29669
|
-
const onToggle =
|
|
29744
|
+
const onToggle = useCallback40(() => {
|
|
29670
29745
|
const next = !expanded;
|
|
29671
29746
|
setUserExpanded(next);
|
|
29672
29747
|
persistLabel(label, next);
|
|
@@ -29701,20 +29776,20 @@ function AppNavGroupDisclosure(props) {
|
|
|
29701
29776
|
} = useAppNavGroupExpanded(linkGroup);
|
|
29702
29777
|
const tid = useTestIds(props, "linkGroup");
|
|
29703
29778
|
const navGroupId = `nav-group-${kebabCase(linkGroup.label)}`;
|
|
29704
|
-
const [contentEl, setContentEl] =
|
|
29779
|
+
const [contentEl, setContentEl] = useState62(null);
|
|
29705
29780
|
const contentRef = useMemo53(() => ({
|
|
29706
29781
|
current: contentEl
|
|
29707
29782
|
}), [contentEl]);
|
|
29708
|
-
const [contentHeight, setContentHeight] =
|
|
29783
|
+
const [contentHeight, setContentHeight] = useState62(expanded ? "auto" : "0");
|
|
29709
29784
|
useEffect34(() => {
|
|
29710
29785
|
setContentHeight(expanded && contentEl ? `${contentEl.scrollHeight}px` : "0");
|
|
29711
29786
|
}, [expanded, contentEl]);
|
|
29712
|
-
const onResize =
|
|
29787
|
+
const onResize = useCallback41(() => {
|
|
29713
29788
|
if (contentEl && expanded) {
|
|
29714
29789
|
setContentHeight(`${contentEl.scrollHeight}px`);
|
|
29715
29790
|
}
|
|
29716
29791
|
}, [expanded, contentEl]);
|
|
29717
|
-
|
|
29792
|
+
useResizeObserver14({
|
|
29718
29793
|
ref: contentRef,
|
|
29719
29794
|
onResize
|
|
29720
29795
|
});
|
|
@@ -29857,12 +29932,12 @@ function AppNavItems(props) {
|
|
|
29857
29932
|
// src/layouts/SideNavLayout/SideNavLayoutContext.tsx
|
|
29858
29933
|
import {
|
|
29859
29934
|
createContext as createContext15,
|
|
29860
|
-
useCallback as
|
|
29935
|
+
useCallback as useCallback42,
|
|
29861
29936
|
useContext as useContext25,
|
|
29862
29937
|
useEffect as useEffect35,
|
|
29863
29938
|
useMemo as useMemo54,
|
|
29864
|
-
useRef as
|
|
29865
|
-
useState as
|
|
29939
|
+
useRef as useRef71,
|
|
29940
|
+
useState as useState63
|
|
29866
29941
|
} from "react";
|
|
29867
29942
|
import { jsx as jsx225 } from "react/jsx-runtime";
|
|
29868
29943
|
var SIDE_NAV_LAYOUT_STATE_STORAGE_KEY = "beam.sideNavLayout.navState";
|
|
@@ -29888,18 +29963,18 @@ function resolveInitialNavState(defaultNavState) {
|
|
|
29888
29963
|
}
|
|
29889
29964
|
var SideNavLayoutContext = createContext15(void 0);
|
|
29890
29965
|
function SideNavLayoutProvider(props) {
|
|
29891
|
-
const [navState, setNavStateInternal] =
|
|
29966
|
+
const [navState, setNavStateInternal] = useState63(
|
|
29892
29967
|
() => resolveInitialNavState(props.defaultNavState)
|
|
29893
29968
|
);
|
|
29894
29969
|
const bp = useBreakpoint();
|
|
29895
|
-
const prevMdAndUp =
|
|
29970
|
+
const prevMdAndUp = useRef71(bp.mdAndUp);
|
|
29896
29971
|
useEffect35(() => {
|
|
29897
29972
|
if (prevMdAndUp.current && !bp.mdAndUp) {
|
|
29898
29973
|
setNavStateInternal((prev) => prev === "expanded" ? "collapse" : prev);
|
|
29899
29974
|
}
|
|
29900
29975
|
prevMdAndUp.current = bp.mdAndUp;
|
|
29901
29976
|
}, [bp.mdAndUp]);
|
|
29902
|
-
const setNavState =
|
|
29977
|
+
const setNavState = useCallback42((value2) => {
|
|
29903
29978
|
setNavStateInternal((prev) => {
|
|
29904
29979
|
const next = typeof value2 === "function" ? value2(prev) : value2;
|
|
29905
29980
|
if (next === "expanded" || next === "collapse") {
|
|
@@ -29980,7 +30055,7 @@ function SideNav(props) {
|
|
|
29980
30055
|
}
|
|
29981
30056
|
|
|
29982
30057
|
// src/components/Stepper.tsx
|
|
29983
|
-
import { useRef as
|
|
30058
|
+
import { useRef as useRef72 } from "react";
|
|
29984
30059
|
import { useButton as useButton12, useFocusRing as useFocusRing18, useHover as useHover23 } from "react-aria";
|
|
29985
30060
|
import { trussProps as trussProps131, maybeCssVar as maybeCssVar62 } from "@homebound/truss/runtime";
|
|
29986
30061
|
import { jsx as jsx227, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
@@ -30062,7 +30137,7 @@ function StepButton(props) {
|
|
|
30062
30137
|
onPress: onClick,
|
|
30063
30138
|
isDisabled: disabled
|
|
30064
30139
|
};
|
|
30065
|
-
const ref =
|
|
30140
|
+
const ref = useRef72(null);
|
|
30066
30141
|
const {
|
|
30067
30142
|
buttonProps,
|
|
30068
30143
|
isPressed
|
|
@@ -30172,7 +30247,7 @@ function StepIcon({
|
|
|
30172
30247
|
}
|
|
30173
30248
|
|
|
30174
30249
|
// src/components/StepperTabs/StepperTab.tsx
|
|
30175
|
-
import { useRef as
|
|
30250
|
+
import { useRef as useRef73 } from "react";
|
|
30176
30251
|
import { mergeProps as mergeProps36, useButton as useButton13, useFocusRing as useFocusRing19, useHover as useHover24, VisuallyHidden as VisuallyHidden10 } from "react-aria";
|
|
30177
30252
|
import { trussProps as trussProps132 } from "@homebound/truss/runtime";
|
|
30178
30253
|
import { Fragment as Fragment49, jsx as jsx228, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
@@ -30191,7 +30266,7 @@ function StepperTab(props) {
|
|
|
30191
30266
|
onPress: () => onClick(value),
|
|
30192
30267
|
isDisabled: disabled || collapsed
|
|
30193
30268
|
};
|
|
30194
|
-
const ref =
|
|
30269
|
+
const ref = useRef73(null);
|
|
30195
30270
|
const {
|
|
30196
30271
|
buttonProps
|
|
30197
30272
|
} = useButton13(ariaProps, ref);
|
|
@@ -30592,7 +30667,7 @@ function segmentWidth(count, total) {
|
|
|
30592
30667
|
}
|
|
30593
30668
|
|
|
30594
30669
|
// src/components/TableSummary/TableSummary.tsx
|
|
30595
|
-
import { useRef as
|
|
30670
|
+
import { useRef as useRef74 } from "react";
|
|
30596
30671
|
import { mergeProps as mergeProps38, useButton as useButton14, useFocusRing as useFocusRing20, useHover as useHover25 } from "react-aria";
|
|
30597
30672
|
import { trussProps as trussProps137, maybeCssVar as maybeCssVar64 } from "@homebound/truss/runtime";
|
|
30598
30673
|
import { jsx as jsx234, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
@@ -30652,7 +30727,7 @@ function MetricButton(props) {
|
|
|
30652
30727
|
metric,
|
|
30653
30728
|
divider
|
|
30654
30729
|
} = props;
|
|
30655
|
-
const ref =
|
|
30730
|
+
const ref = useRef74(null);
|
|
30656
30731
|
const {
|
|
30657
30732
|
buttonProps
|
|
30658
30733
|
} = useButton14({
|
|
@@ -30729,7 +30804,7 @@ function MetricButton(props) {
|
|
|
30729
30804
|
|
|
30730
30805
|
// src/components/DnDGrid/DnDGrid.tsx
|
|
30731
30806
|
import equal2 from "fast-deep-equal";
|
|
30732
|
-
import { useCallback as
|
|
30807
|
+
import { useCallback as useCallback43, useEffect as useEffect36, useRef as useRef75 } from "react";
|
|
30733
30808
|
|
|
30734
30809
|
// src/utils/inlineStyles.ts
|
|
30735
30810
|
function isInlineStyleValue(value) {
|
|
@@ -30779,13 +30854,13 @@ function DnDGrid(props) {
|
|
|
30779
30854
|
activeItemStyles,
|
|
30780
30855
|
lockAxis
|
|
30781
30856
|
} = props;
|
|
30782
|
-
const gridEl =
|
|
30783
|
-
const dragEl =
|
|
30784
|
-
const cloneEl =
|
|
30785
|
-
const initialOrder =
|
|
30786
|
-
const styleSnapshot =
|
|
30787
|
-
const reorderViaKeyboard =
|
|
30788
|
-
const transformFrom =
|
|
30857
|
+
const gridEl = useRef75(null);
|
|
30858
|
+
const dragEl = useRef75(void 0);
|
|
30859
|
+
const cloneEl = useRef75(void 0);
|
|
30860
|
+
const initialOrder = useRef75(void 0);
|
|
30861
|
+
const styleSnapshot = useRef75(void 0);
|
|
30862
|
+
const reorderViaKeyboard = useRef75(false);
|
|
30863
|
+
const transformFrom = useRef75({
|
|
30789
30864
|
x: 0,
|
|
30790
30865
|
y: 0
|
|
30791
30866
|
});
|
|
@@ -30793,20 +30868,20 @@ function DnDGrid(props) {
|
|
|
30793
30868
|
const activeStyles3 = activeItemStyles ?? {
|
|
30794
30869
|
boxShadow: "bshModal"
|
|
30795
30870
|
};
|
|
30796
|
-
const getGridItems =
|
|
30871
|
+
const getGridItems = useCallback43(() => {
|
|
30797
30872
|
return gridEl.current ? Array.from(gridEl.current.querySelectorAll(`[${gridItemIdKey}]`)) : [];
|
|
30798
30873
|
}, []);
|
|
30799
|
-
const getGridItemIdOrder =
|
|
30874
|
+
const getGridItemIdOrder = useCallback43(() => {
|
|
30800
30875
|
return getGridItems().map((child) => child.getAttribute(gridItemIdKey)).filter(isDefined);
|
|
30801
30876
|
}, [getGridItems]);
|
|
30802
|
-
const initReorder =
|
|
30877
|
+
const initReorder = useCallback43(() => {
|
|
30803
30878
|
if (gridEl.current && dragEl.current) {
|
|
30804
30879
|
initialOrder.current = getGridItemIdOrder();
|
|
30805
30880
|
styleSnapshot.current = snapshotElementStyle(dragEl.current);
|
|
30806
30881
|
applyActiveStyles(dragEl.current, activeStyles3);
|
|
30807
30882
|
}
|
|
30808
30883
|
}, [getGridItemIdOrder, activeStyles3]);
|
|
30809
|
-
const commitReorder =
|
|
30884
|
+
const commitReorder = useCallback43(() => {
|
|
30810
30885
|
if (gridEl.current && dragEl.current) {
|
|
30811
30886
|
const currentOrder = getGridItemIdOrder();
|
|
30812
30887
|
if (!equal2(currentOrder, initialOrder.current)) onReorder(currentOrder);
|
|
@@ -30816,7 +30891,7 @@ function DnDGrid(props) {
|
|
|
30816
30891
|
initialOrder.current = currentOrder;
|
|
30817
30892
|
}
|
|
30818
30893
|
}, [onReorder, getGridItemIdOrder]);
|
|
30819
|
-
const cancelReorder =
|
|
30894
|
+
const cancelReorder = useCallback43(() => {
|
|
30820
30895
|
if (gridEl.current && dragEl.current && initialOrder.current) {
|
|
30821
30896
|
const currentOrder = getGridItemIdOrder();
|
|
30822
30897
|
if (!equal2(currentOrder, initialOrder.current)) {
|
|
@@ -30838,7 +30913,7 @@ function DnDGrid(props) {
|
|
|
30838
30913
|
reorderViaKeyboard.current = false;
|
|
30839
30914
|
}
|
|
30840
30915
|
}, [getGridItemIdOrder, getGridItems]);
|
|
30841
|
-
const onMove =
|
|
30916
|
+
const onMove = useCallback43((e) => {
|
|
30842
30917
|
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
30843
30918
|
const clientX = "clientX" in e ? e.clientX : e.touches[0].clientX;
|
|
30844
30919
|
const clientY = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
@@ -30861,7 +30936,7 @@ function DnDGrid(props) {
|
|
|
30861
30936
|
}
|
|
30862
30937
|
}
|
|
30863
30938
|
}, [lockAxis]);
|
|
30864
|
-
const onDragEnd =
|
|
30939
|
+
const onDragEnd = useCallback43((e) => {
|
|
30865
30940
|
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
30866
30941
|
e.preventDefault();
|
|
30867
30942
|
cloneEl.current.replaceWith(dragEl.current);
|
|
@@ -30872,7 +30947,7 @@ function DnDGrid(props) {
|
|
|
30872
30947
|
removePointerDragListeners(onMove, onDragEnd);
|
|
30873
30948
|
}
|
|
30874
30949
|
}, [commitReorder, onMove]);
|
|
30875
|
-
const onDragStart =
|
|
30950
|
+
const onDragStart = useCallback43((e) => {
|
|
30876
30951
|
if (!reorderViaKeyboard.current && dragEl.current && gridEl.current) {
|
|
30877
30952
|
const rect = dragEl.current.getBoundingClientRect();
|
|
30878
30953
|
const clientX = "clientX" in e ? e.clientX : e.touches[0].clientX;
|
|
@@ -30903,7 +30978,7 @@ function DnDGrid(props) {
|
|
|
30903
30978
|
useEffect36(() => {
|
|
30904
30979
|
return () => removePointerDragListeners(onMove, onDragEnd);
|
|
30905
30980
|
}, [onMove, onDragEnd]);
|
|
30906
|
-
const onDragHandleKeyDown =
|
|
30981
|
+
const onDragHandleKeyDown = useCallback43((e) => {
|
|
30907
30982
|
const moveHandle = e.target;
|
|
30908
30983
|
if (dragEl.current instanceof HTMLElement && moveHandle instanceof HTMLElement && gridEl.current) {
|
|
30909
30984
|
const isSpaceKey = e.key === " ";
|
|
@@ -31805,17 +31880,17 @@ function OpenModal(props) {
|
|
|
31805
31880
|
|
|
31806
31881
|
// src/components/Navbar/NavbarMobileMenu.tsx
|
|
31807
31882
|
import { AnimatePresence as AnimatePresence6, motion as motion7 } from "framer-motion";
|
|
31808
|
-
import { useEffect as useEffect39, useState as
|
|
31883
|
+
import { useEffect as useEffect39, useState as useState65 } from "react";
|
|
31809
31884
|
import { FocusScope as FocusScope7, usePreventScroll as usePreventScroll4 } from "react-aria";
|
|
31810
31885
|
import { createPortal as createPortal11 } from "react-dom";
|
|
31811
31886
|
import { useLocation } from "react-router-dom";
|
|
31812
31887
|
|
|
31813
31888
|
// src/layouts/NavbarLayout/MobileSubNavContext.tsx
|
|
31814
|
-
import { createContext as createContext18, useContext as useContext29, useLayoutEffect as
|
|
31889
|
+
import { createContext as createContext18, useContext as useContext29, useLayoutEffect as useLayoutEffect16, useMemo as useMemo60, useState as useState64 } from "react";
|
|
31815
31890
|
import { jsx as jsx250 } from "react/jsx-runtime";
|
|
31816
31891
|
var MobileSubNavContext = createContext18(void 0);
|
|
31817
31892
|
function MobileSubNavProvider(props) {
|
|
31818
|
-
const [mobileSubNav, setMobileSubNav] =
|
|
31893
|
+
const [mobileSubNav, setMobileSubNav] = useState64(null);
|
|
31819
31894
|
const value = useMemo60(() => ({ mobileSubNav, setMobileSubNav }), [mobileSubNav]);
|
|
31820
31895
|
return /* @__PURE__ */ jsx250(MobileSubNavContext.Provider, { value, children: props.children });
|
|
31821
31896
|
}
|
|
@@ -31827,11 +31902,11 @@ function useRegisterMobileSubNav(content2) {
|
|
|
31827
31902
|
const setMobileSubNav = ctx?.setMobileSubNav;
|
|
31828
31903
|
const enabled = !useBreakpoint().mdAndUp;
|
|
31829
31904
|
const { top, items, footer } = content2;
|
|
31830
|
-
|
|
31905
|
+
useLayoutEffect16(() => {
|
|
31831
31906
|
if (!setMobileSubNav || !enabled) return;
|
|
31832
31907
|
setMobileSubNav({ top, items, footer });
|
|
31833
31908
|
}, [setMobileSubNav, enabled, top, items, footer]);
|
|
31834
|
-
|
|
31909
|
+
useLayoutEffect16(() => {
|
|
31835
31910
|
if (!setMobileSubNav || !enabled) return;
|
|
31836
31911
|
return () => setMobileSubNav(null);
|
|
31837
31912
|
}, [setMobileSubNav, enabled]);
|
|
@@ -31846,8 +31921,8 @@ function NavbarMobileMenu(props) {
|
|
|
31846
31921
|
items
|
|
31847
31922
|
} = props;
|
|
31848
31923
|
const tid = useTestIds(props, "navbar");
|
|
31849
|
-
const [isOpen2, setIsOpen] =
|
|
31850
|
-
const [level, setLevel] =
|
|
31924
|
+
const [isOpen2, setIsOpen] = useState65(false);
|
|
31925
|
+
const [level, setLevel] = useState65("sub");
|
|
31851
31926
|
const {
|
|
31852
31927
|
pathname,
|
|
31853
31928
|
search
|
|
@@ -32006,12 +32081,12 @@ function NavbarMobileDrawer({
|
|
|
32006
32081
|
}
|
|
32007
32082
|
|
|
32008
32083
|
// src/hooks/useContentOverflow.ts
|
|
32009
|
-
import { useCallback as
|
|
32084
|
+
import { useCallback as useCallback44, useLayoutEffect as useLayoutEffect17, useRef as useRef76, useState as useState66 } from "react";
|
|
32010
32085
|
function useContentOverflow(enabled = true) {
|
|
32011
|
-
const containerRef =
|
|
32012
|
-
const contentRef =
|
|
32013
|
-
const [overflows, setOverflows] =
|
|
32014
|
-
const checkContentOverflow =
|
|
32086
|
+
const containerRef = useRef76(null);
|
|
32087
|
+
const contentRef = useRef76(null);
|
|
32088
|
+
const [overflows, setOverflows] = useState66(false);
|
|
32089
|
+
const checkContentOverflow = useCallback44(() => {
|
|
32015
32090
|
const container = containerRef.current;
|
|
32016
32091
|
const content2 = contentRef.current;
|
|
32017
32092
|
if (!enabled || !container || !content2) {
|
|
@@ -32020,7 +32095,7 @@ function useContentOverflow(enabled = true) {
|
|
|
32020
32095
|
}
|
|
32021
32096
|
setOverflows(content2.offsetWidth > container.clientWidth);
|
|
32022
32097
|
}, [enabled]);
|
|
32023
|
-
|
|
32098
|
+
useLayoutEffect17(() => {
|
|
32024
32099
|
checkContentOverflow();
|
|
32025
32100
|
window.addEventListener("resize", checkContentOverflow);
|
|
32026
32101
|
return () => window.removeEventListener("resize", checkContentOverflow);
|
|
@@ -32107,10 +32182,10 @@ function NavbarUserMenu({
|
|
|
32107
32182
|
}
|
|
32108
32183
|
|
|
32109
32184
|
// src/components/Snackbar/useSnackbar.tsx
|
|
32110
|
-
import { useCallback as
|
|
32185
|
+
import { useCallback as useCallback45, useEffect as useEffect40 } from "react";
|
|
32111
32186
|
function useSnackbar() {
|
|
32112
32187
|
const { setNotices, setOffset } = useSnackbarContext();
|
|
32113
|
-
const onClose =
|
|
32188
|
+
const onClose = useCallback45(
|
|
32114
32189
|
(noticeId) => {
|
|
32115
32190
|
setNotices((prev) => {
|
|
32116
32191
|
let returnValue = prev;
|
|
@@ -32127,7 +32202,7 @@ function useSnackbar() {
|
|
|
32127
32202
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32128
32203
|
[]
|
|
32129
32204
|
);
|
|
32130
|
-
const triggerNotice =
|
|
32205
|
+
const triggerNotice = useCallback45(
|
|
32131
32206
|
(props) => {
|
|
32132
32207
|
const noticeId = props.id ?? `beamSnackbar:${snackbarId++}`;
|
|
32133
32208
|
let maybeTimeout;
|
|
@@ -32156,7 +32231,7 @@ function useSnackbar() {
|
|
|
32156
32231
|
},
|
|
32157
32232
|
[onClose, setNotices]
|
|
32158
32233
|
);
|
|
32159
|
-
const closeNotice =
|
|
32234
|
+
const closeNotice = useCallback45((id) => onClose(id), [onClose]);
|
|
32160
32235
|
const useSnackbarOffset = ({ bottom }) => useEffect40(() => {
|
|
32161
32236
|
setOffset({ bottom });
|
|
32162
32237
|
return () => setOffset({});
|
|
@@ -32206,7 +32281,7 @@ function simpleDataRows(data = []) {
|
|
|
32206
32281
|
|
|
32207
32282
|
// src/components/Tabs.tsx
|
|
32208
32283
|
import { camelCase as camelCase8 } from "change-case";
|
|
32209
|
-
import { useEffect as useEffect41, useMemo as useMemo61, useRef as
|
|
32284
|
+
import { useEffect as useEffect41, useMemo as useMemo61, useRef as useRef77, useState as useState67 } from "react";
|
|
32210
32285
|
import { mergeProps as mergeProps42, useFocusRing as useFocusRing22, useHover as useHover27 } from "react-aria";
|
|
32211
32286
|
import { matchPath } from "react-router";
|
|
32212
32287
|
import { Link as Link7, useLocation as useLocation2 } from "react-router-dom";
|
|
@@ -32286,8 +32361,8 @@ function Tabs(props) {
|
|
|
32286
32361
|
focusProps
|
|
32287
32362
|
} = useFocusRing22();
|
|
32288
32363
|
const tid = useTestIds(others, "tabs");
|
|
32289
|
-
const [active, setActive] =
|
|
32290
|
-
const ref =
|
|
32364
|
+
const [active, setActive] = useState67(selected);
|
|
32365
|
+
const ref = useRef77(null);
|
|
32291
32366
|
useEffect41(() => setActive(selected), [selected]);
|
|
32292
32367
|
function onKeyUp(e) {
|
|
32293
32368
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
@@ -32523,10 +32598,10 @@ function hideTabs(props) {
|
|
|
32523
32598
|
}
|
|
32524
32599
|
|
|
32525
32600
|
// src/components/Toast/useToast.tsx
|
|
32526
|
-
import { useCallback as
|
|
32601
|
+
import { useCallback as useCallback46 } from "react";
|
|
32527
32602
|
function useToast() {
|
|
32528
32603
|
const { setNotice, clear } = useToastContext();
|
|
32529
|
-
const showToast =
|
|
32604
|
+
const showToast = useCallback46((props) => setNotice(props), [setNotice]);
|
|
32530
32605
|
return { showToast, clear };
|
|
32531
32606
|
}
|
|
32532
32607
|
|
|
@@ -32799,7 +32874,7 @@ import { useCheckboxGroupState as useCheckboxGroupState4, useRadioGroupState as
|
|
|
32799
32874
|
import { trussProps as trussProps150, maybeCssVar as maybeCssVar70 } from "@homebound/truss/runtime";
|
|
32800
32875
|
|
|
32801
32876
|
// src/forms/FormSection/FormSectionChild.tsx
|
|
32802
|
-
import { useRef as
|
|
32877
|
+
import { useRef as useRef78 } from "react";
|
|
32803
32878
|
import { mergeProps as mergeProps46, useCheckboxGroupItem as useCheckboxGroupItem4, useFocusRing as useFocusRing23, useRadio as useRadio3, VisuallyHidden as VisuallyHidden11 } from "react-aria";
|
|
32804
32879
|
import { trussProps as trussProps149 } from "@homebound/truss/runtime";
|
|
32805
32880
|
import { Fragment as Fragment56, jsx as jsx259, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
@@ -32816,7 +32891,7 @@ function FormSectionChild(props) {
|
|
|
32816
32891
|
group
|
|
32817
32892
|
} = props;
|
|
32818
32893
|
const tid = useTestIds(props, "formSectionChild");
|
|
32819
|
-
const itemRef =
|
|
32894
|
+
const itemRef = useRef78(null);
|
|
32820
32895
|
const isDraggable = !!orderField;
|
|
32821
32896
|
const {
|
|
32822
32897
|
dragItemProps,
|
|
@@ -32858,7 +32933,7 @@ function FormSectionChildRadio(props) {
|
|
|
32858
32933
|
value,
|
|
32859
32934
|
label
|
|
32860
32935
|
} = props;
|
|
32861
|
-
const ref =
|
|
32936
|
+
const ref = useRef78(null);
|
|
32862
32937
|
const {
|
|
32863
32938
|
inputProps,
|
|
32864
32939
|
isDisabled,
|
|
@@ -32884,7 +32959,7 @@ function FormSectionChildCheckbox(props) {
|
|
|
32884
32959
|
value,
|
|
32885
32960
|
label
|
|
32886
32961
|
} = props;
|
|
32887
|
-
const ref =
|
|
32962
|
+
const ref = useRef78(null);
|
|
32888
32963
|
const {
|
|
32889
32964
|
inputProps,
|
|
32890
32965
|
isDisabled,
|
|
@@ -33077,12 +33152,12 @@ var railAndShellPx = centeredShellMaxPx.sm + jumpLinksRailWidthPx;
|
|
|
33077
33152
|
var jumpLinksRailReservation = `clamp(0px, 100% - ${railAndShellPx}px, ${jumpLinksRailWidthPx}px)`;
|
|
33078
33153
|
|
|
33079
33154
|
// src/layouts/FormSectionLayout/useActiveJumpLink.ts
|
|
33080
|
-
import { useLayoutEffect as
|
|
33155
|
+
import { useLayoutEffect as useLayoutEffect18, useState as useState68 } from "react";
|
|
33081
33156
|
var activationLeadPx = 120;
|
|
33082
33157
|
function useActiveJumpLink(sectionIds) {
|
|
33083
33158
|
const idsKey = sectionIds.join("\0");
|
|
33084
|
-
const [activeId, setActiveId] =
|
|
33085
|
-
|
|
33159
|
+
const [activeId, setActiveId] = useState68(sectionIds[0]);
|
|
33160
|
+
useLayoutEffect18(() => {
|
|
33086
33161
|
const ids = idsKey.length === 0 ? [] : idsKey.split("\0");
|
|
33087
33162
|
if (ids.length === 0) return;
|
|
33088
33163
|
const update = () => {
|
|
@@ -33184,7 +33259,7 @@ function FormSectionLayout(props) {
|
|
|
33184
33259
|
}
|
|
33185
33260
|
|
|
33186
33261
|
// src/layouts/PageBanner/usePageBanner.tsx
|
|
33187
|
-
import { useEffect as useEffect42, useId as useId5, useLayoutEffect as
|
|
33262
|
+
import { useEffect as useEffect42, useId as useId5, useLayoutEffect as useLayoutEffect19 } from "react";
|
|
33188
33263
|
|
|
33189
33264
|
// src/layouts/PageBanner/pageBannerStore.ts
|
|
33190
33265
|
var current;
|
|
@@ -33222,7 +33297,7 @@ function clearPageBanner(id) {
|
|
|
33222
33297
|
// src/layouts/PageBanner/usePageBanner.tsx
|
|
33223
33298
|
function usePageBanner(banner) {
|
|
33224
33299
|
const id = useId5();
|
|
33225
|
-
|
|
33300
|
+
useLayoutEffect19(() => {
|
|
33226
33301
|
if (!banner) return;
|
|
33227
33302
|
setPageBanner(id, banner);
|
|
33228
33303
|
return () => clearPageBanner(id);
|
|
@@ -33238,11 +33313,11 @@ function PageBanner(props) {
|
|
|
33238
33313
|
}
|
|
33239
33314
|
|
|
33240
33315
|
// src/layouts/NavbarLayout/NavbarLayout.tsx
|
|
33241
|
-
import { useMemo as useMemo62, useRef as
|
|
33316
|
+
import { useMemo as useMemo62, useRef as useRef80 } from "react";
|
|
33242
33317
|
import { mergeProps as mergeProps47, maybeCssVar as maybeCssVar73 } from "@homebound/truss/runtime";
|
|
33243
33318
|
|
|
33244
33319
|
// src/layouts/useAutoHideOnScroll.ts
|
|
33245
|
-
import { useLayoutEffect as
|
|
33320
|
+
import { useLayoutEffect as useLayoutEffect20, useRef as useRef79, useState as useState69 } from "react";
|
|
33246
33321
|
var THRESHOLD = 80;
|
|
33247
33322
|
function getInitialAutoHideState() {
|
|
33248
33323
|
if (typeof window === "undefined" || window.scrollY <= 0) {
|
|
@@ -33252,13 +33327,13 @@ function getInitialAutoHideState() {
|
|
|
33252
33327
|
}
|
|
33253
33328
|
function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
33254
33329
|
const initial = getInitialAutoHideState();
|
|
33255
|
-
const [state, setState] =
|
|
33256
|
-
const stateRef =
|
|
33257
|
-
const getTopOffsetRef =
|
|
33330
|
+
const [state, setState] = useState69(initial);
|
|
33331
|
+
const stateRef = useRef79(initial);
|
|
33332
|
+
const getTopOffsetRef = useRef79(getTopOffset);
|
|
33258
33333
|
getTopOffsetRef.current = getTopOffset;
|
|
33259
|
-
const lastScrollY =
|
|
33260
|
-
const lastScrollHeight =
|
|
33261
|
-
|
|
33334
|
+
const lastScrollY = useRef79(Number.POSITIVE_INFINITY);
|
|
33335
|
+
const lastScrollHeight = useRef79(0);
|
|
33336
|
+
useLayoutEffect20(() => {
|
|
33262
33337
|
if (!enabled) {
|
|
33263
33338
|
stateRef.current = "resting";
|
|
33264
33339
|
lastScrollY.current = Number.POSITIVE_INFINITY;
|
|
@@ -33323,26 +33398,26 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
33323
33398
|
}
|
|
33324
33399
|
|
|
33325
33400
|
// src/layouts/useMeasuredHeight.ts
|
|
33326
|
-
import { useResizeObserver as
|
|
33327
|
-
import { useCallback as
|
|
33401
|
+
import { useResizeObserver as useResizeObserver15 } from "@react-aria/utils";
|
|
33402
|
+
import { useCallback as useCallback47, useLayoutEffect as useLayoutEffect21, useState as useState70 } from "react";
|
|
33328
33403
|
function useMeasuredHeight(ref, enabled) {
|
|
33329
|
-
const [height, setHeight] =
|
|
33330
|
-
const syncElementHeight =
|
|
33404
|
+
const [height, setHeight] = useState70(0);
|
|
33405
|
+
const syncElementHeight = useCallback47(() => {
|
|
33331
33406
|
const el = ref.current;
|
|
33332
33407
|
const next = el ? Math.round(el.getBoundingClientRect().height) : 0;
|
|
33333
33408
|
setHeight((prev) => prev === next ? prev : next);
|
|
33334
33409
|
}, [ref]);
|
|
33335
|
-
|
|
33336
|
-
|
|
33410
|
+
useResizeObserver15({ ref, onResize: syncElementHeight });
|
|
33411
|
+
useLayoutEffect21(() => {
|
|
33337
33412
|
syncElementHeight();
|
|
33338
33413
|
}, [enabled, syncElementHeight]);
|
|
33339
33414
|
return height;
|
|
33340
33415
|
}
|
|
33341
33416
|
|
|
33342
33417
|
// src/layouts/useTransitionAfterPaint.ts
|
|
33343
|
-
import { useLayoutEffect as
|
|
33418
|
+
import { useLayoutEffect as useLayoutEffect22 } from "react";
|
|
33344
33419
|
function useTransitionAfterPaint(ref, transition) {
|
|
33345
|
-
|
|
33420
|
+
useLayoutEffect22(() => {
|
|
33346
33421
|
const el = ref.current;
|
|
33347
33422
|
if (!el) return;
|
|
33348
33423
|
const id = requestAnimationFrame(() => {
|
|
@@ -33374,8 +33449,8 @@ function NavbarLayout(props) {
|
|
|
33374
33449
|
children
|
|
33375
33450
|
} = props;
|
|
33376
33451
|
const tid = useTestIds(props, "navbarLayout");
|
|
33377
|
-
const navMetricsRef =
|
|
33378
|
-
const spacerRef =
|
|
33452
|
+
const navMetricsRef = useRef80(null);
|
|
33453
|
+
const spacerRef = useRef80(null);
|
|
33379
33454
|
const navHeight = useMeasuredHeight(navMetricsRef, true);
|
|
33380
33455
|
const {
|
|
33381
33456
|
state: autoHideState
|
|
@@ -33419,14 +33494,14 @@ function NavbarLayout(props) {
|
|
|
33419
33494
|
}
|
|
33420
33495
|
|
|
33421
33496
|
// src/layouts/PageHeaderLayout/PageHeaderLayout.tsx
|
|
33422
|
-
import { useCallback as
|
|
33497
|
+
import { useCallback as useCallback49, useMemo as useMemo63, useRef as useRef82 } from "react";
|
|
33423
33498
|
|
|
33424
33499
|
// src/hooks/useDocumentTitle.tsx
|
|
33425
|
-
import { useLayoutEffect as
|
|
33500
|
+
import { useLayoutEffect as useLayoutEffect23 } from "react";
|
|
33426
33501
|
function useDocumentTitle(...titleSegments) {
|
|
33427
33502
|
const config = useDocumentTitleConfig();
|
|
33428
33503
|
const pageTitle = joinDocumentTitleSegments(...titleSegments);
|
|
33429
|
-
|
|
33504
|
+
useLayoutEffect23(() => {
|
|
33430
33505
|
if (!config || !pageTitle || typeof document === "undefined") {
|
|
33431
33506
|
return;
|
|
33432
33507
|
}
|
|
@@ -33532,7 +33607,7 @@ function PageHeader2(props) {
|
|
|
33532
33607
|
}
|
|
33533
33608
|
|
|
33534
33609
|
// src/layouts/PageBanner/internal/usePageBannerSlot.tsx
|
|
33535
|
-
import { useCallback as
|
|
33610
|
+
import { useCallback as useCallback48, useLayoutEffect as useLayoutEffect24, useRef as useRef81, useState as useState71 } from "react";
|
|
33536
33611
|
|
|
33537
33612
|
// src/layouts/PageBanner/internal/PageBannerSlot.tsx
|
|
33538
33613
|
import { trussProps as trussProps155, maybeCssVar as maybeCssVar74 } from "@homebound/truss/runtime";
|
|
@@ -33570,18 +33645,18 @@ import { jsx as jsx268 } from "react/jsx-runtime";
|
|
|
33570
33645
|
function usePageBannerSlot(bannerProp, testIds) {
|
|
33571
33646
|
const publishedBanner = usePublishedPageBanner();
|
|
33572
33647
|
const banner = publishedBanner ?? bannerProp;
|
|
33573
|
-
const metricsRef =
|
|
33648
|
+
const metricsRef = useRef81(null);
|
|
33574
33649
|
const height = useMeasuredHeight(metricsRef, banner != null);
|
|
33575
33650
|
const slot = banner ? /* @__PURE__ */ jsx268(PageBannerSlot, { ...testIds, banner, metricsRef }) : null;
|
|
33576
33651
|
return { slot, height };
|
|
33577
33652
|
}
|
|
33578
33653
|
function usePublishedPageBanner() {
|
|
33579
|
-
const [banner, setBanner] =
|
|
33580
|
-
const sync =
|
|
33654
|
+
const [banner, setBanner] = useState71(pageBannerStore.getSnapshot);
|
|
33655
|
+
const sync = useCallback48(() => {
|
|
33581
33656
|
const next = pageBannerStore.getSnapshot();
|
|
33582
33657
|
setBanner((prev) => prev === next ? prev : next);
|
|
33583
33658
|
}, []);
|
|
33584
|
-
|
|
33659
|
+
useLayoutEffect24(() => {
|
|
33585
33660
|
sync();
|
|
33586
33661
|
return pageBannerStore.subscribe(sync);
|
|
33587
33662
|
}, [sync]);
|
|
@@ -33611,11 +33686,11 @@ function PageHeaderLayout(props) {
|
|
|
33611
33686
|
height: bannerHeight
|
|
33612
33687
|
} = usePageBannerSlot(bannerProp, tid);
|
|
33613
33688
|
const bannerAndNavbarHeight = useBannerAndNavbarHeight();
|
|
33614
|
-
const bannerAndNavbarHeightRef =
|
|
33689
|
+
const bannerAndNavbarHeightRef = useRef82(bannerAndNavbarHeight);
|
|
33615
33690
|
bannerAndNavbarHeightRef.current = bannerAndNavbarHeight;
|
|
33616
|
-
const getBannerAndNavbarHeight =
|
|
33617
|
-
const headerMetricsRef =
|
|
33618
|
-
const spacerRef =
|
|
33691
|
+
const getBannerAndNavbarHeight = useCallback49(() => bannerAndNavbarHeightRef.current, []);
|
|
33692
|
+
const headerMetricsRef = useRef82(null);
|
|
33693
|
+
const spacerRef = useRef82(null);
|
|
33619
33694
|
const headerHeight = useMeasuredHeight(headerMetricsRef, true);
|
|
33620
33695
|
const {
|
|
33621
33696
|
state: autoHideState
|
|
@@ -33666,7 +33741,7 @@ function PageHeaderLayout(props) {
|
|
|
33666
33741
|
}
|
|
33667
33742
|
|
|
33668
33743
|
// src/layouts/Workflow/WorkflowPageLayout.tsx
|
|
33669
|
-
import { useLayoutEffect as
|
|
33744
|
+
import { useLayoutEffect as useLayoutEffect25, useRef as useRef84 } from "react";
|
|
33670
33745
|
|
|
33671
33746
|
// src/components/Headers/WorkflowHeader.tsx
|
|
33672
33747
|
import { jsx as jsx270 } from "react/jsx-runtime";
|
|
@@ -33683,7 +33758,7 @@ function WorkflowHeader(props) {
|
|
|
33683
33758
|
}
|
|
33684
33759
|
|
|
33685
33760
|
// src/layouts/Workflow/RightPaneTriggers.tsx
|
|
33686
|
-
import { useCallback as
|
|
33761
|
+
import { useCallback as useCallback50 } from "react";
|
|
33687
33762
|
import { trussProps as trussProps156, maybeCssVar as maybeCssVar76 } from "@homebound/truss/runtime";
|
|
33688
33763
|
import { jsx as jsx271 } from "react/jsx-runtime";
|
|
33689
33764
|
var __maybeInc36 = (inc) => {
|
|
@@ -33704,7 +33779,7 @@ function WorkflowPageRightPaneTriggers(props) {
|
|
|
33704
33779
|
} = useRightPaneActions();
|
|
33705
33780
|
const tid = useTestIds(props, "rightPaneTriggers");
|
|
33706
33781
|
const pageTriggerInsetPx = 24;
|
|
33707
|
-
const onClick =
|
|
33782
|
+
const onClick = useCallback50((trigger) => {
|
|
33708
33783
|
openRightPane({
|
|
33709
33784
|
content: /* @__PURE__ */ jsx271(RightPanePanel, { title: trigger.label, children: trigger.content })
|
|
33710
33785
|
});
|
|
@@ -33747,17 +33822,17 @@ function WorkflowPageRightPaneTriggers(props) {
|
|
|
33747
33822
|
}
|
|
33748
33823
|
|
|
33749
33824
|
// src/layouts/Workflow/useUnsavedChangesGuard.tsx
|
|
33750
|
-
import { useEffect as useEffect43, useRef as
|
|
33825
|
+
import { useEffect as useEffect43, useRef as useRef83 } from "react";
|
|
33751
33826
|
import { useBlocker } from "react-router-dom";
|
|
33752
33827
|
import { jsx as jsx272 } from "react/jsx-runtime";
|
|
33753
33828
|
function useUnsavedChangesGuard(options) {
|
|
33754
33829
|
const { isDirty, allowNavigation, onCancel, destructiveAction } = options;
|
|
33755
33830
|
const { openModal } = useModal();
|
|
33756
|
-
const isDirtyRef =
|
|
33831
|
+
const isDirtyRef = useRef83(isDirty);
|
|
33757
33832
|
isDirtyRef.current = isDirty;
|
|
33758
|
-
const allowNavigationRef =
|
|
33833
|
+
const allowNavigationRef = useRef83(allowNavigation);
|
|
33759
33834
|
allowNavigationRef.current = allowNavigation;
|
|
33760
|
-
const allowCancelNavigationRef =
|
|
33835
|
+
const allowCancelNavigationRef = useRef83(false);
|
|
33761
33836
|
useEffect43(() => {
|
|
33762
33837
|
const onBeforeUnload = (e) => {
|
|
33763
33838
|
if (isDirtyRef.current?.()) {
|
|
@@ -33915,7 +33990,7 @@ function WorkflowPageLayout(props) {
|
|
|
33915
33990
|
} });
|
|
33916
33991
|
const triggers = rightPaneTriggers ?? [];
|
|
33917
33992
|
const pageTriggers = triggers.length > 0 ? /* @__PURE__ */ jsx274(WorkflowPageRightPaneTriggers, { triggers }) : void 0;
|
|
33918
|
-
const headerMetricsRef =
|
|
33993
|
+
const headerMetricsRef = useRef84(null);
|
|
33919
33994
|
const headerHeight = useMeasuredHeight(headerMetricsRef, true);
|
|
33920
33995
|
const headerWidth = documentScrollChromeWidth();
|
|
33921
33996
|
const outerTop = belowNavbarOffset();
|
|
@@ -33928,7 +34003,7 @@ function WorkflowPageLayout(props) {
|
|
|
33928
34003
|
}
|
|
33929
34004
|
const style = Object.keys(cssVars).length > 0 ? cssVars : void 0;
|
|
33930
34005
|
const showFooter = isMobile;
|
|
33931
|
-
|
|
34006
|
+
useLayoutEffect25(() => {
|
|
33932
34007
|
const root = document.documentElement;
|
|
33933
34008
|
const previous = root.style.getPropertyValue(beamWorkflowLayoutFooterHeightVar);
|
|
33934
34009
|
root.style.setProperty(beamWorkflowLayoutFooterHeightVar, showFooter ? `${mobileFooterHeightPx}px` : "0px");
|
|
@@ -33941,8 +34016,8 @@ function WorkflowPageLayout(props) {
|
|
|
33941
34016
|
};
|
|
33942
34017
|
}, [showFooter]);
|
|
33943
34018
|
const currentStep = stepperTabs?.currentStep;
|
|
33944
|
-
const prevStepRef =
|
|
33945
|
-
|
|
34019
|
+
const prevStepRef = useRef84(currentStep);
|
|
34020
|
+
useLayoutEffect25(() => {
|
|
33946
34021
|
if (prevStepRef.current === currentStep) return;
|
|
33947
34022
|
prevStepRef.current = currentStep;
|
|
33948
34023
|
window.scrollTo({
|
|
@@ -34073,7 +34148,7 @@ function FocusedFormLayout(props) {
|
|
|
34073
34148
|
}
|
|
34074
34149
|
|
|
34075
34150
|
// src/layouts/Workflow/StepperLayout.tsx
|
|
34076
|
-
import { useState as
|
|
34151
|
+
import { useState as useState72 } from "react";
|
|
34077
34152
|
import { jsx as jsx276 } from "react/jsx-runtime";
|
|
34078
34153
|
function StepperLayout(props) {
|
|
34079
34154
|
const {
|
|
@@ -34091,7 +34166,7 @@ function StepperLayout(props) {
|
|
|
34091
34166
|
...headerProps
|
|
34092
34167
|
} = props;
|
|
34093
34168
|
const stepTabs = steps.map((step) => ({ ...step, value: defaultTestId(step.label) }));
|
|
34094
|
-
const [currentStep, setCurrentStep] =
|
|
34169
|
+
const [currentStep, setCurrentStep] = useState72(() => getInitialStep(stepTabs, defaultStep));
|
|
34095
34170
|
const tid = useTestIds(props, "stepperLayout");
|
|
34096
34171
|
const currentIndex = hasStep(stepTabs, currentStep) ? stepTabs.findIndex((step) => step.value === currentStep) : 0;
|
|
34097
34172
|
const isFirstStep = currentIndex <= 0;
|
|
@@ -34294,9 +34369,9 @@ function StaticField(props) {
|
|
|
34294
34369
|
}
|
|
34295
34370
|
|
|
34296
34371
|
// src/hooks/useFilter.ts
|
|
34297
|
-
import { useState as
|
|
34372
|
+
import { useState as useState73 } from "react";
|
|
34298
34373
|
function useFilter5({ filterDefs }) {
|
|
34299
|
-
const [filter, setFilter] =
|
|
34374
|
+
const [filter, setFilter] = useState73(
|
|
34300
34375
|
Object.fromEntries(
|
|
34301
34376
|
safeEntries(filterDefs).filter(([key, def]) => def(key).defaultValue !== void 0).map(([key, def]) => [key, def(key).defaultValue])
|
|
34302
34377
|
)
|
|
@@ -34305,7 +34380,7 @@ function useFilter5({ filterDefs }) {
|
|
|
34305
34380
|
}
|
|
34306
34381
|
|
|
34307
34382
|
// src/inputs/Autocomplete.tsx
|
|
34308
|
-
import { useCallback as
|
|
34383
|
+
import { useCallback as useCallback51, useRef as useRef85 } from "react";
|
|
34309
34384
|
import { useComboBox as useComboBox3, useOverlayPosition as useOverlayPosition7 } from "react-aria";
|
|
34310
34385
|
import { Item as Item6, useComboBoxState as useComboBoxState3 } from "react-stately";
|
|
34311
34386
|
import { Fragment as Fragment58, jsx as jsx281, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
@@ -34325,7 +34400,7 @@ function Autocomplete(props) {
|
|
|
34325
34400
|
} = props;
|
|
34326
34401
|
const { effectiveValue, proposalProps } = useAiProposal(value, proposedValue);
|
|
34327
34402
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
34328
|
-
const comboBoxChildren =
|
|
34403
|
+
const comboBoxChildren = useCallback51(
|
|
34329
34404
|
(item) => /* @__PURE__ */ jsx281(Item6, { textValue: getOptionLabel(item), children: getOptionMenuLabel ? getOptionMenuLabel(item) : getOptionLabel(item) }, getOptionValue(item)),
|
|
34330
34405
|
[getOptionValue, getOptionLabel, getOptionMenuLabel]
|
|
34331
34406
|
);
|
|
@@ -34350,10 +34425,10 @@ function Autocomplete(props) {
|
|
|
34350
34425
|
...others
|
|
34351
34426
|
};
|
|
34352
34427
|
const state = useComboBoxState3(comboBoxProps);
|
|
34353
|
-
const inputWrapRef =
|
|
34354
|
-
const inputRef =
|
|
34355
|
-
const listBoxRef =
|
|
34356
|
-
const popoverRef =
|
|
34428
|
+
const inputWrapRef = useRef85(null);
|
|
34429
|
+
const inputRef = useRef85(null);
|
|
34430
|
+
const listBoxRef = useRef85(null);
|
|
34431
|
+
const popoverRef = useRef85(null);
|
|
34357
34432
|
const { inputProps, listBoxProps, labelProps } = useComboBox3(
|
|
34358
34433
|
{
|
|
34359
34434
|
...comboBoxProps,
|
|
@@ -34421,7 +34496,7 @@ function Autocomplete(props) {
|
|
|
34421
34496
|
}
|
|
34422
34497
|
|
|
34423
34498
|
// src/inputs/ToggleButton.tsx
|
|
34424
|
-
import { useRef as
|
|
34499
|
+
import { useRef as useRef86, useState as useState74 } from "react";
|
|
34425
34500
|
import { useFocusRing as useFocusRing24, useHover as useHover28, usePress as usePress3, useSwitch as useSwitch2, VisuallyHidden as VisuallyHidden12 } from "react-aria";
|
|
34426
34501
|
import { useToggleState as useToggleState2 } from "react-stately";
|
|
34427
34502
|
import { trussProps as trussProps160 } from "@homebound/truss/runtime";
|
|
@@ -34436,7 +34511,7 @@ function ToggleButton(props) {
|
|
|
34436
34511
|
__storyState,
|
|
34437
34512
|
...otherProps
|
|
34438
34513
|
} = props;
|
|
34439
|
-
const [asyncInProgress, setAsyncInProgress] =
|
|
34514
|
+
const [asyncInProgress, setAsyncInProgress] = useState74(false);
|
|
34440
34515
|
const isDisabled = !!disabled || asyncInProgress;
|
|
34441
34516
|
const ariaProps = {
|
|
34442
34517
|
"aria-label": label,
|
|
@@ -34455,8 +34530,8 @@ function ToggleButton(props) {
|
|
|
34455
34530
|
return result;
|
|
34456
34531
|
}
|
|
34457
34532
|
});
|
|
34458
|
-
const labelRef =
|
|
34459
|
-
const ref =
|
|
34533
|
+
const labelRef = useRef86(null);
|
|
34534
|
+
const ref = useRef86(null);
|
|
34460
34535
|
const tid = useTestIds(otherProps, label);
|
|
34461
34536
|
const {
|
|
34462
34537
|
isPressed: isPressedFromEvents,
|