@thkl/agrid 0.1.12 → 0.1.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thkl/agrid",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "A signal-based, standalone data grid for Angular.",
5
5
  "keywords": [
6
6
  "angular",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "sideEffects": false,
25
25
  "peerDependencies": {
26
- "@angular/cdk": "21.2.14",
27
- "@angular/common": "21.2.17",
28
- "@angular/core": "21.2.17"
26
+ "@angular/cdk": ">=21.0.0 <23.0.0",
27
+ "@angular/common": ">=21.0.0 <23.0.0",
28
+ "@angular/core": ">=21.0.0 <23.0.0"
29
29
  },
30
30
  "dependencies": {
31
31
  "tslib": "^2.3.0"
@@ -127,6 +127,15 @@ interface AgridControlState {
127
127
  /** Per-field aggregate function set via the column menu. Only built-in string values are serializable. */
128
128
  aggregates?: Record<string, 'sum' | 'avg' | 'min' | 'max' | 'count'>;
129
129
  }
130
+ /** Detached, JSON-safe filter/search/sort state for {@link AgridControl}. */
131
+ interface AgridFilterModel {
132
+ /** Per-field column filter and sort state. */
133
+ filters: Record<string, ColumnFilter>;
134
+ /** Global quick-filter text. Empty or omitted means inactive. */
135
+ quickFilter?: string;
136
+ /** Ordered sorted fields, from highest to lowest priority. */
137
+ sortOrder?: string[];
138
+ }
130
139
  /**
131
140
  * Signal-based container for mutable grid UI state such as column widths and active filters.
132
141
  *
@@ -162,6 +171,8 @@ declare class AgridControl {
162
171
  private readonly _loading;
163
172
  private readonly _readonly;
164
173
  private readonly _autoAddRows;
174
+ private readonly _filterReapplyRevision;
175
+ private readonly _filterReapplyNeeded;
165
176
  private readonly _rowIndications;
166
177
  private readonly _changedCells;
167
178
  private readonly rowIndicationTimers;
@@ -202,6 +213,20 @@ declare class AgridControl {
202
213
  readonly autoAddRows: Signal<boolean>;
203
214
  /** Enable or disable automatic row insertion at runtime. */
204
215
  setAutoAddRows(value: boolean): void;
216
+ /**
217
+ * Reapply active filters to rows that were inserted while filters were already active.
218
+ * By default, newly inserted rows stay visible until this method is called.
219
+ */
220
+ reapplyFilters(): void;
221
+ /**
222
+ * `true` when inserted rows are currently bypassing active filters or sorts.
223
+ * Bind this to visual feedback for a "Reapply filters" action.
224
+ */
225
+ readonly filterReapplyNeeded: Signal<boolean>;
226
+ /** @internal Updates {@link filterReapplyNeeded} from the rendered grid projection. */
227
+ ɵsetFilterReapplyNeeded(value: boolean): void;
228
+ /** @internal Emits whenever {@link reapplyFilters} is called. */
229
+ readonly ɵfilterReapplyRevision: Signal<number>;
205
230
  /**
206
231
  * When `true`, the control column shows a drag handle and rows can be
207
232
  * reordered by dragging. Requires `showControlColumn` to be enabled on the grid.
@@ -360,6 +385,15 @@ declare class AgridControl {
360
385
  * Returns a default (inactive) filter when no state is stored for the field.
361
386
  */
362
387
  getFilter(field: string): ColumnFilter;
388
+ /** Replace the complete filter/sort state for one field. */
389
+ setFilter(field: string, filter: ColumnFilter): void;
390
+ /** Return a detached JSON-safe snapshot of active column filters, quick filter, and sort order. */
391
+ getFilterModel(): AgridFilterModel;
392
+ /**
393
+ * Replace active column filters, quick filter, and sort order from a filter model.
394
+ * Pass `null` to clear all filters and sorts.
395
+ */
396
+ setFilterModel(model: AgridFilterModel | null): void;
363
397
  /**
364
398
  * Set the free-text filter for a column.
365
399
  * An empty string removes the text filter for that column.
@@ -416,6 +450,7 @@ declare class AgridControl {
416
450
  toJSON(): AgridControlState;
417
451
  /** Restore an `AgridControl` from a previously serialized state. */
418
452
  static fromJSON(state: Partial<AgridControlState>): AgridControl;
453
+ private cloneFilters;
419
454
  }
420
455
 
421
456
  /**
@@ -439,6 +474,7 @@ declare class AgridDataSource<T extends object = any> {
439
474
  private readonly _rows;
440
475
  private _writableLinkedRows;
441
476
  private readonly _rowAdded;
477
+ private readonly _unfilteredAddedRows;
442
478
  private _changeSequence;
443
479
  /**
444
480
  * @param initialData Rows to seed the data source with.
@@ -455,6 +491,12 @@ declare class AgridDataSource<T extends object = any> {
455
491
  index: number;
456
492
  sequence: number;
457
493
  } | null>;
494
+ /**
495
+ * Rows inserted since filters were last explicitly reapplied.
496
+ * Attached grids include these rows even when they do not match active filters.
497
+ * @internal
498
+ */
499
+ readonly ɵunfilteredAddedRows: Signal<ReadonlySet<number>>;
458
500
  /**
459
501
  * Link an external row signal to this data source.
460
502
  *
@@ -507,6 +549,8 @@ declare class AgridDataSource<T extends object = any> {
507
549
  private updateRows;
508
550
  /** Replace the backing row array without copying. Intended for specialized datasource models. */
509
551
  protected setRows(rows: T[]): void;
552
+ /** @internal Clears the transient filter bypass applied to newly inserted rows. */
553
+ ɵreapplyFiltersToAddedRows(): void;
510
554
  }
