@homebound/beam 2.343.4 → 2.343.5
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.
|
@@ -293,7 +293,7 @@ function GridTable(props) {
|
|
|
293
293
|
// behave semantically the same as `as=div` did for its tests.
|
|
294
294
|
const _as = as === "virtual" && runningInJest ? "div" : as;
|
|
295
295
|
const rowStateContext = (0, react_1.useMemo)(() => ({ tableState: tableState }), [tableState]);
|
|
296
|
-
return ((0, jsx_runtime_1.jsx)(TableState_1.TableStateContext.Provider, { value: rowStateContext, children: (0, jsx_runtime_1.jsxs)(PresentationContext_1.PresentationProvider, { fieldProps: fieldProps, wrap: (_c = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _c === void 0 ? void 0 : _c.wrap, children: [(0, jsx_runtime_1.jsx)("div", { ref: resizeRef, css:
|
|
296
|
+
return ((0, jsx_runtime_1.jsx)(TableState_1.TableStateContext.Provider, { value: rowStateContext, children: (0, jsx_runtime_1.jsxs)(PresentationContext_1.PresentationProvider, { fieldProps: fieldProps, wrap: (_c = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _c === void 0 ? void 0 : _c.wrap, children: [(0, jsx_runtime_1.jsx)("div", { ref: resizeRef, css: (0, components_1.getTableRefWidthStyles)(as === "virtual") }), renders[_as](style, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, tableHeadRows, stickyOffset, infiniteScroll)] }) }));
|
|
297
297
|
}
|
|
298
298
|
exports.GridTable = GridTable;
|
|
299
299
|
// Determine which HTML element to use to build the GridTable
|
|
@@ -391,7 +391,9 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
391
391
|
// Show firstRowMessage as the first `filteredRow`
|
|
392
392
|
if (firstRowMessage) {
|
|
393
393
|
if (index === 0) {
|
|
394
|
-
return (
|
|
394
|
+
return (
|
|
395
|
+
// Ensure the fallback message is the same width as the table
|
|
396
|
+
(0, jsx_runtime_1.jsx)("div", { css: (0, components_1.getTableRefWidthStyles)(true), children: (0, jsx_runtime_1.jsx)("div", { css: { ...style.firstRowMessageCss }, children: firstRowMessage }) }));
|
|
395
397
|
}
|
|
396
398
|
// Shift index -1 when there is a firstRowMessage to not skip the
|
|
397
399
|
// first `filteredRow`
|
|
@@ -48,3 +48,6 @@ export declare function recursivelyGetContainingRow<R extends Kinded>(rowId: str
|
|
|
48
48
|
array: GridDataRow<R>[];
|
|
49
49
|
parent: GridDataRow<R> | undefined;
|
|
50
50
|
} | undefined;
|
|
51
|
+
export declare function getTableRefWidthStyles(isVirtual: boolean): {
|
|
52
|
+
width: import("csstype").Property.Width<string | 0> | undefined;
|
|
53
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.recursivelyGetContainingRow = exports.isCursorBelowMidpoint = exports.insertAtIndex = exports.loadArrayOrUndefined = exports.zIndices = exports.reservedRowKinds = exports.KEPT_GROUP = exports.EXPANDABLE_HEADER = exports.TOTALS = exports.HEADER = exports.matchesFilter = exports.maybeApplyFunction = exports.getJustification = exports.getAlignment = exports.getFirstOrLastCellCss = exports.emptyCell = exports.DESC = exports.ASC = exports.applyRowFn = exports.isGridCellContent = exports.toContent = void 0;
|
|
3
|
+
exports.getTableRefWidthStyles = exports.recursivelyGetContainingRow = exports.isCursorBelowMidpoint = exports.insertAtIndex = exports.loadArrayOrUndefined = exports.zIndices = exports.reservedRowKinds = exports.KEPT_GROUP = exports.EXPANDABLE_HEADER = exports.TOTALS = exports.HEADER = exports.matchesFilter = exports.maybeApplyFunction = exports.getJustification = exports.getAlignment = exports.getFirstOrLastCellCss = exports.emptyCell = exports.DESC = exports.ASC = exports.applyRowFn = exports.isGridCellContent = exports.toContent = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const Icon_1 = require("../../Icon");
|
|
6
6
|
const ExpandableHeader_1 = require("../components/ExpandableHeader");
|
|
@@ -200,3 +200,9 @@ function recursivelyGetContainingRow(rowId, rowArray, parent) {
|
|
|
200
200
|
return undefined;
|
|
201
201
|
}
|
|
202
202
|
exports.recursivelyGetContainingRow = recursivelyGetContainingRow;
|
|
203
|
+
function getTableRefWidthStyles(isVirtual) {
|
|
204
|
+
// If virtualized take some pixels off the width to accommodate when virtuoso's scrollbar is introduced.
|
|
205
|
+
// Otherwise a horizontal scrollbar will _always_ appear once the vertical scrollbar is needed
|
|
206
|
+
return Css_1.Css.w100.if(isVirtual).w("calc(100% - 20px)").$;
|
|
207
|
+
}
|
|
208
|
+
exports.getTableRefWidthStyles = getTableRefWidthStyles;
|