@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.cjs
CHANGED
|
@@ -195,6 +195,7 @@ __export(index_exports, {
|
|
|
195
195
|
beamNavbarLayoutHeightVar: () => beamNavbarLayoutHeightVar,
|
|
196
196
|
beamPageHeaderLayoutHeightVar: () => beamPageHeaderLayoutHeightVar,
|
|
197
197
|
beamSideNavLayoutWidthVar: () => beamSideNavLayoutWidthVar,
|
|
198
|
+
beamTableActionsHeightVar: () => beamTableActionsHeightVar,
|
|
198
199
|
booleanFilter: () => booleanFilter,
|
|
199
200
|
boundCheckboxField: () => boundCheckboxField,
|
|
200
201
|
boundCheckboxGroupField: () => boundCheckboxGroupField,
|
|
@@ -213,6 +214,7 @@ __export(index_exports, {
|
|
|
213
214
|
boundTextField: () => boundTextField,
|
|
214
215
|
boundToggleChipGroupField: () => boundToggleChipGroupField,
|
|
215
216
|
boundTreeSelectField: () => boundTreeSelectField,
|
|
217
|
+
calcColumnLayout: () => calcColumnLayout,
|
|
216
218
|
calcColumnSizes: () => calcColumnSizes,
|
|
217
219
|
cardStyle: () => cardStyle,
|
|
218
220
|
checkboxFilter: () => checkboxFilter,
|
|
@@ -233,6 +235,8 @@ __export(index_exports, {
|
|
|
233
235
|
defaultRenderFn: () => defaultRenderFn,
|
|
234
236
|
defaultStyle: () => defaultStyle,
|
|
235
237
|
defaultTestId: () => defaultTestId,
|
|
238
|
+
documentScrollChromeLeft: () => documentScrollChromeLeft,
|
|
239
|
+
documentScrollChromeWidth: () => documentScrollChromeWidth,
|
|
236
240
|
dragHandleColumn: () => dragHandleColumn,
|
|
237
241
|
emptyCell: () => emptyCell,
|
|
238
242
|
ensureClientSideSortValueIsSortable: () => ensureClientSideSortValueIsSortable,
|
|
@@ -287,6 +291,7 @@ __export(index_exports, {
|
|
|
287
291
|
px: () => px,
|
|
288
292
|
recursivelyGetContainingRow: () => recursivelyGetContainingRow,
|
|
289
293
|
reservedRowKinds: () => reservedRowKinds,
|
|
294
|
+
resolveTableContentWidth: () => resolveTableContentWidth,
|
|
290
295
|
resolveTooltip: () => resolveTooltip,
|
|
291
296
|
rowClickRenderFn: () => rowClickRenderFn,
|
|
292
297
|
rowLinkRenderFn: () => rowLinkRenderFn,
|
|
@@ -301,6 +306,9 @@ __export(index_exports, {
|
|
|
301
306
|
singleFilter: () => singleFilter,
|
|
302
307
|
sortFn: () => sortFn,
|
|
303
308
|
sortRows: () => sortRows,
|
|
309
|
+
stickyNavAndHeaderOffset: () => stickyNavAndHeaderOffset,
|
|
310
|
+
stickyTableHeaderOffset: () => stickyTableHeaderOffset,
|
|
311
|
+
sumColumnSizesPx: () => sumColumnSizesPx,
|
|
304
312
|
switchFocusStyles: () => switchFocusStyles,
|
|
305
313
|
switchHoverStyles: () => switchHoverStyles,
|
|
306
314
|
switchSelectedHoverStyles: () => switchSelectedHoverStyles,
|
|
@@ -6212,9 +6220,19 @@ var beamPageHeaderLayoutHeightVar = "--beam-page-header-layout-height";
|
|
|
6212
6220
|
var beamLayoutViewportWidthVar = "--beam-layout-viewport-width";
|
|
6213
6221
|
var beamLayoutViewportHeightVar = "--beam-layout-viewport-height";
|
|
6214
6222
|
var beamSideNavLayoutWidthVar = "--beam-side-nav-layout-width";
|
|
6223
|
+
var beamTableActionsHeightVar = "--beam-table-actions-height";
|
|
6224
|
+
function documentScrollChromeLeft() {
|
|
6225
|
+
return `var(${beamSideNavLayoutWidthVar}, 0px)`;
|
|
6226
|
+
}
|
|
6227
|
+
function documentScrollChromeWidth() {
|
|
6228
|
+
return `calc(var(${beamLayoutViewportWidthVar}, 100vw) - var(${beamSideNavLayoutWidthVar}, 0px))`;
|
|
6229
|
+
}
|
|
6215
6230
|
function stickyNavAndHeaderOffset(basePx = 0) {
|
|
6216
6231
|
return `calc(${basePx}px + var(${beamNavbarLayoutHeightVar}, 0px) + var(${beamPageHeaderLayoutHeightVar}, 0px))`;
|
|
6217
6232
|
}
|
|
6233
|
+
function stickyTableHeaderOffset(basePx = 0) {
|
|
6234
|
+
return `calc(${basePx}px + var(${beamNavbarLayoutHeightVar}, 0px) + var(${beamPageHeaderLayoutHeightVar}, 0px) + var(${beamTableActionsHeightVar}, 0px))`;
|
|
6235
|
+
}
|
|
6218
6236
|
|
|
6219
6237
|
// src/utils/zIndices.ts
|
|
6220
6238
|
var zIndices = {
|
|
@@ -6223,6 +6241,7 @@ var zIndices = {
|
|
|
6223
6241
|
tableExpandableTitle: 20,
|
|
6224
6242
|
tableStickyColumn: 30,
|
|
6225
6243
|
tableStickyHeader: 40,
|
|
6244
|
+
tableActions: 45,
|
|
6226
6245
|
// Page chrome - ensure these items sit above the table
|
|
6227
6246
|
scrollShadow: 50,
|
|
6228
6247
|
superDrawerScrim: 50,
|
|
@@ -6389,6 +6408,9 @@ function SortHeader(props) {
|
|
|
6389
6408
|
// src/components/Table/utils/utils.tsx
|
|
6390
6409
|
var import_runtime12 = require("@homebound/truss/runtime");
|
|
6391
6410
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
6411
|
+
var __maybeInc4 = (inc) => {
|
|
6412
|
+
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
6413
|
+
};
|
|
6392
6414
|
function toContent(maybeContent, isHeader, canSortColumn, isClientSideSorting, style, as, alignment, column2, isExpandableHeader, isExpandable, minStickyLeftOffset, isKeptSelectedRow) {
|
|
6393
6415
|
if (isKeptSelectedRow && column2.id === "beamCollapseColumn") {
|
|
6394
6416
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, {});
|
|
@@ -6583,12 +6605,21 @@ function recursivelyGetContainingRow(rowId, rowArray, parent) {
|
|
|
6583
6605
|
}
|
|
6584
6606
|
return void 0;
|
|
6585
6607
|
}
|
|
6586
|
-
function getTableRefWidthStyles(isVirtual) {
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6608
|
+
function getTableRefWidthStyles(isVirtual, inDocumentScrollLayout = false) {
|
|
6609
|
+
if (inDocumentScrollLayout) {
|
|
6610
|
+
return {
|
|
6611
|
+
width: ["w_var", {
|
|
6612
|
+
"--width": (0, import_runtime12.maybeCssVar)(__maybeInc4(documentScrollChromeWidth()))
|
|
6613
|
+
}]
|
|
6614
|
+
};
|
|
6615
|
+
}
|
|
6616
|
+
if (isVirtual) {
|
|
6617
|
+
return {
|
|
6590
6618
|
width: "w_calc_100_20px"
|
|
6591
|
-
}
|
|
6619
|
+
};
|
|
6620
|
+
}
|
|
6621
|
+
return {
|
|
6622
|
+
width: "w100"
|
|
6592
6623
|
};
|
|
6593
6624
|
}
|
|
6594
6625
|
|
|
@@ -7396,7 +7427,7 @@ function ColumnResizeHandle({
|
|
|
7396
7427
|
var import_react25 = require("react");
|
|
7397
7428
|
var import_runtime19 = require("@homebound/truss/runtime");
|
|
7398
7429
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
7399
|
-
var
|
|
7430
|
+
var __maybeInc5 = (inc) => {
|
|
7400
7431
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
7401
7432
|
};
|
|
7402
7433
|
function KeptGroupRow(props) {
|
|
@@ -7423,7 +7454,7 @@ function KeptGroupRow(props) {
|
|
|
7423
7454
|
...{
|
|
7424
7455
|
paddingLeft: "pl0",
|
|
7425
7456
|
width: ["w_var", {
|
|
7426
|
-
"--width": (0, import_runtime19.maybeCssVar)(
|
|
7457
|
+
"--width": (0, import_runtime19.maybeCssVar)(__maybeInc5(`calc(${columnSizes.join(" + ")})`))
|
|
7427
7458
|
}]
|
|
7428
7459
|
}
|
|
7429
7460
|
}), ...as === "table" ? {
|
|
@@ -8232,7 +8263,7 @@ function isZonedDateTime(value) {
|
|
|
8232
8263
|
var import_use_debounce2 = require("use-debounce");
|
|
8233
8264
|
var import_runtime21 = require("@homebound/truss/runtime");
|
|
8234
8265
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
8235
|
-
var
|
|
8266
|
+
var __maybeInc6 = (inc) => {
|
|
8236
8267
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
8237
8268
|
};
|
|
8238
8269
|
var __typography2 = {
|
|
@@ -8456,12 +8487,12 @@ function RowImpl(props) {
|
|
|
8456
8487
|
},
|
|
8457
8488
|
...maybeSticky === "left" ? {
|
|
8458
8489
|
left: ["left_var", {
|
|
8459
|
-
"--left": (0, import_runtime21.maybeCssVar)(
|
|
8490
|
+
"--left": (0, import_runtime21.maybeCssVar)(__maybeInc6(columnIndex === 0 ? `var(${beamSideNavLayoutWidthVar}, 0px)` : `calc(var(${beamSideNavLayoutWidthVar}, 0px) + (${columnSizes.slice(0, columnIndex).join(" + ")}))`))
|
|
8460
8491
|
}]
|
|
8461
8492
|
} : {},
|
|
8462
8493
|
...maybeSticky === "right" ? {
|
|
8463
8494
|
right: ["right_var", {
|
|
8464
|
-
"--right": (0, import_runtime21.maybeCssVar)(
|
|
8495
|
+
"--right": (0, import_runtime21.maybeCssVar)(__maybeInc6(columnIndex + 1 === columnSizes.length ? 0 : `calc(${columnSizes.slice(columnIndex + 1 - columnSizes.length).join(" + ")})`))
|
|
8465
8496
|
}]
|
|
8466
8497
|
} : {}
|
|
8467
8498
|
} : {};
|
|
@@ -8551,7 +8582,7 @@ function RowImpl(props) {
|
|
|
8551
8582
|
// 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.
|
|
8552
8583
|
...{
|
|
8553
8584
|
width: ["w_var", {
|
|
8554
|
-
"--width": (0, import_runtime21.maybeCssVar)(
|
|
8585
|
+
"--width": (0, import_runtime21.maybeCssVar)(__maybeInc6(`calc(${columnSizes.slice(columnIndex, columnIndex + currentColspan).join(" + ")}${applyFirstContentColumnStyles && levelIndent ? ` - ${levelIndent}px` : ""})`))
|
|
8555
8586
|
}]
|
|
8556
8587
|
}
|
|
8557
8588
|
};
|
|
@@ -8648,7 +8679,7 @@ function getFieldWidth(fullWidth) {
|
|
|
8648
8679
|
// src/inputs/TextFieldBase.tsx
|
|
8649
8680
|
var import_runtime23 = require("@homebound/truss/runtime");
|
|
8650
8681
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
8651
|
-
var
|
|
8682
|
+
var __maybeInc7 = (inc) => {
|
|
8652
8683
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
8653
8684
|
};
|
|
8654
8685
|
var __typography3 = {
|
|
@@ -8822,7 +8853,7 @@ function TextFieldBase(props) {
|
|
|
8822
8853
|
} : {},
|
|
8823
8854
|
...labelStyle === "left" ? {
|
|
8824
8855
|
width: ["w_var", {
|
|
8825
|
-
"--width": (0, import_runtime23.maybeCssVar)(
|
|
8856
|
+
"--width": (0, import_runtime23.maybeCssVar)(__maybeInc7(labelLeftFieldWidth))
|
|
8826
8857
|
}]
|
|
8827
8858
|
} : {}
|
|
8828
8859
|
},
|
|
@@ -8898,7 +8929,7 @@ function TextFieldBase(props) {
|
|
|
8898
8929
|
} : {},
|
|
8899
8930
|
...labelStyle === "left" ? {
|
|
8900
8931
|
width: ["w_var", {
|
|
8901
|
-
"--width": (0, import_runtime23.maybeCssVar)(
|
|
8932
|
+
"--width": (0, import_runtime23.maybeCssVar)(__maybeInc7(labelLeftFieldWidth))
|
|
8902
8933
|
}]
|
|
8903
8934
|
} : {}
|
|
8904
8935
|
},
|
|
@@ -14013,7 +14044,7 @@ var import_react61 = require("react");
|
|
|
14013
14044
|
var import_react_aria35 = require("react-aria");
|
|
14014
14045
|
var import_runtime49 = require("@homebound/truss/runtime");
|
|
14015
14046
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
14016
|
-
var
|
|
14047
|
+
var __maybeInc8 = (inc) => {
|
|
14017
14048
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
14018
14049
|
};
|
|
14019
14050
|
function Switch(props) {
|
|
@@ -14107,7 +14138,7 @@ function Switch(props) {
|
|
|
14107
14138
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { ...(0, import_runtime49.trussProps)({
|
|
14108
14139
|
...labelStyle === "left" ? {
|
|
14109
14140
|
width: ["w_var", {
|
|
14110
|
-
"--width": (0, import_runtime49.maybeCssVar)(
|
|
14141
|
+
"--width": (0, import_runtime49.maybeCssVar)(__maybeInc8(labelLeftFieldWidth))
|
|
14111
14142
|
}]
|
|
14112
14143
|
} : {}
|
|
14113
14144
|
}), children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { "aria-hidden": "true", ...(0, import_runtime49.trussProps)({
|
|
@@ -14188,7 +14219,7 @@ function switchCircleDefaultStyles(isCompact) {
|
|
|
14188
14219
|
function switchCircleSelectedStyles(isCompact) {
|
|
14189
14220
|
return {
|
|
14190
14221
|
left: ["left_var", {
|
|
14191
|
-
"--left": (0, import_runtime49.maybeCssVar)(
|
|
14222
|
+
"--left": (0, import_runtime49.maybeCssVar)(__maybeInc8(`calc(100% - ${circleDiameter(isCompact)}px - 2px)`))
|
|
14192
14223
|
}]
|
|
14193
14224
|
};
|
|
14194
14225
|
}
|
|
@@ -14441,7 +14472,7 @@ var import_react_aria39 = require("react-aria");
|
|
|
14441
14472
|
var import_react_stately15 = require("react-stately");
|
|
14442
14473
|
var import_runtime51 = require("@homebound/truss/runtime");
|
|
14443
14474
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
14444
|
-
var
|
|
14475
|
+
var __maybeInc9 = (inc) => {
|
|
14445
14476
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
14446
14477
|
};
|
|
14447
14478
|
function ToggleChipGroup(props) {
|
|
@@ -14489,7 +14520,7 @@ function ToggleChipGroup(props) {
|
|
|
14489
14520
|
flexWrap: "flexWrap_wrap",
|
|
14490
14521
|
...labelStyle === "left" ? {
|
|
14491
14522
|
width: ["w_var", {
|
|
14492
|
-
"--width": (0, import_runtime51.maybeCssVar)(
|
|
14523
|
+
"--width": (0, import_runtime51.maybeCssVar)(__maybeInc9(labelLeftFieldWidth))
|
|
14493
14524
|
}]
|
|
14494
14525
|
} : {}
|
|
14495
14526
|
}), children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(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)) })
|
|
@@ -14682,16 +14713,60 @@ function nonKindDefaults() {
|
|
|
14682
14713
|
function parseWidthToPx(widthStr, tableWidth) {
|
|
14683
14714
|
if (!widthStr) return null;
|
|
14684
14715
|
if (widthStr.endsWith("px")) {
|
|
14685
|
-
const parsed =
|
|
14716
|
+
const parsed = parseFloat(widthStr.replace("px", ""));
|
|
14686
14717
|
return isNaN(parsed) ? null : parsed;
|
|
14687
14718
|
}
|
|
14688
|
-
if (widthStr.endsWith("%") && tableWidth) {
|
|
14719
|
+
if (widthStr.endsWith("%") && tableWidth !== void 0) {
|
|
14689
14720
|
const percent = parseFloat(widthStr.replace("%", ""));
|
|
14690
14721
|
if (isNaN(percent)) return null;
|
|
14691
14722
|
return Math.round(percent / 100 * tableWidth);
|
|
14692
14723
|
}
|
|
14693
14724
|
return null;
|
|
14694
14725
|
}
|
|
14726
|
+
function sumColumnSizesPx(columnSizes, tableWidth) {
|
|
14727
|
+
if (tableWidth === void 0) return null;
|
|
14728
|
+
let sum = 0;
|
|
14729
|
+
for (const size of columnSizes) {
|
|
14730
|
+
const px2 = parseWidthToPx(size, tableWidth);
|
|
14731
|
+
if (px2 === null) return null;
|
|
14732
|
+
sum += px2;
|
|
14733
|
+
}
|
|
14734
|
+
return sum;
|
|
14735
|
+
}
|
|
14736
|
+
function sumColumnSizeParts(columnSizes) {
|
|
14737
|
+
let pxSum = 0;
|
|
14738
|
+
let percentSum = 0;
|
|
14739
|
+
let hasCalc = false;
|
|
14740
|
+
for (const size of columnSizes) {
|
|
14741
|
+
if (size.endsWith("px")) {
|
|
14742
|
+
pxSum += parseFloat(size.replace("px", ""));
|
|
14743
|
+
} else if (size.endsWith("%")) {
|
|
14744
|
+
percentSum += parseFloat(size.replace("%", ""));
|
|
14745
|
+
} else {
|
|
14746
|
+
hasCalc = true;
|
|
14747
|
+
}
|
|
14748
|
+
}
|
|
14749
|
+
return {
|
|
14750
|
+
pxSum,
|
|
14751
|
+
percentSum,
|
|
14752
|
+
hasCalc
|
|
14753
|
+
};
|
|
14754
|
+
}
|
|
14755
|
+
function resolveTableContentWidth(tableWidth, columnSizes, minWidthPx = 0) {
|
|
14756
|
+
if (tableWidth === void 0) return void 0;
|
|
14757
|
+
const {
|
|
14758
|
+
pxSum,
|
|
14759
|
+
percentSum,
|
|
14760
|
+
hasCalc
|
|
14761
|
+
} = sumColumnSizeParts(columnSizes);
|
|
14762
|
+
if (!hasCalc && percentSum > 0 && percentSum < 100) {
|
|
14763
|
+
const selfConsistent = pxSum / (1 - percentSum / 100);
|
|
14764
|
+
return Math.max(tableWidth, minWidthPx, Math.ceil(selfConsistent));
|
|
14765
|
+
}
|
|
14766
|
+
const sum = sumColumnSizesPx(columnSizes, tableWidth);
|
|
14767
|
+
if (sum === null) return void 0;
|
|
14768
|
+
return Math.max(tableWidth, sum, minWidthPx);
|
|
14769
|
+
}
|
|
14695
14770
|
function calcColumnSizes(columns, tableWidth, tableMinWidthPx = 0, expandedColumnIds, resizedWidths) {
|
|
14696
14771
|
const {
|
|
14697
14772
|
claimedPercentages,
|
|
@@ -14790,6 +14865,29 @@ function calcColumnSizes(columns, tableWidth, tableMinWidthPx = 0, expandedColum
|
|
|
14790
14865
|
});
|
|
14791
14866
|
return sizes2;
|
|
14792
14867
|
}
|
|
14868
|
+
function calcColumnLayout(columns, probeWidth, tableMinWidthPx = 0, expandedColumnIds, resizedWidths, inDocumentScrollLayout) {
|
|
14869
|
+
if (probeWidth === void 0) {
|
|
14870
|
+
return {
|
|
14871
|
+
columnSizes: calcColumnSizes(columns, void 0, tableMinWidthPx, expandedColumnIds, resizedWidths),
|
|
14872
|
+
contentWidth: void 0
|
|
14873
|
+
};
|
|
14874
|
+
}
|
|
14875
|
+
if (!inDocumentScrollLayout) {
|
|
14876
|
+
return {
|
|
14877
|
+
columnSizes: calcColumnSizes(columns, probeWidth, tableMinWidthPx, expandedColumnIds, resizedWidths),
|
|
14878
|
+
contentWidth: probeWidth
|
|
14879
|
+
};
|
|
14880
|
+
}
|
|
14881
|
+
let columnSizes = calcColumnSizes(columns, probeWidth, tableMinWidthPx, expandedColumnIds, resizedWidths);
|
|
14882
|
+
const contentWidth = resolveTableContentWidth(probeWidth, columnSizes, tableMinWidthPx) ?? probeWidth;
|
|
14883
|
+
if (contentWidth > probeWidth + 1) {
|
|
14884
|
+
columnSizes = calcColumnSizes(columns, contentWidth, tableMinWidthPx, expandedColumnIds, resizedWidths);
|
|
14885
|
+
}
|
|
14886
|
+
return {
|
|
14887
|
+
columnSizes,
|
|
14888
|
+
contentWidth
|
|
14889
|
+
};
|
|
14890
|
+
}
|
|
14793
14891
|
function assignDefaultColumnIds(columns) {
|
|
14794
14892
|
return columns.map((c, idx) => {
|
|
14795
14893
|
const {
|
|
@@ -15754,22 +15852,32 @@ function useColumnResizing(storageKey) {
|
|
|
15754
15852
|
|
|
15755
15853
|
// src/components/Table/hooks/useSetupColumnSizes.ts
|
|
15756
15854
|
var import_use_debounce5 = require("use-debounce");
|
|
15757
|
-
function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visibleColumnsStorageKey, disableColumnResizing) {
|
|
15855
|
+
function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visibleColumnsStorageKey, disableColumnResizing, inDocumentScrollLayout) {
|
|
15758
15856
|
const { resizedWidths, setResizedWidth, setResizedWidths, resetColumnWidths } = useColumnResizing(
|
|
15759
15857
|
disableColumnResizing ? void 0 : visibleColumnsStorageKey
|
|
15760
15858
|
);
|
|
15761
15859
|
const calculateImmediately = (0, import_react72.useRef)(true);
|
|
15762
15860
|
const [tableWidth, setTableWidth] = (0, import_react72.useState)();
|
|
15763
|
-
const
|
|
15861
|
+
const [contentWidth, setContentWidth] = (0, import_react72.useState)();
|
|
15764
15862
|
const [columnSizes, setColumnSizes] = (0, import_react72.useState)(
|
|
15765
|
-
|
|
15863
|
+
() => calcColumnLayout(columns, void 0, style.minWidthPx, expandedColumnIds, resizedWidths, inDocumentScrollLayout).columnSizes
|
|
15766
15864
|
);
|
|
15767
|
-
const
|
|
15768
|
-
|
|
15769
|
-
|
|
15770
|
-
|
|
15865
|
+
const prevTableWidthRef = (0, import_react72.useRef)(tableWidth);
|
|
15866
|
+
const applyColumnLayout = (0, import_react72.useCallback)(
|
|
15867
|
+
(probeWidth) => {
|
|
15868
|
+
const layout = calcColumnLayout(
|
|
15869
|
+
columns,
|
|
15870
|
+
probeWidth,
|
|
15871
|
+
style.minWidthPx,
|
|
15872
|
+
expandedColumnIds,
|
|
15873
|
+
resizedWidths,
|
|
15874
|
+
inDocumentScrollLayout
|
|
15875
|
+
);
|
|
15876
|
+
setTableWidth(probeWidth);
|
|
15877
|
+
setContentWidth(layout.contentWidth);
|
|
15878
|
+
setColumnSizes(layout.columnSizes);
|
|
15771
15879
|
},
|
|
15772
|
-
[
|
|
15880
|
+
[columns, style.minWidthPx, expandedColumnIds, resizedWidths, inDocumentScrollLayout]
|
|
15773
15881
|
);
|
|
15774
15882
|
(0, import_react72.useEffect)(() => {
|
|
15775
15883
|
if (!prevTableWidthRef.current) {
|
|
@@ -15798,32 +15906,40 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
|
|
|
15798
15906
|
() => {
|
|
15799
15907
|
if (!calculateImmediately.current) {
|
|
15800
15908
|
const width2 = resizeRef.current?.clientWidth;
|
|
15801
|
-
width2 &&
|
|
15909
|
+
width2 && applyColumnLayout(width2);
|
|
15802
15910
|
}
|
|
15803
15911
|
},
|
|
15804
15912
|
// 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
|
|
15805
15913
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15806
|
-
[columns, resizedWidths,
|
|
15914
|
+
[columns, resizedWidths, applyColumnLayout]
|
|
15807
15915
|
);
|
|
15808
|
-
const
|
|
15916
|
+
const applyColumnLayoutDebounced = (0, import_use_debounce5.useDebouncedCallback)(applyColumnLayout, 100);
|
|
15809
15917
|
const onResize = (0, import_react72.useCallback)(
|
|
15810
15918
|
() => {
|
|
15811
15919
|
const target = resizeRef.current;
|
|
15812
15920
|
if (target && target.clientWidth !== tableWidth) {
|
|
15813
15921
|
if (calculateImmediately.current) {
|
|
15814
15922
|
calculateImmediately.current = false;
|
|
15815
|
-
|
|
15923
|
+
applyColumnLayout(target.clientWidth);
|
|
15816
15924
|
} else {
|
|
15817
|
-
|
|
15925
|
+
applyColumnLayoutDebounced(target.clientWidth);
|
|
15818
15926
|
}
|
|
15819
15927
|
}
|
|
15820
15928
|
},
|
|
15821
15929
|
// 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
|
|
15822
15930
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15823
|
-
[tableWidth,
|
|
15931
|
+
[tableWidth, applyColumnLayout, applyColumnLayoutDebounced]
|
|
15824
15932
|
);
|
|
15825
15933
|
(0, import_utils67.useResizeObserver)({ ref: resizeRef, onResize });
|
|
15826
|
-
return {
|
|
15934
|
+
return {
|
|
15935
|
+
columnSizes,
|
|
15936
|
+
tableWidth,
|
|
15937
|
+
contentWidth,
|
|
15938
|
+
resizedWidths,
|
|
15939
|
+
setResizedWidth,
|
|
15940
|
+
setResizedWidths,
|
|
15941
|
+
resetColumnWidths
|
|
15942
|
+
};
|
|
15827
15943
|
}
|
|
15828
15944
|
|
|
15829
15945
|
// src/hooks/useRenderCount.ts
|
|
@@ -15897,7 +16013,7 @@ function DocumentScrollLayoutViewportRoot({
|
|
|
15897
16013
|
// src/components/Table/GridTable.tsx
|
|
15898
16014
|
var import_runtime53 = require("@homebound/truss/runtime");
|
|
15899
16015
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
15900
|
-
var
|
|
16016
|
+
var __maybeInc10 = (inc) => {
|
|
15901
16017
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
15902
16018
|
};
|
|
15903
16019
|
var runningInJest = false;
|
|
@@ -15972,6 +16088,7 @@ function GridTable(props) {
|
|
|
15972
16088
|
const {
|
|
15973
16089
|
tableState
|
|
15974
16090
|
} = api;
|
|
16091
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
15975
16092
|
tableState.onRowSelect = onRowSelect;
|
|
15976
16093
|
(0, import_react75.useEffect)(() => {
|
|
15977
16094
|
(0, import_mobx10.runInAction)(() => {
|
|
@@ -15994,11 +16111,12 @@ function GridTable(props) {
|
|
|
15994
16111
|
const {
|
|
15995
16112
|
columnSizes,
|
|
15996
16113
|
tableWidth,
|
|
16114
|
+
contentWidth,
|
|
15997
16115
|
resizedWidths,
|
|
15998
16116
|
setResizedWidth,
|
|
15999
16117
|
setResizedWidths,
|
|
16000
16118
|
resetColumnWidths
|
|
16001
|
-
} = useSetupColumnSizes(style, columns, resizeTarget ?? resizeRef, expandedColumnIds, visibleColumnsStorageKey, disableColumnResizing);
|
|
16119
|
+
} = useSetupColumnSizes(style, columns, resizeTarget ?? resizeRef, expandedColumnIds, visibleColumnsStorageKey, disableColumnResizing, inDocumentScrollLayout);
|
|
16002
16120
|
(0, import_react75.useEffect)(() => {
|
|
16003
16121
|
api.resetColumnWidthsFn = !disableColumnResizing ? resetColumnWidths : void 0;
|
|
16004
16122
|
}, [api, resetColumnWidths, disableColumnResizing]);
|
|
@@ -16169,9 +16287,18 @@ function GridTable(props) {
|
|
|
16169
16287
|
tableState,
|
|
16170
16288
|
tableContainerRef
|
|
16171
16289
|
}), [tableState, tableContainerRef]);
|
|
16290
|
+
const tableStyle = (0, import_react75.useMemo)(() => {
|
|
16291
|
+
if (!inDocumentScrollLayout || contentWidth === void 0 || tableWidth === void 0) return style;
|
|
16292
|
+
const minWidthPx = Math.max(style.minWidthPx ?? 0, contentWidth);
|
|
16293
|
+
if (minWidthPx === style.minWidthPx) return style;
|
|
16294
|
+
return {
|
|
16295
|
+
...style,
|
|
16296
|
+
minWidthPx
|
|
16297
|
+
};
|
|
16298
|
+
}, [contentWidth, inDocumentScrollLayout, style, tableWidth]);
|
|
16172
16299
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TableStateContext.Provider, { value: rowStateContext, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(PresentationProvider, { fieldProps, wrap: style?.presentationSettings?.wrap, children: [
|
|
16173
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { ref: resizeRef, ...(0, import_runtime53.trussProps)(getTableRefWidthStyles(as === "virtual")) }),
|
|
16174
|
-
renders[_as](
|
|
16300
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { ref: resizeRef, ...(0, import_runtime53.trussProps)(getTableRefWidthStyles(as === "virtual", inDocumentScrollLayout)) }),
|
|
16301
|
+
renders[_as](tableStyle, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, virtuosoRangeRef, tableHeadRows, stickyOffset, infiniteScroll, tableContainerRef, persistScrollPosition)
|
|
16175
16302
|
] }) });
|
|
16176
16303
|
}
|
|
16177
16304
|
var renders = {
|
|
@@ -16199,8 +16326,9 @@ function renderDiv(style, id, columns, visibleDataRows, keptSelectedRows, firstR
|
|
|
16199
16326
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { ...(0, import_runtime53.trussProps)({
|
|
16200
16327
|
...stickyHeader ? {
|
|
16201
16328
|
position: "sticky",
|
|
16329
|
+
transition: "transitionTop",
|
|
16202
16330
|
top: ["top_var", {
|
|
16203
|
-
"--top": (0, import_runtime53.maybeCssVar)(
|
|
16331
|
+
"--top": (0, import_runtime53.maybeCssVar)(__maybeInc10(stickyTableHeaderOffset(stickyOffset)))
|
|
16204
16332
|
}],
|
|
16205
16333
|
zIndex: ["z_var", {
|
|
16206
16334
|
"--zIndex": (0, import_runtime53.maybeCssVar)(zIndices.tableStickyHeader)
|
|
@@ -16239,8 +16367,9 @@ function renderTable(style, id, columns, visibleDataRows, keptSelectedRows, firs
|
|
|
16239
16367
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("thead", { ...(0, import_runtime53.trussProps)({
|
|
16240
16368
|
...stickyHeader ? {
|
|
16241
16369
|
position: "sticky",
|
|
16370
|
+
transition: "transitionTop",
|
|
16242
16371
|
top: ["top_var", {
|
|
16243
|
-
"--top": (0, import_runtime53.maybeCssVar)(
|
|
16372
|
+
"--top": (0, import_runtime53.maybeCssVar)(__maybeInc10(stickyTableHeaderOffset(stickyOffset)))
|
|
16244
16373
|
}],
|
|
16245
16374
|
zIndex: ["z_var", {
|
|
16246
16375
|
"--zIndex": (0, import_runtime53.maybeCssVar)(zIndices.tableStickyHeader)
|
|
@@ -16291,11 +16420,16 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
16291
16420
|
components: {
|
|
16292
16421
|
// zIndex keeps the pinned head above sticky columns; `top` matches the offsets used by
|
|
16293
16422
|
// the div/table render paths so virtualized tables pin below the global nav + page header.
|
|
16294
|
-
TopItemList: import_react75.default.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { ...props, ref,
|
|
16423
|
+
TopItemList: import_react75.default.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { ...props, ref, ...(0, import_runtime53.mergeProps)(void 0, {
|
|
16295
16424
|
...props.style,
|
|
16425
|
+
...style.minWidthPx !== void 0 ? {
|
|
16426
|
+
minWidth: style.minWidthPx
|
|
16427
|
+
} : {},
|
|
16296
16428
|
zIndex: zIndices.tableStickyHeader,
|
|
16297
|
-
top:
|
|
16298
|
-
}
|
|
16429
|
+
top: stickyTableHeaderOffset(stickyOffset)
|
|
16430
|
+
}, {
|
|
16431
|
+
transition: "transitionTop"
|
|
16432
|
+
}) })),
|
|
16299
16433
|
List: VirtualRoot(style, columns, id, xss),
|
|
16300
16434
|
Footer: () => {
|
|
16301
16435
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { ...(0, import_runtime53.trussProps)({
|
|
@@ -16322,7 +16456,7 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
16322
16456
|
return (
|
|
16323
16457
|
// Ensure the fallback message is the same width as the table
|
|
16324
16458
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { ...(0, import_runtime53.trussProps)({
|
|
16325
|
-
...getTableRefWidthStyles(true),
|
|
16459
|
+
...getTableRefWidthStyles(true, inDocumentScrollLayout),
|
|
16326
16460
|
...keptSelectedRows.length === 0 && style.firstBodyRowCss,
|
|
16327
16461
|
...visibleDataRows.length === 0 && style.lastRowCss
|
|
16328
16462
|
}), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { ...(0, import_runtime53.trussProps)({
|
|
@@ -16481,7 +16615,7 @@ var import_react76 = require("react");
|
|
|
16481
16615
|
var import_react_aria40 = require("react-aria");
|
|
16482
16616
|
var import_runtime56 = require("@homebound/truss/runtime");
|
|
16483
16617
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
16484
|
-
var
|
|
16618
|
+
var __maybeInc11 = (inc) => {
|
|
16485
16619
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
16486
16620
|
};
|
|
16487
16621
|
function Accordion(props) {
|
|
@@ -16628,7 +16762,7 @@ function Accordion(props) {
|
|
|
16628
16762
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { ...tid.details, id, "aria-hidden": !expanded, ...(0, import_runtime56.trussProps)({
|
|
16629
16763
|
overflow: "oh",
|
|
16630
16764
|
height: ["h_var", {
|
|
16631
|
-
"--height": (0, import_runtime56.maybeCssVar)(
|
|
16765
|
+
"--height": (0, import_runtime56.maybeCssVar)(__maybeInc11(contentHeight))
|
|
16632
16766
|
}],
|
|
16633
16767
|
transition: "transition_height_250ms_ease_in_out"
|
|
16634
16768
|
}), children: expanded && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { ...(0, import_runtime56.trussProps)({
|
|
@@ -18212,7 +18346,7 @@ function BoundTreeSelectField(props) {
|
|
|
18212
18346
|
var import_react86 = require("react");
|
|
18213
18347
|
var import_runtime63 = require("@homebound/truss/runtime");
|
|
18214
18348
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
18215
|
-
var
|
|
18349
|
+
var __maybeInc12 = (inc) => {
|
|
18216
18350
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
18217
18351
|
};
|
|
18218
18352
|
function FormLines(props) {
|
|
@@ -18250,13 +18384,13 @@ function FormLines(props) {
|
|
|
18250
18384
|
display: "df",
|
|
18251
18385
|
flexDirection: "fdc",
|
|
18252
18386
|
gap: ["gap_var", {
|
|
18253
|
-
"--gap": (0, import_runtime63.maybeCssVar)(
|
|
18387
|
+
"--gap": (0, import_runtime63.maybeCssVar)(__maybeInc12(gap))
|
|
18254
18388
|
}],
|
|
18255
18389
|
paddingBottom: ["pb_var", {
|
|
18256
|
-
"--paddingBottom": (0, import_runtime63.maybeCssVar)(
|
|
18390
|
+
"--paddingBottom": (0, import_runtime63.maybeCssVar)(__maybeInc12(gap))
|
|
18257
18391
|
}],
|
|
18258
18392
|
width: ["w_var", {
|
|
18259
|
-
"--width": (0, import_runtime63.maybeCssVar)(
|
|
18393
|
+
"--width": (0, import_runtime63.maybeCssVar)(__maybeInc12(sizes[width2]))
|
|
18260
18394
|
}]
|
|
18261
18395
|
}), children: import_react86.Children.map(children, (child) => {
|
|
18262
18396
|
if (child && typeof child === "object" && "type" in child && child.type.isFormHeading) {
|
|
@@ -19136,7 +19270,7 @@ function useActiveSection(sectionsWithRefs) {
|
|
|
19136
19270
|
// src/components/Layout/FullBleed.tsx
|
|
19137
19271
|
var import_runtime71 = require("@homebound/truss/runtime");
|
|
19138
19272
|
var import_react94 = require("react");
|
|
19139
|
-
var
|
|
19273
|
+
var __maybeInc13 = (inc) => {
|
|
19140
19274
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
19141
19275
|
};
|
|
19142
19276
|
function FullBleed({
|
|
@@ -19167,17 +19301,17 @@ function FullBleed({
|
|
|
19167
19301
|
// inverts that padding with negative margins before re-applying it to the child.
|
|
19168
19302
|
{
|
|
19169
19303
|
marginLeft: ["ml_var", {
|
|
19170
|
-
"--marginLeft": (0, import_runtime71.maybeCssVar)(
|
|
19304
|
+
"--marginLeft": (0, import_runtime71.maybeCssVar)(__maybeInc13(invertSpacing(paddingLeft)))
|
|
19171
19305
|
}],
|
|
19172
19306
|
marginRight: ["mr_var", {
|
|
19173
|
-
"--marginRight": (0, import_runtime71.maybeCssVar)(
|
|
19307
|
+
"--marginRight": (0, import_runtime71.maybeCssVar)(__maybeInc13(invertSpacing(paddingRight)))
|
|
19174
19308
|
}],
|
|
19175
19309
|
...!omitPadding ? {
|
|
19176
19310
|
paddingLeft: ["pl_var", {
|
|
19177
|
-
"--paddingLeft": (0, import_runtime71.maybeCssVar)(
|
|
19311
|
+
"--paddingLeft": (0, import_runtime71.maybeCssVar)(__maybeInc13(paddingLeft))
|
|
19178
19312
|
}],
|
|
19179
19313
|
paddingRight: ["pr_var", {
|
|
19180
|
-
"--paddingRight": (0, import_runtime71.maybeCssVar)(
|
|
19314
|
+
"--paddingRight": (0, import_runtime71.maybeCssVar)(__maybeInc13(paddingRight))
|
|
19181
19315
|
}]
|
|
19182
19316
|
} : {}
|
|
19183
19317
|
}
|
|
@@ -19191,6 +19325,7 @@ function invertSpacing(value) {
|
|
|
19191
19325
|
}
|
|
19192
19326
|
|
|
19193
19327
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
19328
|
+
var import_utils117 = require("@react-aria/utils");
|
|
19194
19329
|
var import_react102 = __toESM(require("react"), 1);
|
|
19195
19330
|
|
|
19196
19331
|
// src/components/ButtonMenu.tsx
|
|
@@ -20221,6 +20356,9 @@ function LoadingTable(props) {
|
|
|
20221
20356
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
20222
20357
|
var import_runtime78 = require("@homebound/truss/runtime");
|
|
20223
20358
|
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
20359
|
+
var __maybeInc14 = (inc) => {
|
|
20360
|
+
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
20361
|
+
};
|
|
20224
20362
|
function GridTableLayoutComponent(props) {
|
|
20225
20363
|
const {
|
|
20226
20364
|
pageTitle,
|
|
@@ -20246,8 +20384,12 @@ function GridTableLayoutComponent(props) {
|
|
|
20246
20384
|
const api = (0, import_react102.useMemo)(() => tableProps.api ?? new GridTableApiImpl(), [tableProps.api]);
|
|
20247
20385
|
const [view, setView] = (0, import_react102.useState)(defaultView);
|
|
20248
20386
|
const clientSearch = layoutState?.search === "client" ? layoutState.searchString : void 0;
|
|
20249
|
-
const showTableActions = layoutState?.filterDefs || layoutState?.search || hasHideableColumns ||
|
|
20387
|
+
const showTableActions = !!(layoutState?.filterDefs || layoutState?.search || hasHideableColumns || withCardView);
|
|
20250
20388
|
const isVirtualized = tableProps.as === "virtual";
|
|
20389
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
20390
|
+
const tableActionsRef = (0, import_react102.useRef)(null);
|
|
20391
|
+
const tableWrapperRef = (0, import_react102.useRef)(null);
|
|
20392
|
+
useSetTableActionsHeight(tableWrapperRef, tableActionsRef, inDocumentScrollLayout && showTableActions);
|
|
20251
20393
|
const visibleColumnIds = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
20252
20394
|
(0, import_react102.useEffect)(() => {
|
|
20253
20395
|
if (layoutState?.setVisibleColumnIds) {
|
|
@@ -20255,27 +20397,58 @@ function GridTableLayoutComponent(props) {
|
|
|
20255
20397
|
}
|
|
20256
20398
|
}, [visibleColumnIds, layoutState]);
|
|
20257
20399
|
const visibleColumnsStorageKey = layoutState?.persistedColumnsStorageKey;
|
|
20400
|
+
const tableActionsEl = /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(TableActions, { right: (hasHideableColumns || withCardView) && /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "df gap1", children: [
|
|
20401
|
+
hasHideableColumns && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(EditColumnsButton, { columns, api, tooltip: "Display columns", trigger: {
|
|
20402
|
+
icon: "kanban",
|
|
20403
|
+
size: "md",
|
|
20404
|
+
label: "",
|
|
20405
|
+
variant: "secondaryBlack"
|
|
20406
|
+
}, ...tid.editColumnsButton }),
|
|
20407
|
+
withCardView && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(ViewToggleButton, { view, onChange: setView })
|
|
20408
|
+
] }), xss: {
|
|
20409
|
+
paddingTop: "pt3",
|
|
20410
|
+
...inDocumentScrollLayout ? {
|
|
20411
|
+
paddingLeft: "pl3",
|
|
20412
|
+
paddingRight: "pr3"
|
|
20413
|
+
} : {}
|
|
20414
|
+
}, children: layoutState && (layoutState.filterDefs || layoutState.search) && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(_FilterDropdownMenu, { filterDefs: layoutState.filterDefs, filter: layoutState.filter, onChange: layoutState.setFilter, groupBy: layoutState.groupBy, searchProps: layoutState.search ? {
|
|
20415
|
+
onSearch: layoutState.setSearchString
|
|
20416
|
+
} : void 0 }) });
|
|
20417
|
+
const tableBody = /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_jsx_runtime148.Fragment, { children: [
|
|
20418
|
+
view === "card" && withCardView ? withCardView : isGridTableProps(tableProps) ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(GridTable, { ...tableProps, api, filter: clientSearch, style: {
|
|
20419
|
+
allWhite: true
|
|
20420
|
+
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey }) : /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(QueryTable, { ...tableProps, api, filter: clientSearch, style: {
|
|
20421
|
+
allWhite: true
|
|
20422
|
+
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey }),
|
|
20423
|
+
layoutState && totalCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Pagination, { page: [layoutState.page, layoutState._pagination.setPage], totalCount, pageSizes: layoutState._pagination.pageSizes, ...tid.pagination })
|
|
20424
|
+
] });
|
|
20425
|
+
const tableScrollContent = /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_jsx_runtime148.Fragment, { children: [
|
|
20426
|
+
showTableActions && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { ref: tableActionsRef, ...(0, import_runtime78.trussProps)({
|
|
20427
|
+
...inDocumentScrollLayout ? {
|
|
20428
|
+
transition: "transitionTop",
|
|
20429
|
+
position: "sticky",
|
|
20430
|
+
top: ["top_var", {
|
|
20431
|
+
"--top": (0, import_runtime78.maybeCssVar)(__maybeInc14(stickyNavAndHeaderOffset()))
|
|
20432
|
+
}],
|
|
20433
|
+
left: ["left_var", {
|
|
20434
|
+
"--left": (0, import_runtime78.maybeCssVar)(__maybeInc14(documentScrollChromeLeft()))
|
|
20435
|
+
}],
|
|
20436
|
+
width: ["w_var", {
|
|
20437
|
+
"--width": (0, import_runtime78.maybeCssVar)(__maybeInc14(documentScrollChromeWidth()))
|
|
20438
|
+
}],
|
|
20439
|
+
zIndex: ["z_var", {
|
|
20440
|
+
"--zIndex": (0, import_runtime78.maybeCssVar)(zIndices.tableActions)
|
|
20441
|
+
}],
|
|
20442
|
+
backgroundColor: ["bgColor_var", {
|
|
20443
|
+
"--backgroundColor": "var(--b-surface)"
|
|
20444
|
+
}]
|
|
20445
|
+
} : {}
|
|
20446
|
+
}), ...tid.stickyContent, children: tableActionsEl }),
|
|
20447
|
+
inDocumentScrollLayout ? tableBody : /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(ScrollableContent, { virtualized: isVirtualized, children: tableBody })
|
|
20448
|
+
] });
|
|
20258
20449
|
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_jsx_runtime148.Fragment, { children: [
|
|
20259
20450
|
pageTitle && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Header2, { pageTitle, breadCrumb, primaryAction, secondaryAction, tertiaryAction, actionMenu }),
|
|
20260
|
-
|
|
20261
|
-
hasHideableColumns && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(EditColumnsButton, { columns, api, tooltip: "Display columns", trigger: {
|
|
20262
|
-
icon: "kanban",
|
|
20263
|
-
size: "md",
|
|
20264
|
-
label: "",
|
|
20265
|
-
variant: "secondaryBlack"
|
|
20266
|
-
}, ...tid.editColumnsButton }),
|
|
20267
|
-
withCardView && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(ViewToggleButton, { view, onChange: setView })
|
|
20268
|
-
] }), children: layoutState && (layoutState.filterDefs || layoutState.search) && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(_FilterDropdownMenu, { filterDefs: layoutState.filterDefs, filter: layoutState.filter, onChange: layoutState.setFilter, groupBy: layoutState.groupBy, searchProps: layoutState.search ? {
|
|
20269
|
-
onSearch: layoutState.setSearchString
|
|
20270
|
-
} : void 0 }) }),
|
|
20271
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(ScrollableContent, { virtualized: isVirtualized, children: [
|
|
20272
|
-
view === "card" && withCardView ? withCardView : isGridTableProps(tableProps) ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(GridTable, { ...tableProps, api, filter: clientSearch, style: {
|
|
20273
|
-
allWhite: true
|
|
20274
|
-
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey }) : /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(QueryTable, { ...tableProps, api, filter: clientSearch, style: {
|
|
20275
|
-
allWhite: true
|
|
20276
|
-
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey }),
|
|
20277
|
-
layoutState && totalCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Pagination, { page: [layoutState.page, layoutState._pagination.setPage], totalCount, pageSizes: layoutState._pagination.pageSizes, ...tid.pagination })
|
|
20278
|
-
] })
|
|
20451
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { ref: tableWrapperRef, className: "display_contents", ...tid.tableWrapper, children: tableScrollContent })
|
|
20279
20452
|
] });
|
|
20280
20453
|
}
|
|
20281
20454
|
var GridTableLayout = import_react102.default.memo(GridTableLayoutComponent);
|
|
@@ -20345,6 +20518,33 @@ function useGridTableLayoutState({
|
|
|
20345
20518
|
}
|
|
20346
20519
|
};
|
|
20347
20520
|
}
|
|
20521
|
+
function useSetTableActionsHeight(tableWrapperRef, tableActionsRef, enabled) {
|
|
20522
|
+
const syncHeightVar = (0, import_react102.useCallback)(() => {
|
|
20523
|
+
const tableWrapper = tableWrapperRef.current;
|
|
20524
|
+
if (!tableWrapper) return;
|
|
20525
|
+
if (!enabled) {
|
|
20526
|
+
tableWrapper.style.removeProperty(beamTableActionsHeightVar);
|
|
20527
|
+
return;
|
|
20528
|
+
}
|
|
20529
|
+
const height = tableActionsRef.current ? Math.round(tableActionsRef.current.getBoundingClientRect().height) : 0;
|
|
20530
|
+
if (height > 0) {
|
|
20531
|
+
tableWrapper.style.setProperty(beamTableActionsHeightVar, `${height}px`);
|
|
20532
|
+
} else {
|
|
20533
|
+
tableWrapper.style.removeProperty(beamTableActionsHeightVar);
|
|
20534
|
+
}
|
|
20535
|
+
}, [enabled, tableActionsRef, tableWrapperRef]);
|
|
20536
|
+
(0, import_utils117.useResizeObserver)({
|
|
20537
|
+
ref: tableActionsRef,
|
|
20538
|
+
onResize: enabled ? syncHeightVar : noop
|
|
20539
|
+
});
|
|
20540
|
+
(0, import_react102.useLayoutEffect)(() => {
|
|
20541
|
+
syncHeightVar();
|
|
20542
|
+
const tableWrapper = tableWrapperRef.current;
|
|
20543
|
+
return () => {
|
|
20544
|
+
tableWrapper?.style.removeProperty(beamTableActionsHeightVar);
|
|
20545
|
+
};
|
|
20546
|
+
}, [tableWrapperRef, syncHeightVar]);
|
|
20547
|
+
}
|
|
20348
20548
|
function Header2(props) {
|
|
20349
20549
|
const {
|
|
20350
20550
|
pageTitle,
|
|
@@ -20361,7 +20561,6 @@ function Header2(props) {
|
|
|
20361
20561
|
paddingBottom: "pb3",
|
|
20362
20562
|
paddingRight: "pr3",
|
|
20363
20563
|
paddingLeft: "pl3",
|
|
20364
|
-
marginBottom: "mb3",
|
|
20365
20564
|
minHeight: "mh_50px",
|
|
20366
20565
|
backgroundColor: "bgWhite",
|
|
20367
20566
|
display: "df",
|
|
@@ -20437,7 +20636,7 @@ var import_framer_motion3 = require("framer-motion");
|
|
|
20437
20636
|
var import_react104 = require("react");
|
|
20438
20637
|
var import_runtime79 = require("@homebound/truss/runtime");
|
|
20439
20638
|
var import_jsx_runtime151 = require("react/jsx-runtime");
|
|
20440
|
-
var
|
|
20639
|
+
var __maybeInc15 = (inc) => {
|
|
20441
20640
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
20442
20641
|
};
|
|
20443
20642
|
function RightPaneLayout(props) {
|
|
@@ -20458,7 +20657,7 @@ function RightPaneLayout(props) {
|
|
|
20458
20657
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { ...(0, import_runtime79.trussProps)({
|
|
20459
20658
|
...{
|
|
20460
20659
|
width: ["w_var", {
|
|
20461
|
-
"--width": (0, import_runtime79.maybeCssVar)(
|
|
20660
|
+
"--width": (0, import_runtime79.maybeCssVar)(__maybeInc15(`calc(100% - ${paneWidth + 24}px)`))
|
|
20462
20661
|
}],
|
|
20463
20662
|
transition: "transition_width_2s_linear",
|
|
20464
20663
|
height: "h100",
|
|
@@ -20474,7 +20673,7 @@ function RightPaneLayout(props) {
|
|
|
20474
20673
|
...{
|
|
20475
20674
|
...!!defaultPaneContent ? {
|
|
20476
20675
|
width: ["w_var", {
|
|
20477
|
-
"--width": (0, import_runtime79.maybeCssVar)(
|
|
20676
|
+
"--width": (0, import_runtime79.maybeCssVar)(__maybeInc15(`calc(100% - ${paneWidth + 24}px)`))
|
|
20478
20677
|
}],
|
|
20479
20678
|
marginRight: "mr3"
|
|
20480
20679
|
} : {}
|
|
@@ -20970,7 +21169,7 @@ var import_react110 = require("react");
|
|
|
20970
21169
|
var import_react_aria49 = require("react-aria");
|
|
20971
21170
|
|
|
20972
21171
|
// src/components/Tag.tsx
|
|
20973
|
-
var
|
|
21172
|
+
var import_utils124 = require("@react-aria/utils");
|
|
20974
21173
|
var import_react109 = require("react");
|
|
20975
21174
|
var import_runtime82 = require("@homebound/truss/runtime");
|
|
20976
21175
|
var import_jsx_runtime158 = require("react/jsx-runtime");
|
|
@@ -20986,7 +21185,7 @@ function Tag(props) {
|
|
|
20986
21185
|
const tid = useTestIds(otherProps);
|
|
20987
21186
|
const [showTooltip, setShowTooltip] = (0, import_react109.useState)(false);
|
|
20988
21187
|
const ref = (0, import_react109.useRef)(null);
|
|
20989
|
-
(0,
|
|
21188
|
+
(0, import_utils124.useResizeObserver)({
|
|
20990
21189
|
ref,
|
|
20991
21190
|
onResize: () => {
|
|
20992
21191
|
if (ref.current) {
|
|
@@ -21541,7 +21740,7 @@ function ResponsiveGridItem(props) {
|
|
|
21541
21740
|
// src/components/Grid/useResponsiveGrid.ts
|
|
21542
21741
|
var import_react116 = require("react");
|
|
21543
21742
|
var import_runtime89 = require("@homebound/truss/runtime");
|
|
21544
|
-
var
|
|
21743
|
+
var __maybeInc16 = (inc) => {
|
|
21545
21744
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
21546
21745
|
};
|
|
21547
21746
|
function useResponsiveGrid(props) {
|
|
@@ -21563,7 +21762,7 @@ function useResponsiveGrid(props) {
|
|
|
21563
21762
|
}],
|
|
21564
21763
|
containerType: "ctis",
|
|
21565
21764
|
gap: ["gap_var", {
|
|
21566
|
-
"--gap": (0, import_runtime89.maybeCssVar)(
|
|
21765
|
+
"--gap": (0, import_runtime89.maybeCssVar)(__maybeInc16(gridGap))
|
|
21567
21766
|
}]
|
|
21568
21767
|
};
|
|
21569
21768
|
}, [minColumnWidth, gap, columns]);
|
|
@@ -21688,7 +21887,7 @@ function HbSpinnerProvider({
|
|
|
21688
21887
|
// src/components/HomeboundLogo.tsx
|
|
21689
21888
|
var import_runtime90 = require("@homebound/truss/runtime");
|
|
21690
21889
|
var import_jsx_runtime166 = require("react/jsx-runtime");
|
|
21691
|
-
var
|
|
21890
|
+
var __maybeInc17 = (inc) => {
|
|
21692
21891
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
21693
21892
|
};
|
|
21694
21893
|
function HomeboundLogo(props) {
|
|
@@ -21702,16 +21901,16 @@ function HomeboundLogo(props) {
|
|
|
21702
21901
|
"--fill": (0, import_runtime90.maybeCssVar)(fill)
|
|
21703
21902
|
}],
|
|
21704
21903
|
width: ["w_var", {
|
|
21705
|
-
"--width": (0, import_runtime90.maybeCssVar)(
|
|
21904
|
+
"--width": (0, import_runtime90.maybeCssVar)(__maybeInc17(width2))
|
|
21706
21905
|
}],
|
|
21707
21906
|
height: ["h_var", {
|
|
21708
|
-
"--height": (0, import_runtime90.maybeCssVar)(
|
|
21907
|
+
"--height": (0, import_runtime90.maybeCssVar)(__maybeInc17(height))
|
|
21709
21908
|
}]
|
|
21710
21909
|
}), children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("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" }) });
|
|
21711
21910
|
}
|
|
21712
21911
|
|
|
21713
21912
|
// src/components/MaxLines.tsx
|
|
21714
|
-
var
|
|
21913
|
+
var import_utils132 = require("@react-aria/utils");
|
|
21715
21914
|
var import_react119 = require("react");
|
|
21716
21915
|
var import_runtime91 = require("@homebound/truss/runtime");
|
|
21717
21916
|
var import_jsx_runtime167 = require("react/jsx-runtime");
|
|
@@ -21722,7 +21921,7 @@ function MaxLines({
|
|
|
21722
21921
|
const elRef = (0, import_react119.useRef)(null);
|
|
21723
21922
|
const [hasMore, setHasMore] = (0, import_react119.useState)(false);
|
|
21724
21923
|
const [expanded, setExpanded] = (0, import_react119.useState)(false);
|
|
21725
|
-
(0,
|
|
21924
|
+
(0, import_utils132.useLayoutEffect)(() => {
|
|
21726
21925
|
if (!elRef.current) return;
|
|
21727
21926
|
setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
21728
21927
|
}, []);
|
|
@@ -21733,7 +21932,7 @@ function MaxLines({
|
|
|
21733
21932
|
if (!elRef.current) return;
|
|
21734
21933
|
!expanded && setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
21735
21934
|
}, [expanded]);
|
|
21736
|
-
(0,
|
|
21935
|
+
(0, import_utils132.useResizeObserver)({
|
|
21737
21936
|
ref: elRef,
|
|
21738
21937
|
onResize
|
|
21739
21938
|
});
|
|
@@ -21757,7 +21956,7 @@ function MaxLines({
|
|
|
21757
21956
|
var import_change_case8 = require("change-case");
|
|
21758
21957
|
|
|
21759
21958
|
// src/components/AppNav/AppNavGroup.tsx
|
|
21760
|
-
var
|
|
21959
|
+
var import_utils134 = require("@react-aria/utils");
|
|
21761
21960
|
var import_change_case7 = require("change-case");
|
|
21762
21961
|
var import_react122 = require("react");
|
|
21763
21962
|
|
|
@@ -21963,7 +22162,7 @@ function useAppNavGroupExpanded(linkGroup) {
|
|
|
21963
22162
|
// src/components/AppNav/AppNavGroup.tsx
|
|
21964
22163
|
var import_runtime93 = require("@homebound/truss/runtime");
|
|
21965
22164
|
var import_jsx_runtime169 = require("react/jsx-runtime");
|
|
21966
|
-
var
|
|
22165
|
+
var __maybeInc18 = (inc) => {
|
|
21967
22166
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
21968
22167
|
};
|
|
21969
22168
|
function AppNavGroupView(props) {
|
|
@@ -22000,7 +22199,7 @@ function AppNavGroupDisclosure(props) {
|
|
|
22000
22199
|
setContentHeight(`${contentEl.scrollHeight}px`);
|
|
22001
22200
|
}
|
|
22002
22201
|
}, [expanded, contentEl]);
|
|
22003
|
-
(0,
|
|
22202
|
+
(0, import_utils134.useResizeObserver)({
|
|
22004
22203
|
ref: contentRef,
|
|
22005
22204
|
onResize
|
|
22006
22205
|
});
|
|
@@ -22010,7 +22209,7 @@ function AppNavGroupDisclosure(props) {
|
|
|
22010
22209
|
overflow: "oh",
|
|
22011
22210
|
transition: "transitionHeight",
|
|
22012
22211
|
height: ["h_var", {
|
|
22013
|
-
"--height": (0, import_runtime93.maybeCssVar)(
|
|
22212
|
+
"--height": (0, import_runtime93.maybeCssVar)(__maybeInc18(contentHeight))
|
|
22014
22213
|
}]
|
|
22015
22214
|
}), ...tid.panel, children: /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("div", { ref: setContentEl, className: "df fdc pl2", children: /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(AppNavItems, { items: linkGroup.items, panelCollapsed: false, ...tid }) }) })
|
|
22016
22215
|
] });
|
|
@@ -22613,7 +22812,7 @@ function PageHeader2(props) {
|
|
|
22613
22812
|
}
|
|
22614
22813
|
|
|
22615
22814
|
// src/components/ScrollShadows.tsx
|
|
22616
|
-
var
|
|
22815
|
+
var import_utils142 = require("@react-aria/utils");
|
|
22617
22816
|
var import_react125 = require("react");
|
|
22618
22817
|
var import_runtime99 = require("@homebound/truss/runtime");
|
|
22619
22818
|
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
@@ -22702,7 +22901,7 @@ function ScrollShadows(props) {
|
|
|
22702
22901
|
setShowEndShadow(start + boxSize < end);
|
|
22703
22902
|
}, [horizontal]);
|
|
22704
22903
|
const onResize = (0, import_react125.useCallback)(() => scrollRef.current && updateScrollProps(scrollRef.current), [updateScrollProps]);
|
|
22705
|
-
(0,
|
|
22904
|
+
(0, import_utils142.useResizeObserver)({
|
|
22706
22905
|
ref: scrollRef,
|
|
22707
22906
|
onResize
|
|
22708
22907
|
});
|
|
@@ -22929,7 +23128,7 @@ var import_react_aria55 = require("react-aria");
|
|
|
22929
23128
|
var import_runtime101 = require("@homebound/truss/runtime");
|
|
22930
23129
|
var import_jsx_runtime180 = require("react/jsx-runtime");
|
|
22931
23130
|
var import_react129 = require("react");
|
|
22932
|
-
var
|
|
23131
|
+
var __maybeInc19 = (inc) => {
|
|
22933
23132
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
22934
23133
|
};
|
|
22935
23134
|
function Stepper(props) {
|
|
@@ -22985,7 +23184,7 @@ function Stepper(props) {
|
|
|
22985
23184
|
transition: "transition_width_200ms",
|
|
22986
23185
|
height: "h100",
|
|
22987
23186
|
width: ["w_var", {
|
|
22988
|
-
"--width": (0, import_runtime101.maybeCssVar)(
|
|
23187
|
+
"--width": (0, import_runtime101.maybeCssVar)(__maybeInc19(`${(lastCompletedStep + 1) / steps.length * 100}%`))
|
|
22989
23188
|
}]
|
|
22990
23189
|
}) }) })
|
|
22991
23190
|
] });
|
|
@@ -23405,7 +23604,7 @@ function useToast() {
|
|
|
23405
23604
|
// src/layouts/SideNavLayout/SideNavLayout.tsx
|
|
23406
23605
|
var import_runtime104 = require("@homebound/truss/runtime");
|
|
23407
23606
|
var import_jsx_runtime185 = require("react/jsx-runtime");
|
|
23408
|
-
var
|
|
23607
|
+
var __maybeInc20 = (inc) => {
|
|
23409
23608
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
23410
23609
|
};
|
|
23411
23610
|
function SideNavLayout(props) {
|
|
@@ -23460,11 +23659,11 @@ function SideNavLayoutContent(props) {
|
|
|
23460
23659
|
"--zIndex": (0, import_runtime104.maybeCssVar)(zIndices.sideNav)
|
|
23461
23660
|
}],
|
|
23462
23661
|
top: ["top_var", {
|
|
23463
|
-
"--top": (0, import_runtime104.maybeCssVar)(
|
|
23662
|
+
"--top": (0, import_runtime104.maybeCssVar)(__maybeInc20(navTop))
|
|
23464
23663
|
}],
|
|
23465
23664
|
alignSelf: "asfs",
|
|
23466
23665
|
height: ["h_var", {
|
|
23467
|
-
"--height": (0, import_runtime104.maybeCssVar)(
|
|
23666
|
+
"--height": (0, import_runtime104.maybeCssVar)(__maybeInc20(railViewportHeight))
|
|
23468
23667
|
}],
|
|
23469
23668
|
width: ["w_var", {
|
|
23470
23669
|
"--width": `${collapsed ? railCollapsedWidthPx : railWidthPx}px`
|
|
@@ -23474,7 +23673,7 @@ function SideNavLayoutContent(props) {
|
|
|
23474
23673
|
position: "fixed",
|
|
23475
23674
|
left: "left0",
|
|
23476
23675
|
top: ["top_var", {
|
|
23477
|
-
"--top": (0, import_runtime104.maybeCssVar)(
|
|
23676
|
+
"--top": (0, import_runtime104.maybeCssVar)(__maybeInc20(navTop))
|
|
23478
23677
|
}],
|
|
23479
23678
|
bottom: "bottom0",
|
|
23480
23679
|
zIndex: ["z_var", {
|
|
@@ -23523,19 +23722,28 @@ var import_runtime105 = require("@homebound/truss/runtime");
|
|
|
23523
23722
|
// src/layouts/useAutoHideOnScroll.ts
|
|
23524
23723
|
var import_react132 = require("react");
|
|
23525
23724
|
var THRESHOLD = 80;
|
|
23725
|
+
function getInitialAutoHideState() {
|
|
23726
|
+
if (typeof window === "undefined" || window.scrollY <= 0) {
|
|
23727
|
+
return { state: "static", atTop: true };
|
|
23728
|
+
}
|
|
23729
|
+
return { state: "hidden", atTop: false };
|
|
23730
|
+
}
|
|
23526
23731
|
function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
23527
|
-
const
|
|
23528
|
-
const
|
|
23529
|
-
const
|
|
23530
|
-
const
|
|
23732
|
+
const initial = getInitialAutoHideState();
|
|
23733
|
+
const [state, setState] = (0, import_react132.useState)(initial.state);
|
|
23734
|
+
const stateRef = (0, import_react132.useRef)(initial.state);
|
|
23735
|
+
const [atTop, setAtTop] = (0, import_react132.useState)(initial.atTop);
|
|
23736
|
+
const atTopRef = (0, import_react132.useRef)(initial.atTop);
|
|
23531
23737
|
const getTopOffsetRef = (0, import_react132.useRef)(getTopOffset);
|
|
23532
23738
|
getTopOffsetRef.current = getTopOffset;
|
|
23533
23739
|
const lastScrollY = (0, import_react132.useRef)(Number.POSITIVE_INFINITY);
|
|
23534
|
-
(0, import_react132.
|
|
23740
|
+
const lastScrollHeight = (0, import_react132.useRef)(0);
|
|
23741
|
+
(0, import_react132.useLayoutEffect)(() => {
|
|
23535
23742
|
if (!enabled) {
|
|
23536
23743
|
stateRef.current = "static";
|
|
23537
23744
|
atTopRef.current = true;
|
|
23538
23745
|
lastScrollY.current = Number.POSITIVE_INFINITY;
|
|
23746
|
+
lastScrollHeight.current = 0;
|
|
23539
23747
|
setState("static");
|
|
23540
23748
|
setAtTop(true);
|
|
23541
23749
|
return;
|
|
@@ -23550,22 +23758,41 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
23550
23758
|
setAtTop(nextAtTop);
|
|
23551
23759
|
}
|
|
23552
23760
|
};
|
|
23761
|
+
const autoHideStateOnLayoutChange = (rect, topOffset) => {
|
|
23762
|
+
const nextAtTop = rect.top >= topOffset;
|
|
23763
|
+
let next = stateRef.current;
|
|
23764
|
+
if (nextAtTop) {
|
|
23765
|
+
next = "static";
|
|
23766
|
+
} else if (rect.bottom < -THRESHOLD && next !== "revealed") {
|
|
23767
|
+
next = "hidden";
|
|
23768
|
+
}
|
|
23769
|
+
return { next, nextAtTop };
|
|
23770
|
+
};
|
|
23553
23771
|
const updateAutoHideState = () => {
|
|
23554
23772
|
const el = spacerRef.current;
|
|
23555
23773
|
if (!el) return;
|
|
23774
|
+
const doc = document.documentElement;
|
|
23775
|
+
const currentScrollHeight = doc.scrollHeight;
|
|
23776
|
+
const scrollHeightChanged = lastScrollHeight.current !== 0 && currentScrollHeight !== lastScrollHeight.current;
|
|
23777
|
+
lastScrollHeight.current = currentScrollHeight;
|
|
23556
23778
|
if (window.scrollY <= 0) {
|
|
23557
23779
|
lastScrollY.current = 0;
|
|
23558
23780
|
commit("static", true);
|
|
23559
23781
|
return;
|
|
23560
23782
|
}
|
|
23561
|
-
const rect = el.getBoundingClientRect();
|
|
23562
23783
|
const currentY = window.scrollY;
|
|
23784
|
+
const rect = el.getBoundingClientRect();
|
|
23785
|
+
const topOffset = getTopOffsetRef.current?.() ?? 0;
|
|
23786
|
+
if (scrollHeightChanged) {
|
|
23787
|
+
lastScrollY.current = currentY;
|
|
23788
|
+
const { next: next2, nextAtTop: nextAtTop2 } = autoHideStateOnLayoutChange(rect, topOffset);
|
|
23789
|
+
commit(next2, nextAtTop2);
|
|
23790
|
+
return;
|
|
23791
|
+
}
|
|
23563
23792
|
const dy = currentY - lastScrollY.current;
|
|
23564
23793
|
lastScrollY.current = currentY;
|
|
23565
|
-
const topOffset = getTopOffsetRef.current?.() ?? 0;
|
|
23566
|
-
const nextAtTop = rect.top >= topOffset;
|
|
23567
|
-
const doc = document.documentElement;
|
|
23568
23794
|
const atBottom = currentY >= doc.scrollHeight - doc.clientHeight;
|
|
23795
|
+
const nextAtTop = rect.top >= topOffset;
|
|
23569
23796
|
let next = stateRef.current;
|
|
23570
23797
|
if (nextAtTop) {
|
|
23571
23798
|
next = "static";
|
|
@@ -23583,7 +23810,7 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
23583
23810
|
}
|
|
23584
23811
|
|
|
23585
23812
|
// src/layouts/useMeasuredHeight.ts
|
|
23586
|
-
var
|
|
23813
|
+
var import_utils149 = require("@react-aria/utils");
|
|
23587
23814
|
var import_react133 = require("react");
|
|
23588
23815
|
function useMeasuredHeight(ref, enabled) {
|
|
23589
23816
|
const [height, setHeight] = (0, import_react133.useState)(0);
|
|
@@ -23592,7 +23819,7 @@ function useMeasuredHeight(ref, enabled) {
|
|
|
23592
23819
|
const next = el ? Math.round(el.getBoundingClientRect().height) : 0;
|
|
23593
23820
|
setHeight((prev) => prev === next ? prev : next);
|
|
23594
23821
|
}, [ref]);
|
|
23595
|
-
(0,
|
|
23822
|
+
(0, import_utils149.useResizeObserver)({ ref, onResize: syncElementHeight });
|
|
23596
23823
|
(0, import_react133.useLayoutEffect)(() => {
|
|
23597
23824
|
syncElementHeight();
|
|
23598
23825
|
}, [enabled, syncElementHeight]);
|
|
@@ -23612,7 +23839,7 @@ function useNavbarLayoutHeight() {
|
|
|
23612
23839
|
|
|
23613
23840
|
// src/layouts/NavbarLayout/NavbarLayout.tsx
|
|
23614
23841
|
var import_jsx_runtime187 = require("react/jsx-runtime");
|
|
23615
|
-
var
|
|
23842
|
+
var __maybeInc21 = (inc) => {
|
|
23616
23843
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
23617
23844
|
};
|
|
23618
23845
|
function NavbarLayout(props) {
|
|
@@ -23643,7 +23870,7 @@ function NavbarLayout(props) {
|
|
|
23643
23870
|
"--zIndex": (0, import_runtime105.maybeCssVar)(zIndices.navbar)
|
|
23644
23871
|
}],
|
|
23645
23872
|
width: ["w_var", {
|
|
23646
|
-
"--width": (0, import_runtime105.maybeCssVar)(
|
|
23873
|
+
"--width": (0, import_runtime105.maybeCssVar)(__maybeInc21(innerWidth))
|
|
23647
23874
|
}]
|
|
23648
23875
|
}
|
|
23649
23876
|
) : (
|
|
@@ -23655,7 +23882,7 @@ function NavbarLayout(props) {
|
|
|
23655
23882
|
"--zIndex": (0, import_runtime105.maybeCssVar)(zIndices.navbar)
|
|
23656
23883
|
}],
|
|
23657
23884
|
width: ["w_var", {
|
|
23658
|
-
"--width": (0, import_runtime105.maybeCssVar)(
|
|
23885
|
+
"--width": (0, import_runtime105.maybeCssVar)(__maybeInc21(innerWidth))
|
|
23659
23886
|
}],
|
|
23660
23887
|
transition: "transitionTop"
|
|
23661
23888
|
}
|
|
@@ -23684,7 +23911,7 @@ function NavbarLayout(props) {
|
|
|
23684
23911
|
var import_react136 = require("react");
|
|
23685
23912
|
var import_runtime106 = require("@homebound/truss/runtime");
|
|
23686
23913
|
var import_jsx_runtime188 = require("react/jsx-runtime");
|
|
23687
|
-
var
|
|
23914
|
+
var __maybeInc22 = (inc) => {
|
|
23688
23915
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
23689
23916
|
};
|
|
23690
23917
|
function PageHeaderLayout(props) {
|
|
@@ -23708,16 +23935,16 @@ function PageHeaderLayout(props) {
|
|
|
23708
23935
|
const cssVars = headerHeight > 0 && headerOccupiesPosition ? {
|
|
23709
23936
|
[beamPageHeaderLayoutHeightVar]: `${headerHeight}px`
|
|
23710
23937
|
} : void 0;
|
|
23711
|
-
const headerLeft =
|
|
23712
|
-
const headerWidth =
|
|
23938
|
+
const headerLeft = documentScrollChromeLeft();
|
|
23939
|
+
const headerWidth = documentScrollChromeWidth();
|
|
23713
23940
|
const outerTop = `var(${beamNavbarLayoutHeightVar}, 0px)`;
|
|
23714
23941
|
const innerCss = autoHideState === "static" ? {
|
|
23715
23942
|
position: "sticky",
|
|
23716
23943
|
left: ["left_var", {
|
|
23717
|
-
"--left": (0, import_runtime106.maybeCssVar)(
|
|
23944
|
+
"--left": (0, import_runtime106.maybeCssVar)(__maybeInc22(headerLeft))
|
|
23718
23945
|
}],
|
|
23719
23946
|
width: ["w_var", {
|
|
23720
|
-
"--width": (0, import_runtime106.maybeCssVar)(
|
|
23947
|
+
"--width": (0, import_runtime106.maybeCssVar)(__maybeInc22(headerWidth))
|
|
23721
23948
|
}],
|
|
23722
23949
|
zIndex: ["z_var", {
|
|
23723
23950
|
"--zIndex": (0, import_runtime106.maybeCssVar)(zIndices.pageStickyHeader)
|
|
@@ -23725,10 +23952,10 @@ function PageHeaderLayout(props) {
|
|
|
23725
23952
|
} : {
|
|
23726
23953
|
position: "fixed",
|
|
23727
23954
|
left: ["left_var", {
|
|
23728
|
-
"--left": (0, import_runtime106.maybeCssVar)(
|
|
23955
|
+
"--left": (0, import_runtime106.maybeCssVar)(__maybeInc22(headerLeft))
|
|
23729
23956
|
}],
|
|
23730
23957
|
width: ["w_var", {
|
|
23731
|
-
"--width": (0, import_runtime106.maybeCssVar)(
|
|
23958
|
+
"--width": (0, import_runtime106.maybeCssVar)(__maybeInc22(headerWidth))
|
|
23732
23959
|
}],
|
|
23733
23960
|
zIndex: ["z_var", {
|
|
23734
23961
|
"--zIndex": (0, import_runtime106.maybeCssVar)(zIndices.pageStickyHeader)
|
|
@@ -23920,6 +24147,7 @@ function PageHeaderLayout(props) {
|
|
|
23920
24147
|
beamNavbarLayoutHeightVar,
|
|
23921
24148
|
beamPageHeaderLayoutHeightVar,
|
|
23922
24149
|
beamSideNavLayoutWidthVar,
|
|
24150
|
+
beamTableActionsHeightVar,
|
|
23923
24151
|
booleanFilter,
|
|
23924
24152
|
boundCheckboxField,
|
|
23925
24153
|
boundCheckboxGroupField,
|
|
@@ -23938,6 +24166,7 @@ function PageHeaderLayout(props) {
|
|
|
23938
24166
|
boundTextField,
|
|
23939
24167
|
boundToggleChipGroupField,
|
|
23940
24168
|
boundTreeSelectField,
|
|
24169
|
+
calcColumnLayout,
|
|
23941
24170
|
calcColumnSizes,
|
|
23942
24171
|
cardStyle,
|
|
23943
24172
|
checkboxFilter,
|
|
@@ -23958,6 +24187,8 @@ function PageHeaderLayout(props) {
|
|
|
23958
24187
|
defaultRenderFn,
|
|
23959
24188
|
defaultStyle,
|
|
23960
24189
|
defaultTestId,
|
|
24190
|
+
documentScrollChromeLeft,
|
|
24191
|
+
documentScrollChromeWidth,
|
|
23961
24192
|
dragHandleColumn,
|
|
23962
24193
|
emptyCell,
|
|
23963
24194
|
ensureClientSideSortValueIsSortable,
|
|
@@ -24012,6 +24243,7 @@ function PageHeaderLayout(props) {
|
|
|
24012
24243
|
px,
|
|
24013
24244
|
recursivelyGetContainingRow,
|
|
24014
24245
|
reservedRowKinds,
|
|
24246
|
+
resolveTableContentWidth,
|
|
24015
24247
|
resolveTooltip,
|
|
24016
24248
|
rowClickRenderFn,
|
|
24017
24249
|
rowLinkRenderFn,
|
|
@@ -24026,6 +24258,9 @@ function PageHeaderLayout(props) {
|
|
|
24026
24258
|
singleFilter,
|
|
24027
24259
|
sortFn,
|
|
24028
24260
|
sortRows,
|
|
24261
|
+
stickyNavAndHeaderOffset,
|
|
24262
|
+
stickyTableHeaderOffset,
|
|
24263
|
+
sumColumnSizesPx,
|
|
24029
24264
|
switchFocusStyles,
|
|
24030
24265
|
switchHoverStyles,
|
|
24031
24266
|
switchSelectedHoverStyles,
|