@alaarab/ogrid-core 2.2.0 → 2.3.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.
- package/dist/esm/index.js +3404 -16
- package/dist/types/formula/cellAddressUtils.d.ts +50 -0
- package/dist/types/formula/dependencyGraph.d.ts +72 -0
- package/dist/types/formula/errors.d.ts +15 -0
- package/dist/types/formula/evaluator.d.ts +25 -0
- package/dist/types/formula/formulaEngine.d.ts +104 -0
- package/dist/types/formula/functions/date.d.ts +2 -0
- package/dist/types/formula/functions/index.d.ts +2 -0
- package/dist/types/formula/functions/info.d.ts +2 -0
- package/dist/types/formula/functions/logical.d.ts +2 -0
- package/dist/types/formula/functions/lookup.d.ts +2 -0
- package/dist/types/formula/functions/math.d.ts +2 -0
- package/dist/types/formula/functions/stats.d.ts +2 -0
- package/dist/types/formula/functions/text.d.ts +2 -0
- package/dist/types/formula/index.d.ts +13 -0
- package/dist/types/formula/parser.d.ts +26 -0
- package/dist/types/formula/tokenizer.d.ts +7 -0
- package/dist/types/formula/types.d.ts +139 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types/types/columnTypes.d.ts +2 -0
- package/dist/types/utils/cellReference.d.ts +21 -0
- package/dist/types/utils/clipboardHelpers.d.ts +18 -2
- package/dist/types/utils/dataGridViewModel.d.ts +2 -1
- package/dist/types/utils/exportToCsv.d.ts +10 -2
- package/dist/types/utils/fillHelpers.d.ts +18 -1
- package/dist/types/utils/index.d.ts +3 -1
- package/package.json +1 -1
|
@@ -4,15 +4,32 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IColumnDef, ICellValueChangedEvent } from '../types/columnTypes';
|
|
6
6
|
import type { ISelectionRange } from '../types/dataGridTypes';
|
|
7
|
+
/**
|
|
8
|
+
* Options for formula-aware fill. When provided, source cells with formulas will
|
|
9
|
+
* have their relative references adjusted instead of copying raw values.
|
|
10
|
+
*/
|
|
11
|
+
export interface IFillFormulaOptions<T> {
|
|
12
|
+
/** Flat (unfiltered) column list used to map visible col indices to formula storage indices. */
|
|
13
|
+
flatColumns: IColumnDef<T>[];
|
|
14
|
+
/** Returns the formula string for a given (flatColIndex, rowIndex), or undefined if none. */
|
|
15
|
+
getFormula?: (col: number, row: number) => string | undefined;
|
|
16
|
+
/** Returns true if the cell at (flatColIndex, rowIndex) has a formula. */
|
|
17
|
+
hasFormula?: (col: number, row: number) => boolean;
|
|
18
|
+
/** Sets or clears the formula at (flatColIndex, rowIndex). Pass null to clear. */
|
|
19
|
+
setFormula?: (col: number, row: number, formula: string | null) => void;
|
|
20
|
+
}
|
|
7
21
|
/**
|
|
8
22
|
* Apply fill values from a source cell across a normalized selection range.
|
|
9
23
|
* Copies the value from the start cell of the range to every other editable cell.
|
|
24
|
+
* If formulaOptions is provided and the source cell has a formula, relative references
|
|
25
|
+
* in the formula are adjusted for each target cell instead of copying the raw value.
|
|
10
26
|
*
|
|
11
27
|
* @param range The normalized fill range (startRow/startCol is the source).
|
|
12
28
|
* @param sourceRow The original source row index (skipped during fill).
|
|
13
29
|
* @param sourceCol The original source col index (skipped during fill).
|
|
14
30
|
* @param items Array of all row data objects.
|
|
15
31
|
* @param visibleCols Visible column definitions.
|
|
32
|
+
* @param formulaOptions Optional formula-aware fill configuration.
|
|
16
33
|
* @returns Array of cell value changed events to apply. Empty if source cell is out of bounds.
|
|
17
34
|
*/
|
|
18
|
-
export declare function applyFillValues<T>(range: ISelectionRange, sourceRow: number, sourceCol: number, items: T[], visibleCols: IColumnDef<T>[]): ICellValueChangedEvent<T>[];
|
|
35
|
+
export declare function applyFillValues<T>(range: ISelectionRange, sourceRow: number, sourceCol: number, items: T[], visibleCols: IColumnDef<T>[], formulaOptions?: IFillFormulaOptions<T>): ICellValueChangedEvent<T>[];
|
|
@@ -7,7 +7,7 @@ export { getDataGridStatusBarConfig } from './dataGridStatusBar';
|
|
|
7
7
|
export { getPaginationViewModel, PAGE_SIZE_OPTIONS, MAX_PAGE_BUTTONS, } from './paginationHelpers';
|
|
8
8
|
export type { PaginationViewModel } from './paginationHelpers';
|
|
9
9
|
export { GRID_CONTEXT_MENU_ITEMS, COLUMN_HEADER_MENU_ITEMS, getContextMenuHandlers, getColumnHeaderMenuItems, formatShortcut } from './gridContextMenuHelpers';
|
|
10
|
-
export type { CsvColumn } from './exportToCsv';
|
|
10
|
+
export type { CsvColumn, FormulaExportOptions } from './exportToCsv';
|
|
11
11
|
export type { StatusBarPart, StatusBarPartsInput } from './statusBarHelpers';
|
|
12
12
|
export type { GridContextMenuItem, IColumnHeaderMenuItem, GridContextMenuHandlerProps, ColumnHeaderMenuInput, ColumnHeaderMenuHandlers } from './gridContextMenuHelpers';
|
|
13
13
|
export { parseValue, numberParser, currencyParser, dateParser, emailParser, booleanParser, } from './valueParsers';
|
|
@@ -36,5 +36,7 @@ export type { ArrowNavigationContext, ArrowNavigationResult } from './keyboardNa
|
|
|
36
36
|
export { rangesEqual, clampSelectionToBounds, computeAutoScrollSpeed, applyRangeRowSelection, computeRowSelectionState } from './selectionHelpers';
|
|
37
37
|
export { formatCellValueForTsv, formatSelectionAsTsv, parseTsvClipboard, applyPastedValues, applyCutClear, } from './clipboardHelpers';
|
|
38
38
|
export { applyFillValues } from './fillHelpers';
|
|
39
|
+
export type { IFillFormulaOptions } from './fillHelpers';
|
|
39
40
|
export { UndoRedoStack } from './undoRedoStack';
|
|
40
41
|
export { validateColumns, validateRowIds, validateVirtualScrollConfig } from './validation';
|
|
42
|
+
export { indexToColumnLetter, formatCellReference } from './cellReference';
|
package/package.json
CHANGED