511
555
 
512
556
  /** Sort entry sent to a server-side row datasource. */
@@ -541,6 +585,11 @@ interface AgridServerSideRowModelConfig<T extends object> {
541
585
  /** Known initial total. Omit when the server determines it from the first request. */
542
586
  initialRowCount?: number;
543
587
  }
588
+ /** Refresh behavior for server-side block cache invalidation. */
589
+ interface AgridServerSideRefreshOptions {
590
+ /** When `true`, clear all cached rows and replace them with placeholders. @default true */
591
+ purge?: boolean;
592
+ }
544
593
  /**
545
594
  * Sparse datasource that lazy-loads row blocks while retaining global datasource indices.
546
595
  * Attach it to an `AgridProvider` through `serverSideRowModel`.
@@ -552,6 +601,7 @@ declare class AgridServerSideRowModel<T extends object = any> extends AgridDataS
552
601
  private slots;
553
602
  private readonly loadedBlocks;
554
603
  private readonly loadingBlocks;
604
+ private readonly failedBlocks;
555
605
  private query;
556
606
  private queryKey;
557
607
  private generation;
@@ -569,8 +619,14 @@ declare class AgridServerSideRowModel<T extends object = any> extends AgridDataS
569
619
  constructor(config: AgridServerSideRowModelConfig<T>);
570
620
  /** Update server query state. A changed query invalidates cached blocks and starts at row zero. */
571
621
  setQuery(control: AgridControl | null, sortFields: readonly string[]): boolean;
572
- /** Invalidate all cached blocks while preserving a known total row count. */
573
- refresh(): void;
622
+ /** Invalidate cached blocks while preserving the current query and known total row count. */
623
+ refresh(options?: AgridServerSideRefreshOptions): void;
624
+ /** Clear the block cache and show placeholders until requested blocks are reloaded. */
625
+ purgeCache(): void;
626
+ /** Retry the most recently failed block, or a specific block index when supplied. */
627
+ retryFailedBlock(block?: number): void;
628
+ /** Failed block indices that can be passed to {@link retryFailedBlock}. */
629
+ failedBlockIndices(): number[];
574
630
  /** Ensure every block intersecting the requested half-open range is loaded. */
575
631
  ensureRange(startRow: number, endRow: number): void;
576
632
  /** Whether a logical datasource row has not been loaded yet. */
@@ -742,6 +798,8 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
742
798
  autoAddRows?: boolean;
743
799
  /** Show a 24 px control column with a drag handle and right-click context menu. */
744
800
  showControlColumn?: boolean;
801
+ /** Show automatic row numbers in the control column instead of the drag-handle glyph. @default false */
802
+ showRowNumbers?: boolean;
745
803
  /** Show row-marking checkboxes in a 48 px control column for clipboard inclusion. @default false */
746
804
  enableRowMarking?: boolean;
747
805
  /** Allow clicking column headers to mark complete columns. @default false */
@@ -764,6 +822,12 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
764
822
  * instead of filtering locally. @default false
765
823
  */
766
824
  enableQuickFilter?: boolean;
825
+ /**
826
+ * Show an Excel-style formula/input bar above the grid body. It displays the selected cell's raw
827
+ * value and lets users edit it in a wider input. Useful for formula and long text cells.
828
+ * @default false
829
+ */
830
+ showFormulaBar?: boolean;
767
831
  /**
768
832
  * Optional command bar rendered above the column headers. Buttons and dropdown items emit
769
833
  * their id through the grid's single `(menuBarAction)` output.
@@ -831,6 +895,14 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
831
895
  row: T;
832
896
  index: number;
833
897
  }) => string;
898
+ /**
899
+ * Optional application-owned predicate applied after built-in client-side filters and quick
900
+ * filter. Use this for filters that live outside the column menu.
901
+ */
902
+ externalFilter?: (params: {
903
+ row: T;
904
+ index: number;
905
+ }) => boolean;
834
906
  /**
835
907
  * Designate rows to pin to the top or bottom of the grid body. Pinned rows stay visible during
836
908
  * vertical scroll and are excluded from grouping and pagination, but remain fully interactive
@@ -915,18 +987,27 @@ declare class AgridProvider<T extends object = any> {
915
987
  private readonly _localizations;
916
988
  private exportBridge;
917
989
  private readonly _visibleRows;
990
+ private readonly _serverQuery;
918
991
  /**
919
992
  * The grid's currently filtered and sorted rows, as published by the rendered grid component.
920
993
  * Falls back to every datasource row when no grid is attached. Link a chart to this signal to
921
994
  * keep it in sync with the grid's filters and sorting.
922
995
  */
923
996
  readonly visibleRows: Signal<readonly T[]>;
997
+ /**
998
+ * Complete server-side filter/sort/page query published by the rendered grid.
999
+ * Useful for signal-backed stores that fetch data from an API. `null` means the grid is not in
1000
+ * server-side filtering or pagination mode.
1001
+ */
1002
+ readonly serverQuery: Signal<AgridServerQuery | null>;
924
1003
  /**
925
1004
  * @internal Published by the rendered grid whenever its filtered/sorted projection changes.
926
1005
  * Pass `null` on teardown so {@link visibleRows} falls back to the raw datasource. The grid works
927
1006
  * in terms of record rows; the public {@link visibleRows} re-types them as `T`.
928
1007
  */
929
1008
  ɵsetVisibleRows(rows: readonly Record<string, unknown>[] | null): void;
