import { IEditCell, IGrid } from '../base/interface'; import { Column } from '../models/column'; /** * `FormulaCellEditor` provides a custom cell editor for formula cell inputs in EJ2 Grid. * * @hidden */ export declare class FormulaCellEditor implements IEditCell { private parent; private editableDiv; private currentValue; private displayValue; private lastFormulaCaretPosition; private highlightedCells; private referenceToColorMap; private currentEditingRowNum; constructor(parent?: IGrid); /** * Register event listeners for cell edit mode. * * @returns {void} * @hidden */ addEventListener(): void; /** * Remove event listeners (called during destroy). * * @returns {void} * @hidden */ removeEventListener(): void; create(args: { column: Column; value: string; requestType: string; }): Element; read(element: HTMLElement): string; write(args: { rowData: Object; element: Element; column: Column; requestType: string; rowIndex: number; }): void; /** * Renders the formula with colored spans for each cell reference inside the editable div * * @param {string} formula The formula string to render * @param {number} cursorPosition Text cursor position * @returns {void} * @hidden */ renderColorizedFormula(formula: string, cursorPosition?: number): void; /** * Extracts formula references with their start and end positions. * * @param {string} formula - The formula string. * @returns {Array} Array of references with positions. * @hidden */ private extractFormulaReferencesWithPositions; /** * Converts a formula from simple cell reference format (e.g., C6*D6) back to REF(COLUMN("fieldname"), ROW(n)) format. * * @param {string} formula - The formula string in simple format to convert * @param {number} currentRowNum - The current row number being edited (1-based) for detecting cross-row references * @returns {string} The converted formula with REF function calls * @hidden */ private convertCellReferencesToREF; /** * Converts a formula from REF(COLUMN("fieldname"), ROW(n)) format to simple cell reference format (e.g., C6). * * @param {string} formula - The formula string to convert * @param {number} visualRowIndex - The visual row index in the current sorted/filtered view (optional) * @returns {string} The converted formula with simple cell references for editing display * @hidden */ private convertFormulaToCellReference; /** * Handles click event on the editable div element. * * @returns {void} * @hidden */ private onEditableDivClick; private onEditableDivFocusIn; private onEditableDivFocusOut; /** * Handles input change event on the editable div element. * * @returns {void} * @hidden */ private onInputChange; /** * Extracts cell references from a display string with their positions. * * @param {string} display - The display string to extract references from. * @returns {Array} Array of references with their text and positions. * @hidden */ private extractRefsFromDisplay; /** * Handles click event on grid cells for formula cell reference selection. * * @param {MouseEvent} e - The mouse event. * @returns {void} * @hidden */ private onGridCellClick; /** * Gets the current cursor position within the formula. * * @returns {number} The cursor position in the formula. * @hidden */ private getCursorPositionInFormula; /** * Sets the cursor position in the formula editor. * * @param {number} position - The position to set the cursor at. * @returns {void} * @hidden */ private setCursorPosition; /** * Updates the highlight for cell references in the formula. * * @returns {void} * @hidden */ private updateReferenceHighlight; /** * Extracts unique cell references from a formula string. * * @param {string} formula - The formula string to extract references from. * @returns {string[]} Array of unique cell references. * @hidden */ private extractFormulaReferences; /** * Clears all reference highlighting from cells. * * @returns {void} * @hidden */ private clearReferenceHighlight; private getPageRowIndex; /** * Highlights a cell reference or range in the grid. * * @param {string} reference - The cell reference or range to highlight. * @param {string} formulaBorder - The CSS class for the border style. * @returns {void} * @hidden */ private highlightReference; /** * Highlights a single cell in the grid. * * @param {number} colIndex - The column index of the cell. * @param {number} rowIndex - The row index of the cell. * @param {string} formulaBorder - The CSS class for the border style. * @returns {void} * @hidden */ private highlightCell; /** * Create a single border div around an entire range of cells * * @param {number} minRow Start row index * @param {number} maxRow End row index * @param {number} minCol Start column index * @param {number} maxCol End column index * @param {string} formulaBorder CSS class for the border * @returns {void} * @hidden */ private highlightRangeBorder; /** * Determines if auto-fill formula highlighting should be enabled. * * @returns {boolean} True if auto-fill formula is enabled, false otherwise. * @hidden */ private isAutoFillFormula; destroy(): void; }