@thkl/agrid 0.1.10 → 0.1.12
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/README.md +155 -6
- package/fesm2022/thkl-agrid.mjs +3516 -715
- package/fesm2022/thkl-agrid.mjs.map +1 -1
- package/package.json +1 -1
- package/types/thkl-agrid.d.ts +1081 -70
- package/types/thkl-agrid.d.ts.map +1 -1
package/types/thkl-agrid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Signal, WritableSignal, DestroyRef } from '@angular/core';
|
|
2
|
+
import { Signal, WritableSignal, Type, DestroyRef, OnChanges, InjectionToken } from '@angular/core';
|
|
3
3
|
import * as _thkl_agrid from '@thkl/agrid';
|
|
4
4
|
|
|
5
5
|
/** Guarded access to browser-only APIs used by the grid. @internal */
|
|
@@ -34,6 +34,9 @@ declare class AgridBrowserAdapter {
|
|
|
34
34
|
writeClipboard(text: string): Promise<boolean>;
|
|
35
35
|
/** Downloads text through a temporary object URL and anchor element. */
|
|
36
36
|
downloadText(filename: string, text: string, mimeType: string): boolean;
|
|
37
|
+
/** Downloads raw bytes (e.g. a generated `.xlsx`) through a temporary object URL. */
|
|
38
|
+
downloadBytes(filename: string, bytes: Uint8Array, mimeType: string): boolean;
|
|
39
|
+
private downloadBlob;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
/**
|
|
@@ -80,6 +83,15 @@ interface ColumnFilter {
|
|
|
80
83
|
/** Upper-bound operand used only when {@link operator} is `'between'`. */
|
|
81
84
|
operand2?: string | null;
|
|
82
85
|
}
|
|
86
|
+
/** Transient row indication state produced by {@link AgridControl.indicate}. */
|
|
87
|
+
interface AgridRowIndication {
|
|
88
|
+
/** CSS color shown while the row flash is active. */
|
|
89
|
+
color: string;
|
|
90
|
+
/** Fade duration in milliseconds. */
|
|
91
|
+
durationMs: number;
|
|
92
|
+
/** `true` while the row flash is present. */
|
|
93
|
+
active: boolean;
|
|
94
|
+
}
|
|
83
95
|
/** Serializable snapshot of the grid's UI state. Used with `toJSON` / `fromJSON`. */
|
|
84
96
|
interface AgridControlState {
|
|
85
97
|
/** Per-field column width overrides in pixels. */
|
|
@@ -147,8 +159,49 @@ declare class AgridControl {
|
|
|
147
159
|
private readonly _totalRows;
|
|
148
160
|
private readonly _aggregates;
|
|
149
161
|
private readonly _sortOrder;
|
|
162
|
+
private readonly _loading;
|
|
163
|
+
private readonly _readonly;
|
|
164
|
+
private readonly _autoAddRows;
|
|
165
|
+
private readonly _rowIndications;
|
|
166
|
+
private readonly _changedCells;
|
|
167
|
+
private readonly rowIndicationTimers;
|
|
150
168
|
/** @param state Optional initial state, e.g. deserialized from storage. */
|
|
151
169
|
constructor(state?: Partial<AgridControlState>);
|
|
170
|
+
/** Whether the grid displays its loading overlay. This transient state is not serialized. */
|
|
171
|
+
readonly loading: Signal<boolean>;
|
|
172
|
+
/** Show or hide the grid loading overlay. */
|
|
173
|
+
setLoading(value: boolean): void;
|
|
174
|
+
/** Transient row flash indicators keyed by original datasource row index. */
|
|
175
|
+
readonly rowIndications: Signal<ReadonlyMap<number, AgridRowIndication>>;
|
|
176
|
+
/**
|
|
177
|
+
* Flash one datasource row with `color`, then fade back over `durationMs`.
|
|
178
|
+
* This is transient UI state and is not serialized.
|
|
179
|
+
*/
|
|
180
|
+
indicate(rowIndex: number, color: string, durationMs?: number): void;
|
|
181
|
+
private clearRowIndicationTimers;
|
|
182
|
+
/** Changed-cell markers keyed by original datasource row index and field. */
|
|
183
|
+
readonly changedCells: Signal<ReadonlySet<string>>;
|
|
184
|
+
/** Mark one cell as changed. Used by the grid when `showChangedCellIndicator` is enabled. */
|
|
185
|
+
markChangedCell(rowIndex: number, field: string): void;
|
|
186
|
+
/**
|
|
187
|
+
* Clears changed-cell markers after persistence succeeds.
|
|
188
|
+
* Omit `rowIndex` to clear every marker; omit `fields` to clear the whole row.
|
|
189
|
+
*/
|
|
190
|
+
clearChangedCells(rowIndex?: number, fields?: readonly string[]): void;
|
|
191
|
+
/** Returns whether one cell is currently marked as changed. */
|
|
192
|
+
isCellChanged(rowIndex: number, field: string): boolean;
|
|
193
|
+
/** Reconciles changed-cell markers after a datasource row is removed. */
|
|
194
|
+
reconcileChangedCellsAfterRemoval(removedIndex: number): void;
|
|
195
|
+
private changedCellKey;
|
|
196
|
+
private parseChangedCellKey;
|
|
197
|
+
/** Whether all grid editing and mutation UI is disabled. This transient state is not serialized. */
|
|
198
|
+
readonly readonly: Signal<boolean>;
|
|
199
|
+
/** Enable or disable readonly mode at runtime. */
|
|
200
|
+
setReadonly(value: boolean): void;
|
|
201
|
+
/** Whether navigation beyond the final row automatically inserts a row. Not serialized. */
|
|
202
|
+
readonly autoAddRows: Signal<boolean>;
|
|
203
|
+
/** Enable or disable automatic row insertion at runtime. */
|
|
204
|
+
setAutoAddRows(value: boolean): void;
|
|
152
205
|
/**
|
|
153
206
|
* When `true`, the control column shows a drag handle and rows can be
|
|
154
207
|
* reordered by dragging. Requires `showControlColumn` to be enabled on the grid.
|
|
@@ -353,6 +406,12 @@ declare class AgridControl {
|
|
|
353
406
|
hasActiveFilter(field: string): boolean;
|
|
354
407
|
/** Return `true` when the quick filter or ANY column has an active filter or sort. */
|
|
355
408
|
hasAnyActiveFilter(): boolean;
|
|
409
|
+
/**
|
|
410
|
+
* Replace the live serializable state from a plain object.
|
|
411
|
+
* Missing properties reset to their defaults, making a loaded snapshot deterministic.
|
|
412
|
+
* Transient loading, readonly, auto-add, selection, and edit-history state are preserved.
|
|
413
|
+
*/
|
|
414
|
+
loadState(state: Partial<AgridControlState>): void;
|
|
356
415
|
/** Serialize current state to a plain object suitable for JSON storage. */
|
|
357
416
|
toJSON(): AgridControlState;
|
|
358
417
|
/** Restore an `AgridControl` from a previously serialized state. */
|
|
@@ -446,7 +505,83 @@ declare class AgridDataSource<T extends object = any> {
|
|
|
446
505
|
/** Current number of rows (non-reactive snapshot). */
|
|
447
506
|
get length(): number;
|
|
448
507
|
private updateRows;
|
|
449
|
-
|
|
508
|
+
/** Replace the backing row array without copying. Intended for specialized datasource models. */
|
|
509
|
+
protected setRows(rows: T[]): void;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/** Sort entry sent to a server-side row datasource. */
|
|
513
|
+
interface AgridServerSideSort {
|
|
514
|
+
field: string;
|
|
515
|
+
direction: 'asc' | 'desc';
|
|
516
|
+
}
|
|
517
|
+
/** Immutable request for one half-open row block (`startRow <= row < endRow`). */
|
|
518
|
+
interface AgridServerSideRequest {
|
|
519
|
+
startRow: number;
|
|
520
|
+
endRow: number;
|
|
521
|
+
filters: Readonly<Record<string, ColumnFilter>>;
|
|
522
|
+
sort: readonly AgridServerSideSort[];
|
|
523
|
+
quickFilter: string;
|
|
524
|
+
}
|
|
525
|
+
/** Rows returned by a server-side datasource. Supply `rowCount` when the total is known. */
|
|
526
|
+
interface AgridServerSideResult<T extends object> {
|
|
527
|
+
rows: T[];
|
|
528
|
+
rowCount?: number;
|
|
529
|
+
}
|
|
530
|
+
/** Fetches blocks for {@link AgridServerSideRowModel}. */
|
|
531
|
+
interface AgridServerSideDatasource<T extends object> {
|
|
532
|
+
getRows(request: AgridServerSideRequest): Promise<AgridServerSideResult<T>>;
|
|
533
|
+
}
|
|
534
|
+
/** Configuration for the lazy, block-cached server-side row model. */
|
|
535
|
+
interface AgridServerSideRowModelConfig<T extends object> {
|
|
536
|
+
datasource: AgridServerSideDatasource<T>;
|
|
537
|
+
/** Number of rows requested per block. @default 100 */
|
|
538
|
+
blockSize?: number;
|
|
539
|
+
/** Maximum loaded blocks retained in memory. @default 10 */
|
|
540
|
+
maxBlocksInCache?: number;
|
|
541
|
+
/** Known initial total. Omit when the server determines it from the first request. */
|
|
542
|
+
initialRowCount?: number;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Sparse datasource that lazy-loads row blocks while retaining global datasource indices.
|
|
546
|
+
* Attach it to an `AgridProvider` through `serverSideRowModel`.
|
|
547
|
+
*/
|
|
548
|
+
declare class AgridServerSideRowModel<T extends object = any> extends AgridDataSource<T> {
|
|
549
|
+
readonly blockSize: number;
|
|
550
|
+
readonly maxBlocksInCache: number;
|
|
551
|
+
private readonly remote;
|
|
552
|
+
private slots;
|
|
553
|
+
private readonly loadedBlocks;
|
|
554
|
+
private readonly loadingBlocks;
|
|
555
|
+
private query;
|
|
556
|
+
private queryKey;
|
|
557
|
+
private generation;
|
|
558
|
+
private accessSequence;
|
|
559
|
+
private knownRowCount;
|
|
560
|
+
private readonly _loading;
|
|
561
|
+
private readonly _error;
|
|
562
|
+
private readonly _rowCount;
|
|
563
|
+
/** Whether at least one block request is in flight. */
|
|
564
|
+
readonly loading: Signal<boolean>;
|
|
565
|
+
/** Most recent load error, cleared by the next successful request or refresh. */
|
|
566
|
+
readonly error: Signal<unknown | null>;
|
|
567
|
+
/** Current logical row count represented by the virtual scrollbar. */
|
|
568
|
+
readonly rowCount: Signal<number>;
|
|
569
|
+
constructor(config: AgridServerSideRowModelConfig<T>);
|
|
570
|
+
/** Update server query state. A changed query invalidates cached blocks and starts at row zero. */
|
|
571
|
+
setQuery(control: AgridControl | null, sortFields: readonly string[]): boolean;
|
|
572
|
+
/** Invalidate all cached blocks while preserving a known total row count. */
|
|
573
|
+
refresh(): void;
|
|
574
|
+
/** Ensure every block intersecting the requested half-open range is loaded. */
|
|
575
|
+
ensureRange(startRow: number, endRow: number): void;
|
|
576
|
+
/** Whether a logical datasource row has not been loaded yet. */
|
|
577
|
+
isPlaceholder(index: number): boolean;
|
|
578
|
+
private reset;
|
|
579
|
+
private loadBlock;
|
|
580
|
+
private applyBlock;
|
|
581
|
+
private evictBlocks;
|
|
582
|
+
private resize;
|
|
583
|
+
private replaceSlots;
|
|
584
|
+
private createPlaceholders;
|
|
450
585
|
}
|
|
451
586
|
|
|
452
587
|
/** Built-in locale identifiers supplied by the grid. */
|
|
@@ -458,6 +593,7 @@ interface AgridLocaleText {
|
|
|
458
593
|
aggregate: string;
|
|
459
594
|
aggregateAvg: string;
|
|
460
595
|
aggregateCount: string;
|
|
596
|
+
aggregateCustom: string;
|
|
461
597
|
aggregateMax: string;
|
|
462
598
|
aggregateMin: string;
|
|
463
599
|
aggregateSum: string;
|
|
@@ -469,6 +605,7 @@ interface AgridLocaleText {
|
|
|
469
605
|
close: string;
|
|
470
606
|
columnMenu: string;
|
|
471
607
|
columns: string;
|
|
608
|
+
collapse: string;
|
|
472
609
|
detail: string;
|
|
473
610
|
toggleDetail: string;
|
|
474
611
|
hiddenColumn: string;
|
|
@@ -508,9 +645,15 @@ interface AgridLocaleText {
|
|
|
508
645
|
lastPage: string;
|
|
509
646
|
loading: string;
|
|
510
647
|
markRow: string;
|
|
648
|
+
moreInformation: string;
|
|
511
649
|
next: string;
|
|
512
650
|
noRows: string;
|
|
513
651
|
pagination: string;
|
|
652
|
+
pivot: string;
|
|
653
|
+
pivotDescription: string;
|
|
654
|
+
pivotRows: string;
|
|
655
|
+
pivotColumns: string;
|
|
656
|
+
pivotValues: string;
|
|
514
657
|
pinColumn: string;
|
|
515
658
|
pinColumnRight: string;
|
|
516
659
|
unpinColumnRight: string;
|
|
@@ -519,6 +662,7 @@ interface AgridLocaleText {
|
|
|
519
662
|
unpinRow: string;
|
|
520
663
|
previous: string;
|
|
521
664
|
resizeColumn: string;
|
|
665
|
+
expand: string;
|
|
522
666
|
rows: (count: number) => string;
|
|
523
667
|
quickFilterPlaceholder: string;
|
|
524
668
|
searchValuesPlaceholder: string;
|
|
@@ -529,26 +673,61 @@ interface AgridLocaleText {
|
|
|
529
673
|
ungroup: string;
|
|
530
674
|
unpinColumn: string;
|
|
531
675
|
save: string;
|
|
676
|
+
saveConfig: string;
|
|
677
|
+
export: string;
|
|
678
|
+
exportCsv: string;
|
|
679
|
+
exportXlsx: string;
|
|
680
|
+
templates: string;
|
|
532
681
|
}
|
|
533
682
|
/** Partial locale text supplied to {@link AgridProvider.addLocalization}. */
|
|
534
683
|
type AgridLocaleTextOverrides = Partial<AgridLocaleText>;
|
|
535
684
|
/** Built-in English and German grid translations. */
|
|
536
685
|
declare const AGRID_LOCALE_TEXT: Record<AgridLocaleKey, AgridLocaleText>;
|
|
537
686
|
|
|
687
|
+
/** JSON-safe pivot subset used by persisted grid settings. */
|
|
688
|
+
interface AgridPivotSettings {
|
|
689
|
+
rowField: string;
|
|
690
|
+
columnField: string;
|
|
691
|
+
valueField: string;
|
|
692
|
+
aggregate: 'sum' | 'avg' | 'min' | 'max' | 'count';
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Versioned, JSON-safe snapshot that can be stored in local storage or a backend.
|
|
696
|
+
* Functions, datasource rows, selection, loading state, and edit history are intentionally absent.
|
|
697
|
+
*/
|
|
698
|
+
interface AgridSettings {
|
|
699
|
+
version: 1;
|
|
700
|
+
control: AgridControlState;
|
|
701
|
+
pivotConfig: AgridPivotSettings | null;
|
|
702
|
+
}
|
|
538
703
|
/** Configuration used to create an {@link AgridProvider}. */
|
|
539
704
|
interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptions> {
|
|
540
705
|
/** Row data source. A new empty data source is created when omitted. */
|
|
541
706
|
datasource?: AgridDataSource<T>;
|
|
707
|
+
/**
|
|
708
|
+
* Lazy block-based server-side row model. When supplied it becomes the provider datasource and
|
|
709
|
+
* filtering, sorting, and quick filtering are included in block requests automatically.
|
|
710
|
+
*/
|
|
711
|
+
serverSideRowModel?: AgridServerSideRowModel<T>;
|
|
542
712
|
/** Stateful grid control. A default control is created when omitted. */
|
|
543
713
|
control?: AgridControl;
|
|
544
714
|
/** Initial column definitions in display order. */
|
|
545
715
|
columns?: ColDef<T>[];
|
|
716
|
+
/**
|
|
717
|
+
* Derive a read-only client-side pivot table from the datasource.
|
|
718
|
+
* The first release supports one row field, one column field, and one value field.
|
|
719
|
+
* Enable `showSidebar` to let users change this configuration from the grid's Pivot tab.
|
|
720
|
+
*/
|
|
721
|
+
pivotConfig?: AgridPivotConfig<T>;
|
|
546
722
|
/** Labels used by columns with a matching `group` identifier. */
|
|
547
723
|
headerGroups?: HeaderGroup[];
|
|
548
724
|
/**
|
|
549
725
|
* Render rows as a hierarchical tree. When set, rows are nested by the configured
|
|
550
726
|
* parent/child accessors and an expand/collapse twisty is shown on `treeField`.
|
|
551
|
-
*
|
|
727
|
+
*
|
|
728
|
+
* Set `aggregateTreeNodes` in this configuration to display each aggregate column's
|
|
729
|
+
* descendant-leaf rollup on expandable nodes. Tree mode is mutually exclusive with grouping
|
|
730
|
+
* and pagination.
|
|
552
731
|
*/
|
|
553
732
|
treeConfig?: AgridTreeConfig<T>;
|
|
554
733
|
/** Row height in pixels. Must be fixed for CDK virtual scroll. @default 32 */
|
|
@@ -565,13 +744,16 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
565
744
|
showControlColumn?: boolean;
|
|
566
745
|
/** Show row-marking checkboxes in a 48 px control column for clipboard inclusion. @default false */
|
|
567
746
|
enableRowMarking?: boolean;
|
|
747
|
+
/** Allow clicking column headers to mark complete columns. @default false */
|
|
748
|
+
enableColumnMarking?: boolean;
|
|
568
749
|
/** Show the sidebar panel. */
|
|
569
750
|
showSidebar?: boolean;
|
|
570
751
|
/** Automatically open the detail panel when a row is selected. */
|
|
571
752
|
autoOpenDetail?: boolean;
|
|
572
753
|
/**
|
|
573
754
|
* Emit filter and sort changes for server processing instead of applying them locally.
|
|
574
|
-
* The
|
|
755
|
+
* The distinct-value picker is hidden unless the column supplies an explicit `values` list.
|
|
756
|
+
* @default false
|
|
575
757
|
*/
|
|
576
758
|
serverSideFiltering?: boolean;
|
|
577
759
|
/** Delay before emitting server-side text filter changes. Set to `0` to disable. @default 300 */
|
|
@@ -618,6 +800,12 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
618
800
|
cellMenuItems?: (CellContextMenuItem<T> | null)[];
|
|
619
801
|
/** Shade every other row slightly for easier reading. @default false */
|
|
620
802
|
zebraStripes?: boolean;
|
|
803
|
+
/**
|
|
804
|
+
* Render only the scrollable columns near the horizontal viewport once the scrollable-column
|
|
805
|
+
* count exceeds this threshold. Lower it to virtualize sooner, or set a very large value
|
|
806
|
+
* (e.g. `Infinity`) to disable column virtualization entirely. @default 30
|
|
807
|
+
*/
|
|
808
|
+
columnVirtualizationThreshold?: number;
|
|
621
809
|
/** Show a color marker on cells changed through grid editing. @default false */
|
|
622
810
|
showChangedCellIndicator?: boolean;
|
|
623
811
|
/** Ask for confirmation before grid row-delete actions. @default false */
|
|
@@ -674,8 +862,18 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
674
862
|
detailRenderer?: (params: {
|
|
675
863
|
row: T;
|
|
676
864
|
}) => string;
|
|
865
|
+
/** Column displayed as a multiline editable field beneath the custom detail renderer. */
|
|
866
|
+
detailColumnField?: AgridField<T>;
|
|
867
|
+
/** Optional text-template buttons shown above the editable master/detail textarea. */
|
|
868
|
+
detailActions?: DetailAction<T>[];
|
|
677
869
|
/** Fixed height in pixels of an expanded detail panel row. @default 200 */
|
|
678
870
|
detailRowHeight?: number;
|
|
871
|
+
/** this is the id of the grid its stored in the provider the grid will read it as signal */
|
|
872
|
+
gridId?: string;
|
|
873
|
+
/** Hides the grids status bar if set to true. @default false */
|
|
874
|
+
hideGridStatusBar?: boolean;
|
|
875
|
+
/** Enable Menubuttons for csv and xsls export @default false */
|
|
876
|
+
enableExportButtons?: boolean;
|
|
679
877
|
}
|
|
680
878
|
/**
|
|
681
879
|
* Bundles a grid's data source, control state, columns, and display options.
|
|
@@ -683,13 +881,31 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
683
881
|
* Create one provider per independent grid instance. A provider may be selected
|
|
684
882
|
* from an array when a component renders multiple grids.
|
|
685
883
|
*/
|
|
884
|
+
/**
|
|
885
|
+
* Live export hooks installed by the rendered grid component so the provider can export the
|
|
886
|
+
* grid's current filtered/visible projection without the caller holding a component reference.
|
|
887
|
+
* @internal
|
|
888
|
+
*/
|
|
889
|
+
interface AgridExportBridge {
|
|
890
|
+
csv: (filename: string) => void;
|
|
891
|
+
xlsx: (filename: string) => void;
|
|
892
|
+
}
|
|
686
893
|
declare class AgridProvider<T extends object = any> {
|
|
687
894
|
/** Mutable row data consumed by the grid. */
|
|
688
895
|
datasource: AgridDataSource<T>;
|
|
896
|
+
/** Lazy server-side model, or `null` for the regular client-side datasource. */
|
|
897
|
+
serverSideRowModel: AgridServerSideRowModel<T> | null;
|
|
689
898
|
/** Runtime UI state and imperative grid controls. */
|
|
690
899
|
control: AgridControl;
|
|
691
900
|
/** Reactive column definitions in display order. */
|
|
692
901
|
readonly columns: WritableSignal<ColDef<T>[]>;
|
|
902
|
+
private readonly _pivotConfig;
|
|
903
|
+
/**
|
|
904
|
+
* Client-side pivot configuration, or `null` for the normal row view.
|
|
905
|
+
* Assigning a new configuration reactively rebuilds the derived pivot rows and columns.
|
|
906
|
+
*/
|
|
907
|
+
get pivotConfig(): AgridPivotConfig<T> | null;
|
|
908
|
+
set pivotConfig(config: AgridPivotConfig<T> | null);
|
|
693
909
|
/** Header-group labels referenced by column definitions. */
|
|
694
910
|
headerGroups: HeaderGroup[];
|
|
695
911
|
/** Tree configuration, or `null` when the grid is not in tree mode. */
|
|
@@ -697,6 +913,20 @@ declare class AgridProvider<T extends object = any> {
|
|
|
697
913
|
/** Shared grid options such as locale. */
|
|
698
914
|
options: AGridOptions;
|
|
699
915
|
private readonly _localizations;
|
|
916
|
+
private exportBridge;
|
|
917
|
+
private readonly _visibleRows;
|
|
918
|
+
/**
|
|
919
|
+
* The grid's currently filtered and sorted rows, as published by the rendered grid component.
|
|
920
|
+
* Falls back to every datasource row when no grid is attached. Link a chart to this signal to
|
|
921
|
+
* keep it in sync with the grid's filters and sorting.
|
|
922
|
+
*/
|
|
923
|
+
readonly visibleRows: Signal<readonly T[]>;
|
|
924
|
+
/**
|
|
925
|
+
* @internal Published by the rendered grid whenever its filtered/sorted projection changes.
|
|
926
|
+
* Pass `null` on teardown so {@link visibleRows} falls back to the raw datasource. The grid works
|
|
927
|
+
* in terms of record rows; the public {@link visibleRows} re-types them as `T`.
|
|
928
|
+
*/
|
|
929
|
+
ɵsetVisibleRows(rows: readonly Record<string, unknown>[] | null): void;
|
|
700
930
|
/** Read-only view of registered per-locale text overrides. Used by the grid to resolve locale text. */
|
|
701
931
|
get localizations(): ReadonlyMap<string, AgridLocaleTextOverrides>;
|
|
702
932
|
/**
|
|
@@ -720,6 +950,8 @@ declare class AgridProvider<T extends object = any> {
|
|
|
720
950
|
showControlColumn: boolean;
|
|
721
951
|
/** Whether rows can be marked for inclusion in clipboard copies. */
|
|
722
952
|
enableRowMarking: boolean;
|
|
953
|
+
/** Whether complete columns can be marked from their headers. */
|
|
954
|
+
enableColumnMarking: boolean;
|
|
723
955
|
/** Whether the sidebar is available. */
|
|
724
956
|
showSidebar: boolean;
|
|
725
957
|
/** Whether selecting a row automatically opens its detail panel. */
|
|
@@ -734,7 +966,7 @@ declare class AgridProvider<T extends object = any> {
|
|
|
734
966
|
menuBarItems: AgridMenuBarItem<T>[];
|
|
735
967
|
/** Enabled sorting mode. */
|
|
736
968
|
sortOption: 'single' | 'multi' | 'none';
|
|
737
|
-
/**
|
|
969
|
+
/** @deprecated Use `control.autoAddRows` and `control.setAutoAddRows()` instead. */
|
|
738
970
|
readonly autoAddRows: WritableSignal<boolean>;
|
|
739
971
|
/** Enabled row-selection mode. */
|
|
740
972
|
rowSelection: 'single' | 'multi' | 'none';
|
|
@@ -748,6 +980,8 @@ declare class AgridProvider<T extends object = any> {
|
|
|
748
980
|
cellMenuItems: (CellContextMenuItem<T> | null)[];
|
|
749
981
|
/** Whether alternating data rows receive stripe styling. */
|
|
750
982
|
zebraStripes: boolean;
|
|
983
|
+
/** Scrollable-column count above which column virtualization activates. */
|
|
984
|
+
columnVirtualizationThreshold: number;
|
|
751
985
|
/** Whether committed cell changes receive a visual marker. */
|
|
752
986
|
showChangedCellIndicator: boolean;
|
|
753
987
|
/** Whether grid row-delete actions require in-row confirmation. */
|
|
@@ -769,20 +1003,84 @@ declare class AgridProvider<T extends object = any> {
|
|
|
769
1003
|
detailRenderer?: (params: {
|
|
770
1004
|
row: T;
|
|
771
1005
|
}) => string;
|
|
1006
|
+
/** Column displayed as a multiline field inside expanded detail panels. */
|
|
1007
|
+
detailColumnField?: AgridField<T>;
|
|
1008
|
+
/** Text-template buttons shown above the editable master/detail textarea. */
|
|
1009
|
+
detailActions: DetailAction<T>[];
|
|
772
1010
|
/** Fixed height in pixels of an expanded detail panel row. */
|
|
773
1011
|
detailRowHeight: number;
|
|
774
|
-
/**
|
|
1012
|
+
/** its used to save the config */
|
|
1013
|
+
gridId?: string;
|
|
1014
|
+
/** Hides the summary status bar */
|
|
1015
|
+
hideGridStatusBar?: boolean;
|
|
1016
|
+
/** Enables export Menu if true */
|
|
1017
|
+
enableExportButtons?: boolean;
|
|
1018
|
+
/** @deprecated Use `control.loading` and `control.setLoading()` instead. */
|
|
775
1019
|
readonly loading: WritableSignal<boolean>;
|
|
776
|
-
/**
|
|
1020
|
+
/** @deprecated Use `control.readonly` and `control.setReadonly()` instead. */
|
|
777
1021
|
readonly readonlyGrid: WritableSignal<boolean>;
|
|
778
1022
|
/** Creates a provider from the supplied data, state, columns, and display options. */
|
|
779
1023
|
constructor(config?: AgridProviderConfig<T>);
|
|
780
1024
|
/** Returns the current reactive row array. */
|
|
781
1025
|
getGridData(): T[];
|
|
1026
|
+
/**
|
|
1027
|
+
* Return a detached, JSON-safe snapshot of persistent grid and pivot settings.
|
|
1028
|
+
* Custom pivot aggregate functions cannot be serialized and produce an explicit error.
|
|
1029
|
+
*/
|
|
1030
|
+
saveSettings(): AgridSettings;
|
|
1031
|
+
/**
|
|
1032
|
+
* Apply a previously saved snapshot to this live provider.
|
|
1033
|
+
* Existing component instances update immediately because both control and pivot state are
|
|
1034
|
+
* signal-backed. Unknown versions and pivot fields fail early with actionable errors.
|
|
1035
|
+
*/
|
|
1036
|
+
loadSettings(settings: AgridSettings): void;
|
|
1037
|
+
/**
|
|
1038
|
+
* Download the grid's current filtered, visible rows as a CSV file.
|
|
1039
|
+
*
|
|
1040
|
+
* Uses display values (value-list labels, formatters) and respects column visibility; group
|
|
1041
|
+
* header rows are excluded. Requires a rendered `<agrid>` bound to this provider — when no grid
|
|
1042
|
+
* is mounted (e.g. before first render) this is a no-op.
|
|
1043
|
+
*
|
|
1044
|
+
* @param filename Output filename, defaults to `'export.csv'`.
|
|
1045
|
+
*/
|
|
1046
|
+
exportCsv(filename?: string): void;
|
|
1047
|
+
/**
|
|
1048
|
+
* Download the grid's current filtered, visible rows as an `.xlsx` workbook.
|
|
1049
|
+
*
|
|
1050
|
+
* Numbers and dates are written as native, sortable/summable cells; value-list columns and
|
|
1051
|
+
* custom formatters fall back to display text. Requires a rendered `<agrid>` bound to this
|
|
1052
|
+
* provider — a no-op when no grid is mounted. Generated with zero third-party dependencies.
|
|
1053
|
+
*
|
|
1054
|
+
* @param filename Output filename, defaults to `'export.xlsx'`.
|
|
1055
|
+
*/
|
|
1056
|
+
exportXlsx(filename?: string): void;
|
|
1057
|
+
/**
|
|
1058
|
+
* @internal Installed by the rendered `<agrid>` so {@link exportCsv}/{@link exportXlsx} reach the
|
|
1059
|
+
* live projection. Pass `null` on teardown.
|
|
1060
|
+
*/
|
|
1061
|
+
ɵattachExport(bridge: AgridExportBridge | null): void;
|
|
782
1062
|
}
|
|
783
1063
|
|
|
784
1064
|
/** String-valued property names available on a row type. */
|
|
785
1065
|
type AgridField<T extends object> = Extract<keyof T, string>;
|
|
1066
|
+
/** Aggregate functions shared by footers, groups, tree rollups, and pivot values. */
|
|
1067
|
+
type AgridAggregate = 'sum' | 'avg' | 'min' | 'max' | 'count' | ((values: unknown[]) => unknown);
|
|
1068
|
+
/**
|
|
1069
|
+
* Client-side pivot-table configuration.
|
|
1070
|
+
*
|
|
1071
|
+
* The initial pivot implementation supports one row dimension, one column dimension, and one
|
|
1072
|
+
* value field. The resulting table is derived from the datasource and is always read-only.
|
|
1073
|
+
*/
|
|
1074
|
+
interface AgridPivotConfig<T extends object = any> {
|
|
1075
|
+
/** Source field whose distinct values become pivot rows. */
|
|
1076
|
+
rowField: AgridField<T>;
|
|
1077
|
+
/** Source field whose distinct values become generated pivot columns. */
|
|
1078
|
+
columnField: AgridField<T>;
|
|
1079
|
+
/** Source field aggregated at each row/column intersection. */
|
|
1080
|
+
valueField: AgridField<T>;
|
|
1081
|
+
/** Aggregate applied to each intersection. Defaults to `'sum'`. */
|
|
1082
|
+
aggregate?: AgridAggregate;
|
|
1083
|
+
}
|
|
786
1084
|
/** Behavior after pressing Enter while an inline cell editor is active. */
|
|
787
1085
|
type AgridEnterEditAction = 'nothing' | 'nextColumn' | 'nextRow';
|
|
788
1086
|
/** Parameters passed to a row-aware cell readonly resolver. */
|
|
@@ -796,6 +1094,33 @@ interface CellReadonlyParams<T extends object = any, K extends AgridField<T> = A
|
|
|
796
1094
|
/** Zero-based index of the row in the datasource. */
|
|
797
1095
|
originalIndex: number;
|
|
798
1096
|
}
|
|
1097
|
+
/** Parameters passed to a row-aware cell formatting resolver. */
|
|
1098
|
+
type CellFormatParams<T extends object = any, K extends AgridField<T> = AgridField<T>> = CellReadonlyParams<T, K>;
|
|
1099
|
+
/** Parameters passed to a row-aware horizontal cell-span resolver. */
|
|
1100
|
+
type CellSpanParams<T extends object = any, K extends AgridField<T> = AgridField<T>> = CellReadonlyParams<T, K>;
|
|
1101
|
+
/** Supported visual overrides returned by {@link ColDefBase.cellFormat}. */
|
|
1102
|
+
interface CellFormat {
|
|
1103
|
+
/** CSS background color, such as `'#fff4cc'` or `'var(--warning-bg)'`. */
|
|
1104
|
+
backgroundColor?: string;
|
|
1105
|
+
/** CSS border color. The cell's existing right and bottom borders use this color. */
|
|
1106
|
+
borderColor?: string;
|
|
1107
|
+
/** CSS text color. */
|
|
1108
|
+
color?: string;
|
|
1109
|
+
/** CSS `font` shorthand. Individual font properties below can override parts of it. */
|
|
1110
|
+
font?: string;
|
|
1111
|
+
/** CSS font family. */
|
|
1112
|
+
fontFamily?: string;
|
|
1113
|
+
/** CSS font size, including its unit (for example `'0.875rem'`). */
|
|
1114
|
+
fontSize?: string;
|
|
1115
|
+
/** CSS font style. */
|
|
1116
|
+
fontStyle?: 'normal' | 'italic' | 'oblique' | string;
|
|
1117
|
+
/** CSS font weight. */
|
|
1118
|
+
fontWeight?: string | number;
|
|
1119
|
+
/** CSS text decoration. */
|
|
1120
|
+
textDecoration?: string;
|
|
1121
|
+
/** CSS horizontal text alignment. */
|
|
1122
|
+
textAlign?: 'left' | 'right' | 'center' | 'justify' | string;
|
|
1123
|
+
}
|
|
799
1124
|
/** Global options shared by grid providers. */
|
|
800
1125
|
interface AGridOptions {
|
|
801
1126
|
/**
|
|
@@ -855,6 +1180,8 @@ interface AgridMenuBarMenuItem<T extends object = any> {
|
|
|
855
1180
|
active?: AgridMenuBarState<T>;
|
|
856
1181
|
/** Whether the command is disabled. Defaults to `false`. */
|
|
857
1182
|
disabled?: AgridMenuBarState<T>;
|
|
1183
|
+
/** Additional classes */
|
|
1184
|
+
class?: string;
|
|
858
1185
|
}
|
|
859
1186
|
/** Top-level menu-bar button with optional additional dropdown commands. */
|
|
860
1187
|
interface AgridMenuBarItem<T extends object = any> extends AgridMenuBarMenuItem<T> {
|
|
@@ -888,6 +1215,21 @@ interface HeaderGroup {
|
|
|
888
1215
|
/** Text displayed in the grouped header row. */
|
|
889
1216
|
label: string;
|
|
890
1217
|
}
|
|
1218
|
+
/** Custom command appended to a column's header menu. */
|
|
1219
|
+
interface AgridColumnHeaderMenuItem {
|
|
1220
|
+
/** Stable key emitted through `(columnHeaderAction)`. */
|
|
1221
|
+
key: string;
|
|
1222
|
+
/** Visible command label. */
|
|
1223
|
+
label: string;
|
|
1224
|
+
/** Optional compact icon or glyph shown before the label. */
|
|
1225
|
+
icon?: string;
|
|
1226
|
+
/** Disable the command without hiding it. */
|
|
1227
|
+
disabled?: boolean;
|
|
1228
|
+
/** Class a optional classes for the icon */
|
|
1229
|
+
iconClasses?: string[];
|
|
1230
|
+
/** Classes to apply on the complete button */
|
|
1231
|
+
itemClasses?: string[];
|
|
1232
|
+
}
|
|
891
1233
|
/** Defines the behavior shared by every typed column. */
|
|
892
1234
|
interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
893
1235
|
/** Data field name — must match a key in the row object. */
|
|
@@ -896,6 +1238,8 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
896
1238
|
header: string;
|
|
897
1239
|
/** Optional header-group identifier configured through `AgridProvider.headerGroups`. */
|
|
898
1240
|
group?: string;
|
|
1241
|
+
/** Custom commands appended to this column's header menu. */
|
|
1242
|
+
headerMenuItems?: AgridColumnHeaderMenuItem[];
|
|
899
1243
|
/**
|
|
900
1244
|
* Default column width in pixels. Can be overridden at runtime via {@link AgridControl}.
|
|
901
1245
|
* Use `-1` (or omit) to make the column auto-scale and fill available space (`1fr`).
|
|
@@ -926,6 +1270,40 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
926
1270
|
* ```
|
|
927
1271
|
*/
|
|
928
1272
|
cellReadonly?: (params: CellReadonlyParams<T, K>) => boolean;
|
|
1273
|
+
/**
|
|
1274
|
+
* Return visual overrides for this specific cell at runtime.
|
|
1275
|
+
* Runs with the current row, value, column definition, and original datasource index.
|
|
1276
|
+
* Return `null` or `undefined` to use the grid's normal styling.
|
|
1277
|
+
*
|
|
1278
|
+
* @example
|
|
1279
|
+
* ```ts
|
|
1280
|
+
* {
|
|
1281
|
+
* field: 'balance',
|
|
1282
|
+
* cellFormat: ({ value }) => value < 0
|
|
1283
|
+
* ? { backgroundColor: '#fee2e2', color: '#991b1b', fontWeight: 600 }
|
|
1284
|
+
* : undefined,
|
|
1285
|
+
* }
|
|
1286
|
+
* ```
|
|
1287
|
+
*/
|
|
1288
|
+
cellFormat?: (params: CellFormatParams<T, K>) => CellFormat | null | undefined;
|
|
1289
|
+
/**
|
|
1290
|
+
* Default horizontal alignment for every cell in this column.
|
|
1291
|
+
* A `textAlign` returned by {@link cellFormat} overrides this value for that cell.
|
|
1292
|
+
*/
|
|
1293
|
+
textAlign?: 'left' | 'center' | 'right' | Signal<'left' | 'center' | 'right'>;
|
|
1294
|
+
/**
|
|
1295
|
+
* Number of adjacent visible columns occupied by this cell.
|
|
1296
|
+
*
|
|
1297
|
+
* Spans are clamped to the current left-pinned, scrollable, or right-pinned pane and never
|
|
1298
|
+
* cross a pane boundary. Covered cells remain part of the data model but are not rendered.
|
|
1299
|
+
* Return `1` (the default) to render a normal cell.
|
|
1300
|
+
*
|
|
1301
|
+
* @example
|
|
1302
|
+
* ```ts
|
|
1303
|
+
* { field: 'name', colSpan: ({ row }) => row.isSummary ? 3 : 1 }
|
|
1304
|
+
* ```
|
|
1305
|
+
*/
|
|
1306
|
+
colSpan?: number | ((params: CellSpanParams<T, K>) => number);
|
|
929
1307
|
/**
|
|
930
1308
|
* Fixed list of allowed values shown in a `<select>` dropdown when editing.
|
|
931
1309
|
*
|
|
@@ -996,7 +1374,7 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
996
1374
|
* { field: 'score', aggregate: values => values.filter(v => Number(v) > 90).length }
|
|
997
1375
|
* ```
|
|
998
1376
|
*/
|
|
999
|
-
aggregate?:
|
|
1377
|
+
aggregate?: AgridAggregate;
|
|
1000
1378
|
/**
|
|
1001
1379
|
* Return one or more CSS class names to apply to every cell in this column based on the
|
|
1002
1380
|
* cell's value and row data. Useful for conditional highlighting without a custom renderer.
|
|
@@ -1026,10 +1404,26 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
1026
1404
|
* ```
|
|
1027
1405
|
*/
|
|
1028
1406
|
validate?: (value: T[K], row: T) => string | null | undefined;
|
|
1407
|
+
/**
|
|
1408
|
+
* Custom component rendered for the cell's display (read) state, instead of the plain text value.
|
|
1409
|
+
* The component injects {@link AGRID_RENDERER_CONTEXT} to read the value, row, and column. Unlike
|
|
1410
|
+
* {@link cellRenderer}, this supports full Angular bindings, event handlers, and child components
|
|
1411
|
+
* with no manual escaping.
|
|
1412
|
+
*
|
|
1413
|
+
* @example
|
|
1414
|
+
* ```ts
|
|
1415
|
+
* { field: 'status', cellRendererComponent: StatusBadgeComponent }
|
|
1416
|
+
* ```
|
|
1417
|
+
*/
|
|
1418
|
+
cellRendererComponent?: Type<unknown>;
|
|
1029
1419
|
/**
|
|
1030
1420
|
* Custom cell renderer. Returns an HTML string displayed instead of the plain text value.
|
|
1031
1421
|
* Angular's built-in HTML sanitization is applied automatically.
|
|
1032
1422
|
*
|
|
1423
|
+
* @deprecated Use {@link cellRendererComponent} instead. A component renderer supports Angular
|
|
1424
|
+
* bindings and event handlers, and avoids the HTML-string escaping/sanitization caveats. The
|
|
1425
|
+
* string renderer remains supported for now but will be removed in a future release.
|
|
1426
|
+
*
|
|
1033
1427
|
* @example
|
|
1034
1428
|
* ```ts
|
|
1035
1429
|
* { field: 'status', cellRenderer: ({ value }) =>
|
|
@@ -1040,6 +1434,18 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
1040
1434
|
value: T[K];
|
|
1041
1435
|
row: T;
|
|
1042
1436
|
}) => string;
|
|
1437
|
+
/**
|
|
1438
|
+
* Custom editor component shown while the cell is in edit mode, instead of the built-in
|
|
1439
|
+
* text input / dropdown / checkbox. The component injects {@link AGRID_EDITOR_CONTEXT} to read
|
|
1440
|
+
* the current value and stage drafts; the grid keeps ownership of validation, history, and the
|
|
1441
|
+
* commit/cancel lifecycle, so Tab, Enter, and Escape work without extra wiring.
|
|
1442
|
+
*
|
|
1443
|
+
* @example
|
|
1444
|
+
* ```ts
|
|
1445
|
+
* { field: 'rating', cellEditor: RatingEditor }
|
|
1446
|
+
* ```
|
|
1447
|
+
*/
|
|
1448
|
+
cellEditor?: Type<unknown>;
|
|
1043
1449
|
/**
|
|
1044
1450
|
* Show a right-aligned info button in this column's cells.
|
|
1045
1451
|
* Pass a predicate to show it only for selected rows or values.
|
|
@@ -1070,6 +1476,21 @@ interface GroupAction {
|
|
|
1070
1476
|
/** Called with the group's display label when the item is clicked. */
|
|
1071
1477
|
action: (groupLabel: string) => void;
|
|
1072
1478
|
}
|
|
1479
|
+
/** Parameters passed to a master/detail text-template action. */
|
|
1480
|
+
interface DetailActionParams<T extends object = any> {
|
|
1481
|
+
/** Row shown by the expanded detail panel. */
|
|
1482
|
+
row: T;
|
|
1483
|
+
/** Original datasource index of the row. */
|
|
1484
|
+
rowIndex: number;
|
|
1485
|
+
}
|
|
1486
|
+
/** Text-template button shown above the editable master/detail textarea. */
|
|
1487
|
+
interface DetailAction<T extends object = any> {
|
|
1488
|
+
id: string;
|
|
1489
|
+
/** Button text. */
|
|
1490
|
+
label: string;
|
|
1491
|
+
/** Text inserted into the detail textarea, or a row-aware resolver. */
|
|
1492
|
+
text?: string | ((params: DetailActionParams<T>) => string);
|
|
1493
|
+
}
|
|
1073
1494
|
/**
|
|
1074
1495
|
* Internal row item used in the virtual scroll list.
|
|
1075
1496
|
* - `{ row, originalIndex }` — a real data row
|
|
@@ -1082,6 +1503,9 @@ interface GroupAction {
|
|
|
1082
1503
|
type GridItem<T extends object = Record<string, unknown>> = {
|
|
1083
1504
|
row: T;
|
|
1084
1505
|
originalIndex: number;
|
|
1506
|
+
} | {
|
|
1507
|
+
loading: true;
|
|
1508
|
+
originalIndex: number;
|
|
1085
1509
|
} | null | 'ghost' | {
|
|
1086
1510
|
groupLabel: string;
|
|
1087
1511
|
count: number;
|
|
@@ -1102,6 +1526,13 @@ interface PathTreeNodeItem {
|
|
|
1102
1526
|
expandable: true;
|
|
1103
1527
|
/** Whether the branch's descendants are currently visible. */
|
|
1104
1528
|
expanded: boolean;
|
|
1529
|
+
/**
|
|
1530
|
+
* Field-to-value rollups computed from all datasource leaves below this generated branch.
|
|
1531
|
+
* Present only when the grid enables {@link AgridTreeConfig.aggregateTreeNodes}; standalone
|
|
1532
|
+
* trees do not compute column aggregates.
|
|
1533
|
+
* @internal
|
|
1534
|
+
*/
|
|
1535
|
+
aggregates?: Record<string, unknown>;
|
|
1105
1536
|
}
|
|
1106
1537
|
/**
|
|
1107
1538
|
* A master/detail panel row rendered immediately beneath its expanded parent data row.
|
|
@@ -1136,6 +1567,12 @@ interface TreeRowItem<T extends object = Record<string, unknown>> {
|
|
|
1136
1567
|
expanded: boolean;
|
|
1137
1568
|
/** Optional display-only label for the tree cell, used by path-based trees. */
|
|
1138
1569
|
treeLabel?: string;
|
|
1570
|
+
/**
|
|
1571
|
+
* Field-to-value rollups computed from this node's descendant leaves. Parent rows are excluded
|
|
1572
|
+
* so a stored subtotal is not counted again. Present only for expandable rows when enabled.
|
|
1573
|
+
* @internal
|
|
1574
|
+
*/
|
|
1575
|
+
aggregates?: Record<string, unknown>;
|
|
1139
1576
|
}
|
|
1140
1577
|
/**
|
|
1141
1578
|
* Host-supplied configuration that turns the grid into a tree.
|
|
@@ -1169,6 +1606,35 @@ interface AgridTreeConfigBase<T extends object> {
|
|
|
1169
1606
|
* Defaults to `true`. (Applied by the projection layer, not by {@link GridItem} flattening.)
|
|
1170
1607
|
*/
|
|
1171
1608
|
keepAncestorsOnFilter?: boolean;
|
|
1609
|
+
/**
|
|
1610
|
+
* Display aggregate-column rollups on expandable nodes in `AgridComponent` tree mode.
|
|
1611
|
+
*
|
|
1612
|
+
* Parent/id trees aggregate descendant leaves and deliberately exclude intermediate parent
|
|
1613
|
+
* values to avoid counting stored subtotals twice. Generated path branches aggregate every
|
|
1614
|
+
* datasource leaf below that branch. Expansion does not affect the result, while active filters
|
|
1615
|
+
* limit the contributing leaves. Aggregate cells on datasource-backed parents are display-only.
|
|
1616
|
+
*
|
|
1617
|
+
* The function comes from {@link ColDef.aggregate} or a runtime
|
|
1618
|
+
* `AgridControl.setAggregate()` override. The standalone `AgridTreeComponent` has no columns and
|
|
1619
|
+
* therefore ignores this option.
|
|
1620
|
+
*
|
|
1621
|
+
* @default false
|
|
1622
|
+
* @example
|
|
1623
|
+
* ```ts
|
|
1624
|
+
* const columns = [
|
|
1625
|
+
* { field: 'name', header: 'Name' },
|
|
1626
|
+
* { field: 'amount', header: 'Amount', aggregate: 'sum' },
|
|
1627
|
+
* ];
|
|
1628
|
+
*
|
|
1629
|
+
* const treeConfig = {
|
|
1630
|
+
* getId: row => row.id,
|
|
1631
|
+
* getParentId: row => row.parentId,
|
|
1632
|
+
* treeField: 'name',
|
|
1633
|
+
* aggregateTreeNodes: true,
|
|
1634
|
+
* };
|
|
1635
|
+
* ```
|
|
1636
|
+
*/
|
|
1637
|
+
aggregateTreeNodes?: boolean;
|
|
1172
1638
|
}
|
|
1173
1639
|
/** Tree configuration for rows that already expose stable id and parent-id values. */
|
|
1174
1640
|
interface AgridParentTreeConfig<T extends object = any> extends AgridTreeConfigBase<T> {
|
|
@@ -1251,7 +1717,7 @@ interface ValidationFailedEvent<T extends object = any> {
|
|
|
1251
1717
|
/** Message returned by the `validate` hook. */
|
|
1252
1718
|
message: string;
|
|
1253
1719
|
/** Which editing surface produced the rejected edit. */
|
|
1254
|
-
source: 'inline' | 'sidebar';
|
|
1720
|
+
source: 'inline' | 'sidebar' | 'detail';
|
|
1255
1721
|
}
|
|
1256
1722
|
/** Emitted by `(cellEdit)` after the user commits a cell change. */
|
|
1257
1723
|
type GridEditEvent<T extends object = any> = {
|
|
@@ -1313,6 +1779,45 @@ interface RowSelectEvent<T extends object = any> {
|
|
|
1313
1779
|
originalIndex: number;
|
|
1314
1780
|
}[];
|
|
1315
1781
|
}
|
|
1782
|
+
/** Emitted when a row is marked or unmarked through the row header or marker checkbox. */
|
|
1783
|
+
interface RowMarkEvent<T extends object = any> {
|
|
1784
|
+
/** Row whose mark state changed. */
|
|
1785
|
+
row: T;
|
|
1786
|
+
/** Zero-based index of the row in the data source. */
|
|
1787
|
+
originalIndex: number;
|
|
1788
|
+
/** Current mark state after the interaction. */
|
|
1789
|
+
marked: boolean;
|
|
1790
|
+
}
|
|
1791
|
+
/** Emitted when a column is marked or unmarked from its header. */
|
|
1792
|
+
interface ColumnMarkEvent<T extends object = any> {
|
|
1793
|
+
column: ColDef<T>;
|
|
1794
|
+
field: AgridField<T>;
|
|
1795
|
+
marked: boolean;
|
|
1796
|
+
}
|
|
1797
|
+
/** Emitted when a custom column-header menu command is selected. */
|
|
1798
|
+
interface ColumnHeaderActionEvent<T extends object = any> {
|
|
1799
|
+
column: ColDef<T>;
|
|
1800
|
+
key: string;
|
|
1801
|
+
}
|
|
1802
|
+
/** Emitted once after the grid first renders with rows from its active datasource. */
|
|
1803
|
+
interface FirstDataRenderedEvent<T extends object = any> {
|
|
1804
|
+
/** Rows present in the datasource for the first non-empty render. */
|
|
1805
|
+
rows: readonly T[];
|
|
1806
|
+
/** Number of rows present for that render. */
|
|
1807
|
+
rowCount: number;
|
|
1808
|
+
/** Provider attached to the rendered grid. */
|
|
1809
|
+
provider: AgridProvider<T>;
|
|
1810
|
+
/** Active datasource that supplied the rows. */
|
|
1811
|
+
datasource: AgridDataSource<T>;
|
|
1812
|
+
}
|
|
1813
|
+
/** Live numeric statistics for the active cell or range selection. */
|
|
1814
|
+
interface AgridSelectionSummary {
|
|
1815
|
+
count: number;
|
|
1816
|
+
sum: number;
|
|
1817
|
+
average: number;
|
|
1818
|
+
min: number;
|
|
1819
|
+
max: number;
|
|
1820
|
+
}
|
|
1316
1821
|
/** Emitted when the user clicks a data row. */
|
|
1317
1822
|
interface RowClickEvent<T extends object = any> {
|
|
1318
1823
|
/** Snapshot of the clicked row. */
|
|
@@ -1344,6 +1849,14 @@ interface RowUpdateEvent<T extends object = any> {
|
|
|
1344
1849
|
/** Zero-based index of the updated row in the data source. */
|
|
1345
1850
|
originalIndex: number;
|
|
1346
1851
|
}
|
|
1852
|
+
interface RowDetailActionEvent<T extends object = any> {
|
|
1853
|
+
/** the id of the button */
|
|
1854
|
+
id: string;
|
|
1855
|
+
/** Updated row data. */
|
|
1856
|
+
row: T;
|
|
1857
|
+
/** Zero-based index of the updated row in the data source. */
|
|
1858
|
+
originalIndex: number;
|
|
1859
|
+
}
|
|
1347
1860
|
/**
|
|
1348
1861
|
* Emitted by `(rowReorder)` when the user finishes dragging a row to a new position.
|
|
1349
1862
|
* The grid does **not** reorder data itself — call `dataSource.moveRow(oldIndex, newIndex)`
|
|
@@ -1415,6 +1928,50 @@ interface NewRecord<T extends object = any> {
|
|
|
1415
1928
|
/** Exact data source containing the inserted row. */
|
|
1416
1929
|
datasource: AgridDataSource<T>;
|
|
1417
1930
|
}
|
|
1931
|
+
/**
|
|
1932
|
+
* Precomputed per-column header state. @internal
|
|
1933
|
+
*
|
|
1934
|
+
* The header/filter rows would otherwise call a dozen helpers per column on every
|
|
1935
|
+
* change-detection pass (e.g. `getSort`, `hasActiveFilter`, `isColDragging`). The header
|
|
1936
|
+
* view-model computeds resolve all of that once per column — and only when an underlying
|
|
1937
|
+
* signal changes — so the template reads plain fields instead.
|
|
1938
|
+
*/
|
|
1939
|
+
interface AgridHeaderColumn {
|
|
1940
|
+
col: ColDef;
|
|
1941
|
+
field: string;
|
|
1942
|
+
ariaColIndex: number;
|
|
1943
|
+
sort: 'asc' | 'desc' | null;
|
|
1944
|
+
sortPriority: number;
|
|
1945
|
+
hasFilter: boolean;
|
|
1946
|
+
dragging: boolean;
|
|
1947
|
+
dropSide: 'before' | 'after' | null;
|
|
1948
|
+
reorderOffset: number;
|
|
1949
|
+
grouped: boolean;
|
|
1950
|
+
lastPinned: boolean;
|
|
1951
|
+
firstRightPinned: boolean;
|
|
1952
|
+
columnWidth: number;
|
|
1953
|
+
textFilter: string;
|
|
1954
|
+
menuFilterType: 'text' | 'number' | 'date' | null;
|
|
1955
|
+
hasCondition: boolean;
|
|
1956
|
+
conditionLabel: string;
|
|
1957
|
+
}
|
|
1958
|
+
/**
|
|
1959
|
+
* Precomputed per-column state for the data-row, footer, and ghost cell loops. @internal
|
|
1960
|
+
*
|
|
1961
|
+
* Deliberately leaner than {@link AgridHeaderColumn}: it omits sort/filter state so the body
|
|
1962
|
+
* view-model only changes on column layout, drag, or pinning — sorting or filtering does not
|
|
1963
|
+
* invalidate it (and therefore does not force every rendered cell to re-render).
|
|
1964
|
+
*/
|
|
1965
|
+
interface AgridBodyColumn {
|
|
1966
|
+
col: ColDef;
|
|
1967
|
+
field: string;
|
|
1968
|
+
visibleColIndex: number;
|
|
1969
|
+
ariaColIndex: number;
|
|
1970
|
+
dragging: boolean;
|
|
1971
|
+
reorderOffset: number;
|
|
1972
|
+
lastPinned: boolean;
|
|
1973
|
+
firstRightPinned: boolean;
|
|
1974
|
+
}
|
|
1418
1975
|
|
|
1419
1976
|
/** View state for the floating column header shown during a reorder drag. @internal */
|
|
1420
1977
|
interface AgridColumnDragPreview {
|
|
@@ -1471,17 +2028,26 @@ interface AgridColumnMenuValueItem {
|
|
|
1471
2028
|
/** Position and target field of the open column menu. @internal */
|
|
1472
2029
|
type AgridColumnMenuState = {
|
|
1473
2030
|
field: string;
|
|
2031
|
+
mode: 'column' | 'condition';
|
|
1474
2032
|
x: number;
|
|
1475
2033
|
y: number;
|
|
1476
2034
|
};
|
|
1477
2035
|
|
|
1478
|
-
/**
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
2036
|
+
/**
|
|
2037
|
+
* The contiguous slice of scrollable columns to render, plus the pixel widths of the
|
|
2038
|
+
* hidden columns on either side (used to size leading/trailing spacer grid items so the
|
|
2039
|
+
* full column layout and scroll width are preserved).
|
|
2040
|
+
* @internal
|
|
2041
|
+
*/
|
|
2042
|
+
interface AgridColumnWindow {
|
|
2043
|
+
/** Index of the first rendered scrollable column (inclusive). */
|
|
2044
|
+
start: number;
|
|
2045
|
+
/** Index just past the last rendered scrollable column (exclusive). */
|
|
2046
|
+
end: number;
|
|
2047
|
+
/** Combined width of the hidden columns before {@link start}. */
|
|
2048
|
+
leftWidth: number;
|
|
2049
|
+
/** Combined width of the hidden columns from {@link end} onward. */
|
|
2050
|
+
rightWidth: number;
|
|
1485
2051
|
}
|
|
1486
2052
|
|
|
1487
2053
|
/** Rectangular bounds in projected row and visible column coordinates. @internal */
|
|
@@ -1492,6 +2058,20 @@ type VisibleCellBounds = {
|
|
|
1492
2058
|
colEnd: number;
|
|
1493
2059
|
};
|
|
1494
2060
|
|
|
2061
|
+
/** One contiguous segment in the optional grouped-header row. @internal */
|
|
2062
|
+
interface AgridHeaderGroupRun {
|
|
2063
|
+
key: string;
|
|
2064
|
+
id: string | null;
|
|
2065
|
+
label: string;
|
|
2066
|
+
fields: string[];
|
|
2067
|
+
span: number;
|
|
2068
|
+
}
|
|
2069
|
+
/** A grouped-header run enriched with reactive lock/drag state. @internal */
|
|
2070
|
+
interface AgridHeaderGroup extends AgridHeaderGroupRun {
|
|
2071
|
+
locked: boolean;
|
|
2072
|
+
dragging: boolean;
|
|
2073
|
+
}
|
|
2074
|
+
|
|
1495
2075
|
/** Dependencies and callbacks required by {@link AgridDragHandler}. @internal */
|
|
1496
2076
|
interface AgridDragHandlerOptions {
|
|
1497
2077
|
dataSource: Signal<AgridDataSource>;
|
|
@@ -1568,6 +2148,8 @@ declare class AgridTreeController {
|
|
|
1568
2148
|
collapseAll(): void;
|
|
1569
2149
|
}
|
|
1570
2150
|
|
|
2151
|
+
/** Tabs available from the grid's vertical sidebar strip. @internal */
|
|
2152
|
+
type AgridSidebarTab = 'columns' | 'detail' | 'pivot';
|
|
1571
2153
|
/** Field edit emitted by the sidebar detail form. @internal */
|
|
1572
2154
|
interface AgridSidebarEdit {
|
|
1573
2155
|
/** Data field being edited. */
|
|
@@ -1607,6 +2189,9 @@ interface AgridSidebarDetailField {
|
|
|
1607
2189
|
* | Key | Action |
|
|
1608
2190
|
* |-----|--------|
|
|
1609
2191
|
* | Arrow keys | Move selection |
|
|
2192
|
+
* | Page Up / Page Down | Move by one visible viewport page |
|
|
2193
|
+
* | Home / End | Move to the first / last cell in the current row |
|
|
2194
|
+
* | Ctrl/Cmd+Home / Ctrl/Cmd+End | Move to the first / last cell in the grid |
|
|
1610
2195
|
* | Tab / Shift+Tab | Move right / left (wraps rows) |
|
|
1611
2196
|
* | Enter | Enter edit mode |
|
|
1612
2197
|
* | Ctrl/Cmd+Enter | Toggle an expandable tree node |
|
|
@@ -1615,23 +2200,25 @@ interface AgridSidebarDetailField {
|
|
|
1615
2200
|
* | Escape | Close any open menu or cancel edit |
|
|
1616
2201
|
* | Tab / Enter (while editing) | Commit and move according to navigation settings |
|
|
1617
2202
|
*/
|
|
1618
|
-
declare class AgridComponent<T extends object = any> {
|
|
2203
|
+
declare class AgridComponent<T extends object = any> implements OnChanges {
|
|
1619
2204
|
/** Grid provider containing columns, data source, control, and options. */
|
|
1620
2205
|
provider: _angular_core.InputSignal<AgridProvider<T>>;
|
|
2206
|
+
private restoredProvider?;
|
|
1621
2207
|
readonly rowHeight: Signal<number>;
|
|
1622
2208
|
readonly minHeight: Signal<string | undefined>;
|
|
1623
2209
|
readonly maxHeight: Signal<string | undefined>;
|
|
1624
2210
|
readonly allowAddRows: Signal<boolean>;
|
|
1625
2211
|
readonly autoAddRows: Signal<boolean>;
|
|
1626
2212
|
readonly enableRowMarking: Signal<boolean>;
|
|
2213
|
+
readonly enableColumnMarking: Signal<boolean>;
|
|
1627
2214
|
readonly showControlColumn: Signal<boolean>;
|
|
1628
|
-
readonly controlColumnWidth: Signal<
|
|
2215
|
+
readonly controlColumnWidth: Signal<24 | 48>;
|
|
1629
2216
|
readonly showSidebar: Signal<boolean>;
|
|
1630
2217
|
readonly autoOpenDetail: Signal<boolean>;
|
|
1631
2218
|
readonly serverSideFiltering: Signal<boolean>;
|
|
1632
2219
|
readonly filterDebounceMs: Signal<number>;
|
|
1633
2220
|
readonly enableQuickFilter: Signal<boolean>;
|
|
1634
|
-
readonly menuBarItems: Signal<AgridMenuBarItem<T>[]>;
|
|
2221
|
+
readonly menuBarItems: Signal<_thkl_agrid.AgridMenuBarItem<T>[]>;
|
|
1635
2222
|
readonly quickFilterValue: Signal<string>;
|
|
1636
2223
|
readonly sortOption: Signal<"single" | "multi" | "none">;
|
|
1637
2224
|
readonly rowSelection: Signal<"single" | "multi" | "none">;
|
|
@@ -1641,6 +2228,8 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1641
2228
|
readonly cellMenuItems: Signal<(CellContextMenuItem<T> | null)[]>;
|
|
1642
2229
|
readonly headerGroups: Signal<_thkl_agrid.HeaderGroup[]>;
|
|
1643
2230
|
readonly treeConfig: Signal<_thkl_agrid.AgridTreeConfig<T> | null>;
|
|
2231
|
+
/** Whether the provider is rendering a derived client-side pivot table. */
|
|
2232
|
+
readonly pivotMode: Signal<boolean>;
|
|
1644
2233
|
readonly zebraStripes: Signal<boolean>;
|
|
1645
2234
|
readonly showChangedCellIndicator: Signal<boolean>;
|
|
1646
2235
|
readonly confirmRowDelete: Signal<boolean>;
|
|
@@ -1648,6 +2237,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1648
2237
|
readonly loading: Signal<boolean>;
|
|
1649
2238
|
readonly emptyText: Signal<string | undefined>;
|
|
1650
2239
|
readonly useSidebarEditor: Signal<boolean>;
|
|
2240
|
+
readonly hideGridStatusBar: Signal<boolean | undefined>;
|
|
1651
2241
|
/** Host callback for per-row CSS classes, or `undefined`. */
|
|
1652
2242
|
readonly rowClassFn: Signal<((params: {
|
|
1653
2243
|
row: Record<string, unknown>;
|
|
@@ -1655,6 +2245,8 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1655
2245
|
}) => string) | undefined>;
|
|
1656
2246
|
/** Host callback designating pinned rows, or `undefined`. */
|
|
1657
2247
|
readonly pinRowFn: Signal<((row: Record<string, unknown>, index: number) => "top" | "bottom" | undefined) | undefined>;
|
|
2248
|
+
readonly pivotRowColumnField: Signal<Extract<keyof T, string> | undefined>;
|
|
2249
|
+
readonly pivotHeaderLabel: Signal<string | undefined>;
|
|
1658
2250
|
/**
|
|
1659
2251
|
* Effective pin resolver fed to the projection: a runtime UI override wins (including an explicit
|
|
1660
2252
|
* `null` unpin), otherwise the provider `pinRow` predicate decides. Returns `undefined` when
|
|
@@ -1665,10 +2257,21 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1665
2257
|
readonly masterDetail: Signal<boolean>;
|
|
1666
2258
|
/** Fixed detail-panel height in pixels. */
|
|
1667
2259
|
readonly detailRowHeight: Signal<number>;
|
|
1668
|
-
/** Column
|
|
2260
|
+
/** Column configured as the expanded panel's multiline detail field. */
|
|
2261
|
+
readonly detailColumn: Signal<ColDefBase<any, string> | null>;
|
|
2262
|
+
/** Text-template buttons configured for the expanded panel's multiline detail field. */
|
|
2263
|
+
readonly detailActions: Signal<DetailAction<T>[]>;
|
|
2264
|
+
/** Read-only pivot rows and generated columns, or `null` in the normal datasource view. */
|
|
2265
|
+
private readonly pivotResult;
|
|
2266
|
+
/** Reactive row projection linked into a stable datasource instance for pivot mode. */
|
|
2267
|
+
private readonly pivotRows;
|
|
2268
|
+
private readonly pivotDataSource;
|
|
2269
|
+
/** Column definitions from the active provider or generated by the active pivot. */
|
|
1669
2270
|
readonly colDefs: Signal<ColDefBase<any, string>[]>;
|
|
1670
|
-
/** Signal-based
|
|
2271
|
+
/** Signal-based source rows or a derived, read-only pivot datasource. */
|
|
1671
2272
|
readonly dataSource: Signal<AgridDataSource<any>>;
|
|
2273
|
+
/** Active lazy server-side row model, when configured on the provider. */
|
|
2274
|
+
readonly serverSideRowModel: Signal<_thkl_agrid.AgridServerSideRowModel<T> | null>;
|
|
1672
2275
|
private readonly treeParentIds;
|
|
1673
2276
|
/** Grid UI state container from the active provider. */
|
|
1674
2277
|
readonly control: Signal<AgridControl | null>;
|
|
@@ -1678,6 +2281,8 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1678
2281
|
readonly localeText: Signal<AgridLocaleText>;
|
|
1679
2282
|
/** Effective empty-state label. */
|
|
1680
2283
|
readonly emptyTextLabel: Signal<string>;
|
|
2284
|
+
readonly gridId: Signal<string | undefined>;
|
|
2285
|
+
readonly enableExportButtons: Signal<boolean | undefined>;
|
|
1681
2286
|
/** Emitted after the user commits a cell edit. */
|
|
1682
2287
|
cellEdit: _angular_core.OutputEmitterRef<GridEditEvent<T>>;
|
|
1683
2288
|
/**
|
|
@@ -1693,11 +2298,21 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1693
2298
|
rowReorder: _angular_core.OutputEmitterRef<RowReorderEvent<T>>;
|
|
1694
2299
|
/** Emitted when the row selection changes. `null` = selection cleared. */
|
|
1695
2300
|
rowSelect: _angular_core.OutputEmitterRef<RowSelectEvent<T> | null>;
|
|
2301
|
+
/** Emitted when a row is marked or unmarked from its row header. */
|
|
2302
|
+
rowMark: _angular_core.OutputEmitterRef<RowMarkEvent<T>>;
|
|
2303
|
+
/** Emitted when a complete column is marked or unmarked from its header. */
|
|
2304
|
+
columnMark: _angular_core.OutputEmitterRef<ColumnMarkEvent<T>>;
|
|
2305
|
+
/** Emitted when a custom column-header menu command is selected. */
|
|
2306
|
+
columnHeaderAction: _angular_core.OutputEmitterRef<ColumnHeaderActionEvent<T>>;
|
|
2307
|
+
/** Emitted once after the first non-empty datasource render has completed. */
|
|
2308
|
+
firstDataRendered: _angular_core.OutputEmitterRef<FirstDataRenderedEvent<T>>;
|
|
1696
2309
|
rowDoubleClicked: _angular_core.OutputEmitterRef<RowClickEvent<T>>;
|
|
1697
2310
|
/** Emitted when the user single-clicks a data row. */
|
|
1698
2311
|
rowClick: _angular_core.OutputEmitterRef<RowClickEvent<T>>;
|
|
1699
2312
|
/** Emitted when the user single-clicks a generated path-tree branch node. */
|
|
1700
2313
|
treeNodeClick: _angular_core.OutputEmitterRef<TreeNodeClickEvent>;
|
|
2314
|
+
/** Emitted after sidebar changes produce a new persistable grid settings snapshot. */
|
|
2315
|
+
settingsChange: _angular_core.OutputEmitterRef<AgridSettings>;
|
|
1701
2316
|
/** Emitted when the user double-clicks a generated path-tree branch node. */
|
|
1702
2317
|
treeNodeDoubleClicked: _angular_core.OutputEmitterRef<TreeNodeClickEvent>;
|
|
1703
2318
|
/**
|
|
@@ -1727,10 +2342,10 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1727
2342
|
cellInfo: _angular_core.OutputEmitterRef<CellInfoEvent<T>>;
|
|
1728
2343
|
/** Emitted for every enabled menu-bar button or dropdown item, carrying its configured id. */
|
|
1729
2344
|
menuBarAction: _angular_core.OutputEmitterRef<string>;
|
|
2345
|
+
/** Emitted if there is a Detail pane Action without text property */
|
|
2346
|
+
detailAction: _angular_core.OutputEmitterRef<RowDetailActionEvent<T>>;
|
|
1730
2347
|
/** Currently focused cell, or `null`. */
|
|
1731
2348
|
readonly selectedCell: _angular_core.WritableSignal<CellPosition | null>;
|
|
1732
|
-
/** Original index of the row awaiting delete confirmation, or `null`. */
|
|
1733
|
-
readonly pendingDeleteRow: _angular_core.WritableSignal<number | null>;
|
|
1734
2349
|
/** Original indices of rows whose master/detail panel is currently expanded. */
|
|
1735
2350
|
private readonly _expandedDetailIds;
|
|
1736
2351
|
/**
|
|
@@ -1740,12 +2355,12 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1740
2355
|
*/
|
|
1741
2356
|
private readonly _pinnedRows;
|
|
1742
2357
|
private readonly markedIndices;
|
|
2358
|
+
private readonly markedFields;
|
|
2359
|
+
private firstDataRenderedEmitted;
|
|
1743
2360
|
/** Original datasource indices marked for inclusion in copy operations. */
|
|
1744
2361
|
readonly markedRowIndices: Signal<ReadonlySet<number>>;
|
|
1745
|
-
/**
|
|
1746
|
-
readonly
|
|
1747
|
-
/** Visible width available to the delete prompt. */
|
|
1748
|
-
readonly deleteConfirmationWidth: _angular_core.WritableSignal<number>;
|
|
2362
|
+
/** Fields currently marked as complete columns. */
|
|
2363
|
+
readonly markedColumnFields: Signal<ReadonlySet<string>>;
|
|
1749
2364
|
/** Rectangular cell range selected by Shift+arrow or Shift+click. */
|
|
1750
2365
|
readonly selectedRange: _angular_core.WritableSignal<CellRange | null>;
|
|
1751
2366
|
/** @internal Stable callback passed to child components for row-aware editability checks. */
|
|
@@ -1763,26 +2378,29 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1763
2378
|
/** Toggle the sidebar open/closed. */
|
|
1764
2379
|
toggleSidebar(): void;
|
|
1765
2380
|
/** @internal */
|
|
1766
|
-
onSidebarStripClick(tab:
|
|
2381
|
+
onSidebarStripClick(tab: AgridSidebarTab): void;
|
|
2382
|
+
/** @internal Replace the active pivot configuration from the sidebar controls. */
|
|
2383
|
+
onSidebarPivotChange(config: AgridPivotConfig): void;
|
|
2384
|
+
/** Return a detached, JSON-safe snapshot suitable for persistence by the host application. */
|
|
2385
|
+
saveSettings(): AgridSettings;
|
|
2386
|
+
/** Apply a saved settings snapshot to this live grid. */
|
|
2387
|
+
loadSettings(settings: AgridSettings): void;
|
|
2388
|
+
/** Emit when the active state is JSON-safe; custom function aggregates remain host-owned. */
|
|
2389
|
+
private emitSettingsChange;
|
|
2390
|
+
ngOnChanges(): void;
|
|
1767
2391
|
/** @internal */
|
|
1768
2392
|
onSidebarDetailEdit(event: AgridSidebarEdit): void;
|
|
1769
2393
|
/** @internal Commit an edit made via the detail panel. */
|
|
1770
2394
|
commitDetailEdit(field: string, col: ColDef, stringValue: string): void;
|
|
1771
2395
|
onSidebarDetailSave(_event: AgridSidebarDetailField[]): void;
|
|
1772
|
-
/**
|
|
1773
|
-
* Download the currently visible, filtered rows as a CSV file.
|
|
1774
|
-
* Uses display values (ValueOption labels, formatters) and respects column visibility.
|
|
1775
|
-
* Group header rows are excluded — only data rows are exported.
|
|
1776
|
-
*
|
|
1777
|
-
* @param filename Output filename, defaults to `'export.csv'`.
|
|
1778
|
-
*/
|
|
1779
|
-
exportCsv(filename?: string): void;
|
|
1780
2396
|
/** @internal */ goToFirstPage(): void;
|
|
1781
2397
|
/** @internal */ goToLastPage(): void;
|
|
1782
2398
|
/** @internal */ goToNextPage(): void;
|
|
1783
2399
|
/** @internal */ goToPrevPage(): void;
|
|
1784
2400
|
/** Resize every visible column to fit its header and current row values. */
|
|
1785
2401
|
autosizeAllColumns(): void;
|
|
2402
|
+
/** return yes if we have saved config so a autosize from the client can be surpressed */
|
|
2403
|
+
hasSavedSizeConfig(): boolean;
|
|
1786
2404
|
/**
|
|
1787
2405
|
* Clears changed-cell markers after persistence succeeds.
|
|
1788
2406
|
* Omit `originalIndex` to clear every marker; omit `fields` to clear the whole row.
|
|
@@ -1790,6 +2408,12 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1790
2408
|
clearChangedCells(originalIndex?: number, fields?: readonly string[]): void;
|
|
1791
2409
|
/** @internal Whether a cell has an unsaved-change marker. */
|
|
1792
2410
|
isCellChanged(originalIndex: number, field: string): boolean;
|
|
2411
|
+
/** @internal Whether a row is currently in the colored phase of a control indication. */
|
|
2412
|
+
rowIndicationActive(originalIndex: number): boolean;
|
|
2413
|
+
/** @internal CSS color for a transient row indication. */
|
|
2414
|
+
rowIndicationColor(originalIndex: number): string | null;
|
|
2415
|
+
/** @internal Fade duration for a transient row indication. */
|
|
2416
|
+
rowIndicationDuration(originalIndex: number): number | null;
|
|
1793
2417
|
/** @internal Full display value for a cell — used as the `title` tooltip attribute. */
|
|
1794
2418
|
getCellTitle(col: ColDef, value: unknown): string;
|
|
1795
2419
|
/** @internal Dynamic CSS class string for a cell from `ColDef.cellClass`. */
|
|
@@ -1825,6 +2449,31 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1825
2449
|
readonly pinnedHeaderGroupRuns: Signal<AgridHeaderGroupRun[]>;
|
|
1826
2450
|
readonly scrollableHeaderGroupRuns: Signal<AgridHeaderGroupRun[]>;
|
|
1827
2451
|
readonly rightHeaderGroupRuns: Signal<AgridHeaderGroupRun[]>;
|
|
2452
|
+
/** @internal Header view-model for the left-pinned, scrollable, and right-pinned panes. */
|
|
2453
|
+
readonly pinnedHeaderColumns: Signal<AgridHeaderColumn[]>;
|
|
2454
|
+
readonly scrollableHeaderColumns: Signal<AgridHeaderColumn[]>;
|
|
2455
|
+
readonly rightHeaderColumns: Signal<AgridHeaderColumn[]>;
|
|
2456
|
+
/** @internal Grouped-header view-model per pane (run + reactive lock/drag state). */
|
|
2457
|
+
readonly pinnedHeaderGroups: Signal<AgridHeaderGroup[]>;
|
|
2458
|
+
readonly scrollableHeaderGroups: Signal<AgridHeaderGroup[]>;
|
|
2459
|
+
readonly rightHeaderGroups: Signal<AgridHeaderGroup[]>;
|
|
2460
|
+
/**
|
|
2461
|
+
* Resolves every per-column header/filter binding into a flat view-model. Called from the
|
|
2462
|
+
* pane header computeds; reads the same signal-backed helpers the template used directly, so
|
|
2463
|
+
* the result is memoized and recomputed only when sort/filter/drag/sizing state changes.
|
|
2464
|
+
*/
|
|
2465
|
+
private buildHeaderColumns;
|
|
2466
|
+
private buildHeaderGroups;
|
|
2467
|
+
/** @internal Body view-model for the left-pinned, scrollable, and right-pinned panes. */
|
|
2468
|
+
readonly pinnedBodyColumns: Signal<AgridBodyColumn[]>;
|
|
2469
|
+
readonly scrollableBodyColumns: Signal<AgridBodyColumn[]>;
|
|
2470
|
+
readonly rightBodyColumns: Signal<AgridBodyColumn[]>;
|
|
2471
|
+
/**
|
|
2472
|
+
* Resolves the per-column bindings shared by every data, footer, and ghost cell. Reads only
|
|
2473
|
+
* layout/drag/pinning signals, so the result is reused across all rows and recomputes only
|
|
2474
|
+
* when columns move, resize, drag, or change pinning.
|
|
2475
|
+
*/
|
|
2476
|
+
private buildBodyColumns;
|
|
1828
2477
|
private readonly columnState;
|
|
1829
2478
|
private readonly projection;
|
|
1830
2479
|
private readonly editController;
|
|
@@ -1856,11 +2505,29 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1856
2505
|
readonly totalWidth: Signal<number>;
|
|
1857
2506
|
readonly pinnedPaneWidth: Signal<number>;
|
|
1858
2507
|
readonly scrollableTotalWidth: Signal<number>;
|
|
2508
|
+
/** Live horizontal scroll metrics of the scrollable pane, fed to column virtualization. */
|
|
2509
|
+
private readonly colScrollLeft;
|
|
2510
|
+
private readonly colViewportWidth;
|
|
2511
|
+
/** Scrollable-column count above which column virtualization activates. */
|
|
2512
|
+
readonly columnVirtualizationThreshold: Signal<number>;
|
|
2513
|
+
/** Windows the scrollable-pane columns to those near the horizontal viewport. */
|
|
2514
|
+
private readonly columnVirtualization;
|
|
2515
|
+
/** @internal Current rendered column window (full set + zero spacers when inactive). */
|
|
2516
|
+
readonly columnWindow: Signal<AgridColumnWindow>;
|
|
2517
|
+
/** @internal Scrollable body columns sliced to the active window. */
|
|
2518
|
+
readonly virtualScrollableBodyColumns: Signal<AgridBodyColumn[]>;
|
|
2519
|
+
/** @internal Number of hidden scrollable columns after the window (trailing spacer span). */
|
|
2520
|
+
readonly columnWindowRightSpan: Signal<number>;
|
|
1859
2521
|
/**
|
|
1860
2522
|
* Filtered, sorted, and optionally grouped row list for `*cdkVirtualFor`.
|
|
1861
2523
|
* Appends `null` when the explicit add-row placeholder is active.
|
|
1862
2524
|
*/
|
|
1863
2525
|
readonly filteredItems: Signal<GridItem[]>;
|
|
2526
|
+
/**
|
|
2527
|
+
* @internal The full filtered + sorted row set (grouping/pagination ignored). Reused for export
|
|
2528
|
+
* and published to the provider as `visibleRows` so charts and consumers can react to filters.
|
|
2529
|
+
*/
|
|
2530
|
+
readonly ɵvisibleRows: Signal<Record<string, unknown>[]>;
|
|
1864
2531
|
/** Virtual scroll source — injects ghost row during a reorder drag. */
|
|
1865
2532
|
/** 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. */
|
|
1866
2533
|
readonly dataRowIsOdd: Signal<Map<number, boolean>>;
|
|
@@ -1898,7 +2565,18 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1898
2565
|
private readonly destroyRef;
|
|
1899
2566
|
private readonly _hostEl;
|
|
1900
2567
|
private readonly browser;
|
|
2568
|
+
private viewReady;
|
|
1901
2569
|
private readonly rangeController;
|
|
2570
|
+
/** Live numeric statistics for the active cell or rectangular range. */
|
|
2571
|
+
readonly selectionSummary: Signal<AgridSelectionSummary | null>;
|
|
2572
|
+
/** Locale-formatted status-bar values derived from {@link selectionSummary}. */
|
|
2573
|
+
readonly selectionSummaryDisplay: Signal<{
|
|
2574
|
+
count: string;
|
|
2575
|
+
sum: string;
|
|
2576
|
+
average: string;
|
|
2577
|
+
min: string;
|
|
2578
|
+
max: string;
|
|
2579
|
+
} | null>;
|
|
1902
2580
|
private readonly columnSizing;
|
|
1903
2581
|
private readonly columnMenuController;
|
|
1904
2582
|
readonly filterMenu: _angular_core.WritableSignal<AgridColumnMenuState | null>;
|
|
@@ -1919,31 +2597,46 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1919
2597
|
readonly findQuery: _angular_core.WritableSignal<string>;
|
|
1920
2598
|
readonly findActiveIndex: _angular_core.WritableSignal<number>;
|
|
1921
2599
|
readonly findMatches: Signal<AgridFindMatch[]>;
|
|
2600
|
+
private readonly detailController;
|
|
2601
|
+
/** @internal Detail-field editor state, re-exported for the template. */
|
|
2602
|
+
readonly detailEditingRow: _angular_core.WritableSignal<number | null>;
|
|
2603
|
+
readonly detailDraft: _angular_core.WritableSignal<string>;
|
|
2604
|
+
readonly detailValidationError: _angular_core.WritableSignal<string | null>;
|
|
1922
2605
|
private readonly navigationController;
|
|
2606
|
+
/** Maps logical covered columns to a rendered span anchor (or past it when moving right). */
|
|
2607
|
+
private resolveSpannedColumn;
|
|
1923
2608
|
private readonly rowController;
|
|
1924
2609
|
readonly selectedRowIndices: Signal<ReadonlySet<number>>;
|
|
1925
2610
|
readonly selectedRowIndex: Signal<number | null>;
|
|
1926
2611
|
readonly contextMenu: _angular_core.WritableSignal<AgridRowContextMenu | null>;
|
|
1927
2612
|
readonly cellContextMenuState: _angular_core.WritableSignal<AgridCellContextMenu | null>;
|
|
2613
|
+
readonly pendingDeleteRow: _angular_core.WritableSignal<number | null>;
|
|
2614
|
+
readonly deleteConfirmationLeft: _angular_core.WritableSignal<number>;
|
|
2615
|
+
readonly deleteConfirmationWidth: _angular_core.WritableSignal<number>;
|
|
2616
|
+
private readonly menuBarController;
|
|
1928
2617
|
/** Id of the menu-bar button whose dropdown is open, or `null`. */
|
|
1929
2618
|
readonly openMenuBarItemId: _angular_core.WritableSignal<string | null>;
|
|
1930
2619
|
/** Runtime state passed to menu-bar visibility, active, and disabled resolvers. */
|
|
1931
|
-
readonly menuBarContext: Signal<AgridMenuBarContext<T>>;
|
|
2620
|
+
readonly menuBarContext: Signal<_thkl_agrid.AgridMenuBarContext<T>>;
|
|
1932
2621
|
/** Menu-bar buttons currently allowed by their visibility resolvers. */
|
|
1933
|
-
readonly visibleMenuBarItems: Signal<AgridMenuBarItem<T>[]>;
|
|
2622
|
+
readonly visibleMenuBarItems: Signal<(_thkl_agrid.AgridMenuBarItem<any> | _thkl_agrid.AgridMenuBarItem<T>)[]>;
|
|
1934
2623
|
private readonly sidebarController;
|
|
1935
2624
|
readonly sidebarOpen: _angular_core.WritableSignal<boolean>;
|
|
1936
2625
|
/** @internal Per-field sidebar validation messages. */
|
|
1937
2626
|
readonly sidebarValidationErrors: _angular_core.WritableSignal<Record<string, string>>;
|
|
1938
|
-
readonly sidebarTab: _angular_core.WritableSignal<
|
|
2627
|
+
readonly sidebarTab: _angular_core.WritableSignal<AgridSidebarTab>;
|
|
1939
2628
|
readonly sidebarRow: Signal<Record<string, unknown> | null>;
|
|
1940
2629
|
readonly sidebarHiddenColumns: Signal<ReadonlySet<string>>;
|
|
2630
|
+
/** Original provider columns used as pivot field choices. */
|
|
2631
|
+
readonly sidebarPivotColumns: Signal<ColDefBase<any, string>[]>;
|
|
1941
2632
|
private readonly clipboardHandler;
|
|
1942
2633
|
readonly dragHandler: AgridDragHandler;
|
|
1943
2634
|
private readonly columnReorder;
|
|
1944
2635
|
readonly columnDragPreview: _angular_core.WritableSignal<AgridColumnDragPreview | null>;
|
|
1945
2636
|
/** @internal Start a column header drag. */
|
|
1946
2637
|
onColHeaderPointerDown(event: PointerEvent, field: string): void;
|
|
2638
|
+
/** @internal Toggles a complete column when its non-interactive header surface is clicked. */
|
|
2639
|
+
onColHeaderClick(event: MouseEvent, field: string): void;
|
|
1947
2640
|
/** @internal Start dragging all columns in one contiguous grouped-header segment. */
|
|
1948
2641
|
onHeaderGroupPointerDown(event: PointerEvent, fields: string[], label: string): void;
|
|
1949
2642
|
/** @internal Whether any field in a grouped-header segment is being dragged. */
|
|
@@ -1960,18 +2653,14 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1960
2653
|
private readonly _seededControls;
|
|
1961
2654
|
private readonly dirtyInlineRows;
|
|
1962
2655
|
private dirtyRowsDataSource;
|
|
1963
|
-
private readonly changedCells;
|
|
1964
2656
|
private changedCellsDataSource;
|
|
1965
2657
|
private emitEditEvents;
|
|
1966
2658
|
private emitSidebarEditEvents;
|
|
1967
2659
|
private emitRecordEdit;
|
|
1968
2660
|
private markInlineRowDirty;
|
|
1969
2661
|
private markCellChanged;
|
|
1970
|
-
private changedCellKey;
|
|
1971
|
-
private parseChangedCellKey;
|
|
1972
2662
|
private flushDirtyInlineRows;
|
|
1973
2663
|
private reconcileDirtyInlineRowsAfterRemoval;
|
|
1974
|
-
private reconcileChangedCellsAfterRemoval;
|
|
1975
2664
|
private emitRowChanged;
|
|
1976
2665
|
private createRecordEvent;
|
|
1977
2666
|
constructor();
|
|
@@ -1980,6 +2669,11 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1980
2669
|
row: Record<string, unknown>;
|
|
1981
2670
|
originalIndex: number;
|
|
1982
2671
|
};
|
|
2672
|
+
/** @internal Whether this virtual row is waiting for a server-side block. */
|
|
2673
|
+
isLoadingRow(item: GridItem): item is {
|
|
2674
|
+
loading: true;
|
|
2675
|
+
originalIndex: number;
|
|
2676
|
+
};
|
|
1983
2677
|
/** @internal */
|
|
1984
2678
|
isGroupHeaderItem(item: GridItem): item is {
|
|
1985
2679
|
groupLabel: string;
|
|
@@ -1996,6 +2690,23 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1996
2690
|
rowPx(item: GridItem): number;
|
|
1997
2691
|
/** @internal Resolved HTML for an expanded detail panel (auto-sanitized by `[innerHTML]`). */
|
|
1998
2692
|
detailHtml(item: GridItem): string;
|
|
2693
|
+
/** @internal Formatted value shown while a configured detail field is not being edited. */
|
|
2694
|
+
detailFieldDisplay(item: DetailRowItem): string;
|
|
2695
|
+
/** @internal Whether the configured detail field can be edited for this row. */
|
|
2696
|
+
isDetailFieldEditable(item: DetailRowItem): boolean;
|
|
2697
|
+
/** @internal Enter multiline editing for one expanded detail row. */
|
|
2698
|
+
startDetailFieldEdit(item: DetailRowItem, event?: Event): void;
|
|
2699
|
+
/** @internal Keep the multiline draft synchronized with textarea input. */
|
|
2700
|
+
onDetailDraftInput(event: Event): void;
|
|
2701
|
+
/** @internal Commit on blur or Ctrl/Cmd+Enter, and cancel on Escape. */
|
|
2702
|
+
onDetailEditorKeydown(item: DetailRowItem, event: KeyboardEvent): void;
|
|
2703
|
+
/** @internal Insert a configured text template into the active detail textarea. */
|
|
2704
|
+
applyDetailAction(item: DetailRowItem, action: DetailAction, event: Event): void;
|
|
2705
|
+
private focusDetailEditorFromKeyboard;
|
|
2706
|
+
/** @internal Commit a multiline detail edit through normal grid edit semantics. */
|
|
2707
|
+
commitDetailFieldEdit(item: DetailRowItem): void;
|
|
2708
|
+
/** @internal Discard the active multiline detail draft. */
|
|
2709
|
+
cancelDetailFieldEdit(): void;
|
|
1999
2710
|
/** @internal Resolved per-row CSS classes from the host `getRowClass` callback. */
|
|
2000
2711
|
getRowClass(row: Record<string, unknown>, index: number): string;
|
|
2001
2712
|
/** Whether the master/detail panel for `originalIndex` is currently expanded. */
|
|
@@ -2023,8 +2734,20 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2023
2734
|
treeRowExpandable(item: GridItem): boolean;
|
|
2024
2735
|
/** @internal Whether a tree row is currently expanded. */
|
|
2025
2736
|
treeRowExpanded(item: GridItem): boolean;
|
|
2026
|
-
/**
|
|
2737
|
+
/**
|
|
2738
|
+
* @internal Resolve the non-persistent value shown by a tree cell.
|
|
2739
|
+
*
|
|
2740
|
+
* A formatted path-leaf label wins in the tree column. In every other aggregate column, an
|
|
2741
|
+
* expandable parent shows its descendant rollup instead of its stored value. Returning `null`
|
|
2742
|
+
* delegates to the normal cell formatter. The source row is never mutated.
|
|
2743
|
+
*/
|
|
2027
2744
|
treeCellDisplayOverride(item: GridItem, col: ColDef): string | null;
|
|
2745
|
+
/**
|
|
2746
|
+
* @internal True when a datasource-backed tree parent cell displays a computed rollup.
|
|
2747
|
+
* The template uses this to prevent editing a display-only value into the source parent row.
|
|
2748
|
+
* Generated path branches are not cell components and render their aggregates separately.
|
|
2749
|
+
*/
|
|
2750
|
+
isTreeAggregateCell(item: GridItem, col: ColDef): boolean;
|
|
2028
2751
|
/** @internal Whether the configured info action is visible for this cell. */
|
|
2029
2752
|
showCellInfoIcon(col: ColDef, row: Record<string, unknown>): boolean;
|
|
2030
2753
|
/** @internal Emits the typed cell information action. */
|
|
@@ -2122,6 +2845,10 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2122
2845
|
onStartEdit(originalIndex: number, ci: number): void;
|
|
2123
2846
|
/** @internal */
|
|
2124
2847
|
onDraftChange(value: unknown): void;
|
|
2848
|
+
/** @internal A custom cell editor requested a commit (e.g. picking a value). */
|
|
2849
|
+
onEditorCommit(): void;
|
|
2850
|
+
/** @internal A custom cell editor requested cancellation. */
|
|
2851
|
+
onEditorCancel(): void;
|
|
2125
2852
|
private quickFilterTimer;
|
|
2126
2853
|
/**
|
|
2127
2854
|
* @internal Quick-filter input handler. Stores the text on the control (drives the bound value
|
|
@@ -2155,12 +2882,24 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2155
2882
|
onHandlePointerDown(event: PointerEvent, originalIndex: number): void;
|
|
2156
2883
|
/** @internal Handles the control column without letting the row receive a second pointer event. */
|
|
2157
2884
|
onControlPointerDown(event: PointerEvent, originalIndex: number): void;
|
|
2158
|
-
/** @internal
|
|
2885
|
+
/** @internal Marks a row when its control-column header surface is clicked. */
|
|
2886
|
+
onControlCellClick(event: MouseEvent, originalIndex: number): void;
|
|
2887
|
+
/** Toggle whether a row is included in subsequent copy operations and emit its new state. */
|
|
2159
2888
|
toggleRowMarked(originalIndex: number): void;
|
|
2889
|
+
/** Set one row's mark state and emit `rowMark` when that state changes. */
|
|
2890
|
+
setRowMarked(originalIndex: number, marked: boolean): void;
|
|
2160
2891
|
/** @internal Returns whether a row is marked for copying. */
|
|
2161
2892
|
isRowMarked(originalIndex: number): boolean;
|
|
2162
2893
|
/** Clear every row marked for clipboard inclusion. */
|
|
2163
2894
|
clearMarkedRows(): void;
|
|
2895
|
+
/** Set one complete column's mark state and emit `columnMark` when it changes. */
|
|
2896
|
+
setColumnMarked(field: string, marked: boolean): void;
|
|
2897
|
+
/** Toggle one complete column's mark state. */
|
|
2898
|
+
toggleColumnMarked(field: string): void;
|
|
2899
|
+
/** Clear all marked columns. */
|
|
2900
|
+
clearMarkedColumns(): void;
|
|
2901
|
+
/** @internal Emits a custom header command for its typed column and closes the menu. */
|
|
2902
|
+
onColumnHeaderAction(field: string, key: string): void;
|
|
2164
2903
|
/** @internal Copy the active range or cell as TSV. */
|
|
2165
2904
|
onCopy(event: ClipboardEvent): void;
|
|
2166
2905
|
/** @internal Paste TSV/CSV-like plain text into the current cell. */
|
|
@@ -2181,28 +2920,12 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2181
2920
|
closeCellContextMenu(): void;
|
|
2182
2921
|
/** @internal Closes any row, cell, menu-bar, group-action, or column menu owned by this grid. */
|
|
2183
2922
|
closeOpenMenus(): boolean;
|
|
2184
|
-
/** @internal Resolves a menu-bar state callback against the current grid state. */
|
|
2185
|
-
resolveMenuBarState(state: AgridMenuBarState<T> | undefined, fallback: boolean): boolean;
|
|
2186
|
-
/** @internal Whether a menu-bar button or dropdown item should be rendered. */
|
|
2187
|
-
isMenuBarItemVisible(item: AgridMenuBarMenuItem<T>): boolean;
|
|
2188
|
-
/** @internal Whether a menu-bar button or dropdown item is active. */
|
|
2189
|
-
isMenuBarItemActive(item: AgridMenuBarMenuItem<T>): boolean;
|
|
2190
|
-
/** @internal Whether a menu-bar button or dropdown item is disabled. */
|
|
2191
|
-
isMenuBarItemDisabled(item: AgridMenuBarMenuItem<T>): boolean;
|
|
2192
|
-
/** @internal Visible dropdown entries for a menu-bar button. */
|
|
2193
|
-
visibleMenuBarChildren(item: AgridMenuBarItem<T>): AgridMenuBarMenuItem<T>[];
|
|
2194
|
-
/** @internal Emits one menu-bar action and closes its dropdown. */
|
|
2195
|
-
runMenuBarAction(event: Event, item: AgridMenuBarMenuItem<T>): void;
|
|
2196
|
-
/** @internal Opens or closes a split button's additional command menu. */
|
|
2197
|
-
toggleMenuBarMenu(event: Event, item: AgridMenuBarItem<T>): void;
|
|
2198
|
-
/** @internal Opens a dropdown from the keyboard and focuses its first/last enabled item. */
|
|
2199
|
-
onMenuBarTriggerKeydown(event: KeyboardEvent, item: AgridMenuBarItem<T>): void;
|
|
2200
|
-
/** @internal Provides standard keyboard navigation within an open menu-bar dropdown. */
|
|
2201
|
-
onMenuBarMenuKeydown(event: KeyboardEvent): void;
|
|
2202
2923
|
/** @internal Closes the currently open menu-bar dropdown. */
|
|
2203
2924
|
closeMenuBarMenu(): void;
|
|
2204
2925
|
/** @internal Synchronizes dropdown state and closes competing grid menus when one opens. */
|
|
2205
2926
|
onMenuBarOpenItemChange(id: string | null): void;
|
|
2927
|
+
/** @internal Dispatches a menu-bar action (or persists config for the built-in save entry). */
|
|
2928
|
+
onMenuBarAction(id: string): void;
|
|
2206
2929
|
/** @internal Runs a typed provider context-menu action against erased controller state. */
|
|
2207
2930
|
runCellMenuItem(item: CellContextMenuItem<T>, menu: AgridCellContextMenu): void;
|
|
2208
2931
|
/** @internal Copy one field from the target and marked rows. */
|
|
@@ -2219,8 +2942,6 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2219
2942
|
confirmPendingRowDelete(): void;
|
|
2220
2943
|
/** @internal Cancel the active row-delete confirmation. */
|
|
2221
2944
|
cancelRowDelete(): void;
|
|
2222
|
-
private deleteRowImmediately;
|
|
2223
|
-
private updateDeleteConfirmationPosition;
|
|
2224
2945
|
/** @internal */
|
|
2225
2946
|
onGroupHeaderClick(label: string): void;
|
|
2226
2947
|
/** Expand all groups. No-op when grouping is not active. */
|
|
@@ -2238,7 +2959,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2238
2959
|
/** @internal */
|
|
2239
2960
|
onTextFilterChange(event: Event, field: string): void;
|
|
2240
2961
|
/** @internal */
|
|
2241
|
-
openFilterMenu(event: MouseEvent, field: string): void;
|
|
2962
|
+
openFilterMenu(event: MouseEvent, field: string, mode?: 'column' | 'condition'): void;
|
|
2242
2963
|
/** @internal */
|
|
2243
2964
|
closeFilterMenu(): void;
|
|
2244
2965
|
/** @internal */
|
|
@@ -2263,8 +2984,11 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2263
2984
|
onSidebarToggleColumnGroup(fields: string[], visible: boolean): void;
|
|
2264
2985
|
/** @internal Mirrors vertical scrolling from the main viewport into both pinned panes. */
|
|
2265
2986
|
onBodyScroll(): void;
|
|
2987
|
+
private ensureServerRowsVisible;
|
|
2266
2988
|
/** @internal Keeps the row-delete prompt visible while columns scroll horizontally. */
|
|
2267
2989
|
onHorizontalScroll(): void;
|
|
2990
|
+
/** @internal Refreshes the scroll offset / viewport width driving column virtualization. */
|
|
2991
|
+
private syncColumnViewportMetrics;
|
|
2268
2992
|
/** @internal */
|
|
2269
2993
|
onRightPinnedBodyScroll(): void;
|
|
2270
2994
|
/** @internal */
|
|
@@ -2299,7 +3023,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2299
3023
|
getColumnWidth(col: ColDef): number;
|
|
2300
3024
|
private getColumnWidthToken;
|
|
2301
3025
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgridComponent<any>, never>;
|
|
2302
|
-
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"; "rowDoubleClicked": "rowDoubleClicked"; "rowClick": "rowClick"; "treeNodeClick": "treeNodeClick"; "treeNodeDoubleClicked": "treeNodeDoubleClicked"; "rowChanged": "rowChanged"; "pageChange": "pageChange"; "filterChange": "filterChange"; "sortChange": "sortChange"; "quickFilterChange": "quickFilterChange"; "validationFailed": "validationFailed"; "cellInfo": "cellInfo"; "menuBarAction": "menuBarAction"; }, never, never, true, 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>;
|
|
2303
3027
|
}
|
|
2304
3028
|
|
|
2305
3029
|
/** Identifier supported by the standalone page selector. */
|
|
@@ -2355,7 +3079,12 @@ declare class AgridPageSelectorComponent<TId extends AgridPageId = AgridPageId>
|
|
|
2355
3079
|
|
|
2356
3080
|
/** Configuration accepted by {@link AgridTreeProvider}. */
|
|
2357
3081
|
interface AgridTreeProviderConfig<T extends object> {
|
|
3082
|
+
/** Flat datasource whose rows are linked by parent ids or path segments. */
|
|
2358
3083
|
datasource: AgridDataSource<T>;
|
|
3084
|
+
/**
|
|
3085
|
+
* Hierarchy, identity, labeling, filtering, and initial-expansion configuration.
|
|
3086
|
+
* `aggregateTreeNodes` is ignored because the standalone tree has no grid columns.
|
|
3087
|
+
*/
|
|
2359
3088
|
treeConfig: AgridTreeConfig<T>;
|
|
2360
3089
|
/** Label for parent-linked rows. Defaults to the configured `treeField` value. */
|
|
2361
3090
|
getLabel?: (row: T) => string;
|
|
@@ -2372,14 +3101,23 @@ interface AgridTreeProviderConfig<T extends object> {
|
|
|
2372
3101
|
}
|
|
2373
3102
|
/** Provider-style configuration and datasource container for `<agrid-tree>`. */
|
|
2374
3103
|
declare class AgridTreeProvider<T extends object = any> {
|
|
3104
|
+
/** Rows projected into the standalone tree. */
|
|
2375
3105
|
readonly datasource: AgridDataSource<T>;
|
|
3106
|
+
/** Shared hierarchy configuration; column-specific aggregation is not used here. */
|
|
2376
3107
|
readonly treeConfig: AgridTreeConfig<T>;
|
|
3108
|
+
/** Optional host label resolver for parent-linked datasource rows. */
|
|
2377
3109
|
readonly getLabel?: (row: T) => string;
|
|
3110
|
+
/** Optional host resolver for secondary node text. */
|
|
2378
3111
|
readonly getDescription?: (row: T) => string | undefined;
|
|
3112
|
+
/** Effective node selection behavior. */
|
|
2379
3113
|
readonly selection: AgridTreeSelectionMode;
|
|
3114
|
+
/** Effective fixed node height in pixels. */
|
|
2380
3115
|
readonly rowHeight: number;
|
|
3116
|
+
/** Effective accessible name applied to the tree root. */
|
|
2381
3117
|
readonly ariaLabel: string;
|
|
3118
|
+
/** Effective empty-state message. */
|
|
2382
3119
|
readonly emptyText: string;
|
|
3120
|
+
/** Normalize optional standalone-tree settings and retain the reactive datasource. */
|
|
2383
3121
|
constructor(config: AgridTreeProviderConfig<T>);
|
|
2384
3122
|
}
|
|
2385
3123
|
|
|
@@ -2387,6 +3125,7 @@ type StandaloneTreeItem<T extends object> = TreeRowItem<T> | PathTreeNodeItem;
|
|
|
2387
3125
|
/** Standalone accessible tree control backed by the same projection logic as `AgridComponent`. */
|
|
2388
3126
|
declare class AgridTreeComponent<T extends object = any> {
|
|
2389
3127
|
provider: _angular_core.InputSignal<AgridTreeProvider<T>>;
|
|
3128
|
+
localeText: _angular_core.InputSignal<AgridLocaleText>;
|
|
2390
3129
|
nodeClick: _angular_core.OutputEmitterRef<AgridTreeNodeEvent<T>>;
|
|
2391
3130
|
nodeDoubleClicked: _angular_core.OutputEmitterRef<AgridTreeNodeEvent<T>>;
|
|
2392
3131
|
selectionChange: _angular_core.OutputEmitterRef<AgridTreeSelectionEvent<T>>;
|
|
@@ -2426,9 +3165,281 @@ declare class AgridTreeComponent<T extends object = any> {
|
|
|
2426
3165
|
private focusNode;
|
|
2427
3166
|
private findParentIndex;
|
|
2428
3167
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgridTreeComponent<any>, never>;
|
|
2429
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgridTreeComponent<any>, "agrid-tree", never, { "provider": { "alias": "provider"; "required": true; "isSignal": true; }; }, { "nodeClick": "nodeClick"; "nodeDoubleClicked": "nodeDoubleClicked"; "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
3168
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgridTreeComponent<any>, "agrid-tree", never, { "provider": { "alias": "provider"; "required": true; "isSignal": true; }; "localeText": { "alias": "localeText"; "required": false; "isSignal": true; }; }, { "nodeClick": "nodeClick"; "nodeDoubleClicked": "nodeDoubleClicked"; "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
/**
|
|
3172
|
+
* Context handed to a custom cell editor component through dependency injection.
|
|
3173
|
+
*
|
|
3174
|
+
* A custom editor is any standalone component referenced by {@link ColDef.cellEditor}.
|
|
3175
|
+
* The grid instantiates it while a cell is in edit mode and provides this context via the
|
|
3176
|
+
* {@link AGRID_EDITOR_CONTEXT} token. The editor is purely an *input surface*: it reads the
|
|
3177
|
+
* current value and pushes drafts back through {@link setDraft}. The grid keeps full ownership
|
|
3178
|
+
* of validation, history (undo/redo), and the commit/cancel lifecycle — so Tab, Enter, and
|
|
3179
|
+
* Escape continue to work without the editor doing anything.
|
|
3180
|
+
*
|
|
3181
|
+
* @example
|
|
3182
|
+
* ```ts
|
|
3183
|
+
* @Component({
|
|
3184
|
+
* selector: 'rating-editor',
|
|
3185
|
+
* template: `
|
|
3186
|
+
* <select #s [value]="ctx.value()" (change)="ctx.setDraft(+s.value); ctx.commit()">
|
|
3187
|
+
* @for (n of [1,2,3,4,5]; track n) { <option [value]="n">{{ n }} ★</option> }
|
|
3188
|
+
* </select>`,
|
|
3189
|
+
* })
|
|
3190
|
+
* export class RatingEditor {
|
|
3191
|
+
* readonly ctx = inject(AGRID_EDITOR_CONTEXT);
|
|
3192
|
+
* }
|
|
3193
|
+
*
|
|
3194
|
+
* // ColDef: { field: 'rating', cellEditor: RatingEditor }
|
|
3195
|
+
* ```
|
|
3196
|
+
*/
|
|
3197
|
+
interface AgridEditorContext<TValue = unknown> {
|
|
3198
|
+
/** The cell's current value at the moment editing started. */
|
|
3199
|
+
readonly value: Signal<TValue>;
|
|
3200
|
+
/** The full row record the cell belongs to. */
|
|
3201
|
+
readonly row: Signal<Record<string, unknown>>;
|
|
3202
|
+
/** The column definition this cell is rendered from. */
|
|
3203
|
+
readonly column: Signal<ColDef>;
|
|
3204
|
+
/**
|
|
3205
|
+
* The printable character that triggered type-to-edit, or `''` when editing started another
|
|
3206
|
+
* way (double-click, Enter, F2). Useful for seeding a free-text editor.
|
|
3207
|
+
*/
|
|
3208
|
+
readonly seedChar: Signal<string>;
|
|
3209
|
+
/** Stage a new value. The grid commits whatever was last staged on Tab/Enter. */
|
|
3210
|
+
setDraft(value: unknown): void;
|
|
3211
|
+
/** Programmatically commit the staged value (same as the user pressing Enter). */
|
|
3212
|
+
commit(): void;
|
|
3213
|
+
/** Programmatically discard the edit (same as the user pressing Escape). */
|
|
3214
|
+
cancel(): void;
|
|
3215
|
+
}
|
|
3216
|
+
/** DI token a custom {@link ColDef.cellEditor} component injects to talk to the grid. */
|
|
3217
|
+
declare const AGRID_EDITOR_CONTEXT: InjectionToken<AgridEditorContext<unknown>>;
|
|
3218
|
+
|
|
3219
|
+
/**
|
|
3220
|
+
* Context handed to a custom cell renderer component through dependency injection.
|
|
3221
|
+
*
|
|
3222
|
+
* A custom renderer is any standalone component referenced by {@link ColDef.cellRendererComponent}.
|
|
3223
|
+
* The grid instantiates it for the cell's *display* (read) state and provides this context via the
|
|
3224
|
+
* {@link AGRID_RENDERER_CONTEXT} token. Unlike the HTML-string {@link ColDef.cellRenderer}, a
|
|
3225
|
+
* component renderer supports full Angular bindings, event handlers, and child components — and
|
|
3226
|
+
* needs no manual escaping or sanitization.
|
|
3227
|
+
*
|
|
3228
|
+
* @example
|
|
3229
|
+
* ```ts
|
|
3230
|
+
* @Component({
|
|
3231
|
+
* selector: 'status-badge',
|
|
3232
|
+
* template: `<span class="badge" [class]="'badge--' + value()">{{ value() }}</span>`,
|
|
3233
|
+
* })
|
|
3234
|
+
* export class StatusBadge {
|
|
3235
|
+
* private readonly ctx = inject(AGRID_RENDERER_CONTEXT);
|
|
3236
|
+
* readonly value = computed(() => String(this.ctx.value() ?? ''));
|
|
3237
|
+
* }
|
|
3238
|
+
*
|
|
3239
|
+
* // ColDef: { field: 'status', cellRendererComponent: StatusBadge }
|
|
3240
|
+
* ```
|
|
3241
|
+
*/
|
|
3242
|
+
interface AgridRendererContext<TValue = unknown> {
|
|
3243
|
+
/** The cell's current value. */
|
|
3244
|
+
readonly value: Signal<TValue>;
|
|
3245
|
+
/** The full row record the cell belongs to. */
|
|
3246
|
+
readonly row: Signal<Record<string, unknown>>;
|
|
3247
|
+
/** The column definition this cell is rendered from. */
|
|
3248
|
+
readonly column: Signal<ColDef>;
|
|
3249
|
+
}
|
|
3250
|
+
/** DI token a custom {@link ColDef.cellRendererComponent} component injects to read cell data. */
|
|
3251
|
+
declare const AGRID_RENDERER_CONTEXT: InjectionToken<AgridRendererContext<unknown>>;
|
|
3252
|
+
|
|
3253
|
+
/**
|
|
3254
|
+
* Zero-dependency chart geometry. Pure math that turns a typed dataset + a diagram type into flat
|
|
3255
|
+
* SVG primitives (bars, line/area paths, pie slices, gridlines, labels), so the chart component
|
|
3256
|
+
* only has to emit elements. No charting library — same hand-rolled approach as the xlsx writer
|
|
3257
|
+
* and the sparkline helper.
|
|
3258
|
+
*/
|
|
3259
|
+
/** Supported diagram types. */
|
|
3260
|
+
type AgridChartType = 'column' | 'bar' | 'line' | 'area' | 'pie' | 'donut';
|
|
3261
|
+
/** One data series (a row of values aligned to {@link AgridChartData.categories}). */
|
|
3262
|
+
interface AgridChartSeries {
|
|
3263
|
+
/** Series name shown in the legend. */
|
|
3264
|
+
name?: string;
|
|
3265
|
+
/** Explicit colour; falls back to the palette by index. */
|
|
3266
|
+
color?: string;
|
|
3267
|
+
values: number[];
|
|
3268
|
+
}
|
|
3269
|
+
/** The dataset fed to a chart: one or more series sharing a category axis. */
|
|
3270
|
+
interface AgridChartData {
|
|
3271
|
+
/** Category labels (x-axis ticks, or pie/donut slice labels). */
|
|
3272
|
+
categories?: string[];
|
|
3273
|
+
series: AgridChartSeries[];
|
|
3274
|
+
}
|
|
3275
|
+
/** Box dimensions and styling knobs the dataset is laid out into. */
|
|
3276
|
+
interface AgridChartOptions {
|
|
3277
|
+
width: number;
|
|
3278
|
+
height: number;
|
|
3279
|
+
palette?: string[];
|
|
3280
|
+
/** Whether value/category axes and gridlines are produced (cartesian types only). */
|
|
3281
|
+
showAxis?: boolean;
|
|
3282
|
+
}
|
|
3283
|
+
interface ChartBar {
|
|
3284
|
+
x: number;
|
|
3285
|
+
y: number;
|
|
3286
|
+
width: number;
|
|
3287
|
+
height: number;
|
|
3288
|
+
color: string;
|
|
3289
|
+
value: number;
|
|
3290
|
+
seriesIndex: number;
|
|
3291
|
+
categoryIndex: number;
|
|
3292
|
+
}
|
|
3293
|
+
interface ChartPath {
|
|
3294
|
+
d: string;
|
|
3295
|
+
color: string;
|
|
3296
|
+
name: string;
|
|
3297
|
+
}
|
|
3298
|
+
interface ChartPoint {
|
|
3299
|
+
x: number;
|
|
3300
|
+
y: number;
|
|
3301
|
+
color: string;
|
|
3302
|
+
}
|
|
3303
|
+
interface ChartSlice {
|
|
3304
|
+
d: string;
|
|
3305
|
+
color: string;
|
|
3306
|
+
value: number;
|
|
3307
|
+
label: string;
|
|
3308
|
+
percentText: string;
|
|
3309
|
+
labelX: number;
|
|
3310
|
+
labelY: number;
|
|
3311
|
+
full: boolean;
|
|
3312
|
+
}
|
|
3313
|
+
interface ChartGridline {
|
|
3314
|
+
x1: number;
|
|
3315
|
+
y1: number;
|
|
3316
|
+
x2: number;
|
|
3317
|
+
y2: number;
|
|
3318
|
+
}
|
|
3319
|
+
interface ChartLabel {
|
|
3320
|
+
x: number;
|
|
3321
|
+
y: number;
|
|
3322
|
+
text: string;
|
|
3323
|
+
anchor: 'start' | 'middle' | 'end';
|
|
3324
|
+
baseline: 'auto' | 'middle' | 'hanging';
|
|
3325
|
+
}
|
|
3326
|
+
interface ChartLegendItem {
|
|
3327
|
+
name: string;
|
|
3328
|
+
color: string;
|
|
3329
|
+
}
|
|
3330
|
+
/** Flat, drawable primitives for a chart. */
|
|
3331
|
+
interface AgridChartLayout {
|
|
3332
|
+
type: AgridChartType;
|
|
3333
|
+
width: number;
|
|
3334
|
+
height: number;
|
|
3335
|
+
bars: ChartBar[];
|
|
3336
|
+
areas: ChartPath[];
|
|
3337
|
+
lines: ChartPath[];
|
|
3338
|
+
points: ChartPoint[];
|
|
3339
|
+
slices: ChartSlice[];
|
|
3340
|
+
gridlines: ChartGridline[];
|
|
3341
|
+
axisLabels: ChartLabel[];
|
|
3342
|
+
legend: ChartLegendItem[];
|
|
3343
|
+
}
|
|
3344
|
+
/** Default qualitative palette (colour-blind-friendly-ish, distinct hues). */
|
|
3345
|
+
declare const AGRID_CHART_PALETTE: string[];
|
|
3346
|
+
/** Builds drawable geometry for a chart. Empty/invalid input yields an empty layout. */
|
|
3347
|
+
declare function buildChart(type: AgridChartType, data: AgridChartData, options: AgridChartOptions): AgridChartLayout;
|
|
3348
|
+
|
|
3349
|
+
/**
|
|
3350
|
+
* Construction options for an {@link AgridChartProvider}.
|
|
3351
|
+
*
|
|
3352
|
+
* Provide a static {@link data} set, or link a live {@link source} (e.g. a grid provider's
|
|
3353
|
+
* `visibleRows`) together with a {@link transform} so the chart follows the grid's filtering and
|
|
3354
|
+
* sorting automatically.
|
|
3355
|
+
*/
|
|
3356
|
+
interface AgridChartProviderConfig<T = any> {
|
|
3357
|
+
/** Diagram type: column, bar, line, area, pie, or donut. */
|
|
3358
|
+
type: AgridChartType;
|
|
3359
|
+
/** Static dataset. Ignored when {@link source} + {@link transform} are provided. */
|
|
3360
|
+
data?: AgridChartData;
|
|
3361
|
+
/**
|
|
3362
|
+
* A reactive row source to derive the dataset from — typically a grid provider's `visibleRows`,
|
|
3363
|
+
* which reflects the grid's current filters and sorting. Requires {@link transform}.
|
|
3364
|
+
*/
|
|
3365
|
+
source?: Signal<readonly T[]>;
|
|
3366
|
+
/**
|
|
3367
|
+
* Turns the {@link source} rows (and the current chart type) into a chart dataset. Re-runs
|
|
3368
|
+
* whenever the source rows or the chart type change.
|
|
3369
|
+
*/
|
|
3370
|
+
transform?: (rows: readonly T[], type: AgridChartType) => AgridChartData;
|
|
3371
|
+
/** Chart height in pixels (width follows the host). @default 220 */
|
|
3372
|
+
height?: number;
|
|
3373
|
+
/** Show the series/category legend below the chart. @default true */
|
|
3374
|
+
showLegend?: boolean;
|
|
3375
|
+
/** Draw value/category axes for cartesian types. @default true */
|
|
3376
|
+
showAxis?: boolean;
|
|
3377
|
+
/** Override the colour palette. */
|
|
3378
|
+
palette?: string[];
|
|
3379
|
+
}
|
|
3380
|
+
/**
|
|
3381
|
+
* Bundles a chart's type, dataset, and display options behind one object, so a chart is configured
|
|
3382
|
+
* exactly like a grid: `<agrid-chart [provider]="chartProvider" />`.
|
|
3383
|
+
*
|
|
3384
|
+
* @example Static data
|
|
3385
|
+
* ```ts
|
|
3386
|
+
* new AgridChartProvider({ type: 'column', data: { categories: ['Q1','Q2'], series: [{ values: [10, 14] }] } });
|
|
3387
|
+
* ```
|
|
3388
|
+
*
|
|
3389
|
+
* @example Linked to a grid (follows filters/sorting)
|
|
3390
|
+
* ```ts
|
|
3391
|
+
* new AgridChartProvider({
|
|
3392
|
+
* type: 'column',
|
|
3393
|
+
* source: gridProvider.visibleRows,
|
|
3394
|
+
* transform: (rows, type) => ({ categories: rows.map(r => r.region), series: [{ values: rows.map(r => r.total) }] }),
|
|
3395
|
+
* });
|
|
3396
|
+
* ```
|
|
3397
|
+
*/
|
|
3398
|
+
declare class AgridChartProvider<T = any> {
|
|
3399
|
+
/** Diagram type. Writable — set it to switch chart type at runtime. */
|
|
3400
|
+
readonly type: WritableSignal<AgridChartType>;
|
|
3401
|
+
/** The dataset rendered by the chart (derived from the source when linked). */
|
|
3402
|
+
readonly data: Signal<AgridChartData>;
|
|
3403
|
+
/** Chart height in pixels. */
|
|
3404
|
+
readonly height: WritableSignal<number>;
|
|
3405
|
+
/** Whether the legend is shown. */
|
|
3406
|
+
readonly showLegend: WritableSignal<boolean>;
|
|
3407
|
+
/** Whether cartesian axes are drawn. */
|
|
3408
|
+
readonly showAxis: WritableSignal<boolean>;
|
|
3409
|
+
/** Colour palette override, or `undefined` for the default. */
|
|
3410
|
+
readonly palette: WritableSignal<string[] | undefined>;
|
|
3411
|
+
/** Writable backing store in static mode; `null` when the data is derived from a source. */
|
|
3412
|
+
private readonly _data;
|
|
3413
|
+
constructor(config: AgridChartProviderConfig<T>);
|
|
3414
|
+
/** Replace the dataset. Only valid in static mode (no linked {@link AgridChartProviderConfig.source}). */
|
|
3415
|
+
setData(data: AgridChartData): void;
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
/**
|
|
3419
|
+
* Zero-dependency chart component. Configured exactly like the grid — hand it an
|
|
3420
|
+
* {@link AgridChartProvider} and it renders an SVG column / bar / line / area / pie / donut chart
|
|
3421
|
+
* with no charting library. The chart sizes itself to the host width (observed) and the provider's
|
|
3422
|
+
* height.
|
|
3423
|
+
*
|
|
3424
|
+
* @example
|
|
3425
|
+
* ```html
|
|
3426
|
+
* <agrid-chart [provider]="chartProvider" />
|
|
3427
|
+
* ```
|
|
3428
|
+
*/
|
|
3429
|
+
declare class AgridChartComponent {
|
|
3430
|
+
/** All chart configuration — type, data, and display options. */
|
|
3431
|
+
readonly provider: _angular_core.InputSignal<AgridChartProvider<any>>;
|
|
3432
|
+
private readonly host;
|
|
3433
|
+
protected readonly width: _angular_core.WritableSignal<number>;
|
|
3434
|
+
protected readonly height: _angular_core.Signal<number>;
|
|
3435
|
+
protected readonly showLegend: _angular_core.Signal<boolean>;
|
|
3436
|
+
protected readonly sliceLabels: _angular_core.Signal<boolean>;
|
|
3437
|
+
protected readonly layout: _angular_core.Signal<_thkl_agrid.AgridChartLayout>;
|
|
3438
|
+
constructor();
|
|
3439
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgridChartComponent, never>;
|
|
3440
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgridChartComponent, "agrid-chart", never, { "provider": { "alias": "provider"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2430
3441
|
}
|
|
2431
3442
|
|
|
2432
|
-
export { AGRID_LOCALE_TEXT, AgridComponent, AgridControl, AgridDataSource, AgridPageSelectorComponent, AgridProvider, AgridTreeComponent, AgridTreeProvider, ColDefAutoSize };
|
|
2433
|
-
export type { AgridControlState, AgridEnterEditAction, AgridField, AgridLocaleKey, AgridLocaleText, AgridLocaleTextOverrides, AgridMenuBarContext, AgridMenuBarItem, AgridMenuBarMenuItem, AgridMenuBarState, AgridPageId, AgridPageItem, AgridParentTreeConfig, AgridPathSegmentParams, AgridPathTreeConfig, AgridProviderConfig, AgridTreeConfig, AgridTreeNodeEvent, AgridTreeProviderConfig, AgridTreeSelectionEvent, AgridTreeSelectionMode, CellContextMenuItem, CellInfoEvent, CellPosition, CellReadonlyParams, ColDef, ColumnFilter, DetailRowItem, FilterChangeEvent, FilterOperator, GridEditEvent, GroupAction, HeaderGroup, HistoryEntry, HistoryItem, InputMaskParams, NewRecord, PageChangeEvent, PathTreeNodeItem, RecordEditEvent, RowClickEvent, RowRemovedEvent, RowReorderEvent, RowSelectEvent, RowUpdateEvent, SortChangeEvent, TreeNodeClickEvent, TreeRowItem, ValidationFailedEvent, ValueOption };
|
|
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 };
|
|
2434
3445
|
//# sourceMappingURL=thkl-agrid.d.ts.map
|