@mui/x-virtualizer
Version:
42 lines (40 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Rowspan = void 0;
/* eslint-disable import/export, @typescript-eslint/no-redeclare */
const EMPTY_RANGE = {
firstRowIndex: 0,
lastRowIndex: 0
};
const EMPTY_CACHES = {
spannedCells: {},
hiddenCells: {},
hiddenCellOriginMap: {}
};
const selectors = {
state: state => state.rowSpanning,
hiddenCells: state => state.rowSpanning.caches.hiddenCells,
spannedCells: state => state.rowSpanning.caches.spannedCells,
hiddenCellsOriginMap: state => state.rowSpanning.caches.hiddenCellOriginMap
};
const Rowspan = exports.Rowspan = {
initialize: initializeState,
use: useRowspan,
selectors
};
function initializeState(params) {
return {
rowSpanning: params.initialState?.rowSpanning ?? {
caches: EMPTY_CACHES,
processedRange: EMPTY_RANGE
}
};
}
function useRowspan(store, _params, _api) {
const getHiddenCellsOrigin = () => selectors.hiddenCellsOriginMap(store.state);
return {
getHiddenCellsOrigin
};
}