ag-grid-community
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
59 lines (58 loc) • 3.45 kB
TypeScript
import { BeanStub } from '../context/beanStub';
import type { AgColumn } from '../entities/agColumn';
import type { IsRowSelectable } from '../entities/gridOptions';
import type { RowNode } from '../entities/rowNode';
import type { SelectionEventSourceType } from '../events';
import type { IRowNode } from '../interfaces/iRowNode';
import type { ISetNodesSelectedParams } from '../interfaces/iSelectionService';
import type { RowCtrl } from '../rendering/row/rowCtrl';
import type { ChangedPath } from '../utils/changedPath';
import { CheckboxSelectionComponent } from './checkboxSelectionComponent';
import { RowRangeSelectionContext } from './rowRangeSelectionContext';
import { SelectAllFeature } from './selectAllFeature';
/** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */
export declare abstract class BaseSelectionService extends BeanStub {
protected isRowSelectable?: IsRowSelectable;
protected selectionCtx: RowRangeSelectionContext;
/** Rendered selection checkboxes, so Space can tell where it acts as a checkbox click. */
private readonly checkboxes;
postConstruct(): void;
destroy(): void;
createCheckboxSelectionComponent(): CheckboxSelectionComponent;
registerCheckbox(rowNode: RowNode, checkbox: CheckboxSelectionComponent): void;
unregisterCheckbox(rowNode: RowNode, checkbox: CheckboxSelectionComponent): void;
createSelectAllFeature(column: AgColumn): SelectAllFeature | undefined;
protected isMultiSelect(): boolean;
onRowCtrlSelected(rowCtrl: RowCtrl, hasFocusFunc: () => void): void;
announceAriaRowSelection(rowNode: RowNode, column: AgColumn | undefined): void;
updateGroupsFromChildrenSelections?(source: SelectionEventSourceType, changedPath?: ChangedPath, event?: Event): boolean;
abstract setNodesSelected(params: ISetNodesSelectedParams): number;
protected abstract isSoleSelection(node: RowNode): boolean;
protected abstract updateSelectable(changedPath?: ChangedPath): void;
protected isRowSelectionBlocked(rowNode: RowNode): boolean;
updateRowSelectable(rowNode: RowNode, suppressSelectionUpdate?: boolean): boolean;
protected setRowSelectable(rowNode: RowNode, newVal: boolean, suppressSelectionUpdate?: boolean): void;
protected calculateSelectedFromChildren(rowNode: RowNode): boolean | undefined | null;
selectRowNode(rowNode: RowNode, newValue?: boolean, e?: Event, source?: SelectionEventSourceType): boolean;
isCellCheckboxSelection(column: AgColumn, rowNode: IRowNode): boolean;
protected inferNodeSelections(node: RowNode, shiftKey: boolean, metaKey: boolean, source: SelectionEventSourceType, column: AgColumn | undefined): null | NodeSelection;
private isSpaceKeyBlocked;
/** Whether Space must obey `enableClickSelection`. On a selection checkbox cell it acts like clicking the checkbox. */
private isSpaceKeyClickGated;
/** Whether `rowNode` shows an enabled selection checkbox in `column`, or in its full-width row when there is no `column`. */
private isSelectionCheckboxShown;
}
interface SingleNodeSelection {
node: RowNode;
newValue: boolean;
clearSelection: boolean;
keepDescendants?: boolean;
checkFilteredNodes?: boolean;
}
interface MultiNodeSelection {
select: readonly RowNode[];
deselect: readonly RowNode[];
reset: boolean;
}
type NodeSelection = SingleNodeSelection | MultiNodeSelection;
export {};