1009
+ /** @internal Published by the rendered grid whenever the server-side query state changes. */
1010
+ ɵsetServerQuery(query: AgridServerQuery | null): void;
930
1011
  /** Read-only view of registered per-locale text overrides. Used by the grid to resolve locale text. */
931
1012
  get localizations(): ReadonlyMap<string, AgridLocaleTextOverrides>;
932
1013
  /**
@@ -948,6 +1029,8 @@ declare class AgridProvider<T extends object = any> {
948
1029
  allowAddRows: boolean;
949
1030
  /** Whether the control column is rendered. */
950
1031
  showControlColumn: boolean;
1032
+ /** Whether the control column displays automatic row numbers. */
1033
+ showRowNumbers: boolean;
951
1034
  /** Whether rows can be marked for inclusion in clipboard copies. */
952
1035
  enableRowMarking: boolean;
953
1036
  /** Whether complete columns can be marked from their headers. */
@@ -962,6 +1045,8 @@ declare class AgridProvider<T extends object = any> {
962
1045
  filterDebounceMs: number;
963
1046
  /** Whether the global quick-filter box is shown above the grid. */
964
1047
  enableQuickFilter: boolean;
1048
+ /** Whether the formula/input bar is shown above the grid body. */
1049
+ showFormulaBar: boolean;
965
1050
  /** Commands rendered in the optional menu bar above the column headers. */
966
1051
  menuBarItems: AgridMenuBarItem<T>[];
967
1052
  /** Enabled sorting mode. */
@@ -995,6 +1080,11 @@ declare class AgridProvider<T extends object = any> {
995
1080
  row: T;
996
1081
  index: number;
997
1082
  }) => string;
1083
+ /** Optional application-owned row predicate applied by the client-side projection. */
1084
+ externalFilter?: (params: {
1085
+ row: T;
1086
+ index: number;
1087
+ }) => boolean;
998
1088
  /** Optional callback designating rows pinned to the top or bottom of the body. */
999
1089
  pinRow?: (row: T, index: number) => 'top' | 'bottom' | undefined;
1000
1090
  /** Whether master/detail expandable detail rows are enabled. */
@@ -1206,6 +1296,34 @@ interface ValueOption<TValue = unknown> {
1206
1296
  /** Human-readable label shown in the cell, dropdown, and filter menu. */
1207
1297
  label: string;
1208
1298
  }
1299
+ /**
1300
+ * Built-in editor surfaces available without registering a custom Angular component.
1301
+ *
1302
+ * - `'text'` uses the default single-line input.
1303
+ * - `'largeText'` uses a multiline textarea for longer content.
1304
+ * - `'richSelect'` uses a searchable select surface backed by `values` or `asyncValues`.
1305
+ * - `'formula'` uses a formula-friendly input. Pair it with {@link ColDefBase.formula} to
1306
+ * evaluate strings that start with `=`.
1307
+ */
1308
+ type AgridBuiltInEditor = 'text' | 'largeText' | 'richSelect' | 'formula';
1309
+ /** Parameters passed to {@link ColDefBase.asyncValues} when the rich-select editor opens. */
1310
+ interface AsyncValueOptionsParams<T extends object = any, K extends AgridField<T> = AgridField<T>> {
1311
+ /** Row currently being edited. */
1312
+ row: T;
1313
+ /** Current raw value stored in the edited cell. */
1314
+ value: T[K];
1315
+ /** Column definition for the edited cell. */
1316
+ column: ColDef<T, K>;
1317
+ /** Original datasource index for the edited row. */
1318
+ originalIndex: number;
1319
+ }
1320
+ /**
1321
+ * Sync or async value options used by the built-in rich-select editor.
1322
+ *
1323
+ * Strings are stored and displayed as-is. {@link ValueOption} entries display `label` while
1324
+ * committing `value` into the datasource.
1325
+ */
1326
+ type AgridAsyncValues<TValue = unknown> = readonly (string | ValueOption<TValue>)[] | Promise<readonly (string | ValueOption<TValue>)[]>;
1209
1327
  /** Width sentinel that makes a column fill the remaining horizontal space. */
1210
1328
  declare const ColDefAutoSize = -1;
1211
1329
  /** Label definition for a group displayed above contiguous column headers. */
@@ -1312,6 +1430,24 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
1312
1430
  * displayed label (`label`). Useful when the dataset stores IDs but should show names.
1313
1431
  */
1314
1432
  values?: string[] | ValueOption<T[K]>[];
1433
+ /**
1434
+ * Built-in editor to use for this column.
1435
+ * - `'richSelect'` renders a searchable select surface and can load async values.
1436
+ * - `'largeText'` renders a multiline textarea for longer notes.
1437
+ * - `'formula'` renders a formula input. Pair with `formula: true` to evaluate formulas.
1438
+ * - `'text'` forces the default text input.
1439
+ */
1440
+ editor?: AgridBuiltInEditor;
1441
+ /**
1442
+ * Values loaded when the built-in rich-select editor opens. Use this for large or remote option
1443
+ * lists. Static `values` are used immediately; `asyncValues` can return a Promise.
1444
+ */
1445
+ asyncValues?: (params: AsyncValueOptionsParams<T, K>) => AgridAsyncValues<T[K]>;
1446
+ /**
1447
+ * Evaluate strings beginning with `=` as row-local formulas for display, filtering, and export.
1448
+ * Formulas support arithmetic, parentheses, and field-name references from the same row.
1449
+ */
1450
+ formula?: boolean;
1315
1451
  /**
1316
1452
  * Optional display formatter applied when the column has no `values` list.
1317
1453
  * Receives the raw cell value and returns the string to display in the cell.
@@ -1346,6 +1482,16 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
1346
1482
  * At least one filterable column must exist for the filter row to appear.
1347
1483
  */
