42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
"use strict";
|
|
|
|
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
|
|
};
|
|
} |