@alaarab/ogrid-angular 2.4.2 → 2.5.1
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 +25 -4975
- package/dist/types/components/base-datagrid-table.component.d.ts +7 -6
- package/dist/types/components/formula-ref-overlay.component.d.ts +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/services/column-reorder.service.d.ts +1 -1
- package/dist/types/services/datagrid-interaction.service.d.ts +4 -4
- package/dist/types/services/datagrid-state.service.d.ts +5 -4
- package/dist/types/services/ogrid.service.d.ts +2 -1
- package/dist/types/types/dataGridTypes.d.ts +6 -1
- package/dist/types/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -128,6 +128,7 @@ export declare abstract class BaseDataGridTableComponent<T = unknown> {
|
|
|
128
128
|
isDragging: boolean;
|
|
129
129
|
getFormulaValue?: (col: number, row: number) => unknown;
|
|
130
130
|
hasFormula?: (col: number, row: number) => boolean;
|
|
131
|
+
getFormula?: (col: number, row: number) => string | undefined;
|
|
131
132
|
formulaVersion?: number;
|
|
132
133
|
}>;
|
|
133
134
|
readonly pinnedColumnsMap: import("@angular/core").Signal<Record<string, "left" | "right">>;
|
|
@@ -203,7 +204,7 @@ export declare abstract class BaseDataGridTableComponent<T = unknown> {
|
|
|
203
204
|
/**
|
|
204
205
|
* Returns derived cell interaction metadata (non-event attributes) for use in templates.
|
|
205
206
|
* Mirrors React's getCellInteractionProps for the Angular view layer.
|
|
206
|
-
* Event handlers (
|
|
207
|
+
* Event handlers (pointerdown, click, dblclick, contextmenu) are still bound inline in templates.
|
|
207
208
|
*/
|
|
208
209
|
getCellInteractionProps(descriptor: {
|
|
209
210
|
isActive: boolean;
|
|
@@ -271,14 +272,14 @@ export declare abstract class BaseDataGridTableComponent<T = unknown> {
|
|
|
271
272
|
setPendingEditorValue(value: unknown): void;
|
|
272
273
|
cancelPopoverEdit(): void;
|
|
273
274
|
commitPopoverEdit(item: T, columnId: string, oldValue: unknown, newValue: unknown, rowIndex: number, globalColIndex: number): void;
|
|
274
|
-
onWrapperMouseDown(event:
|
|
275
|
+
onWrapperMouseDown(event: PointerEvent): void;
|
|
275
276
|
onGridKeyDown(event: KeyboardEvent): void;
|
|
276
|
-
onCellMouseDown(event:
|
|
277
|
+
onCellMouseDown(event: PointerEvent, rowIndex: number, globalColIndex: number): void;
|
|
277
278
|
onCellClick(rowIndex: number, globalColIndex: number): void;
|
|
278
279
|
onCellContextMenu(event: MouseEvent): void;
|
|
279
280
|
onCellDblClick(rowId: RowId, columnId: string): void;
|
|
280
|
-
onFillHandleMouseDown(event:
|
|
281
|
-
onResizeStart(event:
|
|
281
|
+
onFillHandleMouseDown(event: PointerEvent): void;
|
|
282
|
+
onResizeStart(event: PointerEvent, col: IColumnDef<T>): void;
|
|
282
283
|
onResizeDoubleClick(event: MouseEvent, col: IColumnDef<T>): void;
|
|
283
284
|
onSelectAllChange(event: Event): void;
|
|
284
285
|
onRowClick(event: MouseEvent, rowId: RowId): void;
|
|
@@ -293,7 +294,7 @@ export declare abstract class BaseDataGridTableComponent<T = unknown> {
|
|
|
293
294
|
handleSelectAllCells(): void;
|
|
294
295
|
onUndo(): void;
|
|
295
296
|
onRedo(): void;
|
|
296
|
-
onHeaderMouseDown(columnId: string, event:
|
|
297
|
+
onHeaderMouseDown(columnId: string, event: PointerEvent): void;
|
|
297
298
|
onPinColumn(columnId: string, side: 'left' | 'right'): void;
|
|
298
299
|
onUnpinColumn(columnId: string): void;
|
|
299
300
|
isPinned(columnId: string): 'left' | 'right' | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
1
|
+
export type { ISheetDef, IVirtualScrollConfig, IColumnReorderConfig, CsvColumn, FormulaExportOptions, StatusBarPart, StatusBarPartsInput, PaginationViewModel, GridContextMenuItem, IColumnHeaderMenuItem, GridContextMenuHandlerProps, ColumnHeaderMenuInput, ColumnHeaderMenuHandlers, ParseValueResult, AggregationResult, GridRowComparatorProps, ColumnPinState, IDropTarget, ICalculateDropTargetParams, IVisibleRange, IVisibleColumnRange, SortFilterRequest, SortFilterResponse, OverlayRect, ISortState, ArrowNavigationContext, ArrowNavigationResult, IFillFormulaOptions, FormulaReference, IResponsiveColumnsConfig, ZIndexKey, ICellAddress, ICellRange, CellKey, FormulaErrorType, TokenType, Token, ASTNode, BinaryOp, IFormulaContext, IFormulaFunction, IEvaluator, IRecalcResult, IFormulaEngineConfig, IGridDataAccessor, INamedRange, IAuditEntry, IAuditTrail, } from '@alaarab/ogrid-core';
|
|
2
|
+
export { escapeCsvValue, buildCsvHeader, buildCsvRows, exportToCsv, triggerCsvDownload, getCellValue, isColumnEditable, createGridDataAccessor, flattenColumns, buildHeaderRows, isFilterConfig, getFilterField, mergeFilter, deriveFilterOptionsFromData, getMultiSelectFilterFields, getStatusBarParts, getDataGridStatusBarConfig, getPaginationViewModel, PAGE_SIZE_OPTIONS, MAX_PAGE_BUTTONS, GRID_CONTEXT_MENU_ITEMS, COLUMN_HEADER_MENU_ITEMS, getContextMenuHandlers, getColumnHeaderMenuItems, formatShortcut, parseValue, numberParser, currencyParser, dateParser, emailParser, booleanParser, computeAggregations, processClientSideData, areGridRowPropsEqual, isRowInRange, getPinStateForColumn, reorderColumnArray, calculateDropTarget, computeVisibleRange, computeTotalHeight, getScrollTopForRow, computeVisibleColumnRange, partitionColumnsForVirtualization, createSortFilterWorker, terminateSortFilterWorker, extractValueMatrix, processClientSideDataAsync, CellDescriptorCache, buildInlineEditorProps, buildPopoverEditorProps, measureRange, buildCellIndex, injectGlobalStyles, computeNextSortState, measureColumnContentWidth, AUTOSIZE_EXTRA_PX, AUTOSIZE_MAX_PX, findCtrlArrowTarget, computeTabNavigation, computeArrowNavigation, applyCellDeletion, rangesEqual, clampSelectionToBounds, computeAutoScrollSpeed, applyRangeRowSelection, computeRowSelectionState, formatCellValueForTsv, formatSelectionAsTsv, parseTsvClipboard, applyPastedValues, applyCutClear, applyFillValues, UndoRedoStack, validateColumns, validateRowIds, validateVirtualScrollConfig, indexToColumnLetter, columnLetterToIndex, formatCellReference, getResponsiveHiddenColumns, RESPONSIVE_BREAKPOINTS, resolveResponsiveConfig, applyResponsiveHiding, } from '@alaarab/ogrid-core';
|
|
3
|
+
export { CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, ROW_NUMBER_COLUMN_ID, ROW_NUMBER_COLUMN_MIN_WIDTH, DEFAULT_MIN_COLUMN_WIDTH, CELL_PADDING, GRID_BORDER_RADIUS, DEFAULT_DEBOUNCE_MS, PEOPLE_SEARCH_DEBOUNCE_MS, SIDEBAR_TRANSITION_MS, Z_INDEX, } from '@alaarab/ogrid-core';
|
|
4
|
+
export { FormulaError, FormulaEngine, FormulaEvaluator, DependencyGraph, tokenize, parse, createBuiltInFunctions, parseCellRef, parseRange, formatAddress, toCellKey, fromCellKey, adjustFormulaReferences, toNumber, formulaToString, toBoolean, flattenArgs, isFormulaError, REF_ERROR, DIV_ZERO_ERROR, VALUE_ERROR, NAME_ERROR, CIRC_ERROR, GENERAL_ERROR, NA_ERROR, extractFormulaReferences, processFormulaBarCommit, deriveFormulaBarText, handleFormulaBarKeyDown, canInsertReference, insertReferenceAtCursor, FORMULA_REF_COLORS, FORMULA_BAR_CSS, FORMULA_BAR_STYLES, } from '@alaarab/ogrid-core/formula';
|
|
3
5
|
export type { IColumnDef, IColumnGroupDef, IColumnDefinition, ICellEditorProps, } from './types';
|
|
4
6
|
export type { IOGridProps, IOGridClientProps, IOGridServerProps, IOGridDataGridProps, } from './types';
|
|
5
7
|
export type { ColumnFilterType, IColumnFilterDef, IColumnMeta, ICellValueChangedEvent, CellEditorParams, IValueParserParams, IDateFilterValue, HeaderCell, HeaderRow, RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, } from './types';
|
|
@@ -21,7 +21,7 @@ export declare class ColumnReorderService<T> {
|
|
|
21
21
|
* @param columnId - The column being dragged
|
|
22
22
|
* @param event - The native MouseEvent
|
|
23
23
|
*/
|
|
24
|
-
handleHeaderMouseDown(columnId: string, event:
|
|
24
|
+
handleHeaderMouseDown(columnId: string, event: PointerEvent): void;
|
|
25
25
|
/**
|
|
26
26
|
* Calculate drop target from mouse position and header cell rects.
|
|
27
27
|
* Same logic as React's useColumnReorder inline calculation.
|
|
@@ -30,7 +30,7 @@ export declare class DataGridInteractionHelper<T> {
|
|
|
30
30
|
startCol: number;
|
|
31
31
|
} | null;
|
|
32
32
|
fillRafId: number;
|
|
33
|
-
fillMoveHandler: ((e:
|
|
33
|
+
fillMoveHandler: ((e: PointerEvent) => void) | null;
|
|
34
34
|
fillUpHandler: (() => void) | null;
|
|
35
35
|
dragStartPos: {
|
|
36
36
|
row: number;
|
|
@@ -65,9 +65,9 @@ export declare class DataGridInteractionHelper<T> {
|
|
|
65
65
|
endBatch(): void;
|
|
66
66
|
undo(originalOnCellValueChanged: ((event: ICellValueChangedEvent<T>) => void) | undefined): void;
|
|
67
67
|
redo(originalOnCellValueChanged: ((event: ICellValueChangedEvent<T>) => void) | undefined): void;
|
|
68
|
-
handleCellMouseDown(e:
|
|
68
|
+
handleCellMouseDown(e: PointerEvent, rowIndex: number, globalColIndex: number, colOffset: number, wrapperEl: HTMLElement | null): void;
|
|
69
69
|
handleSelectAllCells(rowCount: number, visibleColCount: number, colOffset: number): void;
|
|
70
|
-
handleFillHandleMouseDown(e:
|
|
70
|
+
handleFillHandleMouseDown(e: PointerEvent): void;
|
|
71
71
|
handleGridKeyDown(e: KeyboardEvent, items: T[], getRowId: (item: T) => RowId, visibleCols: IColumnDef<T>[], colOffset: number, hasCheckboxCol: boolean, visibleColumnCount: number, editable: boolean | undefined, wrappedOnCellValueChanged: ((event: ICellValueChangedEvent<T>) => void) | undefined, originalOnCellValueChanged: ((event: ICellValueChangedEvent<T>) => void) | undefined, rowSelection: string, selectedRowIds: Set<RowId>, wrapperEl: HTMLElement | null, handleRowCheckboxChange: (rowId: RowId, checked: boolean, rowIndex: number, shiftKey: boolean) => void, editingCell: {
|
|
72
72
|
rowId: RowId;
|
|
73
73
|
columnId: string;
|
|
@@ -75,7 +75,7 @@ export declare class DataGridInteractionHelper<T> {
|
|
|
75
75
|
rowId: RowId;
|
|
76
76
|
columnId: string;
|
|
77
77
|
} | null) => void, onKeyDown?: (event: KeyboardEvent) => void): void;
|
|
78
|
-
onWindowMouseMove(e:
|
|
78
|
+
onWindowMouseMove(e: PointerEvent, colOffset: number, wrapperEl: HTMLElement | null): void;
|
|
79
79
|
onWindowMouseUp(colOffset: number, wrapperEl: HTMLElement | null): void;
|
|
80
80
|
resolveRangeFromMouse(cx: number, cy: number, colOffset: number): ISelectionRange | null;
|
|
81
81
|
applyDragAttrs(range: ISelectionRange, colOff: number, wrapper: HTMLElement | null): void;
|
|
@@ -58,12 +58,12 @@ export interface DataGridCellInteractionState {
|
|
|
58
58
|
selectionRange: ISelectionRange | null;
|
|
59
59
|
/** Set selection range. Undefined when cell selection is disabled. */
|
|
60
60
|
setSelectionRange?: (range: ISelectionRange | null) => void;
|
|
61
|
-
handleCellMouseDown: (e:
|
|
61
|
+
handleCellMouseDown: (e: PointerEvent, rowIndex: number, globalColIndex: number) => void;
|
|
62
62
|
handleSelectAllCells: () => void;
|
|
63
63
|
hasCellSelection: boolean;
|
|
64
64
|
handleGridKeyDown: (e: KeyboardEvent) => void;
|
|
65
65
|
/** Handle fill handle mouse down. Undefined when cell selection is disabled. */
|
|
66
|
-
handleFillHandleMouseDown?: (e:
|
|
66
|
+
handleFillHandleMouseDown?: (e: PointerEvent) => void;
|
|
67
67
|
handleCopy: () => void;
|
|
68
68
|
handleCut: () => void;
|
|
69
69
|
handlePaste: () => Promise<void>;
|
|
@@ -121,6 +121,7 @@ export interface DataGridViewModelState<T> {
|
|
|
121
121
|
isDragging: boolean;
|
|
122
122
|
getFormulaValue?: (col: number, row: number) => unknown;
|
|
123
123
|
hasFormula?: (col: number, row: number) => boolean;
|
|
124
|
+
getFormula?: (col: number, row: number) => string | undefined;
|
|
124
125
|
formulaVersion?: number;
|
|
125
126
|
};
|
|
126
127
|
statusBarConfig: IStatusBarProps | null;
|
|
@@ -223,7 +224,7 @@ export declare class DataGridStateService<T> {
|
|
|
223
224
|
setSelectionRange(range: ISelectionRange | null): void;
|
|
224
225
|
commitCellEdit(item: T, columnId: string, oldValue: unknown, newValue: unknown, rowIndex: number, globalColIndex: number): void;
|
|
225
226
|
cancelPopoverEdit(): void;
|
|
226
|
-
handleCellMouseDown(e:
|
|
227
|
+
handleCellMouseDown(e: PointerEvent, rowIndex: number, globalColIndex: number): void;
|
|
227
228
|
handleSelectAllCells(): void;
|
|
228
229
|
setContextMenuPosition(pos: {
|
|
229
230
|
x: number;
|
|
@@ -244,7 +245,7 @@ export declare class DataGridStateService<T> {
|
|
|
244
245
|
undo(): void;
|
|
245
246
|
redo(): void;
|
|
246
247
|
handleGridKeyDown(e: KeyboardEvent): void;
|
|
247
|
-
handleFillHandleMouseDown(e:
|
|
248
|
+
handleFillHandleMouseDown(e: PointerEvent): void;
|
|
248
249
|
pinColumn(columnId: string, side: 'left' | 'right'): void;
|
|
249
250
|
unpinColumn(columnId: string): void;
|
|
250
251
|
isPinned(columnId: string): 'left' | 'right' | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormulaReference } from '@alaarab/ogrid-core';
|
|
2
|
-
import type { RowId, IOGridApi, IFilters, FilterValue, IRowSelectionChangeEvent, IStatusBarProps, IColumnDefinition, IDataSource, ISideBarDef, IVirtualScrollConfig, SideBarPanelId, IFormulaFunction, IRecalcResult, IGridDataAccessor } from '../types';
|
|
2
|
+
import type { RowId, IOGridApi, IFilters, FilterValue, IRowSelectionChangeEvent, IStatusBarProps, IColumnDefinition, IDataSource, ISideBarDef, IVirtualScrollConfig, IResponsiveColumnsConfig, SideBarPanelId, IFormulaFunction, IRecalcResult, IGridDataAccessor } from '../types';
|
|
3
3
|
import type { IOGridProps, IOGridDataGridProps } from '../types';
|
|
4
4
|
import type { IColumnDef, IColumnGroupDef, ICellValueChangedEvent } from '../types';
|
|
5
5
|
import type { SideBarProps } from '../components/sidebar.component';
|
|
@@ -117,6 +117,7 @@ export declare class OGridService<T> {
|
|
|
117
117
|
readonly onError: import("@angular/core").WritableSignal<((error: unknown) => void) | undefined>;
|
|
118
118
|
readonly columnChooserProp: import("@angular/core").WritableSignal<boolean | "toolbar" | "sidebar" | undefined>;
|
|
119
119
|
readonly columnReorder: import("@angular/core").WritableSignal<boolean | undefined>;
|
|
120
|
+
readonly responsiveColumns: import("@angular/core").WritableSignal<boolean | IResponsiveColumnsConfig | undefined>;
|
|
120
121
|
readonly virtualScroll: import("@angular/core").WritableSignal<IVirtualScrollConfig | undefined>;
|
|
121
122
|
readonly ariaLabel: import("@angular/core").WritableSignal<string | undefined>;
|
|
122
123
|
readonly ariaLabelledBy: import("@angular/core").WritableSignal<string | undefined>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TemplateRef } from '@angular/core';
|
|
2
2
|
import type { IColumnDef, IColumnGroupDef, ICellValueChangedEvent } from './columnTypes';
|
|
3
|
-
|
|
3
|
+
import type { IResponsiveColumnsConfig } from '@alaarab/ogrid-core';
|
|
4
|
+
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IVirtualScrollConfig, IResponsiveColumnsConfig, IOGridApi, IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail, ISheetDef, FormulaReference, } from '@alaarab/ogrid-core';
|
|
4
5
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from '@alaarab/ogrid-core';
|
|
5
6
|
import type { RowId, UserLike, IFilters, FilterValue, RowSelectionMode, IRowSelectionChangeEvent, IStatusBarProps, IDataSource, ISideBarDef, IVirtualScrollConfig, IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail, ISheetDef, FormulaReference } from '@alaarab/ogrid-core';
|
|
6
7
|
/** Base props shared by both client-side and server-side OGrid modes. */
|
|
@@ -62,6 +63,8 @@ interface IOGridBaseProps<T> {
|
|
|
62
63
|
fullScreen?: boolean;
|
|
63
64
|
sideBar?: boolean | ISideBarDef;
|
|
64
65
|
columnReorder?: boolean;
|
|
66
|
+
/** Enable responsive column hiding based on container width. Columns with `responsivePriority` are auto-hidden on narrow containers. */
|
|
67
|
+
responsiveColumns?: boolean | IResponsiveColumnsConfig;
|
|
65
68
|
virtualScroll?: IVirtualScrollConfig;
|
|
66
69
|
/** Offload sort/filter to a Web Worker for large datasets. Falls back to sync when sort column has a custom compare. */
|
|
67
70
|
workerSort?: boolean;
|
|
@@ -162,6 +165,8 @@ export interface IOGridDataGridProps<T> {
|
|
|
162
165
|
peopleSearch?: (query: string) => Promise<UserLike[]>;
|
|
163
166
|
getUserByEmail?: (email: string) => Promise<UserLike | undefined>;
|
|
164
167
|
columnReorder?: boolean;
|
|
168
|
+
/** Responsive column hiding config. */
|
|
169
|
+
responsiveColumns?: boolean | IResponsiveColumnsConfig;
|
|
165
170
|
virtualScroll?: IVirtualScrollConfig;
|
|
166
171
|
/** Fixed row height in pixels. Overrides default row height (36px). */
|
|
167
172
|
rowHeight?: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { ColumnFilterType, IColumnFilterDef, IColumnMeta, IColumnDef, IColumnGroupDef, IColumnDefinition, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IValueParserParams, IDateFilterValue, HeaderCell, HeaderRow, } from './columnTypes';
|
|
2
|
-
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, IOGridProps, IOGridClientProps, IOGridServerProps, IOGridDataGridProps, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IVirtualScrollConfig, IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail, ISheetDef, FormulaReference, } from './dataGridTypes';
|
|
2
|
+
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, IOGridProps, IOGridClientProps, IOGridServerProps, IOGridDataGridProps, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IVirtualScrollConfig, IResponsiveColumnsConfig, IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail, ISheetDef, FormulaReference, } from './dataGridTypes';
|
|
3
3
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from './dataGridTypes';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-angular",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "OGrid Angular – Angular services, signals, and headless components for OGrid data grids.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"node": ">=18"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@alaarab/ogrid-core": "2.
|
|
38
|
+
"@alaarab/ogrid-core": "2.5.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@angular/core": "^21.0.0",
|