1348
1484
  filterable?: boolean;
1485
+ /**
1486
+ * Custom component rendered inside this column's filter menu.
1487
+ * The component injects `AGRID_FILTER_CONTEXT` to read and update the field filter.
1488
+ */
1489
+ filterComponent?: Type<unknown>;
1490
+ /**
1491
+ * Maximum number of value-filter choices rendered at once. Search still runs against the full
1492
+ * value list, then caps the displayed matches. Defaults to `250`.
1493
+ */
1494
+ filterValueLimit?: number;
1349
1495
  /**
1350
1496
  * Set to `true` to allow grouping the grid by this column.
1351
1497
  * When set, the filter dropdown shows a "Group by" toggle for this column.
@@ -1747,6 +1893,32 @@ type CellInfoEvent<T extends object = any> = {
1747
1893
  column: ColDef<T, K>;
1748
1894
  };
1749
1895
  }[AgridField<T>];
1896
+ /** Current selected row returned by {@link AgridComponent.getCurrentRow}. */
1897
+ interface AgridCurrentRow<T extends object = any> {
1898
+ /** Selected datasource row. */
1899
+ row: T;
1900
+ /** Zero-based row index in the datasource. */
1901
+ originalIndex: number;
1902
+ }
1903
+ /** Current selected cell returned by {@link AgridComponent.getCurrentCell} and emitted by `(cellSelect)`. */
1904
+ type AgridCurrentCell<T extends object = any> = {
1905
+ [K in AgridField<T>]: {
1906
+ /** Selected cell position. */
1907
+ position: CellPosition;
1908
+ /** Datasource row containing the selected cell. */
1909
+ row: T;
1910
+ /** Zero-based row index in the datasource. */
1911
+ originalIndex: number;
1912
+ /** Selected column field. */
1913
+ field: K;
1914
+ /** Current raw field value. */
1915
+ value: T[K];
1916
+ /** Column definition for the selected cell. */
1917
+ column: ColDef<T, K>;
1918
+ };
1919
+ }[AgridField<T>];
1920
+ /** Emitted when the selected cell changes. `null` means the cell selection was cleared. */
1921
+ type CellSelectEvent<T extends object = any> = AgridCurrentCell<T>;
1750
1922
  /**
1751
1923
  * Emitted asynchronously after an edit changes a row and the data source has been updated.
1752
1924
  *
@@ -1889,12 +2061,49 @@ interface PageChangeEvent {
1889
2061
  /** Zero-based index of the last row on this page (inclusive). */
1890
2062
  endRow: number;
1891
2063
  }
