@homebound/beam 3.18.0 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +359 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +461 -234
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5779,9 +5779,19 @@ var beamPageHeaderLayoutHeightVar = "--beam-page-header-layout-height";
|
|
|
5779
5779
|
var beamLayoutViewportWidthVar = "--beam-layout-viewport-width";
|
|
5780
5780
|
var beamLayoutViewportHeightVar = "--beam-layout-viewport-height";
|
|
5781
5781
|
var beamSideNavLayoutWidthVar = "--beam-side-nav-layout-width";
|
|
5782
|
+
var beamTableActionsHeightVar = "--beam-table-actions-height";
|
|
5783
|
+
function documentScrollChromeLeft() {
|
|
5784
|
+
return `var(${beamSideNavLayoutWidthVar}, 0px)`;
|
|
5785
|
+
}
|
|
5786
|
+
function documentScrollChromeWidth() {
|
|
5787
|
+
return `calc(var(${beamLayoutViewportWidthVar}, 100vw) - var(${beamSideNavLayoutWidthVar}, 0px))`;
|
|
5788
|
+
}
|
|
5782
5789
|
function stickyNavAndHeaderOffset(basePx = 0) {
|
|
5783
5790
|
return `calc(${basePx}px + var(${beamNavbarLayoutHeightVar}, 0px) + var(${beamPageHeaderLayoutHeightVar}, 0px))`;
|
|
5784
5791
|
}
|
|
5792
|
+
function stickyTableHeaderOffset(basePx = 0) {
|
|
5793
|
+
return `calc(${basePx}px + var(${beamNavbarLayoutHeightVar}, 0px) + var(${beamPageHeaderLayoutHeightVar}, 0px) + var(${beamTableActionsHeightVar}, 0px))`;
|
|
5794
|
+
}
|
|
5785
5795
|
|
|
5786
5796
|
// src/utils/zIndices.ts
|
|
5787
5797
|
var zIndices = {
|
|
@@ -5790,6 +5800,7 @@ var zIndices = {
|
|
|
5790
5800
|
tableExpandableTitle: 20,
|
|
5791
5801
|
tableStickyColumn: 30,
|
|
5792
5802
|
tableStickyHeader: 40,
|
|
5803
|
+
tableActions: 45,
|
|
5793
5804
|
// Page chrome - ensure these items sit above the table
|
|
5794
5805
|
scrollShadow: 50,
|
|
5795
5806
|
superDrawerScrim: 50,
|
|
@@ -5956,6 +5967,9 @@ function SortHeader(props) {
|
|
|
5956
5967
|
// src/components/Table/utils/utils.tsx
|
|
5957
5968
|
import { trussProps as trussProps11, maybeCssVar as maybeCssVar9 } from "@homebound/truss/runtime";
|
|
5958
5969
|
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5970
|
+
var __maybeInc4 = (inc) => {
|
|
5971
|
+
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
5972
|
+
};
|
|
5959
5973
|
function toContent(maybeContent, isHeader, canSortColumn, isClientSideSorting, style, as, alignment, column2, isExpandableHeader, isExpandable, minStickyLeftOffset, isKeptSelectedRow) {
|
|
5960
5974
|
if (isKeptSelectedRow && column2.id === "beamCollapseColumn") {
|
|
5961
5975
|
return /* @__PURE__ */ jsx14(Fragment4, {});
|
|
@@ -6150,12 +6164,21 @@ function recursivelyGetContainingRow(rowId, rowArray, parent) {
|
|
|
6150
6164
|
}
|
|
6151
6165
|
return void 0;
|
|
6152
6166
|
}
|
|
6153
|
-
function getTableRefWidthStyles(isVirtual) {
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6167
|
+
function getTableRefWidthStyles(isVirtual, inDocumentScrollLayout = false) {
|
|
6168
|
+
if (inDocumentScrollLayout) {
|
|
6169
|
+
return {
|
|
6170
|
+
width: ["w_var", {
|
|
6171
|
+
"--width": maybeCssVar9(__maybeInc4(documentScrollChromeWidth()))
|
|
6172
|
+
}]
|
|
6173
|
+
};
|
|
6174
|
+
}
|
|
6175
|
+
if (isVirtual) {
|
|
6176
|
+
return {
|
|
6157
6177
|
width: "w_calc_100_20px"
|
|
6158
|
-
}
|
|
6178
|
+
};
|
|
6179
|
+
}
|
|
6180
|
+
return {
|
|
6181
|
+
width: "w100"
|
|
6159
6182
|
};
|
|
6160
6183
|
}
|
|
6161
6184
|
|
|
@@ -6963,7 +6986,7 @@ function ColumnResizeHandle({
|
|
|
6963
6986
|
import { useContext as useContext9 } from "react";
|
|
6964
6987
|
import { trussProps as trussProps17, maybeCssVar as maybeCssVar11 } from "@homebound/truss/runtime";
|
|
6965
6988
|
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6966
|
-
var
|
|
6989
|
+
var __maybeInc5 = (inc) => {
|
|
6967
6990
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
6968
6991
|
};
|
|
6969
6992
|
function KeptGroupRow(props) {
|
|
@@ -6990,7 +7013,7 @@ function KeptGroupRow(props) {
|
|
|
6990
7013
|
...{
|
|
6991
7014
|
paddingLeft: "pl0",
|
|
6992
7015
|
width: ["w_var", {
|
|
6993
|
-
"--width": maybeCssVar11(
|
|
7016
|
+
"--width": maybeCssVar11(__maybeInc5(`calc(${columnSizes.join(" + ")})`))
|
|
6994
7017
|
}]
|
|
6995
7018
|
}
|
|
6996
7019
|
}), ...as === "table" ? {
|
|
@@ -7799,7 +7822,7 @@ function isZonedDateTime(value) {
|
|
|
7799
7822
|
import { useDebouncedCallback as useDebouncedCallback2 } from "use-debounce";
|
|
7800
7823
|
import { trussProps as trussProps18, mergeProps as mergeProps_12, maybeCssVar as maybeCssVar13 } from "@homebound/truss/runtime";
|
|
7801
7824
|
import { Fragment as Fragment8, jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7802
|
-
var
|
|
7825
|
+
var __maybeInc6 = (inc) => {
|
|
7803
7826
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
7804
7827
|
};
|
|
7805
7828
|
var __typography2 = {
|
|
@@ -8023,12 +8046,12 @@ function RowImpl(props) {
|
|
|
8023
8046
|
},
|
|
8024
8047
|
...maybeSticky === "left" ? {
|
|
8025
8048
|
left: ["left_var", {
|
|
8026
|
-
"--left": maybeCssVar13(
|
|
8049
|
+
"--left": maybeCssVar13(__maybeInc6(columnIndex === 0 ? `var(${beamSideNavLayoutWidthVar}, 0px)` : `calc(var(${beamSideNavLayoutWidthVar}, 0px) + (${columnSizes.slice(0, columnIndex).join(" + ")}))`))
|
|
8027
8050
|
}]
|
|
8028
8051
|
} : {},
|
|
8029
8052
|
...maybeSticky === "right" ? {
|
|
8030
8053
|
right: ["right_var", {
|
|
8031
|
-
"--right": maybeCssVar13(
|
|
8054
|
+
"--right": maybeCssVar13(__maybeInc6(columnIndex + 1 === columnSizes.length ? 0 : `calc(${columnSizes.slice(columnIndex + 1 - columnSizes.length).join(" + ")})`))
|
|
8032
8055
|
}]
|
|
8033
8056
|
} : {}
|
|
8034
8057
|
} : {};
|
|
@@ -8118,7 +8141,7 @@ function RowImpl(props) {
|
|
|
8118
8141
|
// If we have a 'levelIndent' defined, then subtract that amount from the first content column's width to ensure all columns will still line up properly.
|
|
8119
8142
|
...{
|
|
8120
8143
|
width: ["w_var", {
|
|
8121
|
-
"--width": maybeCssVar13(
|
|
8144
|
+
"--width": maybeCssVar13(__maybeInc6(`calc(${columnSizes.slice(columnIndex, columnIndex + currentColspan).join(" + ")}${applyFirstContentColumnStyles && levelIndent ? ` - ${levelIndent}px` : ""})`))
|
|
8122
8145
|
}]
|
|
8123
8146
|
}
|
|
8124
8147
|
};
|
|
@@ -8215,7 +8238,7 @@ function getFieldWidth(fullWidth) {
|
|
|
8215
8238
|
// src/inputs/TextFieldBase.tsx
|
|
8216
8239
|
import { trussProps as trussProps20, mergeProps as mergeProps_13, maybeCssVar as maybeCssVar14 } from "@homebound/truss/runtime";
|
|
8217
8240
|
import { Fragment as Fragment10, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
8218
|
-
var
|
|
8241
|
+
var __maybeInc7 = (inc) => {
|
|
8219
8242
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
8220
8243
|
};
|
|
8221
8244
|
var __typography3 = {
|
|
@@ -8389,7 +8412,7 @@ function TextFieldBase(props) {
|
|
|
8389
8412
|
} : {},
|
|
8390
8413
|
...labelStyle === "left" ? {
|
|
8391
8414
|
width: ["w_var", {
|
|
8392
|
-
"--width": maybeCssVar14(
|
|
8415
|
+
"--width": maybeCssVar14(__maybeInc7(labelLeftFieldWidth))
|
|
8393
8416
|
}]
|
|
8394
8417
|
} : {}
|
|
8395
8418
|
},
|
|
@@ -8465,7 +8488,7 @@ function TextFieldBase(props) {
|
|
|
8465
8488
|
} : {},
|
|
8466
8489
|
...labelStyle === "left" ? {
|
|
8467
8490
|
width: ["w_var", {
|
|
8468
|
-
"--width": maybeCssVar14(
|
|
8491
|
+
"--width": maybeCssVar14(__maybeInc7(labelLeftFieldWidth))
|
|
8469
8492
|
}]
|
|
8470
8493
|
} : {}
|
|
8471
8494
|
},
|
|
@@ -13580,7 +13603,7 @@ import { useRef as useRef32 } from "react";
|
|
|
13580
13603
|
import { useFocusRing as useFocusRing7, useHover as useHover13, useSwitch, VisuallyHidden as VisuallyHidden5 } from "react-aria";
|
|
13581
13604
|
import { trussProps as trussProps46, maybeCssVar as maybeCssVar27 } from "@homebound/truss/runtime";
|
|
13582
13605
|
import { jsx as jsx74, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
13583
|
-
var
|
|
13606
|
+
var __maybeInc8 = (inc) => {
|
|
13584
13607
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
13585
13608
|
};
|
|
13586
13609
|
function Switch(props) {
|
|
@@ -13674,7 +13697,7 @@ function Switch(props) {
|
|
|
13674
13697
|
/* @__PURE__ */ jsx74("div", { ...trussProps46({
|
|
13675
13698
|
...labelStyle === "left" ? {
|
|
13676
13699
|
width: ["w_var", {
|
|
13677
|
-
"--width": maybeCssVar27(
|
|
13700
|
+
"--width": maybeCssVar27(__maybeInc8(labelLeftFieldWidth))
|
|
13678
13701
|
}]
|
|
13679
13702
|
} : {}
|
|
13680
13703
|
}), children: /* @__PURE__ */ jsx74("div", { "aria-hidden": "true", ...trussProps46({
|
|
@@ -13755,7 +13778,7 @@ function switchCircleDefaultStyles(isCompact) {
|
|
|
13755
13778
|
function switchCircleSelectedStyles(isCompact) {
|
|
13756
13779
|
return {
|
|
13757
13780
|
left: ["left_var", {
|
|
13758
|
-
"--left": maybeCssVar27(
|
|
13781
|
+
"--left": maybeCssVar27(__maybeInc8(`calc(100% - ${circleDiameter(isCompact)}px - 2px)`))
|
|
13759
13782
|
}]
|
|
13760
13783
|
};
|
|
13761
13784
|
}
|
|
@@ -14008,7 +14031,7 @@ import { useCheckboxGroup as useCheckboxGroup2, useCheckboxGroupItem as useCheck
|
|
|
14008
14031
|
import { useCheckboxGroupState as useCheckboxGroupState2 } from "react-stately";
|
|
14009
14032
|
import { trussProps as trussProps48, maybeCssVar as maybeCssVar28 } from "@homebound/truss/runtime";
|
|
14010
14033
|
import { jsx as jsx78, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
14011
|
-
var
|
|
14034
|
+
var __maybeInc9 = (inc) => {
|
|
14012
14035
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
14013
14036
|
};
|
|
14014
14037
|
function ToggleChipGroup(props) {
|
|
@@ -14056,7 +14079,7 @@ function ToggleChipGroup(props) {
|
|
|
14056
14079
|
flexWrap: "flexWrap_wrap",
|
|
14057
14080
|
...labelStyle === "left" ? {
|
|
14058
14081
|
width: ["w_var", {
|
|
14059
|
-
"--width": maybeCssVar28(
|
|
14082
|
+
"--width": maybeCssVar28(__maybeInc9(labelLeftFieldWidth))
|
|
14060
14083
|
}]
|
|
14061
14084
|
} : {}
|
|
14062
14085
|
}), children: options.map((o) => /* @__PURE__ */ jsx78(ToggleChip2, { value: o.value, groupState: state, selected: state.value.includes(o.value), label: o.label, disabled: o.disabled, readonly: o.readonly, startAdornment: o.startAdornment, xss, ...tid[o.value] }, o.value)) })
|
|
@@ -14249,16 +14272,60 @@ function nonKindDefaults() {
|
|
|
14249
14272
|
function parseWidthToPx(widthStr, tableWidth) {
|
|
14250
14273
|
if (!widthStr) return null;
|
|
14251
14274
|
if (widthStr.endsWith("px")) {
|
|
14252
|
-
const parsed =
|
|
14275
|
+
const parsed = parseFloat(widthStr.replace("px", ""));
|
|
14253
14276
|
return isNaN(parsed) ? null : parsed;
|
|
14254
14277
|
}
|
|
14255
|
-
if (widthStr.endsWith("%") && tableWidth) {
|
|
14278
|
+
if (widthStr.endsWith("%") && tableWidth !== void 0) {
|
|
14256
14279
|
const percent = parseFloat(widthStr.replace("%", ""));
|
|
14257
14280
|
if (isNaN(percent)) return null;
|
|
14258
14281
|
return Math.round(percent / 100 * tableWidth);
|
|
14259
14282
|
}
|
|
14260
14283
|
return null;
|
|
14261
14284
|
}
|
|
14285
|
+
function sumColumnSizesPx(columnSizes, tableWidth) {
|
|
14286
|
+
if (tableWidth === void 0) return null;
|
|
14287
|
+
let sum = 0;
|
|
14288
|
+
for (const size of columnSizes) {
|
|
14289
|
+
const px2 = parseWidthToPx(size, tableWidth);
|
|
14290
|
+
if (px2 === null) return null;
|
|
14291
|
+
sum += px2;
|
|
14292
|
+
}
|
|
14293
|
+
return sum;
|
|
14294
|
+
}
|
|
14295
|
+
function sumColumnSizeParts(columnSizes) {
|
|
14296
|
+
let pxSum = 0;
|
|
14297
|
+
let percentSum = 0;
|
|
14298
|
+
let hasCalc = false;
|
|
14299
|
+
for (const size of columnSizes) {
|
|
14300
|
+
if (size.endsWith("px")) {
|
|
14301
|
+
pxSum += parseFloat(size.replace("px", ""));
|
|
14302
|
+
} else if (size.endsWith("%")) {
|
|
14303
|
+
percentSum += parseFloat(size.replace("%", ""));
|
|
14304
|
+
} else {
|
|
14305
|
+
hasCalc = true;
|
|
14306
|
+
}
|
|
14307
|
+
}
|
|
14308
|
+
return {
|
|
14309
|
+
pxSum,
|
|
14310
|
+
percentSum,
|
|
14311
|
+
hasCalc
|
|
14312
|
+
};
|
|
14313
|
+
}
|
|
14314
|
+
function resolveTableContentWidth(tableWidth, columnSizes, minWidthPx = 0) {
|
|
14315
|
+
if (tableWidth === void 0) return void 0;
|
|
14316
|
+
const {
|
|
14317
|
+
pxSum,
|
|
14318
|
+
percentSum,
|
|
14319
|
+
hasCalc
|
|
14320
|
+
} = sumColumnSizeParts(columnSizes);
|
|
14321
|
+
if (!hasCalc && percentSum > 0 && percentSum < 100) {
|
|
14322
|
+
const selfConsistent = pxSum / (1 - percentSum / 100);
|
|
14323
|
+
return Math.max(tableWidth, minWidthPx, Math.ceil(selfConsistent));
|
|
14324
|
+
}
|
|
14325
|
+
const sum = sumColumnSizesPx(columnSizes, tableWidth);
|
|
14326
|
+
if (sum === null) return void 0;
|
|
14327
|
+
return Math.max(tableWidth, sum, minWidthPx);
|
|
14328
|
+
}
|
|
14262
14329
|
function calcColumnSizes(columns, tableWidth, tableMinWidthPx = 0, expandedColumnIds, resizedWidths) {
|
|
14263
14330
|
const {
|
|
14264
14331
|
claimedPercentages,
|
|
@@ -14357,6 +14424,29 @@ function calcColumnSizes(columns, tableWidth, tableMinWidthPx = 0, expandedColum
|
|
|
14357
14424
|
});
|
|
14358
14425
|
return sizes2;
|
|
14359
14426
|
}
|
|
14427
|
+
function calcColumnLayout(columns, probeWidth, tableMinWidthPx = 0, expandedColumnIds, resizedWidths, inDocumentScrollLayout) {
|
|
14428
|
+
if (probeWidth === void 0) {
|
|
14429
|
+
return {
|
|
14430
|
+
columnSizes: calcColumnSizes(columns, void 0, tableMinWidthPx, expandedColumnIds, resizedWidths),
|
|
14431
|
+
contentWidth: void 0
|
|
14432
|
+
};
|
|
14433
|
+
}
|
|
14434
|
+
if (!inDocumentScrollLayout) {
|
|
14435
|
+
return {
|
|
14436
|
+
columnSizes: calcColumnSizes(columns, probeWidth, tableMinWidthPx, expandedColumnIds, resizedWidths),
|
|
14437
|
+
contentWidth: probeWidth
|
|
14438
|
+
};
|
|
14439
|
+
}
|
|
14440
|
+
let columnSizes = calcColumnSizes(columns, probeWidth, tableMinWidthPx, expandedColumnIds, resizedWidths);
|
|
14441
|
+
const contentWidth = resolveTableContentWidth(probeWidth, columnSizes, tableMinWidthPx) ?? probeWidth;
|
|
14442
|
+
if (contentWidth > probeWidth + 1) {
|
|
14443
|
+
columnSizes = calcColumnSizes(columns, contentWidth, tableMinWidthPx, expandedColumnIds, resizedWidths);
|
|
14444
|
+
}
|
|
14445
|
+
return {
|
|
14446
|
+
columnSizes,
|
|
14447
|
+
contentWidth
|
|
14448
|
+
};
|
|
14449
|
+
}
|
|
14360
14450
|
function assignDefaultColumnIds(columns) {
|
|
14361
14451
|
return columns.map((c, idx) => {
|
|
14362
14452
|
const {
|
|
@@ -15321,22 +15411,32 @@ function useColumnResizing(storageKey) {
|
|
|
15321
15411
|
|
|
15322
15412
|
// src/components/Table/hooks/useSetupColumnSizes.ts
|
|
15323
15413
|
import { useDebouncedCallback as useDebouncedCallback4 } from "use-debounce";
|
|
15324
|
-
function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visibleColumnsStorageKey, disableColumnResizing) {
|
|
15414
|
+
function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visibleColumnsStorageKey, disableColumnResizing, inDocumentScrollLayout) {
|
|
15325
15415
|
const { resizedWidths, setResizedWidth, setResizedWidths, resetColumnWidths } = useColumnResizing(
|
|
15326
15416
|
disableColumnResizing ? void 0 : visibleColumnsStorageKey
|
|
15327
15417
|
);
|
|
15328
15418
|
const calculateImmediately = useRef38(true);
|
|
15329
15419
|
const [tableWidth, setTableWidth] = useState29();
|
|
15330
|
-
const
|
|
15420
|
+
const [contentWidth, setContentWidth] = useState29();
|
|
15331
15421
|
const [columnSizes, setColumnSizes] = useState29(
|
|
15332
|
-
|
|
15422
|
+
() => calcColumnLayout(columns, void 0, style.minWidthPx, expandedColumnIds, resizedWidths, inDocumentScrollLayout).columnSizes
|
|
15333
15423
|
);
|
|
15334
|
-
const
|
|
15335
|
-
|
|
15336
|
-
|
|
15337
|
-
|
|
15424
|
+
const prevTableWidthRef = useRef38(tableWidth);
|
|
15425
|
+
const applyColumnLayout = useCallback15(
|
|
15426
|
+
(probeWidth) => {
|
|
15427
|
+
const layout = calcColumnLayout(
|
|
15428
|
+
columns,
|
|
15429
|
+
probeWidth,
|
|
15430
|
+
style.minWidthPx,
|
|
15431
|
+
expandedColumnIds,
|
|
15432
|
+
resizedWidths,
|
|
15433
|
+
inDocumentScrollLayout
|
|
15434
|
+
);
|
|
15435
|
+
setTableWidth(probeWidth);
|
|
15436
|
+
setContentWidth(layout.contentWidth);
|
|
15437
|
+
setColumnSizes(layout.columnSizes);
|
|
15338
15438
|
},
|
|
15339
|
-
[
|
|
15439
|
+
[columns, style.minWidthPx, expandedColumnIds, resizedWidths, inDocumentScrollLayout]
|
|
15340
15440
|
);
|
|
15341
15441
|
useEffect18(() => {
|
|
15342
15442
|
if (!prevTableWidthRef.current) {
|
|
@@ -15365,32 +15465,40 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
|
|
|
15365
15465
|
() => {
|
|
15366
15466
|
if (!calculateImmediately.current) {
|
|
15367
15467
|
const width2 = resizeRef.current?.clientWidth;
|
|
15368
|
-
width2 &&
|
|
15468
|
+
width2 && applyColumnLayout(width2);
|
|
15369
15469
|
}
|
|
15370
15470
|
},
|
|
15371
15471
|
// TODO: validate this eslint-disable. It was automatically ignored as part of https://app.shortcut.com/homebound-team/story/40033/enable-react-hooks-exhaustive-deps-for-react-projects
|
|
15372
15472
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15373
|
-
[columns, resizedWidths,
|
|
15473
|
+
[columns, resizedWidths, applyColumnLayout]
|
|
15374
15474
|
);
|
|
15375
|
-
const
|
|
15475
|
+
const applyColumnLayoutDebounced = useDebouncedCallback4(applyColumnLayout, 100);
|
|
15376
15476
|
const onResize = useCallback15(
|
|
15377
15477
|
() => {
|
|
15378
15478
|
const target = resizeRef.current;
|
|
15379
15479
|
if (target && target.clientWidth !== tableWidth) {
|
|
15380
15480
|
if (calculateImmediately.current) {
|
|
15381
15481
|
calculateImmediately.current = false;
|
|
15382
|
-
|
|
15482
|
+
applyColumnLayout(target.clientWidth);
|
|
15383
15483
|
} else {
|
|
15384
|
-
|
|
15484
|
+
applyColumnLayoutDebounced(target.clientWidth);
|
|
15385
15485
|
}
|
|
15386
15486
|
}
|
|
15387
15487
|
},
|
|
15388
15488
|
// TODO: validate this eslint-disable. It was automatically ignored as part of https://app.shortcut.com/homebound-team/story/40033/enable-react-hooks-exhaustive-deps-for-react-projects
|
|
15389
15489
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15390
|
-
[tableWidth,
|
|
15490
|
+
[tableWidth, applyColumnLayout, applyColumnLayoutDebounced]
|
|
15391
15491
|
);
|
|
15392
15492
|
useResizeObserver({ ref: resizeRef, onResize });
|
|
15393
|
-
return {
|
|
15493
|
+
return {
|
|
15494
|
+
columnSizes,
|
|
15495
|
+
tableWidth,
|
|
15496
|
+
contentWidth,
|
|
15497
|
+
resizedWidths,
|
|
15498
|
+
setResizedWidth,
|
|
15499
|
+
setResizedWidths,
|
|
15500
|
+
resetColumnWidths
|
|
15501
|
+
};
|
|
15394
15502
|
}
|
|
15395
15503
|
|
|
15396
15504
|
// src/hooks/useRenderCount.ts
|
|
@@ -15464,7 +15572,7 @@ function DocumentScrollLayoutViewportRoot({
|
|
|
15464
15572
|
// src/components/Table/GridTable.tsx
|
|
15465
15573
|
import { trussProps as trussProps49, mergeProps as mergeProps19, maybeCssVar as maybeCssVar29 } from "@homebound/truss/runtime";
|
|
15466
15574
|
import { jsx as jsx82, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
15467
|
-
var
|
|
15575
|
+
var __maybeInc10 = (inc) => {
|
|
15468
15576
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
15469
15577
|
};
|
|
15470
15578
|
var runningInJest = false;
|
|
@@ -15539,6 +15647,7 @@ function GridTable(props) {
|
|
|
15539
15647
|
const {
|
|
15540
15648
|
tableState
|
|
15541
15649
|
} = api;
|
|
15650
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
15542
15651
|
tableState.onRowSelect = onRowSelect;
|
|
15543
15652
|
useEffect19(() => {
|
|
15544
15653
|
runInAction(() => {
|
|
@@ -15561,11 +15670,12 @@ function GridTable(props) {
|
|
|
15561
15670
|
const {
|
|
15562
15671
|
columnSizes,
|
|
15563
15672
|
tableWidth,
|
|
15673
|
+
contentWidth,
|
|
15564
15674
|
resizedWidths,
|
|
15565
15675
|
setResizedWidth,
|
|
15566
15676
|
setResizedWidths,
|
|
15567
15677
|
resetColumnWidths
|
|
15568
|
-
} = useSetupColumnSizes(style, columns, resizeTarget ?? resizeRef, expandedColumnIds, visibleColumnsStorageKey, disableColumnResizing);
|
|
15678
|
+
} = useSetupColumnSizes(style, columns, resizeTarget ?? resizeRef, expandedColumnIds, visibleColumnsStorageKey, disableColumnResizing, inDocumentScrollLayout);
|
|
15569
15679
|
useEffect19(() => {
|
|
15570
15680
|
api.resetColumnWidthsFn = !disableColumnResizing ? resetColumnWidths : void 0;
|
|
15571
15681
|
}, [api, resetColumnWidths, disableColumnResizing]);
|
|
@@ -15736,9 +15846,18 @@ function GridTable(props) {
|
|
|
15736
15846
|
tableState,
|
|
15737
15847
|
tableContainerRef
|
|
15738
15848
|
}), [tableState, tableContainerRef]);
|
|
15849
|
+
const tableStyle = useMemo24(() => {
|
|
15850
|
+
if (!inDocumentScrollLayout || contentWidth === void 0 || tableWidth === void 0) return style;
|
|
15851
|
+
const minWidthPx = Math.max(style.minWidthPx ?? 0, contentWidth);
|
|
15852
|
+
if (minWidthPx === style.minWidthPx) return style;
|
|
15853
|
+
return {
|
|
15854
|
+
...style,
|
|
15855
|
+
minWidthPx
|
|
15856
|
+
};
|
|
15857
|
+
}, [contentWidth, inDocumentScrollLayout, style, tableWidth]);
|
|
15739
15858
|
return /* @__PURE__ */ jsx82(TableStateContext.Provider, { value: rowStateContext, children: /* @__PURE__ */ jsxs48(PresentationProvider, { fieldProps, wrap: style?.presentationSettings?.wrap, children: [
|
|
15740
|
-
/* @__PURE__ */ jsx82("div", { ref: resizeRef, ...trussProps49(getTableRefWidthStyles(as === "virtual")) }),
|
|
15741
|
-
renders[_as](
|
|
15859
|
+
/* @__PURE__ */ jsx82("div", { ref: resizeRef, ...trussProps49(getTableRefWidthStyles(as === "virtual", inDocumentScrollLayout)) }),
|
|
15860
|
+
renders[_as](tableStyle, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, stickyOffset, infiniteScroll, tableContainerRef, persistScrollPosition)
|
|
15742
15861
|
] }) });
|
|
15743
15862
|
}
|
|
15744
15863
|
var renders = {
|
|
@@ -15766,8 +15885,9 @@ function renderDiv(style, id, columns, visibleDataRows, keptSelectedRows, firstR
|
|
|
15766
15885
|
/* @__PURE__ */ jsx82("div", { ...trussProps49({
|
|
15767
15886
|
...stickyHeader ? {
|
|
15768
15887
|
position: "sticky",
|
|
15888
|
+
transition: "transitionTop",
|
|
15769
15889
|
top: ["top_var", {
|
|
15770
|
-
"--top": maybeCssVar29(
|
|
15890
|
+
"--top": maybeCssVar29(__maybeInc10(stickyTableHeaderOffset(stickyOffset)))
|
|
15771
15891
|
}],
|
|
15772
15892
|
zIndex: ["z_var", {
|
|
15773
15893
|
"--zIndex": maybeCssVar29(zIndices.tableStickyHeader)
|
|
@@ -15806,8 +15926,9 @@ function renderTable(style, id, columns, visibleDataRows, keptSelectedRows, firs
|
|
|
15806
15926
|
/* @__PURE__ */ jsx82("thead", { ...trussProps49({
|
|
15807
15927
|
...stickyHeader ? {
|
|
15808
15928
|
position: "sticky",
|
|
15929
|
+
transition: "transitionTop",
|
|
15809
15930
|
top: ["top_var", {
|
|
15810
|
-
"--top": maybeCssVar29(
|
|
15931
|
+
"--top": maybeCssVar29(__maybeInc10(stickyTableHeaderOffset(stickyOffset)))
|
|
15811
15932
|
}],
|
|
15812
15933
|
zIndex: ["z_var", {
|
|
15813
15934
|
"--zIndex": maybeCssVar29(zIndices.tableStickyHeader)
|
|
@@ -15858,11 +15979,16 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
15858
15979
|
components: {
|
|
15859
15980
|
// zIndex keeps the pinned head above sticky columns; `top` matches the offsets used by
|
|
15860
15981
|
// the div/table render paths so virtualized tables pin below the global nav + page header.
|
|
15861
|
-
TopItemList: React13.forwardRef((props, ref) => /* @__PURE__ */ jsx82("div", { ...props, ref,
|
|
15982
|
+
TopItemList: React13.forwardRef((props, ref) => /* @__PURE__ */ jsx82("div", { ...props, ref, ...mergeProps19(void 0, {
|
|
15862
15983
|
...props.style,
|
|
15984
|
+
...style.minWidthPx !== void 0 ? {
|
|
15985
|
+
minWidth: style.minWidthPx
|
|
15986
|
+
} : {},
|
|
15863
15987
|
zIndex: zIndices.tableStickyHeader,
|
|
15864
|
-
top:
|
|
15865
|
-
}
|
|
15988
|
+
top: stickyTableHeaderOffset(stickyOffset)
|
|
15989
|
+
}, {
|
|
15990
|
+
transition: "transitionTop"
|
|
15991
|
+
}) })),
|
|
15866
15992
|
List: VirtualRoot(style, columns, id, xss),
|
|
15867
15993
|
Footer: () => {
|
|
15868
15994
|
return /* @__PURE__ */ jsx82("div", { ...trussProps49({
|
|
@@ -15889,7 +16015,7 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
15889
16015
|
return (
|
|
15890
16016
|
// Ensure the fallback message is the same width as the table
|
|
15891
16017
|
/* @__PURE__ */ jsx82("div", { ...trussProps49({
|
|
15892
|
-
...getTableRefWidthStyles(true),
|
|
16018
|
+
...getTableRefWidthStyles(true, inDocumentScrollLayout),
|
|
15893
16019
|
...keptSelectedRows.length === 0 && style.firstBodyRowCss,
|
|
15894
16020
|
...visibleDataRows.length === 0 && style.lastRowCss
|
|
15895
16021
|
}), children: /* @__PURE__ */ jsx82("div", { ...trussProps49({
|
|
@@ -16048,7 +16174,7 @@ import { useCallback as useCallback18, useEffect as useEffect20, useMemo as useM
|
|
|
16048
16174
|
import { useFocusRing as useFocusRing10 } from "react-aria";
|
|
16049
16175
|
import { trussProps as trussProps52, maybeCssVar as maybeCssVar30 } from "@homebound/truss/runtime";
|
|
16050
16176
|
import { jsx as jsx85, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
16051
|
-
var
|
|
16177
|
+
var __maybeInc11 = (inc) => {
|
|
16052
16178
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
16053
16179
|
};
|
|
16054
16180
|
function Accordion(props) {
|
|
@@ -16195,7 +16321,7 @@ function Accordion(props) {
|
|
|
16195
16321
|
/* @__PURE__ */ jsx85("div", { ...tid.details, id, "aria-hidden": !expanded, ...trussProps52({
|
|
16196
16322
|
overflow: "oh",
|
|
16197
16323
|
height: ["h_var", {
|
|
16198
|
-
"--height": maybeCssVar30(
|
|
16324
|
+
"--height": maybeCssVar30(__maybeInc11(contentHeight))
|
|
16199
16325
|
}],
|
|
16200
16326
|
transition: "transition_height_250ms_ease_in_out"
|
|
16201
16327
|
}), children: expanded && /* @__PURE__ */ jsx85("div", { ...trussProps52({
|
|
@@ -16378,7 +16504,7 @@ var variantStyles2 = {
|
|
|
16378
16504
|
};
|
|
16379
16505
|
|
|
16380
16506
|
// src/components/BeamContext.tsx
|
|
16381
|
-
import { createContext as createContext9, useContext as useContext19, useMemo as useMemo40, useReducer, useRef as
|
|
16507
|
+
import { createContext as createContext9, useContext as useContext19, useMemo as useMemo40, useReducer, useRef as useRef49 } from "react";
|
|
16382
16508
|
import { OverlayProvider } from "react-aria";
|
|
16383
16509
|
|
|
16384
16510
|
// src/components/Modal/Modal.tsx
|
|
@@ -17779,7 +17905,7 @@ function BoundTreeSelectField(props) {
|
|
|
17779
17905
|
import { Children, cloneElement } from "react";
|
|
17780
17906
|
import { trussProps as trussProps59, maybeCssVar as maybeCssVar34 } from "@homebound/truss/runtime";
|
|
17781
17907
|
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
17782
|
-
var
|
|
17908
|
+
var __maybeInc12 = (inc) => {
|
|
17783
17909
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
17784
17910
|
};
|
|
17785
17911
|
function FormLines(props) {
|
|
@@ -17817,13 +17943,13 @@ function FormLines(props) {
|
|
|
17817
17943
|
display: "df",
|
|
17818
17944
|
flexDirection: "fdc",
|
|
17819
17945
|
gap: ["gap_var", {
|
|
17820
|
-
"--gap": maybeCssVar34(
|
|
17946
|
+
"--gap": maybeCssVar34(__maybeInc12(gap))
|
|
17821
17947
|
}],
|
|
17822
17948
|
paddingBottom: ["pb_var", {
|
|
17823
|
-
"--paddingBottom": maybeCssVar34(
|
|
17949
|
+
"--paddingBottom": maybeCssVar34(__maybeInc12(gap))
|
|
17824
17950
|
}],
|
|
17825
17951
|
width: ["w_var", {
|
|
17826
|
-
"--width": maybeCssVar34(
|
|
17952
|
+
"--width": maybeCssVar34(__maybeInc12(sizes[width2]))
|
|
17827
17953
|
}]
|
|
17828
17954
|
}), children: Children.map(children, (child) => {
|
|
17829
17955
|
if (child && typeof child === "object" && "type" in child && child.type.isFormHeading) {
|
|
@@ -18703,7 +18829,7 @@ function useActiveSection(sectionsWithRefs) {
|
|
|
18703
18829
|
// src/components/Layout/FullBleed.tsx
|
|
18704
18830
|
import { mergeProps as mergeProps22, maybeCssVar as maybeCssVar38 } from "@homebound/truss/runtime";
|
|
18705
18831
|
import { cloneElement as cloneElement3 } from "react";
|
|
18706
|
-
var
|
|
18832
|
+
var __maybeInc13 = (inc) => {
|
|
18707
18833
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
18708
18834
|
};
|
|
18709
18835
|
function FullBleed({
|
|
@@ -18734,17 +18860,17 @@ function FullBleed({
|
|
|
18734
18860
|
// inverts that padding with negative margins before re-applying it to the child.
|
|
18735
18861
|
{
|
|
18736
18862
|
marginLeft: ["ml_var", {
|
|
18737
|
-
"--marginLeft": maybeCssVar38(
|
|
18863
|
+
"--marginLeft": maybeCssVar38(__maybeInc13(invertSpacing(paddingLeft)))
|
|
18738
18864
|
}],
|
|
18739
18865
|
marginRight: ["mr_var", {
|
|
18740
|
-
"--marginRight": maybeCssVar38(
|
|
18866
|
+
"--marginRight": maybeCssVar38(__maybeInc13(invertSpacing(paddingRight)))
|
|
18741
18867
|
}],
|
|
18742
18868
|
...!omitPadding ? {
|
|
18743
18869
|
paddingLeft: ["pl_var", {
|
|
18744
|
-
"--paddingLeft": maybeCssVar38(
|
|
18870
|
+
"--paddingLeft": maybeCssVar38(__maybeInc13(paddingLeft))
|
|
18745
18871
|
}],
|
|
18746
18872
|
paddingRight: ["pr_var", {
|
|
18747
|
-
"--paddingRight": maybeCssVar38(
|
|
18873
|
+
"--paddingRight": maybeCssVar38(__maybeInc13(paddingRight))
|
|
18748
18874
|
}]
|
|
18749
18875
|
} : {}
|
|
18750
18876
|
}
|
|
@@ -18758,7 +18884,8 @@ function invertSpacing(value) {
|
|
|
18758
18884
|
}
|
|
18759
18885
|
|
|
18760
18886
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
18761
|
-
import
|
|
18887
|
+
import { useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
|
|
18888
|
+
import React17, { useCallback as useCallback25, useEffect as useEffect28, useLayoutEffect as useLayoutEffect4, useMemo as useMemo38, useRef as useRef48, useState as useState44 } from "react";
|
|
18762
18889
|
|
|
18763
18890
|
// src/components/ButtonMenu.tsx
|
|
18764
18891
|
import { useRef as useRef46 } from "react";
|
|
@@ -19786,8 +19913,11 @@ function LoadingTable(props) {
|
|
|
19786
19913
|
}
|
|
19787
19914
|
|
|
19788
19915
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
19789
|
-
import { trussProps as trussProps72 } from "@homebound/truss/runtime";
|
|
19916
|
+
import { trussProps as trussProps72, maybeCssVar as maybeCssVar41 } from "@homebound/truss/runtime";
|
|
19790
19917
|
import { Fragment as Fragment36, jsx as jsx148, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
19918
|
+
var __maybeInc14 = (inc) => {
|
|
19919
|
+
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
19920
|
+
};
|
|
19791
19921
|
function GridTableLayoutComponent(props) {
|
|
19792
19922
|
const {
|
|
19793
19923
|
pageTitle,
|
|
@@ -19813,8 +19943,12 @@ function GridTableLayoutComponent(props) {
|
|
|
19813
19943
|
const api = useMemo38(() => tableProps.api ?? new GridTableApiImpl(), [tableProps.api]);
|
|
19814
19944
|
const [view, setView] = useState44(defaultView);
|
|
19815
19945
|
const clientSearch = layoutState?.search === "client" ? layoutState.searchString : void 0;
|
|
19816
|
-
const showTableActions = layoutState?.filterDefs || layoutState?.search || hasHideableColumns ||
|
|
19946
|
+
const showTableActions = !!(layoutState?.filterDefs || layoutState?.search || hasHideableColumns || withCardView);
|
|
19817
19947
|
const isVirtualized = tableProps.as === "virtual";
|
|
19948
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
19949
|
+
const tableActionsRef = useRef48(null);
|
|
19950
|
+
const tableWrapperRef = useRef48(null);
|
|
19951
|
+
useSetTableActionsHeight(tableWrapperRef, tableActionsRef, inDocumentScrollLayout && showTableActions);
|
|
19818
19952
|
const visibleColumnIds = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
19819
19953
|
useEffect28(() => {
|
|
19820
19954
|
if (layoutState?.setVisibleColumnIds) {
|
|
@@ -19822,27 +19956,58 @@ function GridTableLayoutComponent(props) {
|
|
|
19822
19956
|
}
|
|
19823
19957
|
}, [visibleColumnIds, layoutState]);
|
|
19824
19958
|
const visibleColumnsStorageKey = layoutState?.persistedColumnsStorageKey;
|
|
19959
|
+
const tableActionsEl = /* @__PURE__ */ jsx148(TableActions, { right: (hasHideableColumns || withCardView) && /* @__PURE__ */ jsxs75("div", { className: "df gap1", children: [
|
|
19960
|
+
hasHideableColumns && /* @__PURE__ */ jsx148(EditColumnsButton, { columns, api, tooltip: "Display columns", trigger: {
|
|
19961
|
+
icon: "kanban",
|
|
19962
|
+
size: "md",
|
|
19963
|
+
label: "",
|
|
19964
|
+
variant: "secondaryBlack"
|
|
19965
|
+
}, ...tid.editColumnsButton }),
|
|
19966
|
+
withCardView && /* @__PURE__ */ jsx148(ViewToggleButton, { view, onChange: setView })
|
|
19967
|
+
] }), xss: {
|
|
19968
|
+
paddingTop: "pt3",
|
|
19969
|
+
...inDocumentScrollLayout ? {
|
|
19970
|
+
paddingLeft: "pl3",
|
|
19971
|
+
paddingRight: "pr3"
|
|
19972
|
+
} : {}
|
|
19973
|
+
}, children: layoutState && (layoutState.filterDefs || layoutState.search) && /* @__PURE__ */ jsx148(_FilterDropdownMenu, { filterDefs: layoutState.filterDefs, filter: layoutState.filter, onChange: layoutState.setFilter, groupBy: layoutState.groupBy, searchProps: layoutState.search ? {
|
|
19974
|
+
onSearch: layoutState.setSearchString
|
|
19975
|
+
} : void 0 }) });
|
|
19976
|
+
const tableBody = /* @__PURE__ */ jsxs75(Fragment36, { children: [
|
|
19977
|
+
view === "card" && withCardView ? withCardView : isGridTableProps(tableProps) ? /* @__PURE__ */ jsx148(GridTable, { ...tableProps, api, filter: clientSearch, style: {
|
|
19978
|
+
allWhite: true
|
|
19979
|
+
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey }) : /* @__PURE__ */ jsx148(QueryTable, { ...tableProps, api, filter: clientSearch, style: {
|
|
19980
|
+
allWhite: true
|
|
19981
|
+
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey }),
|
|
19982
|
+
layoutState && totalCount !== void 0 && /* @__PURE__ */ jsx148(Pagination, { page: [layoutState.page, layoutState._pagination.setPage], totalCount, pageSizes: layoutState._pagination.pageSizes, ...tid.pagination })
|
|
19983
|
+
] });
|
|
19984
|
+
const tableScrollContent = /* @__PURE__ */ jsxs75(Fragment36, { children: [
|
|
19985
|
+
showTableActions && /* @__PURE__ */ jsx148("div", { ref: tableActionsRef, ...trussProps72({
|
|
19986
|
+
...inDocumentScrollLayout ? {
|
|
19987
|
+
transition: "transitionTop",
|
|
19988
|
+
position: "sticky",
|
|
19989
|
+
top: ["top_var", {
|
|
19990
|
+
"--top": maybeCssVar41(__maybeInc14(stickyNavAndHeaderOffset()))
|
|
19991
|
+
}],
|
|
19992
|
+
left: ["left_var", {
|
|
19993
|
+
"--left": maybeCssVar41(__maybeInc14(documentScrollChromeLeft()))
|
|
19994
|
+
}],
|
|
19995
|
+
width: ["w_var", {
|
|
19996
|
+
"--width": maybeCssVar41(__maybeInc14(documentScrollChromeWidth()))
|
|
19997
|
+
}],
|
|
19998
|
+
zIndex: ["z_var", {
|
|
19999
|
+
"--zIndex": maybeCssVar41(zIndices.tableActions)
|
|
20000
|
+
}],
|
|
20001
|
+
backgroundColor: ["bgColor_var", {
|
|
20002
|
+
"--backgroundColor": "var(--b-surface)"
|
|
20003
|
+
}]
|
|
20004
|
+
} : {}
|
|
20005
|
+
}), ...tid.stickyContent, children: tableActionsEl }),
|
|
20006
|
+
inDocumentScrollLayout ? tableBody : /* @__PURE__ */ jsx148(ScrollableContent, { virtualized: isVirtualized, children: tableBody })
|
|
20007
|
+
] });
|
|
19825
20008
|
return /* @__PURE__ */ jsxs75(Fragment36, { children: [
|
|
19826
20009
|
pageTitle && /* @__PURE__ */ jsx148(Header2, { pageTitle, breadCrumb, primaryAction, secondaryAction, tertiaryAction, actionMenu }),
|
|
19827
|
-
|
|
19828
|
-
hasHideableColumns && /* @__PURE__ */ jsx148(EditColumnsButton, { columns, api, tooltip: "Display columns", trigger: {
|
|
19829
|
-
icon: "kanban",
|
|
19830
|
-
size: "md",
|
|
19831
|
-
label: "",
|
|
19832
|
-
variant: "secondaryBlack"
|
|
19833
|
-
}, ...tid.editColumnsButton }),
|
|
19834
|
-
withCardView && /* @__PURE__ */ jsx148(ViewToggleButton, { view, onChange: setView })
|
|
19835
|
-
] }), children: layoutState && (layoutState.filterDefs || layoutState.search) && /* @__PURE__ */ jsx148(_FilterDropdownMenu, { filterDefs: layoutState.filterDefs, filter: layoutState.filter, onChange: layoutState.setFilter, groupBy: layoutState.groupBy, searchProps: layoutState.search ? {
|
|
19836
|
-
onSearch: layoutState.setSearchString
|
|
19837
|
-
} : void 0 }) }),
|
|
19838
|
-
/* @__PURE__ */ jsxs75(ScrollableContent, { virtualized: isVirtualized, children: [
|
|
19839
|
-
view === "card" && withCardView ? withCardView : isGridTableProps(tableProps) ? /* @__PURE__ */ jsx148(GridTable, { ...tableProps, api, filter: clientSearch, style: {
|
|
19840
|
-
allWhite: true
|
|
19841
|
-
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey }) : /* @__PURE__ */ jsx148(QueryTable, { ...tableProps, api, filter: clientSearch, style: {
|
|
19842
|
-
allWhite: true
|
|
19843
|
-
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey }),
|
|
19844
|
-
layoutState && totalCount !== void 0 && /* @__PURE__ */ jsx148(Pagination, { page: [layoutState.page, layoutState._pagination.setPage], totalCount, pageSizes: layoutState._pagination.pageSizes, ...tid.pagination })
|
|
19845
|
-
] })
|
|
20010
|
+
/* @__PURE__ */ jsx148("div", { ref: tableWrapperRef, className: "display_contents", ...tid.tableWrapper, children: tableScrollContent })
|
|
19846
20011
|
] });
|
|
19847
20012
|
}
|
|
19848
20013
|
var GridTableLayout = React17.memo(GridTableLayoutComponent);
|
|
@@ -19912,6 +20077,33 @@ function useGridTableLayoutState({
|
|
|
19912
20077
|
}
|
|
19913
20078
|
};
|
|
19914
20079
|
}
|
|
20080
|
+
function useSetTableActionsHeight(tableWrapperRef, tableActionsRef, enabled) {
|
|
20081
|
+
const syncHeightVar = useCallback25(() => {
|
|
20082
|
+
const tableWrapper = tableWrapperRef.current;
|
|
20083
|
+
if (!tableWrapper) return;
|
|
20084
|
+
if (!enabled) {
|
|
20085
|
+
tableWrapper.style.removeProperty(beamTableActionsHeightVar);
|
|
20086
|
+
return;
|
|
20087
|
+
}
|
|
20088
|
+
const height = tableActionsRef.current ? Math.round(tableActionsRef.current.getBoundingClientRect().height) : 0;
|
|
20089
|
+
if (height > 0) {
|
|
20090
|
+
tableWrapper.style.setProperty(beamTableActionsHeightVar, `${height}px`);
|
|
20091
|
+
} else {
|
|
20092
|
+
tableWrapper.style.removeProperty(beamTableActionsHeightVar);
|
|
20093
|
+
}
|
|
20094
|
+
}, [enabled, tableActionsRef, tableWrapperRef]);
|
|
20095
|
+
useResizeObserver5({
|
|
20096
|
+
ref: tableActionsRef,
|
|
20097
|
+
onResize: enabled ? syncHeightVar : noop
|
|
20098
|
+
});
|
|
20099
|
+
useLayoutEffect4(() => {
|
|
20100
|
+
syncHeightVar();
|
|
20101
|
+
const tableWrapper = tableWrapperRef.current;
|
|
20102
|
+
return () => {
|
|
20103
|
+
tableWrapper?.style.removeProperty(beamTableActionsHeightVar);
|
|
20104
|
+
};
|
|
20105
|
+
}, [tableWrapperRef, syncHeightVar]);
|
|
20106
|
+
}
|
|
19915
20107
|
function Header2(props) {
|
|
19916
20108
|
const {
|
|
19917
20109
|
pageTitle,
|
|
@@ -19928,7 +20120,6 @@ function Header2(props) {
|
|
|
19928
20120
|
paddingBottom: "pb3",
|
|
19929
20121
|
paddingRight: "pr3",
|
|
19930
20122
|
paddingLeft: "pl3",
|
|
19931
|
-
marginBottom: "mb3",
|
|
19932
20123
|
minHeight: "mh_50px",
|
|
19933
20124
|
backgroundColor: "bgWhite",
|
|
19934
20125
|
display: "df",
|
|
@@ -19965,7 +20156,7 @@ function PreventBrowserScroll({
|
|
|
19965
20156
|
}
|
|
19966
20157
|
|
|
19967
20158
|
// src/components/Layout/RightPaneLayout/RightPaneContext.tsx
|
|
19968
|
-
import React18, { useCallback as
|
|
20159
|
+
import React18, { useCallback as useCallback26, useContext as useContext18, useMemo as useMemo39, useState as useState45 } from "react";
|
|
19969
20160
|
import { jsx as jsx150 } from "react/jsx-runtime";
|
|
19970
20161
|
var RightPaneContext = React18.createContext({
|
|
19971
20162
|
openInPane: () => {
|
|
@@ -19980,15 +20171,15 @@ var RightPaneContext = React18.createContext({
|
|
|
19980
20171
|
function RightPaneProvider({ children }) {
|
|
19981
20172
|
const [rightPaneContent, setRightPaneContent] = useState45(void 0);
|
|
19982
20173
|
const [isRightPaneOpen, setIsRightPaneOpen] = useState45(false);
|
|
19983
|
-
const openInPane =
|
|
20174
|
+
const openInPane = useCallback26(
|
|
19984
20175
|
(opts) => {
|
|
19985
20176
|
setRightPaneContent(opts?.content);
|
|
19986
20177
|
setIsRightPaneOpen(true);
|
|
19987
20178
|
},
|
|
19988
20179
|
[setRightPaneContent]
|
|
19989
20180
|
);
|
|
19990
|
-
const closePane =
|
|
19991
|
-
const clearPane =
|
|
20181
|
+
const closePane = useCallback26(() => setIsRightPaneOpen(false), []);
|
|
20182
|
+
const clearPane = useCallback26(() => setRightPaneContent(void 0), [setRightPaneContent]);
|
|
19992
20183
|
const context = useMemo39(
|
|
19993
20184
|
() => ({ openInPane, closePane, clearPane, rightPaneContent, isRightPaneOpen }),
|
|
19994
20185
|
[openInPane, closePane, rightPaneContent, clearPane, isRightPaneOpen]
|
|
@@ -20002,9 +20193,9 @@ function useRightPaneContext() {
|
|
|
20002
20193
|
// src/components/Layout/RightPaneLayout/RightPaneLayout.tsx
|
|
20003
20194
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "framer-motion";
|
|
20004
20195
|
import { useEffect as useEffect29 } from "react";
|
|
20005
|
-
import { trussProps as trussProps73, maybeCssVar as
|
|
20196
|
+
import { trussProps as trussProps73, maybeCssVar as maybeCssVar42 } from "@homebound/truss/runtime";
|
|
20006
20197
|
import { Fragment as Fragment37, jsx as jsx151, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
20007
|
-
var
|
|
20198
|
+
var __maybeInc15 = (inc) => {
|
|
20008
20199
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
20009
20200
|
};
|
|
20010
20201
|
function RightPaneLayout(props) {
|
|
@@ -20025,7 +20216,7 @@ function RightPaneLayout(props) {
|
|
|
20025
20216
|
/* @__PURE__ */ jsx151("div", { ...trussProps73({
|
|
20026
20217
|
...{
|
|
20027
20218
|
width: ["w_var", {
|
|
20028
|
-
"--width":
|
|
20219
|
+
"--width": maybeCssVar42(__maybeInc15(`calc(100% - ${paneWidth + 24}px)`))
|
|
20029
20220
|
}],
|
|
20030
20221
|
transition: "transition_width_2s_linear",
|
|
20031
20222
|
height: "h100",
|
|
@@ -20041,7 +20232,7 @@ function RightPaneLayout(props) {
|
|
|
20041
20232
|
...{
|
|
20042
20233
|
...!!defaultPaneContent ? {
|
|
20043
20234
|
width: ["w_var", {
|
|
20044
|
-
"--width":
|
|
20235
|
+
"--width": maybeCssVar42(__maybeInc15(`calc(100% - ${paneWidth + 24}px)`))
|
|
20045
20236
|
}],
|
|
20046
20237
|
marginRight: "mr3"
|
|
20047
20238
|
} : {}
|
|
@@ -20075,7 +20266,7 @@ function RightPaneLayout(props) {
|
|
|
20075
20266
|
"data-testid": "rightPaneContent",
|
|
20076
20267
|
...trussProps73({
|
|
20077
20268
|
backgroundColor: ["bgColor_var", {
|
|
20078
|
-
"--backgroundColor":
|
|
20269
|
+
"--backgroundColor": maybeCssVar42(paneBgColor)
|
|
20079
20270
|
}],
|
|
20080
20271
|
height: "h100",
|
|
20081
20272
|
width: ["w_var", {
|
|
@@ -20156,7 +20347,7 @@ function SidePanel(props) {
|
|
|
20156
20347
|
}
|
|
20157
20348
|
|
|
20158
20349
|
// src/components/Layout/TableReviewLayout/TableReviewLayout.tsx
|
|
20159
|
-
import { trussProps as trussProps74, maybeCssVar as
|
|
20350
|
+
import { trussProps as trussProps74, maybeCssVar as maybeCssVar43 } from "@homebound/truss/runtime";
|
|
20160
20351
|
import { jsx as jsx154, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
20161
20352
|
var defaultRightPaneWidth = 450;
|
|
20162
20353
|
function TableReviewLayout(props) {
|
|
@@ -20205,7 +20396,7 @@ function TableReviewLayout(props) {
|
|
|
20205
20396
|
left: "left0",
|
|
20206
20397
|
right: "right0",
|
|
20207
20398
|
zIndex: ["z_var", {
|
|
20208
|
-
"--zIndex":
|
|
20399
|
+
"--zIndex": maybeCssVar43(zIndices.pageOverlay)
|
|
20209
20400
|
}],
|
|
20210
20401
|
backgroundColor: "bgWhite",
|
|
20211
20402
|
display: "df",
|
|
@@ -20283,18 +20474,18 @@ var BeamContext = createContext9({
|
|
|
20283
20474
|
});
|
|
20284
20475
|
function BeamProvider({ children, ...presentationProps }) {
|
|
20285
20476
|
const [, tick] = useReducer((prev) => prev + 1, 0);
|
|
20286
|
-
const modalRef =
|
|
20477
|
+
const modalRef = useRef49();
|
|
20287
20478
|
const modalHeaderDiv = useMemo40(() => document.createElement("div"), []);
|
|
20288
20479
|
const modalBodyDiv = useMemo40(() => {
|
|
20289
20480
|
const el = document.createElement("div");
|
|
20290
20481
|
el.style.height = "100%";
|
|
20291
20482
|
return el;
|
|
20292
20483
|
}, []);
|
|
20293
|
-
const modalCanCloseChecksRef =
|
|
20484
|
+
const modalCanCloseChecksRef = useRef49([]);
|
|
20294
20485
|
const modalFooterDiv = useMemo40(() => document.createElement("div"), []);
|
|
20295
|
-
const drawerContentStackRef =
|
|
20296
|
-
const drawerCanCloseChecks =
|
|
20297
|
-
const drawerCanCloseDetailsChecks =
|
|
20486
|
+
const drawerContentStackRef = useRef49([]);
|
|
20487
|
+
const drawerCanCloseChecks = useRef49([]);
|
|
20488
|
+
const drawerCanCloseDetailsChecks = useRef49([]);
|
|
20298
20489
|
const sdHeaderDiv = useMemo40(() => document.createElement("div"), []);
|
|
20299
20490
|
const context = useMemo40(() => {
|
|
20300
20491
|
return {
|
|
@@ -20337,14 +20528,14 @@ function useBeamContext() {
|
|
|
20337
20528
|
}
|
|
20338
20529
|
|
|
20339
20530
|
// src/components/ButtonDatePicker.tsx
|
|
20340
|
-
import { useRef as
|
|
20531
|
+
import { useRef as useRef50 } from "react";
|
|
20341
20532
|
import { useMenuTrigger as useMenuTrigger4 } from "react-aria";
|
|
20342
20533
|
import { useMenuTriggerState as useMenuTriggerState4 } from "react-stately";
|
|
20343
20534
|
import { jsx as jsx156 } from "react/jsx-runtime";
|
|
20344
20535
|
function ButtonDatePicker(props) {
|
|
20345
20536
|
const { defaultOpen, disabled, trigger, onSelect, ...datePickerProps } = props;
|
|
20346
20537
|
const state = useMenuTriggerState4({ isOpen: defaultOpen });
|
|
20347
|
-
const buttonRef =
|
|
20538
|
+
const buttonRef = useRef50(null);
|
|
20348
20539
|
const {
|
|
20349
20540
|
menuTriggerProps,
|
|
20350
20541
|
menuProps: { autoFocus: _af, ...menuProps }
|
|
@@ -20367,7 +20558,7 @@ function ButtonDatePicker(props) {
|
|
|
20367
20558
|
}
|
|
20368
20559
|
|
|
20369
20560
|
// src/components/ButtonGroup.tsx
|
|
20370
|
-
import { useRef as
|
|
20561
|
+
import { useRef as useRef51 } from "react";
|
|
20371
20562
|
import { useButton as useButton10, useFocusRing as useFocusRing12, useHover as useHover15 } from "react-aria";
|
|
20372
20563
|
import { trussProps as trussProps75 } from "@homebound/truss/runtime";
|
|
20373
20564
|
import { jsx as jsx157, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
@@ -20415,7 +20606,7 @@ function GroupButton(props) {
|
|
|
20415
20606
|
isDisabled: !!disabled,
|
|
20416
20607
|
...otherProps
|
|
20417
20608
|
};
|
|
20418
|
-
const ref =
|
|
20609
|
+
const ref = useRef51(null);
|
|
20419
20610
|
const {
|
|
20420
20611
|
buttonProps,
|
|
20421
20612
|
isPressed
|
|
@@ -20537,8 +20728,8 @@ import { useMemo as useMemo41 } from "react";
|
|
|
20537
20728
|
import { useHover as useHover16 } from "react-aria";
|
|
20538
20729
|
|
|
20539
20730
|
// src/components/Tag.tsx
|
|
20540
|
-
import { useResizeObserver as
|
|
20541
|
-
import { useRef as
|
|
20731
|
+
import { useResizeObserver as useResizeObserver6 } from "@react-aria/utils";
|
|
20732
|
+
import { useRef as useRef52, useState as useState47 } from "react";
|
|
20542
20733
|
import { trussProps as trussProps76 } from "@homebound/truss/runtime";
|
|
20543
20734
|
import { jsx as jsx158, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
20544
20735
|
function Tag(props) {
|
|
@@ -20552,8 +20743,8 @@ function Tag(props) {
|
|
|
20552
20743
|
const typeStyles2 = getStyles(type);
|
|
20553
20744
|
const tid = useTestIds(otherProps);
|
|
20554
20745
|
const [showTooltip, setShowTooltip] = useState47(false);
|
|
20555
|
-
const ref =
|
|
20556
|
-
|
|
20746
|
+
const ref = useRef52(null);
|
|
20747
|
+
useResizeObserver6({
|
|
20557
20748
|
ref,
|
|
20558
20749
|
onResize: () => {
|
|
20559
20750
|
if (ref.current) {
|
|
@@ -20613,7 +20804,7 @@ function getStyles(type) {
|
|
|
20613
20804
|
}
|
|
20614
20805
|
|
|
20615
20806
|
// src/components/Card.tsx
|
|
20616
|
-
import { trussProps as trussProps77, maybeCssVar as
|
|
20807
|
+
import { trussProps as trussProps77, maybeCssVar as maybeCssVar44 } from "@homebound/truss/runtime";
|
|
20617
20808
|
import { jsx as jsx159, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
20618
20809
|
function Card(props) {
|
|
20619
20810
|
const {
|
|
@@ -20666,7 +20857,7 @@ function Card(props) {
|
|
|
20666
20857
|
width: "w100",
|
|
20667
20858
|
height: "h100",
|
|
20668
20859
|
objectFit: ["objectFit_var", {
|
|
20669
|
-
"--objectFit":
|
|
20860
|
+
"--objectFit": maybeCssVar44(imageFit)
|
|
20670
20861
|
}]
|
|
20671
20862
|
}), src: imgSrc, alt: title, ...tid.img }) }),
|
|
20672
20863
|
isHovered && buttonMenuItems && /* @__PURE__ */ jsx159("div", { ...trussProps77({
|
|
@@ -20761,7 +20952,7 @@ function Copy(props) {
|
|
|
20761
20952
|
|
|
20762
20953
|
// src/components/DnDGrid/DnDGrid.tsx
|
|
20763
20954
|
import equal2 from "fast-deep-equal";
|
|
20764
|
-
import { useCallback as
|
|
20955
|
+
import { useCallback as useCallback27, useRef as useRef53 } from "react";
|
|
20765
20956
|
|
|
20766
20957
|
// src/components/DnDGrid/DnDGridContext.tsx
|
|
20767
20958
|
import { createContext as createContext10, useContext as useContext20 } from "react";
|
|
@@ -20784,12 +20975,12 @@ function DnDGrid(props) {
|
|
|
20784
20975
|
onReorder,
|
|
20785
20976
|
activeItemStyles
|
|
20786
20977
|
} = props;
|
|
20787
|
-
const gridEl =
|
|
20788
|
-
const dragEl =
|
|
20789
|
-
const cloneEl =
|
|
20790
|
-
const initialOrder =
|
|
20791
|
-
const reorderViaKeyboard =
|
|
20792
|
-
const transformFrom =
|
|
20978
|
+
const gridEl = useRef53(null);
|
|
20979
|
+
const dragEl = useRef53();
|
|
20980
|
+
const cloneEl = useRef53();
|
|
20981
|
+
const initialOrder = useRef53();
|
|
20982
|
+
const reorderViaKeyboard = useRef53(false);
|
|
20983
|
+
const transformFrom = useRef53({
|
|
20793
20984
|
x: 0,
|
|
20794
20985
|
y: 0
|
|
20795
20986
|
});
|
|
@@ -20797,19 +20988,19 @@ function DnDGrid(props) {
|
|
|
20797
20988
|
const activeStyles3 = activeItemStyles ?? {
|
|
20798
20989
|
boxShadow: "bshModal"
|
|
20799
20990
|
};
|
|
20800
|
-
const getGridItems =
|
|
20991
|
+
const getGridItems = useCallback27(() => {
|
|
20801
20992
|
return gridEl.current ? Array.from(gridEl.current.querySelectorAll(`[${gridItemIdKey}]`)) : [];
|
|
20802
20993
|
}, []);
|
|
20803
|
-
const getGridItemIdOrder =
|
|
20994
|
+
const getGridItemIdOrder = useCallback27(() => {
|
|
20804
20995
|
return getGridItems().map((child) => child.getAttribute(gridItemIdKey)).filter(isDefined);
|
|
20805
20996
|
}, [getGridItems]);
|
|
20806
|
-
const initReorder =
|
|
20997
|
+
const initReorder = useCallback27(() => {
|
|
20807
20998
|
if (gridEl.current && dragEl.current) {
|
|
20808
20999
|
initialOrder.current = getGridItemIdOrder();
|
|
20809
21000
|
setInlineStyles(dragEl.current, activeStyles3);
|
|
20810
21001
|
}
|
|
20811
21002
|
}, [getGridItemIdOrder, activeStyles3]);
|
|
20812
|
-
const commitReorder =
|
|
21003
|
+
const commitReorder = useCallback27(() => {
|
|
20813
21004
|
if (gridEl.current && dragEl.current) {
|
|
20814
21005
|
const currentOrder = getGridItemIdOrder();
|
|
20815
21006
|
if (!equal2(currentOrder, initialOrder.current)) onReorder(currentOrder);
|
|
@@ -20819,7 +21010,7 @@ function DnDGrid(props) {
|
|
|
20819
21010
|
initialOrder.current = currentOrder;
|
|
20820
21011
|
}
|
|
20821
21012
|
}, [onReorder, getGridItemIdOrder, activeStyles3]);
|
|
20822
|
-
const cancelReorder =
|
|
21013
|
+
const cancelReorder = useCallback27(() => {
|
|
20823
21014
|
if (gridEl.current && dragEl.current && initialOrder.current) {
|
|
20824
21015
|
const currentOrder = getGridItemIdOrder();
|
|
20825
21016
|
if (!equal2(currentOrder, initialOrder.current)) {
|
|
@@ -20841,7 +21032,7 @@ function DnDGrid(props) {
|
|
|
20841
21032
|
reorderViaKeyboard.current = false;
|
|
20842
21033
|
}
|
|
20843
21034
|
}, [getGridItemIdOrder, getGridItems, activeStyles3]);
|
|
20844
|
-
const onMove =
|
|
21035
|
+
const onMove = useCallback27((e) => {
|
|
20845
21036
|
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
20846
21037
|
const clientX = "clientX" in e ? e.clientX : e.touches[0].clientX;
|
|
20847
21038
|
const clientY = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
@@ -20864,7 +21055,7 @@ function DnDGrid(props) {
|
|
|
20864
21055
|
}
|
|
20865
21056
|
}
|
|
20866
21057
|
}, []);
|
|
20867
|
-
const onDragStart =
|
|
21058
|
+
const onDragStart = useCallback27((e) => {
|
|
20868
21059
|
if (!reorderViaKeyboard.current && dragEl.current && gridEl.current) {
|
|
20869
21060
|
initReorder();
|
|
20870
21061
|
const rect = dragEl.current.getBoundingClientRect();
|
|
@@ -20894,7 +21085,7 @@ function DnDGrid(props) {
|
|
|
20894
21085
|
gridEl.current.addEventListener("touchmove", onMove);
|
|
20895
21086
|
}
|
|
20896
21087
|
}, [initReorder, onMove, activeStyles3]);
|
|
20897
|
-
const onDragEnd =
|
|
21088
|
+
const onDragEnd = useCallback27((e) => {
|
|
20898
21089
|
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
20899
21090
|
e.preventDefault();
|
|
20900
21091
|
cloneEl.current.replaceWith(dragEl.current);
|
|
@@ -20907,7 +21098,7 @@ function DnDGrid(props) {
|
|
|
20907
21098
|
gridEl.current.removeEventListener("touchmove", onMove);
|
|
20908
21099
|
}
|
|
20909
21100
|
}, [commitReorder, onMove]);
|
|
20910
|
-
const onDragHandleKeyDown =
|
|
21101
|
+
const onDragHandleKeyDown = useCallback27((e) => {
|
|
20911
21102
|
const moveHandle = e.target;
|
|
20912
21103
|
if (dragEl.current instanceof HTMLElement && moveHandle instanceof HTMLElement && gridEl.current) {
|
|
20913
21104
|
const isSpaceKey = e.key === " ";
|
|
@@ -21107,8 +21298,8 @@ function ResponsiveGridItem(props) {
|
|
|
21107
21298
|
|
|
21108
21299
|
// src/components/Grid/useResponsiveGrid.ts
|
|
21109
21300
|
import { useMemo as useMemo44 } from "react";
|
|
21110
|
-
import { maybeCssVar as
|
|
21111
|
-
var
|
|
21301
|
+
import { maybeCssVar as maybeCssVar45 } from "@homebound/truss/runtime";
|
|
21302
|
+
var __maybeInc16 = (inc) => {
|
|
21112
21303
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
21113
21304
|
};
|
|
21114
21305
|
function useResponsiveGrid(props) {
|
|
@@ -21126,11 +21317,11 @@ function useResponsiveGrid(props) {
|
|
|
21126
21317
|
return {
|
|
21127
21318
|
display: "dg",
|
|
21128
21319
|
gridTemplateColumns: ["gtc_var", {
|
|
21129
|
-
"--gridTemplateColumns":
|
|
21320
|
+
"--gridTemplateColumns": maybeCssVar45(gridTemplateColumns)
|
|
21130
21321
|
}],
|
|
21131
21322
|
containerType: "ctis",
|
|
21132
21323
|
gap: ["gap_var", {
|
|
21133
|
-
"--gap":
|
|
21324
|
+
"--gap": maybeCssVar45(__maybeInc16(gridGap))
|
|
21134
21325
|
}]
|
|
21135
21326
|
};
|
|
21136
21327
|
}, [minColumnWidth, gap, columns]);
|
|
@@ -21253,9 +21444,9 @@ function HbSpinnerProvider({
|
|
|
21253
21444
|
}
|
|
21254
21445
|
|
|
21255
21446
|
// src/components/HomeboundLogo.tsx
|
|
21256
|
-
import { trussProps as trussProps82, maybeCssVar as
|
|
21447
|
+
import { trussProps as trussProps82, maybeCssVar as maybeCssVar46 } from "@homebound/truss/runtime";
|
|
21257
21448
|
import { jsx as jsx166 } from "react/jsx-runtime";
|
|
21258
|
-
var
|
|
21449
|
+
var __maybeInc17 = (inc) => {
|
|
21259
21450
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
21260
21451
|
};
|
|
21261
21452
|
function HomeboundLogo(props) {
|
|
@@ -21266,41 +21457,41 @@ function HomeboundLogo(props) {
|
|
|
21266
21457
|
} = props;
|
|
21267
21458
|
return /* @__PURE__ */ jsx166("svg", { viewBox: "0 0 158.1 97.6", xmlns: "http://www.w3.org/2000/svg", ...trussProps82({
|
|
21268
21459
|
fill: ["fill_var", {
|
|
21269
|
-
"--fill":
|
|
21460
|
+
"--fill": maybeCssVar46(fill)
|
|
21270
21461
|
}],
|
|
21271
21462
|
width: ["w_var", {
|
|
21272
|
-
"--width":
|
|
21463
|
+
"--width": maybeCssVar46(__maybeInc17(width2))
|
|
21273
21464
|
}],
|
|
21274
21465
|
height: ["h_var", {
|
|
21275
|
-
"--height":
|
|
21466
|
+
"--height": maybeCssVar46(__maybeInc17(height))
|
|
21276
21467
|
}]
|
|
21277
21468
|
}), children: /* @__PURE__ */ jsx166("path", { d: "M158.1,97.6H0.2L0,39.7L76.8,0l68,38.7l-3.1,5.3l-65-37L6.2,43.4l0.2,48h151.7V97.6z" }) });
|
|
21278
21469
|
}
|
|
21279
21470
|
|
|
21280
21471
|
// src/components/MaxLines.tsx
|
|
21281
|
-
import { useLayoutEffect as
|
|
21282
|
-
import { useCallback as
|
|
21283
|
-
import { trussProps as trussProps83, maybeCssVar as
|
|
21472
|
+
import { useLayoutEffect as useLayoutEffect5, useResizeObserver as useResizeObserver7 } from "@react-aria/utils";
|
|
21473
|
+
import { useCallback as useCallback28, useEffect as useEffect32, useRef as useRef54, useState as useState48 } from "react";
|
|
21474
|
+
import { trussProps as trussProps83, maybeCssVar as maybeCssVar47 } from "@homebound/truss/runtime";
|
|
21284
21475
|
import { jsx as jsx167, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
21285
21476
|
function MaxLines({
|
|
21286
21477
|
maxLines,
|
|
21287
21478
|
children
|
|
21288
21479
|
}) {
|
|
21289
|
-
const elRef =
|
|
21480
|
+
const elRef = useRef54(null);
|
|
21290
21481
|
const [hasMore, setHasMore] = useState48(false);
|
|
21291
21482
|
const [expanded, setExpanded] = useState48(false);
|
|
21292
|
-
|
|
21483
|
+
useLayoutEffect5(() => {
|
|
21293
21484
|
if (!elRef.current) return;
|
|
21294
21485
|
setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
21295
21486
|
}, []);
|
|
21296
21487
|
useEffect32(() => {
|
|
21297
21488
|
setExpanded(false);
|
|
21298
21489
|
}, [children]);
|
|
21299
|
-
const onResize =
|
|
21490
|
+
const onResize = useCallback28(() => {
|
|
21300
21491
|
if (!elRef.current) return;
|
|
21301
21492
|
!expanded && setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
21302
21493
|
}, [expanded]);
|
|
21303
|
-
|
|
21494
|
+
useResizeObserver7({
|
|
21304
21495
|
ref: elRef,
|
|
21305
21496
|
onResize
|
|
21306
21497
|
});
|
|
@@ -21308,7 +21499,7 @@ function MaxLines({
|
|
|
21308
21499
|
/* @__PURE__ */ jsx167("div", { ref: elRef, ...trussProps83({
|
|
21309
21500
|
...!expanded ? {
|
|
21310
21501
|
WebkitLineClamp: ["lineClamp_var", {
|
|
21311
|
-
"--WebkitLineClamp":
|
|
21502
|
+
"--WebkitLineClamp": maybeCssVar47(maxLines)
|
|
21312
21503
|
}],
|
|
21313
21504
|
overflow: "oh",
|
|
21314
21505
|
display: "d_negwebkit_box",
|
|
@@ -21324,12 +21515,12 @@ function MaxLines({
|
|
|
21324
21515
|
import { camelCase as camelCase6 } from "change-case";
|
|
21325
21516
|
|
|
21326
21517
|
// src/components/AppNav/AppNavGroup.tsx
|
|
21327
|
-
import { useResizeObserver as
|
|
21518
|
+
import { useResizeObserver as useResizeObserver8 } from "@react-aria/utils";
|
|
21328
21519
|
import { camelCase as camelCase5, kebabCase } from "change-case";
|
|
21329
|
-
import { useCallback as
|
|
21520
|
+
import { useCallback as useCallback30, useEffect as useEffect33, useMemo as useMemo48, useState as useState50 } from "react";
|
|
21330
21521
|
|
|
21331
21522
|
// src/components/AppNav/AppNavGroupTrigger.tsx
|
|
21332
|
-
import { useMemo as useMemo47, useRef as
|
|
21523
|
+
import { useMemo as useMemo47, useRef as useRef55 } from "react";
|
|
21333
21524
|
import { mergeProps as mergeProps26, useButton as useButton11, useFocusRing as useFocusRing14, useHover as useHover18 } from "react-aria";
|
|
21334
21525
|
import { trussProps as trussProps84, mergeProps as mergeProps_14 } from "@homebound/truss/runtime";
|
|
21335
21526
|
import { jsx as jsx168, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
@@ -21341,7 +21532,7 @@ function AppNavGroupTrigger(props) {
|
|
|
21341
21532
|
onClick
|
|
21342
21533
|
} = props;
|
|
21343
21534
|
const tid = useTestIds(props, "trigger");
|
|
21344
|
-
const ref =
|
|
21535
|
+
const ref = useRef55(null);
|
|
21345
21536
|
const {
|
|
21346
21537
|
buttonProps,
|
|
21347
21538
|
isPressed
|
|
@@ -21494,7 +21685,7 @@ function entryHasIcons(item) {
|
|
|
21494
21685
|
}
|
|
21495
21686
|
|
|
21496
21687
|
// src/components/AppNav/useAppNavGroupExpanded.ts
|
|
21497
|
-
import { useCallback as
|
|
21688
|
+
import { useCallback as useCallback29, useState as useState49 } from "react";
|
|
21498
21689
|
var APP_NAV_EXPANDED_LINK_GROUPS_STORAGE_KEY = "beam.appNav.expandedLinkGroups";
|
|
21499
21690
|
function loadStored() {
|
|
21500
21691
|
try {
|
|
@@ -21519,7 +21710,7 @@ function useAppNavGroupExpanded(linkGroup) {
|
|
|
21519
21710
|
});
|
|
21520
21711
|
const hasActiveLink = appNavLinkGroupLinks(linkGroup).some((l) => l.active);
|
|
21521
21712
|
const expanded = userExpanded !== null ? userExpanded : hasActiveLink ? true : linkGroup.defaultExpanded ?? false;
|
|
21522
|
-
const onToggle =
|
|
21713
|
+
const onToggle = useCallback29(() => {
|
|
21523
21714
|
const next = !expanded;
|
|
21524
21715
|
setUserExpanded(next);
|
|
21525
21716
|
persistLabel(label, next);
|
|
@@ -21528,9 +21719,9 @@ function useAppNavGroupExpanded(linkGroup) {
|
|
|
21528
21719
|
}
|
|
21529
21720
|
|
|
21530
21721
|
// src/components/AppNav/AppNavGroup.tsx
|
|
21531
|
-
import { trussProps as trussProps85, maybeCssVar as
|
|
21722
|
+
import { trussProps as trussProps85, maybeCssVar as maybeCssVar48 } from "@homebound/truss/runtime";
|
|
21532
21723
|
import { Fragment as Fragment39, jsx as jsx169, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
21533
|
-
var
|
|
21724
|
+
var __maybeInc18 = (inc) => {
|
|
21534
21725
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
21535
21726
|
};
|
|
21536
21727
|
function AppNavGroupView(props) {
|
|
@@ -21562,12 +21753,12 @@ function AppNavGroupDisclosure(props) {
|
|
|
21562
21753
|
useEffect33(() => {
|
|
21563
21754
|
setContentHeight(expanded && contentEl ? `${contentEl.scrollHeight}px` : "0");
|
|
21564
21755
|
}, [expanded, contentEl]);
|
|
21565
|
-
const onResize =
|
|
21756
|
+
const onResize = useCallback30(() => {
|
|
21566
21757
|
if (contentEl && expanded) {
|
|
21567
21758
|
setContentHeight(`${contentEl.scrollHeight}px`);
|
|
21568
21759
|
}
|
|
21569
21760
|
}, [expanded, contentEl]);
|
|
21570
|
-
|
|
21761
|
+
useResizeObserver8({
|
|
21571
21762
|
ref: contentRef,
|
|
21572
21763
|
onResize
|
|
21573
21764
|
});
|
|
@@ -21577,7 +21768,7 @@ function AppNavGroupDisclosure(props) {
|
|
|
21577
21768
|
overflow: "oh",
|
|
21578
21769
|
transition: "transitionHeight",
|
|
21579
21770
|
height: ["h_var", {
|
|
21580
|
-
"--height":
|
|
21771
|
+
"--height": maybeCssVar48(__maybeInc18(contentHeight))
|
|
21581
21772
|
}]
|
|
21582
21773
|
}), ...tid.panel, children: /* @__PURE__ */ jsx169("div", { ref: setContentEl, className: "df fdc pl2", children: /* @__PURE__ */ jsx169(AppNavItems, { items: linkGroup.items, panelCollapsed: false, ...tid }) }) })
|
|
21583
21774
|
] });
|
|
@@ -21707,7 +21898,7 @@ import { useEffect as useEffect34, useState as useState51 } from "react";
|
|
|
21707
21898
|
import { FocusScope as FocusScope5, usePreventScroll as usePreventScroll2 } from "react-aria";
|
|
21708
21899
|
import { createPortal as createPortal6 } from "react-dom";
|
|
21709
21900
|
import { useLocation } from "react-router-dom";
|
|
21710
|
-
import { trussProps as trussProps87, maybeCssVar as
|
|
21901
|
+
import { trussProps as trussProps87, maybeCssVar as maybeCssVar49 } from "@homebound/truss/runtime";
|
|
21711
21902
|
import { Fragment as Fragment41, jsx as jsx173, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
21712
21903
|
function NavbarMobileMenu(props) {
|
|
21713
21904
|
const {
|
|
@@ -21744,7 +21935,7 @@ function NavbarMobileDrawer({
|
|
|
21744
21935
|
bottom: "bottom0",
|
|
21745
21936
|
left: "left0",
|
|
21746
21937
|
zIndex: ["z_var", {
|
|
21747
|
-
"--zIndex":
|
|
21938
|
+
"--zIndex": maybeCssVar49(zIndices.modalUnderlay)
|
|
21748
21939
|
}],
|
|
21749
21940
|
backgroundColor: "backgroundColor_rgba_36_36_36_0_2"
|
|
21750
21941
|
}), initial: {
|
|
@@ -21768,7 +21959,7 @@ function NavbarMobileDrawer({
|
|
|
21768
21959
|
width: "w100",
|
|
21769
21960
|
overflow: "oh",
|
|
21770
21961
|
zIndex: ["z_var", {
|
|
21771
|
-
"--zIndex":
|
|
21962
|
+
"--zIndex": maybeCssVar49(zIndices.sideNav)
|
|
21772
21963
|
}],
|
|
21773
21964
|
backgroundColor: ["bgColor_var", {
|
|
21774
21965
|
"--backgroundColor": "var(--b-surface)"
|
|
@@ -21882,11 +22073,11 @@ function NavbarUserMenu({
|
|
|
21882
22073
|
|
|
21883
22074
|
// src/components/Tabs.tsx
|
|
21884
22075
|
import { camelCase as camelCase7 } from "change-case";
|
|
21885
|
-
import { useEffect as useEffect35, useMemo as useMemo49, useRef as
|
|
22076
|
+
import { useEffect as useEffect35, useMemo as useMemo49, useRef as useRef56, useState as useState52 } from "react";
|
|
21886
22077
|
import { mergeProps as mergeProps27, useFocusRing as useFocusRing15, useHover as useHover19 } from "react-aria";
|
|
21887
22078
|
import { matchPath } from "react-router";
|
|
21888
22079
|
import { Link as Link5, useLocation as useLocation2 } from "react-router-dom";
|
|
21889
|
-
import { trussProps as trussProps89, maybeCssVar as
|
|
22080
|
+
import { trussProps as trussProps89, maybeCssVar as maybeCssVar50 } from "@homebound/truss/runtime";
|
|
21890
22081
|
import { Fragment as Fragment42, jsx as jsx175, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
21891
22082
|
function TabsWithContent(props) {
|
|
21892
22083
|
const styles = hideTabs(props) ? {} : {
|
|
@@ -21944,7 +22135,7 @@ function Tabs(props) {
|
|
|
21944
22135
|
} = useFocusRing15();
|
|
21945
22136
|
const tid = useTestIds(others, "tabs");
|
|
21946
22137
|
const [active, setActive] = useState52(selected);
|
|
21947
|
-
const ref =
|
|
22138
|
+
const ref = useRef56(null);
|
|
21948
22139
|
useEffect35(() => setActive(selected), [selected]);
|
|
21949
22140
|
function onKeyUp(e) {
|
|
21950
22141
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
@@ -22062,7 +22253,7 @@ function getTabStyles() {
|
|
|
22062
22253
|
const borderBottomStyles = {
|
|
22063
22254
|
borderBottomStyle: "bbs_solid",
|
|
22064
22255
|
borderBottomWidth: ["borderBottomWidth_var", {
|
|
22065
|
-
"--borderBottomWidth":
|
|
22256
|
+
"--borderBottomWidth": maybeCssVar50(`${borderBottomWidthPx}px`)
|
|
22066
22257
|
}],
|
|
22067
22258
|
paddingBottom: ["pb_var", {
|
|
22068
22259
|
"--paddingBottom": `${verticalPaddingPx - borderBottomWidthPx}px`
|
|
@@ -22180,9 +22371,9 @@ function PageHeader2(props) {
|
|
|
22180
22371
|
}
|
|
22181
22372
|
|
|
22182
22373
|
// src/components/ScrollShadows.tsx
|
|
22183
|
-
import { useResizeObserver as
|
|
22184
|
-
import { useCallback as
|
|
22185
|
-
import { trussProps as trussProps91, maybeCssVar as
|
|
22374
|
+
import { useResizeObserver as useResizeObserver9 } from "@react-aria/utils";
|
|
22375
|
+
import { useCallback as useCallback31, useMemo as useMemo50, useRef as useRef57, useState as useState53 } from "react";
|
|
22376
|
+
import { trussProps as trussProps91, maybeCssVar as maybeCssVar51 } from "@homebound/truss/runtime";
|
|
22186
22377
|
import { jsx as jsx177, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
22187
22378
|
function ScrollShadows(props) {
|
|
22188
22379
|
const {
|
|
@@ -22201,13 +22392,13 @@ function ScrollShadows(props) {
|
|
|
22201
22392
|
}
|
|
22202
22393
|
const [showStartShadow, setShowStartShadow] = useState53(false);
|
|
22203
22394
|
const [showEndShadow, setShowEndShadow] = useState53(false);
|
|
22204
|
-
const scrollRef =
|
|
22395
|
+
const scrollRef = useRef57(null);
|
|
22205
22396
|
const [startShadowStyles, endShadowStyles] = useMemo50(() => {
|
|
22206
22397
|
const transparentBgColor = bgColor.replace(/,1\)$/, ",0)");
|
|
22207
22398
|
const commonStyles = {
|
|
22208
22399
|
position: "absolute",
|
|
22209
22400
|
zIndex: ["z_var", {
|
|
22210
|
-
"--zIndex":
|
|
22401
|
+
"--zIndex": maybeCssVar51(zIndices.scrollShadow)
|
|
22211
22402
|
}],
|
|
22212
22403
|
pointerEvents: "pointerEvents_none"
|
|
22213
22404
|
};
|
|
@@ -22240,7 +22431,7 @@ function ScrollShadows(props) {
|
|
|
22240
22431
|
...startShadowStyles2,
|
|
22241
22432
|
...{
|
|
22242
22433
|
background: ["background_var", {
|
|
22243
|
-
"--background":
|
|
22434
|
+
"--background": maybeCssVar51(startGradient)
|
|
22244
22435
|
}]
|
|
22245
22436
|
}
|
|
22246
22437
|
}, {
|
|
@@ -22248,12 +22439,12 @@ function ScrollShadows(props) {
|
|
|
22248
22439
|
...endShadowStyles2,
|
|
22249
22440
|
...{
|
|
22250
22441
|
background: ["background_var", {
|
|
22251
|
-
"--background":
|
|
22442
|
+
"--background": maybeCssVar51(endGradient)
|
|
22252
22443
|
}]
|
|
22253
22444
|
}
|
|
22254
22445
|
}];
|
|
22255
22446
|
}, [horizontal, bgColor]);
|
|
22256
|
-
const updateScrollProps =
|
|
22447
|
+
const updateScrollProps = useCallback31((el) => {
|
|
22257
22448
|
const {
|
|
22258
22449
|
scrollTop,
|
|
22259
22450
|
scrollHeight,
|
|
@@ -22268,15 +22459,15 @@ function ScrollShadows(props) {
|
|
|
22268
22459
|
setShowStartShadow(start > 0);
|
|
22269
22460
|
setShowEndShadow(start + boxSize < end);
|
|
22270
22461
|
}, [horizontal]);
|
|
22271
|
-
const onResize =
|
|
22272
|
-
|
|
22462
|
+
const onResize = useCallback31(() => scrollRef.current && updateScrollProps(scrollRef.current), [updateScrollProps]);
|
|
22463
|
+
useResizeObserver9({
|
|
22273
22464
|
ref: scrollRef,
|
|
22274
22465
|
onResize
|
|
22275
22466
|
});
|
|
22276
22467
|
return /* @__PURE__ */ jsxs92("div", { ...trussProps91({
|
|
22277
22468
|
display: "df",
|
|
22278
22469
|
flexDirection: ["fd_var", {
|
|
22279
|
-
"--flexDirection":
|
|
22470
|
+
"--flexDirection": maybeCssVar51(!horizontal ? "column" : "row")
|
|
22280
22471
|
}],
|
|
22281
22472
|
position: "relative",
|
|
22282
22473
|
overflow: "oh",
|
|
@@ -22293,7 +22484,7 @@ function ScrollShadows(props) {
|
|
|
22293
22484
|
...startShadowStyles,
|
|
22294
22485
|
...{
|
|
22295
22486
|
opacity: ["o_var", {
|
|
22296
|
-
"--opacity":
|
|
22487
|
+
"--opacity": maybeCssVar51(showStartShadow ? 1 : 0)
|
|
22297
22488
|
}]
|
|
22298
22489
|
}
|
|
22299
22490
|
}), "data-chromatic": "ignore" }),
|
|
@@ -22301,7 +22492,7 @@ function ScrollShadows(props) {
|
|
|
22301
22492
|
...endShadowStyles,
|
|
22302
22493
|
...{
|
|
22303
22494
|
opacity: ["o_var", {
|
|
22304
|
-
"--opacity":
|
|
22495
|
+
"--opacity": maybeCssVar51(showEndShadow ? 1 : 0)
|
|
22305
22496
|
}]
|
|
22306
22497
|
}
|
|
22307
22498
|
}), "data-chromatic": "ignore" }),
|
|
@@ -22319,11 +22510,11 @@ function ScrollShadows(props) {
|
|
|
22319
22510
|
// src/layouts/SideNavLayout/SideNavLayoutContext.tsx
|
|
22320
22511
|
import {
|
|
22321
22512
|
createContext as createContext12,
|
|
22322
|
-
useCallback as
|
|
22513
|
+
useCallback as useCallback32,
|
|
22323
22514
|
useContext as useContext23,
|
|
22324
22515
|
useEffect as useEffect36,
|
|
22325
22516
|
useMemo as useMemo51,
|
|
22326
|
-
useRef as
|
|
22517
|
+
useRef as useRef58,
|
|
22327
22518
|
useState as useState54
|
|
22328
22519
|
} from "react";
|
|
22329
22520
|
import { jsx as jsx178 } from "react/jsx-runtime";
|
|
@@ -22354,14 +22545,14 @@ function SideNavLayoutProvider(props) {
|
|
|
22354
22545
|
() => resolveInitialNavState(props.defaultNavState)
|
|
22355
22546
|
);
|
|
22356
22547
|
const bp = useBreakpoint();
|
|
22357
|
-
const prevMdAndUp =
|
|
22548
|
+
const prevMdAndUp = useRef58(bp.mdAndUp);
|
|
22358
22549
|
useEffect36(() => {
|
|
22359
22550
|
if (prevMdAndUp.current && !bp.mdAndUp) {
|
|
22360
22551
|
setNavStateInternal((prev) => prev === "expanded" ? "collapse" : prev);
|
|
22361
22552
|
}
|
|
22362
22553
|
prevMdAndUp.current = bp.mdAndUp;
|
|
22363
22554
|
}, [bp.mdAndUp]);
|
|
22364
|
-
const setNavState =
|
|
22555
|
+
const setNavState = useCallback32((value2) => {
|
|
22365
22556
|
setNavStateInternal((prev) => {
|
|
22366
22557
|
const next = typeof value2 === "function" ? value2(prev) : value2;
|
|
22367
22558
|
if (next === "expanded" || next === "collapse") {
|
|
@@ -22440,10 +22631,10 @@ function SideNav(props) {
|
|
|
22440
22631
|
}
|
|
22441
22632
|
|
|
22442
22633
|
// src/components/Snackbar/useSnackbar.tsx
|
|
22443
|
-
import { useCallback as
|
|
22634
|
+
import { useCallback as useCallback33, useEffect as useEffect37 } from "react";
|
|
22444
22635
|
function useSnackbar() {
|
|
22445
22636
|
const { setNotices, setOffset } = useSnackbarContext();
|
|
22446
|
-
const onClose =
|
|
22637
|
+
const onClose = useCallback33(
|
|
22447
22638
|
(noticeId) => {
|
|
22448
22639
|
setNotices((prev) => {
|
|
22449
22640
|
let returnValue = prev;
|
|
@@ -22460,7 +22651,7 @@ function useSnackbar() {
|
|
|
22460
22651
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22461
22652
|
[]
|
|
22462
22653
|
);
|
|
22463
|
-
const triggerNotice =
|
|
22654
|
+
const triggerNotice = useCallback33(
|
|
22464
22655
|
(props) => {
|
|
22465
22656
|
const noticeId = props.id ?? `beamSnackbar:${snackbarId++}`;
|
|
22466
22657
|
let maybeTimeout;
|
|
@@ -22489,7 +22680,7 @@ function useSnackbar() {
|
|
|
22489
22680
|
},
|
|
22490
22681
|
[onClose, setNotices]
|
|
22491
22682
|
);
|
|
22492
|
-
const closeNotice =
|
|
22683
|
+
const closeNotice = useCallback33((id) => onClose(id), [onClose]);
|
|
22493
22684
|
const useSnackbarOffset = ({ bottom }) => useEffect37(() => {
|
|
22494
22685
|
setOffset({ bottom });
|
|
22495
22686
|
return () => setOffset({});
|
|
@@ -22499,12 +22690,12 @@ function useSnackbar() {
|
|
|
22499
22690
|
var snackbarId = 1;
|
|
22500
22691
|
|
|
22501
22692
|
// src/components/Stepper.tsx
|
|
22502
|
-
import { useRef as
|
|
22693
|
+
import { useRef as useRef59 } from "react";
|
|
22503
22694
|
import { useButton as useButton12, useFocusRing as useFocusRing16, useHover as useHover20 } from "react-aria";
|
|
22504
|
-
import { trussProps as trussProps93, maybeCssVar as
|
|
22695
|
+
import { trussProps as trussProps93, maybeCssVar as maybeCssVar52 } from "@homebound/truss/runtime";
|
|
22505
22696
|
import { jsx as jsx180, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
22506
22697
|
import { createElement as createElement4 } from "react";
|
|
22507
|
-
var
|
|
22698
|
+
var __maybeInc19 = (inc) => {
|
|
22508
22699
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
22509
22700
|
};
|
|
22510
22701
|
function Stepper(props) {
|
|
@@ -22560,7 +22751,7 @@ function Stepper(props) {
|
|
|
22560
22751
|
transition: "transition_width_200ms",
|
|
22561
22752
|
height: "h100",
|
|
22562
22753
|
width: ["w_var", {
|
|
22563
|
-
"--width":
|
|
22754
|
+
"--width": maybeCssVar52(__maybeInc19(`${(lastCompletedStep + 1) / steps.length * 100}%`))
|
|
22564
22755
|
}]
|
|
22565
22756
|
}) }) })
|
|
22566
22757
|
] });
|
|
@@ -22577,7 +22768,7 @@ function StepButton(props) {
|
|
|
22577
22768
|
onPress: onClick,
|
|
22578
22769
|
isDisabled: disabled
|
|
22579
22770
|
};
|
|
22580
|
-
const ref =
|
|
22771
|
+
const ref = useRef59(null);
|
|
22581
22772
|
const {
|
|
22582
22773
|
buttonProps,
|
|
22583
22774
|
isPressed
|
|
@@ -22970,17 +23161,17 @@ function visit(rows, fn) {
|
|
|
22970
23161
|
}
|
|
22971
23162
|
|
|
22972
23163
|
// src/components/Toast/useToast.tsx
|
|
22973
|
-
import { useCallback as
|
|
23164
|
+
import { useCallback as useCallback34 } from "react";
|
|
22974
23165
|
function useToast() {
|
|
22975
23166
|
const { setNotice, clear } = useToastContext();
|
|
22976
|
-
const showToast =
|
|
23167
|
+
const showToast = useCallback34((props) => setNotice(props), [setNotice]);
|
|
22977
23168
|
return { showToast, clear };
|
|
22978
23169
|
}
|
|
22979
23170
|
|
|
22980
23171
|
// src/layouts/SideNavLayout/SideNavLayout.tsx
|
|
22981
|
-
import { trussProps as trussProps95, mergeProps as mergeProps29, maybeCssVar as
|
|
23172
|
+
import { trussProps as trussProps95, mergeProps as mergeProps29, maybeCssVar as maybeCssVar53 } from "@homebound/truss/runtime";
|
|
22982
23173
|
import { jsx as jsx185, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
22983
|
-
var
|
|
23174
|
+
var __maybeInc20 = (inc) => {
|
|
22984
23175
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
22985
23176
|
};
|
|
22986
23177
|
function SideNavLayout(props) {
|
|
@@ -23032,14 +23223,14 @@ function SideNavLayoutContent(props) {
|
|
|
23032
23223
|
position: "sticky",
|
|
23033
23224
|
left: "left0",
|
|
23034
23225
|
zIndex: ["z_var", {
|
|
23035
|
-
"--zIndex":
|
|
23226
|
+
"--zIndex": maybeCssVar53(zIndices.sideNav)
|
|
23036
23227
|
}],
|
|
23037
23228
|
top: ["top_var", {
|
|
23038
|
-
"--top":
|
|
23229
|
+
"--top": maybeCssVar53(__maybeInc20(navTop))
|
|
23039
23230
|
}],
|
|
23040
23231
|
alignSelf: "asfs",
|
|
23041
23232
|
height: ["h_var", {
|
|
23042
|
-
"--height":
|
|
23233
|
+
"--height": maybeCssVar53(__maybeInc20(railViewportHeight))
|
|
23043
23234
|
}],
|
|
23044
23235
|
width: ["w_var", {
|
|
23045
23236
|
"--width": `${collapsed ? railCollapsedWidthPx : railWidthPx}px`
|
|
@@ -23049,11 +23240,11 @@ function SideNavLayoutContent(props) {
|
|
|
23049
23240
|
position: "fixed",
|
|
23050
23241
|
left: "left0",
|
|
23051
23242
|
top: ["top_var", {
|
|
23052
|
-
"--top":
|
|
23243
|
+
"--top": maybeCssVar53(__maybeInc20(navTop))
|
|
23053
23244
|
}],
|
|
23054
23245
|
bottom: "bottom0",
|
|
23055
23246
|
zIndex: ["z_var", {
|
|
23056
|
-
"--zIndex":
|
|
23247
|
+
"--zIndex": maybeCssVar53(zIndices.sideNav)
|
|
23057
23248
|
}]
|
|
23058
23249
|
},
|
|
23059
23250
|
...collapsed ? {
|
|
@@ -23092,25 +23283,34 @@ function SideNavLayoutContent(props) {
|
|
|
23092
23283
|
}
|
|
23093
23284
|
|
|
23094
23285
|
// src/layouts/NavbarLayout/NavbarLayout.tsx
|
|
23095
|
-
import { useMemo as useMemo53, useRef as
|
|
23096
|
-
import { mergeProps as mergeProps30, maybeCssVar as
|
|
23286
|
+
import { useMemo as useMemo53, useRef as useRef61 } from "react";
|
|
23287
|
+
import { mergeProps as mergeProps30, maybeCssVar as maybeCssVar54 } from "@homebound/truss/runtime";
|
|
23097
23288
|
|
|
23098
23289
|
// src/layouts/useAutoHideOnScroll.ts
|
|
23099
|
-
import {
|
|
23290
|
+
import { useLayoutEffect as useLayoutEffect6, useRef as useRef60, useState as useState55 } from "react";
|
|
23100
23291
|
var THRESHOLD = 80;
|
|
23292
|
+
function getInitialAutoHideState() {
|
|
23293
|
+
if (typeof window === "undefined" || window.scrollY <= 0) {
|
|
23294
|
+
return { state: "static", atTop: true };
|
|
23295
|
+
}
|
|
23296
|
+
return { state: "hidden", atTop: false };
|
|
23297
|
+
}
|
|
23101
23298
|
function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
23102
|
-
const
|
|
23103
|
-
const
|
|
23104
|
-
const
|
|
23105
|
-
const
|
|
23106
|
-
const
|
|
23299
|
+
const initial = getInitialAutoHideState();
|
|
23300
|
+
const [state, setState] = useState55(initial.state);
|
|
23301
|
+
const stateRef = useRef60(initial.state);
|
|
23302
|
+
const [atTop, setAtTop] = useState55(initial.atTop);
|
|
23303
|
+
const atTopRef = useRef60(initial.atTop);
|
|
23304
|
+
const getTopOffsetRef = useRef60(getTopOffset);
|
|
23107
23305
|
getTopOffsetRef.current = getTopOffset;
|
|
23108
|
-
const lastScrollY =
|
|
23109
|
-
|
|
23306
|
+
const lastScrollY = useRef60(Number.POSITIVE_INFINITY);
|
|
23307
|
+
const lastScrollHeight = useRef60(0);
|
|
23308
|
+
useLayoutEffect6(() => {
|
|
23110
23309
|
if (!enabled) {
|
|
23111
23310
|
stateRef.current = "static";
|
|
23112
23311
|
atTopRef.current = true;
|
|
23113
23312
|
lastScrollY.current = Number.POSITIVE_INFINITY;
|
|
23313
|
+
lastScrollHeight.current = 0;
|
|
23114
23314
|
setState("static");
|
|
23115
23315
|
setAtTop(true);
|
|
23116
23316
|
return;
|
|
@@ -23125,22 +23325,41 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
23125
23325
|
setAtTop(nextAtTop);
|
|
23126
23326
|
}
|
|
23127
23327
|
};
|
|
23328
|
+
const autoHideStateOnLayoutChange = (rect, topOffset) => {
|
|
23329
|
+
const nextAtTop = rect.top >= topOffset;
|
|
23330
|
+
let next = stateRef.current;
|
|
23331
|
+
if (nextAtTop) {
|
|
23332
|
+
next = "static";
|
|
23333
|
+
} else if (rect.bottom < -THRESHOLD && next !== "revealed") {
|
|
23334
|
+
next = "hidden";
|
|
23335
|
+
}
|
|
23336
|
+
return { next, nextAtTop };
|
|
23337
|
+
};
|
|
23128
23338
|
const updateAutoHideState = () => {
|
|
23129
23339
|
const el = spacerRef.current;
|
|
23130
23340
|
if (!el) return;
|
|
23341
|
+
const doc = document.documentElement;
|
|
23342
|
+
const currentScrollHeight = doc.scrollHeight;
|
|
23343
|
+
const scrollHeightChanged = lastScrollHeight.current !== 0 && currentScrollHeight !== lastScrollHeight.current;
|
|
23344
|
+
lastScrollHeight.current = currentScrollHeight;
|
|
23131
23345
|
if (window.scrollY <= 0) {
|
|
23132
23346
|
lastScrollY.current = 0;
|
|
23133
23347
|
commit("static", true);
|
|
23134
23348
|
return;
|
|
23135
23349
|
}
|
|
23136
|
-
const rect = el.getBoundingClientRect();
|
|
23137
23350
|
const currentY = window.scrollY;
|
|
23351
|
+
const rect = el.getBoundingClientRect();
|
|
23352
|
+
const topOffset = getTopOffsetRef.current?.() ?? 0;
|
|
23353
|
+
if (scrollHeightChanged) {
|
|
23354
|
+
lastScrollY.current = currentY;
|
|
23355
|
+
const { next: next2, nextAtTop: nextAtTop2 } = autoHideStateOnLayoutChange(rect, topOffset);
|
|
23356
|
+
commit(next2, nextAtTop2);
|
|
23357
|
+
return;
|
|
23358
|
+
}
|
|
23138
23359
|
const dy = currentY - lastScrollY.current;
|
|
23139
23360
|
lastScrollY.current = currentY;
|
|
23140
|
-
const topOffset = getTopOffsetRef.current?.() ?? 0;
|
|
23141
|
-
const nextAtTop = rect.top >= topOffset;
|
|
23142
|
-
const doc = document.documentElement;
|
|
23143
23361
|
const atBottom = currentY >= doc.scrollHeight - doc.clientHeight;
|
|
23362
|
+
const nextAtTop = rect.top >= topOffset;
|
|
23144
23363
|
let next = stateRef.current;
|
|
23145
23364
|
if (nextAtTop) {
|
|
23146
23365
|
next = "static";
|
|
@@ -23158,17 +23377,17 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
23158
23377
|
}
|
|
23159
23378
|
|
|
23160
23379
|
// src/layouts/useMeasuredHeight.ts
|
|
23161
|
-
import { useResizeObserver as
|
|
23162
|
-
import { useCallback as
|
|
23380
|
+
import { useResizeObserver as useResizeObserver10 } from "@react-aria/utils";
|
|
23381
|
+
import { useCallback as useCallback35, useLayoutEffect as useLayoutEffect7, useState as useState56 } from "react";
|
|
23163
23382
|
function useMeasuredHeight(ref, enabled) {
|
|
23164
23383
|
const [height, setHeight] = useState56(0);
|
|
23165
|
-
const syncElementHeight =
|
|
23384
|
+
const syncElementHeight = useCallback35(() => {
|
|
23166
23385
|
const el = ref.current;
|
|
23167
23386
|
const next = el ? Math.round(el.getBoundingClientRect().height) : 0;
|
|
23168
23387
|
setHeight((prev) => prev === next ? prev : next);
|
|
23169
23388
|
}, [ref]);
|
|
23170
|
-
|
|
23171
|
-
|
|
23389
|
+
useResizeObserver10({ ref, onResize: syncElementHeight });
|
|
23390
|
+
useLayoutEffect7(() => {
|
|
23172
23391
|
syncElementHeight();
|
|
23173
23392
|
}, [enabled, syncElementHeight]);
|
|
23174
23393
|
return height;
|
|
@@ -23187,7 +23406,7 @@ function useNavbarLayoutHeight() {
|
|
|
23187
23406
|
|
|
23188
23407
|
// src/layouts/NavbarLayout/NavbarLayout.tsx
|
|
23189
23408
|
import { jsx as jsx187, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
23190
|
-
var
|
|
23409
|
+
var __maybeInc21 = (inc) => {
|
|
23191
23410
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
23192
23411
|
};
|
|
23193
23412
|
function NavbarLayout(props) {
|
|
@@ -23196,8 +23415,8 @@ function NavbarLayout(props) {
|
|
|
23196
23415
|
children
|
|
23197
23416
|
} = props;
|
|
23198
23417
|
const tid = useTestIds(props, "navbarLayout");
|
|
23199
|
-
const navMetricsRef =
|
|
23200
|
-
const spacerRef =
|
|
23418
|
+
const navMetricsRef = useRef61(null);
|
|
23419
|
+
const spacerRef = useRef61(null);
|
|
23201
23420
|
const navHeight = useMeasuredHeight(navMetricsRef, true);
|
|
23202
23421
|
const {
|
|
23203
23422
|
state: autoHideState,
|
|
@@ -23215,10 +23434,10 @@ function NavbarLayout(props) {
|
|
|
23215
23434
|
position: "sticky",
|
|
23216
23435
|
left: "left0",
|
|
23217
23436
|
zIndex: ["z_var", {
|
|
23218
|
-
"--zIndex":
|
|
23437
|
+
"--zIndex": maybeCssVar54(zIndices.navbar)
|
|
23219
23438
|
}],
|
|
23220
23439
|
width: ["w_var", {
|
|
23221
|
-
"--width":
|
|
23440
|
+
"--width": maybeCssVar54(__maybeInc21(innerWidth))
|
|
23222
23441
|
}]
|
|
23223
23442
|
}
|
|
23224
23443
|
) : (
|
|
@@ -23227,10 +23446,10 @@ function NavbarLayout(props) {
|
|
|
23227
23446
|
position: "fixed",
|
|
23228
23447
|
left: "left0",
|
|
23229
23448
|
zIndex: ["z_var", {
|
|
23230
|
-
"--zIndex":
|
|
23449
|
+
"--zIndex": maybeCssVar54(zIndices.navbar)
|
|
23231
23450
|
}],
|
|
23232
23451
|
width: ["w_var", {
|
|
23233
|
-
"--width":
|
|
23452
|
+
"--width": maybeCssVar54(__maybeInc21(innerWidth))
|
|
23234
23453
|
}],
|
|
23235
23454
|
transition: "transitionTop"
|
|
23236
23455
|
}
|
|
@@ -23256,10 +23475,10 @@ function NavbarLayout(props) {
|
|
|
23256
23475
|
}
|
|
23257
23476
|
|
|
23258
23477
|
// src/layouts/PageHeaderLayout/PageHeaderLayout.tsx
|
|
23259
|
-
import { useCallback as
|
|
23260
|
-
import { mergeProps as mergeProps31, maybeCssVar as
|
|
23478
|
+
import { useCallback as useCallback36, useMemo as useMemo54, useRef as useRef62 } from "react";
|
|
23479
|
+
import { mergeProps as mergeProps31, maybeCssVar as maybeCssVar55 } from "@homebound/truss/runtime";
|
|
23261
23480
|
import { jsx as jsx188, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
23262
|
-
var
|
|
23481
|
+
var __maybeInc22 = (inc) => {
|
|
23263
23482
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
23264
23483
|
};
|
|
23265
23484
|
function PageHeaderLayout(props) {
|
|
@@ -23269,11 +23488,11 @@ function PageHeaderLayout(props) {
|
|
|
23269
23488
|
} = props;
|
|
23270
23489
|
const tid = useTestIds(props, "pageHeaderLayout");
|
|
23271
23490
|
const navbarHeight = useNavbarLayoutHeight();
|
|
23272
|
-
const navbarHeightRef =
|
|
23491
|
+
const navbarHeightRef = useRef62(navbarHeight);
|
|
23273
23492
|
navbarHeightRef.current = navbarHeight;
|
|
23274
|
-
const getNavbarBottom =
|
|
23275
|
-
const headerMetricsRef =
|
|
23276
|
-
const spacerRef =
|
|
23493
|
+
const getNavbarBottom = useCallback36(() => navbarHeightRef.current, []);
|
|
23494
|
+
const headerMetricsRef = useRef62(null);
|
|
23495
|
+
const spacerRef = useRef62(null);
|
|
23277
23496
|
const headerHeight = useMeasuredHeight(headerMetricsRef, true);
|
|
23278
23497
|
const {
|
|
23279
23498
|
state: autoHideState,
|
|
@@ -23283,30 +23502,30 @@ function PageHeaderLayout(props) {
|
|
|
23283
23502
|
const cssVars = headerHeight > 0 && headerOccupiesPosition ? {
|
|
23284
23503
|
[beamPageHeaderLayoutHeightVar]: `${headerHeight}px`
|
|
23285
23504
|
} : void 0;
|
|
23286
|
-
const headerLeft =
|
|
23287
|
-
const headerWidth =
|
|
23505
|
+
const headerLeft = documentScrollChromeLeft();
|
|
23506
|
+
const headerWidth = documentScrollChromeWidth();
|
|
23288
23507
|
const outerTop = `var(${beamNavbarLayoutHeightVar}, 0px)`;
|
|
23289
23508
|
const innerCss = autoHideState === "static" ? {
|
|
23290
23509
|
position: "sticky",
|
|
23291
23510
|
left: ["left_var", {
|
|
23292
|
-
"--left":
|
|
23511
|
+
"--left": maybeCssVar55(__maybeInc22(headerLeft))
|
|
23293
23512
|
}],
|
|
23294
23513
|
width: ["w_var", {
|
|
23295
|
-
"--width":
|
|
23514
|
+
"--width": maybeCssVar55(__maybeInc22(headerWidth))
|
|
23296
23515
|
}],
|
|
23297
23516
|
zIndex: ["z_var", {
|
|
23298
|
-
"--zIndex":
|
|
23517
|
+
"--zIndex": maybeCssVar55(zIndices.pageStickyHeader)
|
|
23299
23518
|
}]
|
|
23300
23519
|
} : {
|
|
23301
23520
|
position: "fixed",
|
|
23302
23521
|
left: ["left_var", {
|
|
23303
|
-
"--left":
|
|
23522
|
+
"--left": maybeCssVar55(__maybeInc22(headerLeft))
|
|
23304
23523
|
}],
|
|
23305
23524
|
width: ["w_var", {
|
|
23306
|
-
"--width":
|
|
23525
|
+
"--width": maybeCssVar55(__maybeInc22(headerWidth))
|
|
23307
23526
|
}],
|
|
23308
23527
|
zIndex: ["z_var", {
|
|
23309
|
-
"--zIndex":
|
|
23528
|
+
"--zIndex": maybeCssVar55(zIndices.pageStickyHeader)
|
|
23310
23529
|
}],
|
|
23311
23530
|
transition: "transitionTop"
|
|
23312
23531
|
};
|
|
@@ -23494,6 +23713,7 @@ export {
|
|
|
23494
23713
|
beamNavbarLayoutHeightVar,
|
|
23495
23714
|
beamPageHeaderLayoutHeightVar,
|
|
23496
23715
|
beamSideNavLayoutWidthVar,
|
|
23716
|
+
beamTableActionsHeightVar,
|
|
23497
23717
|
booleanFilter,
|
|
23498
23718
|
boundCheckboxField,
|
|
23499
23719
|
boundCheckboxGroupField,
|
|
@@ -23512,6 +23732,7 @@ export {
|
|
|
23512
23732
|
boundTextField,
|
|
23513
23733
|
boundToggleChipGroupField,
|
|
23514
23734
|
boundTreeSelectField,
|
|
23735
|
+
calcColumnLayout,
|
|
23515
23736
|
calcColumnSizes,
|
|
23516
23737
|
cardStyle,
|
|
23517
23738
|
checkboxFilter,
|
|
@@ -23532,6 +23753,8 @@ export {
|
|
|
23532
23753
|
defaultRenderFn,
|
|
23533
23754
|
defaultStyle,
|
|
23534
23755
|
defaultTestId,
|
|
23756
|
+
documentScrollChromeLeft,
|
|
23757
|
+
documentScrollChromeWidth,
|
|
23535
23758
|
dragHandleColumn,
|
|
23536
23759
|
emptyCell,
|
|
23537
23760
|
ensureClientSideSortValueIsSortable,
|
|
@@ -23586,6 +23809,7 @@ export {
|
|
|
23586
23809
|
px,
|
|
23587
23810
|
recursivelyGetContainingRow,
|
|
23588
23811
|
reservedRowKinds,
|
|
23812
|
+
resolveTableContentWidth,
|
|
23589
23813
|
resolveTooltip,
|
|
23590
23814
|
rowClickRenderFn,
|
|
23591
23815
|
rowLinkRenderFn,
|
|
@@ -23600,6 +23824,9 @@ export {
|
|
|
23600
23824
|
singleFilter,
|
|
23601
23825
|
sortFn,
|
|
23602
23826
|
sortRows,
|
|
23827
|
+
stickyNavAndHeaderOffset,
|
|
23828
|
+
stickyTableHeaderOffset,
|
|
23829
|
+
sumColumnSizesPx,
|
|
23603
23830
|
switchFocusStyles,
|
|
23604
23831
|
switchHoverStyles,
|
|
23605
23832
|
switchSelectedHoverStyles,
|