@homebound/beam 2.308.1 → 2.309.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.
|
@@ -77,8 +77,6 @@ export interface GridTableProps<R extends Kinded, X> {
|
|
|
77
77
|
filter?: string;
|
|
78
78
|
/** Caps the client-side filter to a max number of rows. */
|
|
79
79
|
filterMaxRows?: number;
|
|
80
|
-
/** Accepts the number of filtered rows (based on `filter`), for the caller to observe and display if they want. */
|
|
81
|
-
setRowCount?: (rowCount: number) => void;
|
|
82
80
|
/** A combination of CSS settings to set the static look & feel (vs. rowStyles which is per-row styling). */
|
|
83
81
|
style?: GridStyle | GridStyleDef;
|
|
84
82
|
/**
|
|
@@ -85,7 +85,7 @@ exports.setGridTableDefaults = setGridTableDefaults;
|
|
|
85
85
|
*/
|
|
86
86
|
function GridTable(props) {
|
|
87
87
|
var _a, _b, _c;
|
|
88
|
-
const { id = "gridTable", as = "div", columns: _columns, rows, style: maybeStyle = defaults.style, rowStyles, stickyHeader = defaults.stickyHeader, stickyOffset = 0, xss, filter, filterMaxRows, fallbackMessage = "No rows found.", infoMessage,
|
|
88
|
+
const { id = "gridTable", as = "div", columns: _columns, rows, style: maybeStyle = defaults.style, rowStyles, stickyHeader = defaults.stickyHeader, stickyOffset = 0, xss, filter, filterMaxRows, fallbackMessage = "No rows found.", infoMessage, persistCollapse, resizeTarget, activeRowId, activeCellId, visibleColumnsStorageKey, infiniteScroll, } = props;
|
|
89
89
|
const columnsWithIds = (0, react_1.useMemo)(() => (0, columns_1.assignDefaultColumnIds)(_columns), [_columns]);
|
|
90
90
|
// We only use this in as=virtual mode, but keep this here for rowLookup to use
|
|
91
91
|
const virtuosoRef = (0, react_1.useRef)(null);
|
|
@@ -195,10 +195,6 @@ function GridTable(props) {
|
|
|
195
195
|
// Refs are cheap to assign to, so we don't bother doing this in a useEffect
|
|
196
196
|
rowLookup.current = (0, GridRowLookup_1.createRowLookup)(columns, visibleDataRows, virtuosoRef);
|
|
197
197
|
}
|
|
198
|
-
// TODO: Replace setRowCount with clients observing TableState via the API
|
|
199
|
-
(0, react_1.useEffect)(() => {
|
|
200
|
-
setRowCount && (visibleDataRows === null || visibleDataRows === void 0 ? void 0 : visibleDataRows.length) !== undefined && setRowCount(visibleDataRows.length);
|
|
201
|
-
}, [visibleDataRows === null || visibleDataRows === void 0 ? void 0 : visibleDataRows.length, setRowCount]);
|
|
202
198
|
const noData = visibleDataRows.length === 0;
|
|
203
199
|
const firstRowMessage = (noData && fallbackMessage) || (tooManyClientSideRows && "Hiding some rows, use filter...") || infoMessage;
|
|
204
200
|
const borderless = (_a = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _a === void 0 ? void 0 : _a.borderless;
|