1892
- /** Emitted when a header text filter or column-menu condition changes server-side. */
2064
+ /** Sort entry used by server-side query snapshots. */
2065
+ interface AgridServerSort {
2066
+ /** Field name of the sorted column. */
2067
+ field: string;
2068
+ /** Sort direction for this field. */
2069
+ direction: 'asc' | 'desc';
2070
+ }
2071
+ /**
2072
+ * Complete server-side query snapshot derived from `AgridControl`.
2073
+ *
2074
+ * It is emitted by `(serverQueryChange)` and published as `AgridProvider.serverQuery` whenever
2075
+ * `serverSideFiltering` is enabled or `AgridControl.totalRows` enables server-side pagination.
2076
+ * `endRow` follows the existing `(pageChange)` event: it is inclusive. Server totals are not part
2077
+ * of the query so updating `control.setTotalRows(...)` after a response does not itself trigger a
2078
+ * second fetch.
2079
+ */
2080
+ interface AgridServerQuery {
2081
+ /** Active column filters keyed by field. */
2082
+ filters: Readonly<Record<string, ColumnFilter>>;
2083
+ /** Ordered sort stack after the grid's `sortOption` is applied. */
2084
+ sort: readonly AgridServerSort[];
2085
+ /** Global quick-filter text. Empty string when inactive. */
2086
+ quickFilter: string;
2087
+ /** Current page number (1-based). */
2088
+ page: number;
2089
+ /** Rows per page. `0` means no page size is configured. */
2090
+ pageSize: number;
2091
+ /** Zero-based index of the first requested row. */
2092
+ startRow: number;
2093
+ /** Zero-based index of the last requested row (inclusive), or `-1` when no rows are known. */
2094
+ endRow: number;
2095
+ }
2096
+ /** Emitted when a header text, value, or column-menu condition changes server-side. */
1893
2097
  interface FilterChangeEvent {
1894
2098
  /** Field name of the filtered column. */
1895
2099
  field: string;
1896
2100
  /** Current free-text filter value. An empty string clears the text filter. */
1897
2101
  value: string;
2102
+ /**
2103
+ * Current value-checklist selection.
2104
+ * `null` means all values are selected / no value filter is active.
2105
+ */
2106
+ selectedValues?: readonly string[] | null;
1898
2107
  /**
1899
2108
  * Text, number, or date condition operator from the column-menu UI.
1900
2109
  * `null` clears the condition.
@@ -2178,7 +2387,7 @@ interface AgridSidebarDetailField {
2178
2387
  }
2179
2388
 
2180
2389
  /**
2181
- * Excel-like data grid for Angular 21.
2390
+ * Excel-like data grid for Angular 21 and 22.
2182
2391
  *
2183
2392
  * ## Minimal setup
2184
2393
  * ```html
@@ -2211,13 +2420,15 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2211
2420
  readonly autoAddRows: Signal<boolean>;
2212
2421
  readonly enableRowMarking: Signal<boolean>;
2213
2422
  readonly enableColumnMarking: Signal<boolean>;
2423
+ readonly showRowNumbers: Signal<boolean>;
2214
2424
  readonly showControlColumn: Signal<boolean>;
2215
- readonly controlColumnWidth: Signal<24 | 48>;
2425
+ readonly controlColumnWidth: Signal<number>;
2216
2426
  readonly showSidebar: Signal<boolean>;
2217
2427
  readonly autoOpenDetail: Signal<boolean>;
2218
2428
  readonly serverSideFiltering: Signal<boolean>;
2219
2429
  readonly filterDebounceMs: Signal<number>;
2220
2430
  readonly enableQuickFilter: Signal<boolean>;
2431
+ readonly showFormulaBar: Signal<boolean>;
2221
2432
  readonly menuBarItems: Signal<_thkl_agrid.AgridMenuBarItem<T>[]>;
2222
2433
  readonly quickFilterValue: Signal<string>;
2223
2434
  readonly sortOption: Signal<"single" | "multi" | "none">;
@@ -2243,6 +2454,10 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2243
2454
  row: Record<string, unknown>;
2244
2455
  index: number;
2245
2456
  }) => string) | undefined>;
2457
+ readonly externalFilterFn: Signal<((params: {
2458
+ row: Record<string, unknown>;
2459
+ index: number;
2460
+ }) => boolean) | undefined>;
2246
2461
  /** Host callback designating pinned rows, or `undefined`. */
2247
2462
  readonly pinRowFn: Signal<((row: Record<string, unknown>, index: number) => "top" | "bottom" | undefined) | undefined>;
2248
2463
  readonly pivotRowColumnField: Signal<Extract<keyof T, string> | undefined>;
@@ -2330,6 +2545,8 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2330
2545
  filterChange: _angular_core.OutputEmitterRef<FilterChangeEvent>;
2331
2546
  /** Emitted when a column sort changes in server-side filtering mode. */
2332
2547
  sortChange: _angular_core.OutputEmitterRef<SortChangeEvent>;
2548
+ /** Emitted with the complete server-side filter/sort/page query snapshot. */
2549
+ serverQueryChange: _angular_core.OutputEmitterRef<AgridServerQuery>;
2333
2550
  /**
2334
2551
  * Emitted (debounced) when the global quick-filter text changes in server-side filtering mode.
2335
2552
  * The host should refetch rows matching the text. Not emitted in client mode, where the grid
@@ -2340,12 +2557,15 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2340
2557
  validationFailed: _angular_core.OutputEmitterRef<ValidationFailedEvent<any>>;
2341
2558
  /** Emitted when a column's optional cell information button is clicked. */
2342
2559
  cellInfo: _angular_core.OutputEmitterRef<CellInfoEvent<T>>;
2560
+ /** Emitted when the selected cell changes. `null` = cell selection cleared. */
2561
+ cellSelect: _angular_core.OutputEmitterRef<CellSelectEvent<T> | null>;
2343
2562
  /** Emitted for every enabled menu-bar button or dropdown item, carrying its configured id. */
2344
2563
  menuBarAction: _angular_core.OutputEmitterRef<string>;
2345
2564
  /** Emitted if there is a Detail pane Action without text property */
2346
2565
  detailAction: _angular_core.OutputEmitterRef<RowDetailActionEvent<T>>;
2347
2566
  /** Currently focused cell, or `null`. */
2348
2567
  readonly selectedCell: _angular_core.WritableSignal<CellPosition | null>;
2568
+ private lastEmittedCell;
2349
2569
  /** Original indices of rows whose master/detail panel is currently expanded. */
2350
2570
  private readonly _expandedDetailIds;
2351
2571
  /**
@@ -2354,9 +2574,13 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2354
2574
  * provider predicate by {@link effectivePinRow}.
2355
2575
  */
2356
2576
  private readonly _pinnedRows;
2577
+ readonly formulaBarDraft: _angular_core.WritableSignal<string>;
2578
+ private readonly formulaBarFocused;
2579
+ private formulaBarEditCell;
2357
2580
  private readonly markedIndices;
2358
2581
  private readonly markedFields;
2359
2582
  private firstDataRenderedEmitted;
2583
+ private serverQueryProvider;
2360
2584
  /** Original datasource indices marked for inclusion in copy operations. */
2361
2585
  readonly markedRowIndices: Signal<ReadonlySet<number>>;
2362
2586
  /** Fields currently marked as complete columns. */
@@ -2375,6 +2599,13 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2375
2599
  get editSeedChar(): _angular_core.WritableSignal<string>;
2376
2600
  /** Whether the active text editor should select all text when it opens. */
2377
2601
  get selectTextOnEdit(): _angular_core.WritableSignal<boolean>;
2602
+ /** Return the first currently selected row, or `null` when no row is selected. */
2603
+ getCurrentRow(): AgridCurrentRow<T> | null;
2604
+ /** Return the currently selected cell with row, field, value, and column metadata. */
2605
+ getCurrentCell(): AgridCurrentCell<T> | null;
2606
+ readonly formulaBarLabel: Signal<string>;
2607
+ private resolveCurrentCell;
2608
+ private sameCell;
2378
2609
  /** Toggle the sidebar open/closed. */
2379
2610
  toggleSidebar(): void;
2380
2611
  /** @internal */
@@ -2468,6 +2699,10 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2468
2699
  readonly pinnedBodyColumns: Signal<AgridBodyColumn[]>;
2469
2700
  readonly scrollableBodyColumns: Signal<AgridBodyColumn[]>;
2470
2701
  readonly rightBodyColumns: Signal<AgridBodyColumn[]>;
2702
+ /** @internal Whether a pane needs per-cell span resolution. */
2703
+ readonly pinnedPaneHasSpans: Signal<boolean>;
2704
+ readonly scrollablePaneHasSpans: Signal<boolean>;
2705
+ readonly rightPaneHasSpans: Signal<boolean>;
2471
2706
  /**
2472
2707
  * Resolves the per-column bindings shared by every data, footer, and ghost cell. Reads only
2473
2708
  * layout/drag/pinning signals, so the result is reused across all rows and recomputes only
@@ -2531,6 +2766,10 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2531
2766
  /** Virtual scroll source — injects ghost row during a reorder drag. */
2532
2767
  /** Maps originalIndex → true if the data row should receive the odd-row stripe. Counts only data rows, so group headers don't shift the pattern. */
2533
2768
  readonly dataRowIsOdd: Signal<Map<number, boolean>>;
2769
+ /** Maps originalIndex → 1-based filtered/sorted row number for the control column. */
2770
+ readonly rowNumbers: Signal<Map<number, number>>;
2771
+ /** Width needed for the largest currently rendered row number. */
2772
+ readonly rowNumberColumnWidth: Signal<number>;
2534
2773
  readonly displayItems: Signal<GridItem[]>;
2535
2774
  /** Rows pinned to the top of the body (rendered in a fixed container, outside virtual scroll). */
2536
2775
  readonly pinnedTopItems: Signal<{
@@ -2654,15 +2893,20 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2654
2893
  private readonly dirtyInlineRows;
2655
2894
  private dirtyRowsDataSource;
2656
2895
  private changedCellsDataSource;
2896
+ private dirtyInlineRowsIdleTimer;
2897
+ private readonly dirtyInlineRowsIdleFlushMs;
2657
2898
  private emitEditEvents;
2658
2899
  private emitSidebarEditEvents;
2659
2900
  private emitRecordEdit;
2660
2901
  private markInlineRowDirty;
2661
2902
  private markCellChanged;
2662
2903
  private flushDirtyInlineRows;
2904
+ private scheduleDirtyInlineRowsIdleFlush;
2905
+ private clearDirtyInlineRowsIdleFlush;
2663
2906
  private reconcileDirtyInlineRowsAfterRemoval;
2664
2907
  private emitRowChanged;
2665
2908
  private createRecordEvent;
2909
+ private buildServerQuery;
2666
2910
  constructor();
2667
2911
  /** @internal */
2668
2912
  isDataRowItem(item: GridItem): item is {
@@ -2684,6 +2928,8 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2684
2928
  isPathTreeNodeItem(item: GridItem): boolean;
2685
2929
  /** @internal */
2686
2930
  getItemOriginalIndex(item: GridItem): number | null;
2931
+ /** @internal 1-based row number for visible data rows. */
2932
+ visibleRowNumber(item: GridItem): number | null;
2687
2933
  /** @internal True when the item is a master/detail panel row. */
2688
2934
  isDetailRowItem(item: GridItem): item is DetailRowItem;
2689
2935
  /** @internal Rendered pixel height of a virtual-scroll item (detail panels are taller). */
@@ -2786,6 +3032,8 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2786
3032
  /** @internal Whether more than one column is currently sorted. */
2787
3033
  hasMultiSort(): boolean;
2788
3034
  getTextFilter(field: string): string;
3035
+ /** @internal Complete filter snapshot for custom filter components. */
3036
+ getColumnFilter(field: string): ColumnFilter;
2789
3037
  /** @internal Condition input type for a column, or `null` when unsupported. */
2790
3038
  getMenuFilterType(field: string): 'text' | 'number' | 'date' | null;
2791
3039
  /** @internal Short label for an active header condition. */
@@ -2845,6 +3093,18 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2845
3093
  onStartEdit(originalIndex: number, ci: number): void;
2846
3094
  /** @internal */
2847
3095
  onDraftChange(value: unknown): void;
3096
+ /** @internal */
3097
+ onFormulaBarFocus(): void;
3098
+ /** @internal */
3099
+ onFormulaBarInput(event: Event): void;
3100
+ /** @internal */
3101
+ onFormulaBarBlur(): void;
3102
+ /** @internal */
3103
+ onFormulaBarKeydown(event: KeyboardEvent): void;
3104
+ /** @internal */
3105
+ commitFormulaBar(targetCell?: CellPosition | null): boolean;
3106
+ private finishFormulaBarInteraction;
3107
+ private resetFormulaBarDraft;
2848
3108
  /** @internal A custom cell editor requested a commit (e.g. picking a value). */
2849
3109
  onEditorCommit(): void;
2850
3110
  /** @internal A custom cell editor requested cancellation. */
@@ -2865,6 +3125,7 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2865
3125
  onCellPointerDown(event: PointerEvent, originalIndex: number, colIndex: number): void;
2866
3126
  /** @internal Main keyboard handler delegated from the wrapper div. */
2867
3127
  onKeyDown(event: KeyboardEvent): void;
3128
+ private isToolbarInputEvent;
2868
3129
  /** @internal Clears cell navigation while a header filter control owns focus. */
2869
3130
  onGridFocusIn(event: FocusEvent): void;
2870
3131
  /** Open the find panel and focus its input. */
@@ -2979,12 +3240,19 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
2979
3240
  /** @internal */
2980
3241
  onMenuToggleValue(field: string, rawStr: string): void;
2981
3242
  /** @internal */
3243
+ onMenuReplaceFilter(field: string, filter: ColumnFilter): void;
3244
+ /** @internal */
2982
3245
  onSidebarToggleColumn(field: string): void;
2983
3246
  /** @internal Sets every column in a sidebar header group to the requested visibility. */
2984
3247
  onSidebarToggleColumnGroup(fields: string[], visible: boolean): void;
2985
3248
  /** @internal Mirrors vertical scrolling from the main viewport into both pinned panes. */
2986
3249
  onBodyScroll(): void;
2987
3250
  private ensureServerRowsVisible;
3251
+ /** Refresh the attached server-side row model and optionally reset vertical scroll to row zero. */
3252
+ refreshServerSideRows(options?: {
3253
+ purge?: boolean;
3254
+ resetScroll?: boolean;
3255
+ }): void;
2988
3256
  /** @internal Keeps the row-delete prompt visible while columns scroll horizontally. */
2989
3257
  onHorizontalScroll(): void;
2990
3258
  /** @internal Refreshes the scroll offset / viewport width driving column virtualization. */
@@ -3023,7 +3291,7 @@ declare class AgridComponent<T extends object = any> implements OnChanges {
3023
3291
  getColumnWidth(col: ColDef): number;
3024
3292
  private getColumnWidthToken;
3025
3293
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgridComponent<any>, never>;
3026
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgridComponent<any>, "agrid", never, { "provider": { "alias": "provider"; "required": false; "isSignal": true; }; }, { "cellEdit": "cellEdit"; "recordEdit": "recordEdit"; "rowRemoved": "rowRemoved"; "prepareAddRecord": "prepareAddRecord"; "rowReorder": "rowReorder"; "rowSelect": "rowSelect"; "rowMark": "rowMark"; "columnMark": "columnMark"; "columnHeaderAction": "columnHeaderAction"; "firstDataRendered": "firstDataRendered"; "rowDoubleClicked": "rowDoubleClicked"; "rowClick": "rowClick"; "treeNodeClick": "treeNodeClick"; "settingsChange": "settingsChange"; "treeNodeDoubleClicked": "treeNodeDoubleClicked"; "rowChanged": "rowChanged"; "pageChange": "pageChange"; "filterChange": "filterChange"; "sortChange": "sortChange"; "quickFilterChange": "quickFilterChange"; "validationFailed": "validationFailed"; "cellInfo": "cellInfo"; "menuBarAction": "menuBarAction"; "detailAction": "detailAction"; }, never, never, true, never>;
3294
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgridComponent<any>, "agrid", never, { "provider": { "alias": "provider"; "required": false; "isSignal": true; }; }, { "cellEdit": "cellEdit"; "recordEdit": "recordEdit"; "rowRemoved": "rowRemoved"; "prepareAddRecord": "prepareAddRecord"; "rowReorder": "rowReorder"; "rowSelect": "rowSelect"; "rowMark": "rowMark"; "columnMark": "columnMark"; "columnHeaderAction": "columnHeaderAction"; "firstDataRendered": "firstDataRendered"; "rowDoubleClicked": "rowDoubleClicked"; "rowClick": "rowClick"; "treeNodeClick": "treeNodeClick"; "settingsChange": "settingsChange"; "treeNodeDoubleClicked": "treeNodeDoubleClicked"; "rowChanged": "rowChanged"; "pageChange": "pageChange"; "filterChange": "filterChange"; "sortChange": "sortChange"; "serverQueryChange": "serverQueryChange"; "quickFilterChange": "quickFilterChange"; "validationFailed": "validationFailed"; "cellInfo": "cellInfo"; "cellSelect": "cellSelect"; "menuBarAction": "menuBarAction"; "detailAction": "detailAction"; }, never, never, true, never>;
3027
3295
  }
3028
3296
 
3029
3297
  /** Identifier supported by the standalone page selector. */
@@ -3250,6 +3518,42 @@ interface AgridRendererContext<TValue = unknown> {
3250
3518
  /** DI token a custom {@link ColDef.cellRendererComponent} component injects to read cell data. */
3251
3519
  declare const AGRID_RENDERER_CONTEXT: InjectionToken<AgridRendererContext<unknown>>;
3252
3520
 
3521
+ /**
3522
+ * Runtime context handed to a custom column-filter component through dependency injection.
3523
+ *
3524
+ * Custom filters should write normal {@link ColumnFilter} state through {@link setFilter}. That
3525
+ * keeps filter persistence, server query generation, and the active-filter header state aligned
3526
+ * with built-in filters.
3527
+ *
3528
+ * @example
3529
+ * ```ts
3530
+ * const ctx = inject(AGRID_FILTER_CONTEXT);
3531
+ * ctx.setFilter({ ...ctx.filter(), text: 'active' });
3532
+ * ```
3533
+ */
3534
+ interface AgridFilterContext {
3535
+ /** Field currently being filtered. */
3536
+ readonly field: string;
3537
+ /** Column definition for the active filter menu. */
3538
+ readonly column: ColDef;
3539
+ /** Shared grid control that owns filter state. */
3540
+ readonly control: AgridControl | null;
3541
+ /** Current filter snapshot for this field. */
3542
+ readonly filter: Signal<ColumnFilter>;
3543
+ /** Replace this field's filter state, preserving any fields the component copies forward. */
3544
+ setFilter(filter: ColumnFilter): void;
3545
+ /** Clear this field's filter state. */
3546
+ clear(): void;
3547
+ /** Close the column menu. */
3548
+ close(): void;
3549
+ }
3550
+ /**
3551
+ * DI token a custom {@link ColDef.filterComponent} injects to control column filtering.
3552
+ *
3553
+ * The token is only available while the component is rendered inside an aGrid column menu.
3554
+ */
3555
+ declare const AGRID_FILTER_CONTEXT: InjectionToken<AgridFilterContext>;
3556
+
3253
3557
  /**
3254
3558
  * Zero-dependency chart geometry. Pure math that turns a typed dataset + a diagram type into flat
3255
3559
  * SVG primitives (bars, line/area paths, pie slices, gridlines, labels), so the chart component
@@ -3440,6 +3744,6 @@ declare class AgridChartComponent {
3440
3744
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgridChartComponent, "agrid-chart", never, { "provider": { "alias": "provider"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
3441
3745
  }
3442
3746
 
3443
- export { AGRID_CHART_PALETTE, AGRID_EDITOR_CONTEXT, AGRID_LOCALE_TEXT, AGRID_RENDERER_CONTEXT, AgridBrowserAdapter, AgridChartComponent, AgridChartProvider, AgridComponent, AgridControl, AgridDataSource, AgridPageSelectorComponent, AgridProvider, AgridServerSideRowModel, AgridTreeComponent, AgridTreeProvider, ColDefAutoSize, buildChart };
3444
- export type { AgridAggregate, AgridChartData, AgridChartLayout, AgridChartOptions, AgridChartProviderConfig, AgridChartSeries, AgridChartType, AgridColumnHeaderMenuItem, AgridControlState, AgridEditorContext, AgridEnterEditAction, AgridField, AgridLocaleKey, AgridLocaleText, AgridLocaleTextOverrides, AgridMenuBarContext, AgridMenuBarItem, AgridMenuBarMenuItem, AgridMenuBarState, AgridPageId, AgridPageItem, AgridParentTreeConfig, AgridPathSegmentParams, AgridPathTreeConfig, AgridPivotConfig, AgridPivotSettings, AgridProviderConfig, AgridRendererContext, AgridRowIndication, AgridSelectionSummary, AgridServerSideDatasource, AgridServerSideRequest, AgridServerSideResult, AgridServerSideRowModelConfig, AgridServerSideSort, AgridSettings, AgridTreeConfig, AgridTreeNodeEvent, AgridTreeProviderConfig, AgridTreeSelectionEvent, AgridTreeSelectionMode, CellContextMenuItem, CellFormat, CellFormatParams, CellInfoEvent, CellPosition, CellReadonlyParams, CellSpanParams, ColDef, ColumnFilter, ColumnHeaderActionEvent, ColumnMarkEvent, DetailAction, DetailActionParams, DetailRowItem, FilterChangeEvent, FilterOperator, FirstDataRenderedEvent, GridEditEvent, GroupAction, HeaderGroup, HistoryEntry, HistoryItem, InputMaskParams, NewRecord, PageChangeEvent, PathTreeNodeItem, RecordEditEvent, RowClickEvent, RowMarkEvent, RowRemovedEvent, RowReorderEvent, RowSelectEvent, RowUpdateEvent, SortChangeEvent, TreeNodeClickEvent, TreeRowItem, ValidationFailedEvent, ValueOption };
3747
+ export { AGRID_CHART_PALETTE, AGRID_EDITOR_CONTEXT, AGRID_FILTER_CONTEXT, AGRID_LOCALE_TEXT, AGRID_RENDERER_CONTEXT, AgridBrowserAdapter, AgridChartComponent, AgridChartProvider, AgridComponent, AgridControl, AgridDataSource, AgridPageSelectorComponent, AgridProvider, AgridServerSideRowModel, AgridTreeComponent, AgridTreeProvider, ColDefAutoSize, buildChart };
3748
+ export type { AgridAggregate, AgridAsyncValues, AgridBuiltInEditor, AgridChartData, AgridChartLayout, AgridChartOptions, AgridChartProviderConfig, AgridChartSeries, AgridChartType, AgridColumnHeaderMenuItem, AgridControlState, AgridCurrentCell, AgridCurrentRow, AgridEditorContext, AgridEnterEditAction, AgridField, AgridFilterContext, AgridLocaleKey, AgridLocaleText, AgridLocaleTextOverrides, AgridMenuBarContext, AgridMenuBarItem, AgridMenuBarMenuItem, AgridMenuBarState, AgridPageId, AgridPageItem, AgridParentTreeConfig, AgridPathSegmentParams, AgridPathTreeConfig, AgridPivotConfig, AgridPivotSettings, AgridProviderConfig, AgridRendererContext, AgridRowIndication, AgridSelectionSummary, AgridServerQuery, AgridServerSideDatasource, AgridServerSideRefreshOptions, AgridServerSideRequest, AgridServerSideResult, AgridServerSideRowModelConfig, AgridServerSideSort, AgridServerSort, AgridSettings, AgridTreeConfig, AgridTreeNodeEvent, AgridTreeProviderConfig, AgridTreeSelectionEvent, AgridTreeSelectionMode, AsyncValueOptionsParams, CellContextMenuItem, CellFormat, CellFormatParams, CellInfoEvent, CellPosition, CellReadonlyParams, CellSelectEvent, CellSpanParams, ColDef, ColumnFilter, ColumnHeaderActionEvent, ColumnMarkEvent, DetailAction, DetailActionParams, DetailRowItem, FilterChangeEvent, FilterOperator, FirstDataRenderedEvent, GridEditEvent, GroupAction, HeaderGroup, HistoryEntry, HistoryItem, InputMaskParams, NewRecord, PageChangeEvent, PathTreeNodeItem, RecordEditEvent, RowClickEvent, RowMarkEvent, RowRemovedEvent, RowReorderEvent, RowSelectEvent, RowUpdateEvent, SortChangeEvent, TreeNodeClickEvent, TreeRowItem, ValidationFailedEvent, ValueOption };
3445
3749
  //# sourceMappingURL=thkl-agrid.d.ts.map