@thkl/agrid 0.1.5 → 0.1.9
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 +268 -4
- package/fesm2022/thkl-agrid.mjs +2256 -181
- package/fesm2022/thkl-agrid.mjs.map +1 -1
- package/package.json +4 -4
- package/types/thkl-agrid.d.ts +730 -27
- package/types/thkl-agrid.d.ts.map +1 -1
package/types/thkl-agrid.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ declare class AgridBrowserAdapter {
|
|
|
22
22
|
setBodyInteraction(cursor: string, userSelect: string): void;
|
|
23
23
|
/** Returns the viewport width or infinity during server rendering. */
|
|
24
24
|
viewportWidth(): number;
|
|
25
|
+
/** Returns the viewport height or infinity during server rendering. */
|
|
26
|
+
viewportHeight(): number;
|
|
25
27
|
/** Returns computed styles when a window is available. */
|
|
26
28
|
computedStyle(element: Element): CSSStyleDeclaration | null;
|
|
27
29
|
/** Creates a 2D canvas context for text measurement. */
|
|
@@ -52,6 +54,11 @@ type HistoryItem = HistoryEntry | HistoryEntry[];
|
|
|
52
54
|
* All three fields are independent — text, value selection, and sort are ANDed together
|
|
53
55
|
* when computing the visible rows.
|
|
54
56
|
*/
|
|
57
|
+
/**
|
|
58
|
+
* Comparison operator for a column condition filter.
|
|
59
|
+
* For `date` columns `gt`/`lt`/`eq` read as after / before / on.
|
|
60
|
+
*/
|
|
61
|
+
type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'like' | 'startsWith' | 'endsWith' | 'includes' | 'notIncludes';
|
|
55
62
|
interface ColumnFilter {
|
|
56
63
|
/** Free-text substring filter (case-insensitive). Empty string = no text filter. */
|
|
57
64
|
text: string;
|
|
@@ -63,6 +70,15 @@ interface ColumnFilter {
|
|
|
63
70
|
selectedValues: string[] | null;
|
|
64
71
|
/** Sort direction, or `null` when this column is not sorted. */
|
|
65
72
|
sort: 'asc' | 'desc' | null;
|
|
73
|
+
/**
|
|
74
|
+
* Condition operator for text, number, or date columns, or `null`/omitted when none.
|
|
75
|
+
* Combined with text and value filters using AND semantics.
|
|
76
|
+
*/
|
|
77
|
+
operator?: FilterOperator | null;
|
|
78
|
+
/** Primary comparison operand (number as string, or `yyyy-mm-dd`). */
|
|
79
|
+
operand?: string | null;
|
|
80
|
+
/** Upper-bound operand used only when {@link operator} is `'between'`. */
|
|
81
|
+
operand2?: string | null;
|
|
66
82
|
}
|
|
67
83
|
/** Serializable snapshot of the grid's UI state. Used with `toJSON` / `fromJSON`. */
|
|
68
84
|
interface AgridControlState {
|
|
@@ -70,6 +86,8 @@ interface AgridControlState {
|
|
|
70
86
|
columnWidths: Record<string, number>;
|
|
71
87
|
/** Per-field filter and sort state. Fields with default state may be omitted. */
|
|
72
88
|
filters: Record<string, ColumnFilter>;
|
|
89
|
+
/** Global quick-filter text matched across all visible columns. Empty string when inactive. */
|
|
90
|
+
quickFilter?: string;
|
|
73
91
|
/** When `true`, rows can be reordered by dragging the control-column handle. */
|
|
74
92
|
allowRowReorder?: boolean;
|
|
75
93
|
/** Field to group rows by, or `null` / omitted for no grouping. */
|
|
@@ -117,6 +135,7 @@ interface AgridControlState {
|
|
|
117
135
|
declare class AgridControl {
|
|
118
136
|
private readonly _columnWidths;
|
|
119
137
|
private readonly _filters;
|
|
138
|
+
private readonly _quickFilter;
|
|
120
139
|
private readonly _allowRowReorder;
|
|
121
140
|
private readonly _groupByField;
|
|
122
141
|
private readonly _hiddenColumns;
|
|
@@ -147,6 +166,14 @@ declare class AgridControl {
|
|
|
147
166
|
* Enable grouping by `field`, or pass `null` to turn grouping off.
|
|
148
167
|
*/
|
|
149
168
|
setGroupBy(field: string | null): void;
|
|
169
|
+
/**
|
|
170
|
+
* Global quick-filter text. When non-empty (and not in server-side filtering mode),
|
|
171
|
+
* the grid keeps only rows where at least one visible column's display value contains
|
|
172
|
+
* this text (case-insensitive).
|
|
173
|
+
*/
|
|
174
|
+
readonly quickFilter: Signal<string>;
|
|
175
|
+
/** Set the global quick-filter text. Pass an empty string to clear it. */
|
|
176
|
+
setQuickFilter(text: string): void;
|
|
150
177
|
/**
|
|
151
178
|
* Reactive set of field names that are currently hidden.
|
|
152
179
|
* An empty set means all columns are visible.
|
|
@@ -290,6 +317,13 @@ declare class AgridControl {
|
|
|
290
317
|
* Pass `null` to show all values (clear the value filter).
|
|
291
318
|
*/
|
|
292
319
|
setSelectedValues(field: string, values: string[] | null): void;
|
|
320
|
+
/**
|
|
321
|
+
* Set a column condition filter. Text columns support string operators while number/date
|
|
322
|
+
* columns support comparison operators.
|
|
323
|
+
* Pass `operator: null` (or an empty `operand`) to clear it. `operand2` is only used
|
|
324
|
+
* by the `'between'` operator.
|
|
325
|
+
*/
|
|
326
|
+
setRangeFilter(field: string, operator: FilterOperator | null, operand: string | null, operand2?: string | null): void;
|
|
293
327
|
/** Ordered list of sorted field names, from highest to lowest priority. */
|
|
294
328
|
readonly sortOrder: Signal<string[]>;
|
|
295
329
|
/** Return the 1-based sort priority of a field, or `0` if it is not sorted. */
|
|
@@ -310,14 +344,14 @@ declare class AgridControl {
|
|
|
310
344
|
* Remove all active filters and sort for a single column.
|
|
311
345
|
*/
|
|
312
346
|
clearFilter(field: string): void;
|
|
313
|
-
/** Remove all active filters and sorts for every column. */
|
|
347
|
+
/** Remove all active filters and sorts for every column, including the quick filter. */
|
|
314
348
|
clearAllFilters(): void;
|
|
315
349
|
/**
|
|
316
350
|
* Return `true` when the given field has any active filter or sort.
|
|
317
351
|
* Useful for showing a visual indicator on the column header.
|
|
318
352
|
*/
|
|
319
353
|
hasActiveFilter(field: string): boolean;
|
|
320
|
-
/** Return `true` when ANY column has an active filter or sort. */
|
|
354
|
+
/** Return `true` when the quick filter or ANY column has an active filter or sort. */
|
|
321
355
|
hasAnyActiveFilter(): boolean;
|
|
322
356
|
/** Serialize current state to a plain object suitable for JSON storage. */
|
|
323
357
|
toJSON(): AgridControlState;
|
|
@@ -436,7 +470,27 @@ interface AgridLocaleText {
|
|
|
436
470
|
columnMenu: string;
|
|
437
471
|
columns: string;
|
|
438
472
|
detail: string;
|
|
473
|
+
toggleDetail: string;
|
|
439
474
|
hiddenColumn: string;
|
|
475
|
+
filterCondition: string;
|
|
476
|
+
filterConditionMenu: string;
|
|
477
|
+
filterValue: string;
|
|
478
|
+
filterNoCondition: string;
|
|
479
|
+
filterOpEquals: string;
|
|
480
|
+
filterOpNotEquals: string;
|
|
481
|
+
filterOpGreater: string;
|
|
482
|
+
filterOpGreaterEqual: string;
|
|
483
|
+
filterOpLess: string;
|
|
484
|
+
filterOpLessEqual: string;
|
|
485
|
+
filterOpBetween: string;
|
|
486
|
+
filterOpBefore: string;
|
|
487
|
+
filterOpAfter: string;
|
|
488
|
+
filterOpOn: string;
|
|
489
|
+
filterOpLike: string;
|
|
490
|
+
filterOpStartsWith: string;
|
|
491
|
+
filterOpEndsWith: string;
|
|
492
|
+
filterOpIncludes: string;
|
|
493
|
+
filterOpNotIncludes: string;
|
|
440
494
|
copyCellValue: string;
|
|
441
495
|
copyRow: string;
|
|
442
496
|
confirmDeleteRow: string;
|
|
@@ -460,9 +514,13 @@ interface AgridLocaleText {
|
|
|
460
514
|
pinColumn: string;
|
|
461
515
|
pinColumnRight: string;
|
|
462
516
|
unpinColumnRight: string;
|
|
517
|
+
pinRowTop: string;
|
|
518
|
+
pinRowBottom: string;
|
|
519
|
+
unpinRow: string;
|
|
463
520
|
previous: string;
|
|
464
521
|
resizeColumn: string;
|
|
465
522
|
rows: (count: number) => string;
|
|
523
|
+
quickFilterPlaceholder: string;
|
|
466
524
|
searchValuesPlaceholder: string;
|
|
467
525
|
selectAll: string;
|
|
468
526
|
sortOnlyByThis: string;
|
|
@@ -518,6 +576,17 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
518
576
|
serverSideFiltering?: boolean;
|
|
519
577
|
/** Delay before emitting server-side text filter changes. Set to `0` to disable. @default 300 */
|
|
520
578
|
filterDebounceMs?: number;
|
|
579
|
+
/**
|
|
580
|
+
* Show the global quick-filter box above the grid. In client mode it filters rows whose
|
|
581
|
+
* visible columns contain the text; in `serverSideFiltering` mode it emits `(quickFilterChange)`
|
|
582
|
+
* instead of filtering locally. @default false
|
|
583
|
+
*/
|
|
584
|
+
enableQuickFilter?: boolean;
|
|
585
|
+
/**
|
|
586
|
+
* Optional command bar rendered above the column headers. Buttons and dropdown items emit
|
|
587
|
+
* their id through the grid's single `(menuBarAction)` output.
|
|
588
|
+
*/
|
|
589
|
+
menuBarItems?: AgridMenuBarItem<T>[];
|
|
521
590
|
/**
|
|
522
591
|
* Sorting behavior: one active column, multiple columns, or disabled entirely.
|
|
523
592
|
* @default 'multi'
|
|
@@ -530,6 +599,14 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
530
599
|
* - `'multi'` — Ctrl+click toggles, Shift+click extends range, click+drag sweeps
|
|
531
600
|
*/
|
|
532
601
|
rowSelection?: 'single' | 'multi' | 'none';
|
|
602
|
+
/**
|
|
603
|
+
* Behavior after pressing Enter while an inline cell editor is active.
|
|
604
|
+
* - `'nothing'` — commit and keep the current cell selected
|
|
605
|
+
* - `'nextColumn'` — commit and move to the next column in the same row
|
|
606
|
+
* - `'nextRow'` — commit and move to the same column one row down
|
|
607
|
+
* @default 'nextRow'
|
|
608
|
+
*/
|
|
609
|
+
enterEditAction?: AgridEnterEditAction;
|
|
533
610
|
/** Returns a short description string shown next to the group label. */
|
|
534
611
|
groupDescription?: ((label: string) => string) | null;
|
|
535
612
|
/** Actions shown in the group header's `⋮` menu. */
|
|
@@ -553,6 +630,52 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
553
630
|
loading?: boolean;
|
|
554
631
|
/** Message shown when the grid has no rows to display. */
|
|
555
632
|
emptyText?: string;
|
|
633
|
+
/**
|
|
634
|
+
* Return one or more CSS class names applied to a whole data row, based on its data and index.
|
|
635
|
+
* Complements the per-cell {@link ColDef.cellClass}.
|
|
636
|
+
*
|
|
637
|
+
* @example
|
|
638
|
+
* ```ts
|
|
639
|
+
* getRowClass: ({ row }) => row.status === 'overdue' ? 'row-danger' : ''
|
|
640
|
+
* ```
|
|
641
|
+
*/
|
|
642
|
+
getRowClass?: (params: {
|
|
643
|
+
row: T;
|
|
644
|
+
index: number;
|
|
645
|
+
}) => string;
|
|
646
|
+
/**
|
|
647
|
+
* Designate rows to pin to the top or bottom of the grid body. Pinned rows stay visible during
|
|
648
|
+
* vertical scroll and are excluded from grouping and pagination, but remain fully interactive
|
|
649
|
+
* (editable/selectable) because they keep their real data-source index.
|
|
650
|
+
*
|
|
651
|
+
* Return `'top'`, `'bottom'`, or `undefined` (a normal scrolling row).
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```ts
|
|
655
|
+
* pinRow: row => row.isSummary ? 'bottom' : undefined
|
|
656
|
+
* ```
|
|
657
|
+
*/
|
|
658
|
+
pinRow?: (row: T, index: number) => 'top' | 'bottom' | undefined;
|
|
659
|
+
/**
|
|
660
|
+
* Enable master/detail rows: each flat data row, or each leaf row in tree mode, can expand to
|
|
661
|
+
* reveal a detail panel rendered beneath it. Requires {@link detailRenderer}. Grouped mode is
|
|
662
|
+
* not supported. @default false
|
|
663
|
+
*/
|
|
664
|
+
masterDetail?: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* Returns the HTML shown inside an expanded detail panel. Angular's built-in HTML sanitization
|
|
667
|
+
* is applied automatically (same as {@link ColDef.cellRenderer}).
|
|
668
|
+
*
|
|
669
|
+
* @example
|
|
670
|
+
* ```ts
|
|
671
|
+
* detailRenderer: ({ row }) => `<div class="detail">${row.notes}</div>`
|
|
672
|
+
* ```
|
|
673
|
+
*/
|
|
674
|
+
detailRenderer?: (params: {
|
|
675
|
+
row: T;
|
|
676
|
+
}) => string;
|
|
677
|
+
/** Fixed height in pixels of an expanded detail panel row. @default 200 */
|
|
678
|
+
detailRowHeight?: number;
|
|
556
679
|
}
|
|
557
680
|
/**
|
|
558
681
|
* Bundles a grid's data source, control state, columns, and display options.
|
|
@@ -605,12 +728,18 @@ declare class AgridProvider<T extends object = any> {
|
|
|
605
728
|
serverSideFiltering: boolean;
|
|
606
729
|
/** Delay before server-side filter events are emitted. */
|
|
607
730
|
filterDebounceMs: number;
|
|
731
|
+
/** Whether the global quick-filter box is shown above the grid. */
|
|
732
|
+
enableQuickFilter: boolean;
|
|
733
|
+
/** Commands rendered in the optional menu bar above the column headers. */
|
|
734
|
+
menuBarItems: AgridMenuBarItem<T>[];
|
|
608
735
|
/** Enabled sorting mode. */
|
|
609
736
|
sortOption: 'single' | 'multi' | 'none';
|
|
610
737
|
/** Toggle auto-add-rows without recreating the provider. @default signal(false) */
|
|
611
738
|
readonly autoAddRows: WritableSignal<boolean>;
|
|
612
739
|
/** Enabled row-selection mode. */
|
|
613
740
|
rowSelection: 'single' | 'multi' | 'none';
|
|
741
|
+
/** Behavior after pressing Enter while an inline cell editor is active. */
|
|
742
|
+
enterEditAction: AgridEnterEditAction;
|
|
614
743
|
/** Optional description shown beside each group heading. */
|
|
615
744
|
groupDescription: ((label: string) => string) | null;
|
|
616
745
|
/** Actions available from group headers. */
|
|
@@ -627,6 +756,21 @@ declare class AgridProvider<T extends object = any> {
|
|
|
627
756
|
emptyText?: string;
|
|
628
757
|
/** Whether edits are restricted to the sidebar editor. */
|
|
629
758
|
useSidebarEditor: boolean;
|
|
759
|
+
/** Optional callback returning CSS classes for a whole data row. */
|
|
760
|
+
getRowClass?: (params: {
|
|
761
|
+
row: T;
|
|
762
|
+
index: number;
|
|
763
|
+
}) => string;
|
|
764
|
+
/** Optional callback designating rows pinned to the top or bottom of the body. */
|
|
765
|
+
pinRow?: (row: T, index: number) => 'top' | 'bottom' | undefined;
|
|
766
|
+
/** Whether master/detail expandable detail rows are enabled. */
|
|
767
|
+
masterDetail: boolean;
|
|
768
|
+
/** Returns the sanitized HTML rendered inside an expanded detail panel. */
|
|
769
|
+
detailRenderer?: (params: {
|
|
770
|
+
row: T;
|
|
771
|
+
}) => string;
|
|
772
|
+
/** Fixed height in pixels of an expanded detail panel row. */
|
|
773
|
+
detailRowHeight: number;
|
|
630
774
|
/** Toggle the loading overlay without recreating the provider. @default signal(false) */
|
|
631
775
|
readonly loading: WritableSignal<boolean>;
|
|
632
776
|
/** Toggle readonly mode without recreating the provider. @default signal(false) */
|
|
@@ -639,6 +783,19 @@ declare class AgridProvider<T extends object = any> {
|
|
|
639
783
|
|
|
640
784
|
/** String-valued property names available on a row type. */
|
|
641
785
|
type AgridField<T extends object> = Extract<keyof T, string>;
|
|
786
|
+
/** Behavior after pressing Enter while an inline cell editor is active. */
|
|
787
|
+
type AgridEnterEditAction = 'nothing' | 'nextColumn' | 'nextRow';
|
|
788
|
+
/** Parameters passed to a row-aware cell readonly resolver. */
|
|
789
|
+
interface CellReadonlyParams<T extends object = any, K extends AgridField<T> = AgridField<T>> {
|
|
790
|
+
/** Datasource row containing the cell. */
|
|
791
|
+
row: T;
|
|
792
|
+
/** Current raw field value. */
|
|
793
|
+
value: T[K];
|
|
794
|
+
/** Column definition for the cell. */
|
|
795
|
+
column: ColDef<T, K>;
|
|
796
|
+
/** Zero-based index of the row in the datasource. */
|
|
797
|
+
originalIndex: number;
|
|
798
|
+
}
|
|
642
799
|
/** Global options shared by grid providers. */
|
|
643
800
|
interface AGridOptions {
|
|
644
801
|
/**
|
|
@@ -666,6 +823,44 @@ interface CellContextMenuItem<T extends object = any> {
|
|
|
666
823
|
/** Renders the item in red (destructive action). */
|
|
667
824
|
danger?: boolean;
|
|
668
825
|
}
|
|
826
|
+
/** Current grid state supplied to menu-bar visibility, active, and disabled resolvers. */
|
|
827
|
+
interface AgridMenuBarContext<T extends object = any> {
|
|
828
|
+
/** Current datasource rows. */
|
|
829
|
+
rows: readonly T[];
|
|
830
|
+
/** Currently selected rows with their original datasource indices. */
|
|
831
|
+
selectedRows: readonly {
|
|
832
|
+
row: T;
|
|
833
|
+
originalIndex: number;
|
|
834
|
+
}[];
|
|
835
|
+
/** Currently selected cell, or `null`. */
|
|
836
|
+
selectedCell: CellPosition | null;
|
|
837
|
+
/** Provider that owns the menu bar. */
|
|
838
|
+
provider: AgridProvider<T>;
|
|
839
|
+
/** Datasource that owns the current rows. */
|
|
840
|
+
datasource: AgridDataSource<T>;
|
|
841
|
+
}
|
|
842
|
+
/** Static or runtime-resolved menu-bar state. */
|
|
843
|
+
type AgridMenuBarState<T extends object = any> = boolean | ((context: AgridMenuBarContext<T>) => boolean);
|
|
844
|
+
/** Shared configuration for menu-bar buttons and dropdown items. */
|
|
845
|
+
interface AgridMenuBarMenuItem<T extends object = any> {
|
|
846
|
+
/** Stable command id emitted through `(menuBarAction)`. */
|
|
847
|
+
id: string;
|
|
848
|
+
/** Visible command label. */
|
|
849
|
+
label: string;
|
|
850
|
+
/** Optional compact icon or glyph shown before the label. */
|
|
851
|
+
icon?: string;
|
|
852
|
+
/** Whether the command is rendered. Defaults to `true`. */
|
|
853
|
+
visible?: AgridMenuBarState<T>;
|
|
854
|
+
/** Whether the command receives active styling. Defaults to `false`. */
|
|
855
|
+
active?: AgridMenuBarState<T>;
|
|
856
|
+
/** Whether the command is disabled. Defaults to `false`. */
|
|
857
|
+
disabled?: AgridMenuBarState<T>;
|
|
858
|
+
}
|
|
859
|
+
/** Top-level menu-bar button with optional additional dropdown commands. */
|
|
860
|
+
interface AgridMenuBarItem<T extends object = any> extends AgridMenuBarMenuItem<T> {
|
|
861
|
+
/** Additional commands opened from the button's dropdown chevron. */
|
|
862
|
+
items?: AgridMenuBarMenuItem<T>[];
|
|
863
|
+
}
|
|
669
864
|
/**
|
|
670
865
|
* A structured value option used when the data field stores a raw value (e.g. a numeric ID)
|
|
671
866
|
* but the cell should display a human-readable label.
|
|
@@ -708,15 +903,29 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
708
903
|
width?: number;
|
|
709
904
|
/**
|
|
710
905
|
* Semantic type of the field.
|
|
711
|
-
* - `'number'` — blank rows initialize this field to `0` instead of `''
|
|
712
|
-
*
|
|
906
|
+
* - `'number'` — blank rows initialize this field to `0` instead of `''`; enables numeric
|
|
907
|
+
* range filters (`>`, `<`, `between`, …) in the column menu.
|
|
908
|
+
* - `'date'` — uses a native date editor and built-in localized display formatting; enables
|
|
909
|
+
* date range filters (before / after / between) in the column menu.
|
|
910
|
+
* - `'boolean'` — renders an inline checkbox that toggles the value on click (no edit mode).
|
|
713
911
|
*/
|
|
714
|
-
type?: 'text' | 'number' | 'date';
|
|
912
|
+
type?: 'text' | 'number' | 'date' | 'boolean';
|
|
715
913
|
/**
|
|
716
914
|
* Set to `false` to make the column read-only.
|
|
717
915
|
* Defaults to `true` (editable) when omitted.
|
|
718
916
|
*/
|
|
719
917
|
editable?: boolean;
|
|
918
|
+
/**
|
|
919
|
+
* Return `true` to make this specific cell read-only at runtime.
|
|
920
|
+
* Runs with the current row, value, column definition, and original datasource index.
|
|
921
|
+
* `editable: false` still makes the whole column read-only before this callback is checked.
|
|
922
|
+
*
|
|
923
|
+
* @example
|
|
924
|
+
* ```ts
|
|
925
|
+
* { field: 'approval', cellReadonly: ({ row }) => row.status !== 'Draft' }
|
|
926
|
+
* ```
|
|
927
|
+
*/
|
|
928
|
+
cellReadonly?: (params: CellReadonlyParams<T, K>) => boolean;
|
|
720
929
|
/**
|
|
721
930
|
* Fixed list of allowed values shown in a `<select>` dropdown when editing.
|
|
722
931
|
*
|
|
@@ -735,6 +944,25 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
735
944
|
* ```
|
|
736
945
|
*/
|
|
737
946
|
formatter?: (value: T[K]) => string;
|
|
947
|
+
/**
|
|
948
|
+
* Resolve an input mask for this specific string cell. The callback receives the current
|
|
949
|
+
* row, cell value, and column definition, so different rows in one column can use different
|
|
950
|
+
* regular expressions. Return `null` or `undefined` to leave the cell unrestricted.
|
|
951
|
+
*
|
|
952
|
+
* The expression is matched against the complete proposed editor value. It should accept
|
|
953
|
+
* partial values so the user can build the final value one character at a time.
|
|
954
|
+
*
|
|
955
|
+
* @example
|
|
956
|
+
* ```ts
|
|
957
|
+
* {
|
|
958
|
+
* field: 'reference',
|
|
959
|
+
* inputMask: ({ row }) => row.numeric
|
|
960
|
+
* ? /\d{0,3}(?:-\d{0,5}(?:-\d{0,5})?)?/
|
|
961
|
+
* : /[a-z0-9]{0,3}(?: [a-z0-9]{0,3}(?: [a-z0-9]{0,5})?)?/i,
|
|
962
|
+
* }
|
|
963
|
+
* ```
|
|
964
|
+
*/
|
|
965
|
+
inputMask?: (params: InputMaskParams<T, K>) => RegExp | null | undefined;
|
|
738
966
|
/**
|
|
739
967
|
* Set to `true` to show a filter input and value-picker in the filter row for this column.
|
|
740
968
|
* At least one filterable column must exist for the filter row to appear.
|
|
@@ -787,6 +1015,17 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
787
1015
|
* The column can still be hidden, filtered, and sorted.
|
|
788
1016
|
*/
|
|
789
1017
|
locked?: boolean;
|
|
1018
|
+
/**
|
|
1019
|
+
* Validate a committed value before it is written to the row. Return an error message to
|
|
1020
|
+
* reject the edit (the value is not written and the message is shown), or `null`/`undefined`
|
|
1021
|
+
* to accept it. Runs on inline commit, boolean-checkbox toggle, and sidebar save.
|
|
1022
|
+
*
|
|
1023
|
+
* @example
|
|
1024
|
+
* ```ts
|
|
1025
|
+
* { field: 'email', validate: v => /@/.test(String(v)) ? null : 'Invalid email' }
|
|
1026
|
+
* ```
|
|
1027
|
+
*/
|
|
1028
|
+
validate?: (value: T[K], row: T) => string | null | undefined;
|
|
790
1029
|
/**
|
|
791
1030
|
* Custom cell renderer. Returns an HTML string displayed instead of the plain text value.
|
|
792
1031
|
* Angular's built-in HTML sanitization is applied automatically.
|
|
@@ -801,12 +1040,26 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
801
1040
|
value: T[K];
|
|
802
1041
|
row: T;
|
|
803
1042
|
}) => string;
|
|
1043
|
+
/**
|
|
1044
|
+
* Show a right-aligned info button in this column's cells.
|
|
1045
|
+
* Pass a predicate to show it only for selected rows or values.
|
|
1046
|
+
*/
|
|
1047
|
+
infoIcon?: boolean | ((params: {
|
|
1048
|
+
value: T[K];
|
|
1049
|
+
row: T;
|
|
1050
|
+
}) => boolean);
|
|
804
1051
|
}
|
|
805
1052
|
/**
|
|
806
1053
|
* Defines a column whose `field`, formatter value, renderer value, and row are
|
|
807
1054
|
* derived from the supplied row type.
|
|
808
1055
|
*/
|
|
809
1056
|
type ColDef<T extends object = any, K extends AgridField<T> = AgridField<T>> = K extends AgridField<T> ? ColDefBase<T, K> : never;
|
|
1057
|
+
/** Parameters passed to a row-aware {@link ColDefBase.inputMask} resolver. */
|
|
1058
|
+
interface InputMaskParams<T extends object = any, K extends AgridField<T> = AgridField<T>> {
|
|
1059
|
+
row: T;
|
|
1060
|
+
value: T[K];
|
|
1061
|
+
column: ColDef<T, K>;
|
|
1062
|
+
}
|
|
810
1063
|
/**
|
|
811
1064
|
* Defines a single action shown in the group header's action menu.
|
|
812
1065
|
* Pass an array of these to `<agrid [groupActions]="...">`.
|
|
@@ -822,7 +1075,8 @@ interface GroupAction {
|
|
|
822
1075
|
* - `{ row, originalIndex }` — a real data row
|
|
823
1076
|
* - `null` — the add-row placeholder
|
|
824
1077
|
* - `'ghost'` — the drop-target ghost inserted while dragging
|
|
825
|
-
* - `{ groupLabel, count, collapsed }` — group header row when grouping is active
|
|
1078
|
+
* - `{ groupLabel, count, collapsed, aggregates? }` — group header row when grouping is active
|
|
1079
|
+
* (`aggregates` holds per-group subtotals when aggregated columns exist)
|
|
826
1080
|
* - `{ row, originalIndex, level, expandable, expanded }` — a tree row when tree mode is active
|
|
827
1081
|
*/
|
|
828
1082
|
type GridItem<T extends object = Record<string, unknown>> = {
|
|
@@ -832,7 +1086,36 @@ type GridItem<T extends object = Record<string, unknown>> = {
|
|
|
832
1086
|
groupLabel: string;
|
|
833
1087
|
count: number;
|
|
834
1088
|
collapsed: boolean;
|
|
835
|
-
|
|
1089
|
+
aggregates?: Record<string, unknown>;
|
|
1090
|
+
} | TreeRowItem<T> | PathTreeNodeItem | DetailRowItem<T>;
|
|
1091
|
+
/** A generated, display-only branch node produced by path-based tree data. */
|
|
1092
|
+
interface PathTreeNodeItem {
|
|
1093
|
+
/** Stable UUID for this generated branch node. */
|
|
1094
|
+
uuid: string;
|
|
1095
|
+
/** Stable expansion id derived from the complete path to this node. */
|
|
1096
|
+
pathNodeId: string;
|
|
1097
|
+
/** Segment label shown for this branch. */
|
|
1098
|
+
pathLabel: string;
|
|
1099
|
+
/** Zero-based depth in the generated tree. */
|
|
1100
|
+
level: number;
|
|
1101
|
+
/** Path branch nodes always have descendants. */
|
|
1102
|
+
expandable: true;
|
|
1103
|
+
/** Whether the branch's descendants are currently visible. */
|
|
1104
|
+
expanded: boolean;
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* A master/detail panel row rendered immediately beneath its expanded parent data row.
|
|
1108
|
+
*
|
|
1109
|
+
* Carries the parent's `originalIndex` (so the panel can be re-collapsed and tracked) and the
|
|
1110
|
+
* parent `row` (passed to `detailRenderer`). It is intentionally *not* a data-row item — selection,
|
|
1111
|
+
* editing, and cell rendering skip it.
|
|
1112
|
+
*/
|
|
1113
|
+
interface DetailRowItem<T extends object = Record<string, unknown>> {
|
|
1114
|
+
/** Original index of the parent data row this detail panel belongs to. */
|
|
1115
|
+
detailFor: number;
|
|
1116
|
+
/** The parent row's data, passed to `detailRenderer`. */
|
|
1117
|
+
row: T;
|
|
1118
|
+
}
|
|
836
1119
|
/**
|
|
837
1120
|
* A data row rendered inside a hierarchical tree.
|
|
838
1121
|
*
|
|
@@ -851,14 +1134,15 @@ interface TreeRowItem<T extends object = Record<string, unknown>> {
|
|
|
851
1134
|
expandable: boolean;
|
|
852
1135
|
/** `true` when this row is expandable and currently expanded (its children are visible). */
|
|
853
1136
|
expanded: boolean;
|
|
1137
|
+
/** Optional display-only label for the tree cell, used by path-based trees. */
|
|
1138
|
+
treeLabel?: string;
|
|
854
1139
|
}
|
|
855
1140
|
/**
|
|
856
1141
|
* Host-supplied configuration that turns the grid into a tree.
|
|
857
1142
|
*
|
|
858
|
-
* Hierarchy is expressed over the existing flat row array
|
|
859
|
-
*
|
|
860
|
-
*
|
|
861
|
-
* parent id is not present in the data — is treated as a root.
|
|
1143
|
+
* Hierarchy is expressed over the existing flat row array using either stable id/parent-id
|
|
1144
|
+
* accessors or a path accessor. Path mode creates display-only branch nodes while leaves retain
|
|
1145
|
+
* their original datasource indices, so selection, editing, and persistence remain row-based.
|
|
862
1146
|
*
|
|
863
1147
|
* @example
|
|
864
1148
|
* ```ts
|
|
@@ -867,13 +1151,15 @@ interface TreeRowItem<T extends object = Record<string, unknown>> {
|
|
|
867
1151
|
* getParentId: row => row.managerId,
|
|
868
1152
|
* treeField: 'name',
|
|
869
1153
|
* }
|
|
1154
|
+
*
|
|
1155
|
+
* // Or derive branches from a delimited field:
|
|
1156
|
+
* treeConfig: {
|
|
1157
|
+
* getPath: row => row.oz.split('.'),
|
|
1158
|
+
* treeField: 'oz',
|
|
1159
|
+
* }
|
|
870
1160
|
* ```
|
|
871
1161
|
*/
|
|
872
|
-
interface
|
|
873
|
-
/** Return a stable, unique id for a row. Used as the expansion key and for parent lookups. */
|
|
874
|
-
getId: (row: T) => string | number;
|
|
875
|
-
/** Return the id of a row's parent, or `null`/`undefined` for a root row. */
|
|
876
|
-
getParentId: (row: T) => string | number | null | undefined;
|
|
1162
|
+
interface AgridTreeConfigBase<T extends object> {
|
|
877
1163
|
/** Field whose cell shows the indentation and expand/collapse twisty. */
|
|
878
1164
|
treeField: AgridField<T>;
|
|
879
1165
|
/** Expand all nodes when the tree first renders. Defaults to `false` (all collapsed). */
|
|
@@ -884,6 +1170,66 @@ interface AgridTreeConfig<T extends object = any> {
|
|
|
884
1170
|
*/
|
|
885
1171
|
keepAncestorsOnFilter?: boolean;
|
|
886
1172
|
}
|
|
1173
|
+
/** Tree configuration for rows that already expose stable id and parent-id values. */
|
|
1174
|
+
interface AgridParentTreeConfig<T extends object = any> extends AgridTreeConfigBase<T> {
|
|
1175
|
+
/** Return a stable, unique id for a row. Used as the expansion key and for parent lookups. */
|
|
1176
|
+
getId: (row: T) => string | number;
|
|
1177
|
+
/** Return the id of a row's parent, or `null`/`undefined` for a root row. */
|
|
1178
|
+
getParentId: (row: T) => string | number | null | undefined;
|
|
1179
|
+
getPath?: never;
|
|
1180
|
+
}
|
|
1181
|
+
/** Values supplied when formatting one path-tree segment for display. */
|
|
1182
|
+
interface AgridPathSegmentParams<T extends object = any> {
|
|
1183
|
+
/** Datasource row that produced this path. Shared branches use the first matching row. */
|
|
1184
|
+
row: T;
|
|
1185
|
+
/** Raw segment returned by `getPath`. */
|
|
1186
|
+
segment: string | number;
|
|
1187
|
+
/** Zero-based position of the segment in the path. */
|
|
1188
|
+
level: number;
|
|
1189
|
+
/** Raw path prefix ending at this segment. */
|
|
1190
|
+
path: readonly (string | number)[];
|
|
1191
|
+
/** Whether this segment represents the datasource-backed leaf row. */
|
|
1192
|
+
leaf: boolean;
|
|
1193
|
+
}
|
|
1194
|
+
/** Tree configuration that derives display-only branch nodes from each row's path segments. */
|
|
1195
|
+
interface AgridPathTreeConfig<T extends object = any> extends AgridTreeConfigBase<T> {
|
|
1196
|
+
/** Return ordered path segments, for example `['01', '01', '0001']`. */
|
|
1197
|
+
getPath: (row: T) => readonly (string | number)[];
|
|
1198
|
+
/**
|
|
1199
|
+
* Return a stable UUID for generated branch nodes created from this row.
|
|
1200
|
+
* Shared branches use the first matching row, matching {@link formatPathSegment}.
|
|
1201
|
+
*/
|
|
1202
|
+
nodeUuid?: (row: T) => string | number;
|
|
1203
|
+
/**
|
|
1204
|
+
* Return a stable UUID for generated branch nodes created from this row.
|
|
1205
|
+
* @deprecated Use {@link nodeUuid}. Kept as a compatibility alias for the original typo.
|
|
1206
|
+
*/
|
|
1207
|
+
nodeUUid?: (row: T) => string | number;
|
|
1208
|
+
/** Format a segment for display without changing its identity, grouping, or sort order. */
|
|
1209
|
+
formatPathSegment?: (params: AgridPathSegmentParams<T>) => string;
|
|
1210
|
+
getId?: never;
|
|
1211
|
+
getParentId?: never;
|
|
1212
|
+
}
|
|
1213
|
+
/** Supported tree data modes: explicit parent links or generated path segments. */
|
|
1214
|
+
type AgridTreeConfig<T extends object = any> = AgridParentTreeConfig<T> | AgridPathTreeConfig<T>;
|
|
1215
|
+
/** Selection behavior for the standalone tree control. */
|
|
1216
|
+
type AgridTreeSelectionMode = 'none' | 'single' | 'multi';
|
|
1217
|
+
/** Normalized row or generated-branch event emitted by the standalone tree control. */
|
|
1218
|
+
interface AgridTreeNodeEvent<T extends object = any> {
|
|
1219
|
+
kind: 'row' | 'branch';
|
|
1220
|
+
id: string | number;
|
|
1221
|
+
uuid?: string;
|
|
1222
|
+
label: string;
|
|
1223
|
+
level: number;
|
|
1224
|
+
expandable: boolean;
|
|
1225
|
+
expanded: boolean;
|
|
1226
|
+
row?: T;
|
|
1227
|
+
originalIndex?: number;
|
|
1228
|
+
}
|
|
1229
|
+
/** Current standalone-tree selection after a user interaction. */
|
|
1230
|
+
interface AgridTreeSelectionEvent<T extends object = any> {
|
|
1231
|
+
nodes: AgridTreeNodeEvent<T>[];
|
|
1232
|
+
}
|
|
887
1233
|
/** Zero-based position of a cell inside the grid. */
|
|
888
1234
|
interface CellPosition {
|
|
889
1235
|
/** Zero-based row index in the data array. */
|
|
@@ -891,6 +1237,22 @@ interface CellPosition {
|
|
|
891
1237
|
/** Zero-based column index in {@link ColDef} order. */
|
|
892
1238
|
colIndex: number;
|
|
893
1239
|
}
|
|
1240
|
+
/**
|
|
1241
|
+
* Emitted by `(validationFailed)` when a {@link ColDefBase.validate} hook rejects a committed
|
|
1242
|
+
* value. The value is not written to the row.
|
|
1243
|
+
*/
|
|
1244
|
+
interface ValidationFailedEvent<T extends object = any> {
|
|
1245
|
+
/** Zero-based index of the row whose edit was rejected. */
|
|
1246
|
+
rowIndex: number;
|
|
1247
|
+
/** Field that failed validation. */
|
|
1248
|
+
field: AgridField<T>;
|
|
1249
|
+
/** The rejected value. */
|
|
1250
|
+
value: unknown;
|
|
1251
|
+
/** Message returned by the `validate` hook. */
|
|
1252
|
+
message: string;
|
|
1253
|
+
/** Which editing surface produced the rejected edit. */
|
|
1254
|
+
source: 'inline' | 'sidebar';
|
|
1255
|
+
}
|
|
894
1256
|
/** Emitted by `(cellEdit)` after the user commits a cell change. */
|
|
895
1257
|
type GridEditEvent<T extends object = any> = {
|
|
896
1258
|
[K in AgridField<T>]: {
|
|
@@ -904,6 +1266,21 @@ type GridEditEvent<T extends object = any> = {
|
|
|
904
1266
|
newValue: T[K];
|
|
905
1267
|
};
|
|
906
1268
|
}[AgridField<T>];
|
|
1269
|
+
/** Emitted when the optional info button inside a cell is clicked. */
|
|
1270
|
+
type CellInfoEvent<T extends object = any> = {
|
|
1271
|
+
[K in AgridField<T>]: {
|
|
1272
|
+
/** Datasource row containing the clicked cell. */
|
|
1273
|
+
row: T;
|
|
1274
|
+
/** Column field containing the clicked info button. */
|
|
1275
|
+
field: K;
|
|
1276
|
+
/** Current raw field value. */
|
|
1277
|
+
value: T[K];
|
|
1278
|
+
/** Zero-based index of the row in the datasource. */
|
|
1279
|
+
originalIndex: number;
|
|
1280
|
+
/** Column definition for the clicked cell. */
|
|
1281
|
+
column: ColDef<T, K>;
|
|
1282
|
+
};
|
|
1283
|
+
}[AgridField<T>];
|
|
907
1284
|
/**
|
|
908
1285
|
* Emitted asynchronously after an edit changes a row and the data source has been updated.
|
|
909
1286
|
*
|
|
@@ -943,6 +1320,21 @@ interface RowClickEvent<T extends object = any> {
|
|
|
943
1320
|
/** Zero-based index of the row in the data source. */
|
|
944
1321
|
originalIndex: number;
|
|
945
1322
|
}
|
|
1323
|
+
/** Emitted when the user clicks or double-clicks a generated path-tree branch node. */
|
|
1324
|
+
interface TreeNodeClickEvent {
|
|
1325
|
+
/** Stable UUID for the generated branch node. */
|
|
1326
|
+
uuid: string;
|
|
1327
|
+
/** Stable expansion id derived from the complete path to this node. */
|
|
1328
|
+
pathNodeId: string;
|
|
1329
|
+
/** Segment label shown for this branch. */
|
|
1330
|
+
pathLabel: string;
|
|
1331
|
+
/** Zero-based depth in the generated tree. */
|
|
1332
|
+
level: number;
|
|
1333
|
+
/** Whether the branch's descendants are currently visible. */
|
|
1334
|
+
expanded: boolean;
|
|
1335
|
+
/** Snapshot of the generated branch node. */
|
|
1336
|
+
node: PathTreeNodeItem;
|
|
1337
|
+
}
|
|
946
1338
|
/**
|
|
947
1339
|
* Emitted after an inline-edited row is left, or after the user saves through the sidebar editor.
|
|
948
1340
|
*/
|
|
@@ -984,12 +1376,22 @@ interface PageChangeEvent {
|
|
|
984
1376
|
/** Zero-based index of the last row on this page (inclusive). */
|
|
985
1377
|
endRow: number;
|
|
986
1378
|
}
|
|
987
|
-
/** Emitted when a text filter changes
|
|
1379
|
+
/** Emitted when a header text filter or column-menu condition changes server-side. */
|
|
988
1380
|
interface FilterChangeEvent {
|
|
989
1381
|
/** Field name of the filtered column. */
|
|
990
1382
|
field: string;
|
|
991
|
-
/** Current filter
|
|
1383
|
+
/** Current free-text filter value. An empty string clears the text filter. */
|
|
992
1384
|
value: string;
|
|
1385
|
+
/**
|
|
1386
|
+
* Text, number, or date condition operator from the column-menu UI.
|
|
1387
|
+
* `null` clears the condition.
|
|
1388
|
+
* When set, `value` is empty and the operands live in {@link operand} / {@link operand2}.
|
|
1389
|
+
*/
|
|
1390
|
+
operator?: FilterOperator | null;
|
|
1391
|
+
/** Primary condition operand. Present with {@link operator}. */
|
|
1392
|
+
operand?: string | null;
|
|
1393
|
+
/** Upper-bound operand, present only when {@link operator} is `'between'`. */
|
|
1394
|
+
operand2?: string | null;
|
|
993
1395
|
}
|
|
994
1396
|
/** Emitted when a sort changes in server-side filtering mode. */
|
|
995
1397
|
interface SortChangeEvent {
|
|
@@ -1048,10 +1450,9 @@ type CellRange = {
|
|
|
1048
1450
|
focus: CellPosition;
|
|
1049
1451
|
};
|
|
1050
1452
|
|
|
1051
|
-
/** Location of a formatted-value match in source
|
|
1453
|
+
/** Location of a formatted-value match in source coordinates. @internal */
|
|
1052
1454
|
type AgridFindMatch = {
|
|
1053
1455
|
rowIndex: number;
|
|
1054
|
-
displayIndex: number;
|
|
1055
1456
|
colIndex: number;
|
|
1056
1457
|
};
|
|
1057
1458
|
|
|
@@ -1207,10 +1608,12 @@ interface AgridSidebarDetailField {
|
|
|
1207
1608
|
* |-----|--------|
|
|
1208
1609
|
* | Arrow keys | Move selection |
|
|
1209
1610
|
* | Tab / Shift+Tab | Move right / left (wraps rows) |
|
|
1210
|
-
* | Enter
|
|
1611
|
+
* | Enter | Enter edit mode |
|
|
1612
|
+
* | Ctrl/Cmd+Enter | Toggle an expandable tree node |
|
|
1613
|
+
* | F2 | Enter edit mode |
|
|
1211
1614
|
* | Printable key | Enter edit mode with seeded character |
|
|
1212
|
-
* | Escape |
|
|
1213
|
-
* | Tab / Enter (while editing) | Commit and move
|
|
1615
|
+
* | Escape | Close any open menu or cancel edit |
|
|
1616
|
+
* | Tab / Enter (while editing) | Commit and move according to navigation settings |
|
|
1214
1617
|
*/
|
|
1215
1618
|
declare class AgridComponent<T extends object = any> {
|
|
1216
1619
|
/** Grid provider containing columns, data source, control, and options. */
|
|
@@ -1227,8 +1630,12 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1227
1630
|
readonly autoOpenDetail: Signal<boolean>;
|
|
1228
1631
|
readonly serverSideFiltering: Signal<boolean>;
|
|
1229
1632
|
readonly filterDebounceMs: Signal<number>;
|
|
1633
|
+
readonly enableQuickFilter: Signal<boolean>;
|
|
1634
|
+
readonly menuBarItems: Signal<AgridMenuBarItem<T>[]>;
|
|
1635
|
+
readonly quickFilterValue: Signal<string>;
|
|
1230
1636
|
readonly sortOption: Signal<"single" | "multi" | "none">;
|
|
1231
1637
|
readonly rowSelection: Signal<"single" | "multi" | "none">;
|
|
1638
|
+
readonly enterEditAction: Signal<_thkl_agrid.AgridEnterEditAction>;
|
|
1232
1639
|
readonly groupDescription: Signal<((label: string) => string) | null>;
|
|
1233
1640
|
readonly groupActions: Signal<GroupAction[]>;
|
|
1234
1641
|
readonly cellMenuItems: Signal<(CellContextMenuItem<T> | null)[]>;
|
|
@@ -1241,10 +1648,28 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1241
1648
|
readonly loading: Signal<boolean>;
|
|
1242
1649
|
readonly emptyText: Signal<string | undefined>;
|
|
1243
1650
|
readonly useSidebarEditor: Signal<boolean>;
|
|
1651
|
+
/** Host callback for per-row CSS classes, or `undefined`. */
|
|
1652
|
+
readonly rowClassFn: Signal<((params: {
|
|
1653
|
+
row: Record<string, unknown>;
|
|
1654
|
+
index: number;
|
|
1655
|
+
}) => string) | undefined>;
|
|
1656
|
+
/** Host callback designating pinned rows, or `undefined`. */
|
|
1657
|
+
readonly pinRowFn: Signal<((row: Record<string, unknown>, index: number) => "top" | "bottom" | undefined) | undefined>;
|
|
1658
|
+
/**
|
|
1659
|
+
* Effective pin resolver fed to the projection: a runtime UI override wins (including an explicit
|
|
1660
|
+
* `null` unpin), otherwise the provider `pinRow` predicate decides. Returns `undefined` when
|
|
1661
|
+
* neither pinning source is active, so the projection's pinning path stays off.
|
|
1662
|
+
*/
|
|
1663
|
+
readonly effectivePinRow: Signal<((row: Record<string, unknown>, index: number) => "top" | "bottom" | undefined) | undefined>;
|
|
1664
|
+
/** Whether master/detail is enabled and applicable (flat rows or tree leaves; not grouped). */
|
|
1665
|
+
readonly masterDetail: Signal<boolean>;
|
|
1666
|
+
/** Fixed detail-panel height in pixels. */
|
|
1667
|
+
readonly detailRowHeight: Signal<number>;
|
|
1244
1668
|
/** Column definitions from the active provider. */
|
|
1245
1669
|
readonly colDefs: Signal<ColDefBase<any, string>[]>;
|
|
1246
1670
|
/** Signal-based data container from the active provider. */
|
|
1247
1671
|
readonly dataSource: Signal<AgridDataSource<any>>;
|
|
1672
|
+
private readonly treeParentIds;
|
|
1248
1673
|
/** Grid UI state container from the active provider. */
|
|
1249
1674
|
readonly control: Signal<AgridControl | null>;
|
|
1250
1675
|
/** Resolved locale code used for date formatting and built-in localization lookup. 'auto' is replaced with navigator.language. */
|
|
@@ -1271,6 +1696,10 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1271
1696
|
rowDoubleClicked: _angular_core.OutputEmitterRef<RowClickEvent<T>>;
|
|
1272
1697
|
/** Emitted when the user single-clicks a data row. */
|
|
1273
1698
|
rowClick: _angular_core.OutputEmitterRef<RowClickEvent<T>>;
|
|
1699
|
+
/** Emitted when the user single-clicks a generated path-tree branch node. */
|
|
1700
|
+
treeNodeClick: _angular_core.OutputEmitterRef<TreeNodeClickEvent>;
|
|
1701
|
+
/** Emitted when the user double-clicks a generated path-tree branch node. */
|
|
1702
|
+
treeNodeDoubleClicked: _angular_core.OutputEmitterRef<TreeNodeClickEvent>;
|
|
1274
1703
|
/**
|
|
1275
1704
|
* Emitted once after a changed row is left during inline editing, or when the sidebar editor
|
|
1276
1705
|
* save button is used.
|
|
@@ -1286,10 +1715,30 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1286
1715
|
filterChange: _angular_core.OutputEmitterRef<FilterChangeEvent>;
|
|
1287
1716
|
/** Emitted when a column sort changes in server-side filtering mode. */
|
|
1288
1717
|
sortChange: _angular_core.OutputEmitterRef<SortChangeEvent>;
|
|
1718
|
+
/**
|
|
1719
|
+
* Emitted (debounced) when the global quick-filter text changes in server-side filtering mode.
|
|
1720
|
+
* The host should refetch rows matching the text. Not emitted in client mode, where the grid
|
|
1721
|
+
* filters locally.
|
|
1722
|
+
*/
|
|
1723
|
+
quickFilterChange: _angular_core.OutputEmitterRef<string>;
|
|
1724
|
+
/** Emitted when a `ColDef.validate` hook rejects a committed value (inline or sidebar). */
|
|
1725
|
+
validationFailed: _angular_core.OutputEmitterRef<ValidationFailedEvent<any>>;
|
|
1726
|
+
/** Emitted when a column's optional cell information button is clicked. */
|
|
1727
|
+
cellInfo: _angular_core.OutputEmitterRef<CellInfoEvent<T>>;
|
|
1728
|
+
/** Emitted for every enabled menu-bar button or dropdown item, carrying its configured id. */
|
|
1729
|
+
menuBarAction: _angular_core.OutputEmitterRef<string>;
|
|
1289
1730
|
/** Currently focused cell, or `null`. */
|
|
1290
1731
|
readonly selectedCell: _angular_core.WritableSignal<CellPosition | null>;
|
|
1291
1732
|
/** Original index of the row awaiting delete confirmation, or `null`. */
|
|
1292
1733
|
readonly pendingDeleteRow: _angular_core.WritableSignal<number | null>;
|
|
1734
|
+
/** Original indices of rows whose master/detail panel is currently expanded. */
|
|
1735
|
+
private readonly _expandedDetailIds;
|
|
1736
|
+
/**
|
|
1737
|
+
* Runtime per-row pin overrides set through the UI (keyed by original index). A `null` value
|
|
1738
|
+
* explicitly unpins a row that the `pinRow` predicate would otherwise pin. Merged with the
|
|
1739
|
+
* provider predicate by {@link effectivePinRow}.
|
|
1740
|
+
*/
|
|
1741
|
+
private readonly _pinnedRows;
|
|
1293
1742
|
private readonly markedIndices;
|
|
1294
1743
|
/** Original datasource indices marked for inclusion in copy operations. */
|
|
1295
1744
|
readonly markedRowIndices: Signal<ReadonlySet<number>>;
|
|
@@ -1299,6 +1748,8 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1299
1748
|
readonly deleteConfirmationWidth: _angular_core.WritableSignal<number>;
|
|
1300
1749
|
/** Rectangular cell range selected by Shift+arrow or Shift+click. */
|
|
1301
1750
|
readonly selectedRange: _angular_core.WritableSignal<CellRange | null>;
|
|
1751
|
+
/** @internal Stable callback passed to child components for row-aware editability checks. */
|
|
1752
|
+
readonly isCellEditableForRow: (col: ColDef, originalIndex: number) => boolean;
|
|
1302
1753
|
/** Fill-handle drag preview bounds, in visible row/column coordinates. */
|
|
1303
1754
|
get fillPreviewBounds(): _angular_core.WritableSignal<VisibleCellBounds | null>;
|
|
1304
1755
|
/** Position of the cell in edit mode, or `null`. */
|
|
@@ -1307,6 +1758,8 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1307
1758
|
get currentDraft(): _angular_core.WritableSignal<unknown>;
|
|
1308
1759
|
/** Seed character typed to enter edit mode (e.g. pressing 'A'). */
|
|
1309
1760
|
get editSeedChar(): _angular_core.WritableSignal<string>;
|
|
1761
|
+
/** Whether the active text editor should select all text when it opens. */
|
|
1762
|
+
get selectTextOnEdit(): _angular_core.WritableSignal<boolean>;
|
|
1310
1763
|
/** Toggle the sidebar open/closed. */
|
|
1311
1764
|
toggleSidebar(): void;
|
|
1312
1765
|
/** @internal */
|
|
@@ -1382,7 +1835,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1382
1835
|
readonly showPagination: Signal<boolean>;
|
|
1383
1836
|
/** Number of semantic header rows currently rendered. */
|
|
1384
1837
|
readonly headerRowCount: Signal<1 | 2>;
|
|
1385
|
-
/** Number of rendered semantic rows, including header rows. */
|
|
1838
|
+
/** Number of rendered semantic rows, including header and pinned rows. */
|
|
1386
1839
|
readonly ariaRowCount: Signal<number>;
|
|
1387
1840
|
/** Number of visible semantic columns, including the optional control column. */
|
|
1388
1841
|
readonly ariaColCount: Signal<number>;
|
|
@@ -1412,6 +1865,26 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1412
1865
|
/** 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. */
|
|
1413
1866
|
readonly dataRowIsOdd: Signal<Map<number, boolean>>;
|
|
1414
1867
|
readonly displayItems: Signal<GridItem[]>;
|
|
1868
|
+
/** Rows pinned to the top of the body (rendered in a fixed container, outside virtual scroll). */
|
|
1869
|
+
readonly pinnedTopItems: Signal<{
|
|
1870
|
+
row: Record<string, unknown>;
|
|
1871
|
+
originalIndex: number;
|
|
1872
|
+
}[]>;
|
|
1873
|
+
/** Rows pinned to the bottom of the body (rendered in a fixed container, outside virtual scroll). */
|
|
1874
|
+
readonly pinnedBottomItems: Signal<{
|
|
1875
|
+
row: Record<string, unknown>;
|
|
1876
|
+
originalIndex: number;
|
|
1877
|
+
}[]>;
|
|
1878
|
+
/** Whether any top-pinned rows are present. */
|
|
1879
|
+
readonly hasPinnedTopRows: Signal<boolean>;
|
|
1880
|
+
/** Whether any bottom-pinned rows are present. */
|
|
1881
|
+
readonly hasPinnedBottomRows: Signal<boolean>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Per-item heights fed to the variable-size virtual-scroll strategy: a detail panel uses the
|
|
1884
|
+
* configured detail height, every other row uses the standard row height. With no detail rows
|
|
1885
|
+
* open the array is uniform, so scrolling matches the fixed-size strategy.
|
|
1886
|
+
*/
|
|
1887
|
+
readonly itemSizes: Signal<number[]>;
|
|
1415
1888
|
readonly groupActionsMenu: _angular_core.WritableSignal<{
|
|
1416
1889
|
x: number;
|
|
1417
1890
|
y: number;
|
|
@@ -1452,8 +1925,16 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1452
1925
|
readonly selectedRowIndex: Signal<number | null>;
|
|
1453
1926
|
readonly contextMenu: _angular_core.WritableSignal<AgridRowContextMenu | null>;
|
|
1454
1927
|
readonly cellContextMenuState: _angular_core.WritableSignal<AgridCellContextMenu | null>;
|
|
1928
|
+
/** Id of the menu-bar button whose dropdown is open, or `null`. */
|
|
1929
|
+
readonly openMenuBarItemId: _angular_core.WritableSignal<string | null>;
|
|
1930
|
+
/** Runtime state passed to menu-bar visibility, active, and disabled resolvers. */
|
|
1931
|
+
readonly menuBarContext: Signal<AgridMenuBarContext<T>>;
|
|
1932
|
+
/** Menu-bar buttons currently allowed by their visibility resolvers. */
|
|
1933
|
+
readonly visibleMenuBarItems: Signal<AgridMenuBarItem<T>[]>;
|
|
1455
1934
|
private readonly sidebarController;
|
|
1456
1935
|
readonly sidebarOpen: _angular_core.WritableSignal<boolean>;
|
|
1936
|
+
/** @internal Per-field sidebar validation messages. */
|
|
1937
|
+
readonly sidebarValidationErrors: _angular_core.WritableSignal<Record<string, string>>;
|
|
1457
1938
|
readonly sidebarTab: _angular_core.WritableSignal<"columns" | "detail">;
|
|
1458
1939
|
readonly sidebarRow: Signal<Record<string, unknown> | null>;
|
|
1459
1940
|
readonly sidebarHiddenColumns: Signal<ReadonlySet<string>>;
|
|
@@ -1475,6 +1956,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1475
1956
|
getColDropSide(field: string): 'before' | 'after' | null;
|
|
1476
1957
|
/** @internal Horizontal animation offset for a header during column reordering. */
|
|
1477
1958
|
getColReorderOffset(field: string): number;
|
|
1959
|
+
hasContextMenuEntries(): boolean;
|
|
1478
1960
|
private readonly _seededControls;
|
|
1479
1961
|
private readonly dirtyInlineRows;
|
|
1480
1962
|
private dirtyRowsDataSource;
|
|
@@ -1505,7 +1987,34 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1505
1987
|
collapsed: boolean;
|
|
1506
1988
|
};
|
|
1507
1989
|
/** @internal */
|
|
1990
|
+
isPathTreeNodeItem(item: GridItem): boolean;
|
|
1991
|
+
/** @internal */
|
|
1508
1992
|
getItemOriginalIndex(item: GridItem): number | null;
|
|
1993
|
+
/** @internal True when the item is a master/detail panel row. */
|
|
1994
|
+
isDetailRowItem(item: GridItem): item is DetailRowItem;
|
|
1995
|
+
/** @internal Rendered pixel height of a virtual-scroll item (detail panels are taller). */
|
|
1996
|
+
rowPx(item: GridItem): number;
|
|
1997
|
+
/** @internal Resolved HTML for an expanded detail panel (auto-sanitized by `[innerHTML]`). */
|
|
1998
|
+
detailHtml(item: GridItem): string;
|
|
1999
|
+
/** @internal Resolved per-row CSS classes from the host `getRowClass` callback. */
|
|
2000
|
+
getRowClass(row: Record<string, unknown>, index: number): string;
|
|
2001
|
+
/** Whether the master/detail panel for `originalIndex` is currently expanded. */
|
|
2002
|
+
isDetailExpanded(originalIndex: number): boolean;
|
|
2003
|
+
/** @internal Whether a data row may show a master/detail panel. */
|
|
2004
|
+
canToggleDetail(item: GridItem): boolean;
|
|
2005
|
+
/** Toggle the master/detail panel for a row by its original (data-source) index. */
|
|
2006
|
+
toggleDetail(originalIndex: number): void;
|
|
2007
|
+
/** @internal Template handler for the detail expander chevron. */
|
|
2008
|
+
onDetailToggle(originalIndex: number): void;
|
|
2009
|
+
/** Effective pin position of a row (`'top'`, `'bottom'`, or `undefined`). */
|
|
2010
|
+
rowPinState(originalIndex: number): 'top' | 'bottom' | undefined;
|
|
2011
|
+
/**
|
|
2012
|
+
* Pin a row to the top or bottom of the body, or unpin it with `null`.
|
|
2013
|
+
* Keyed by the row's original (data-source) index; the pinned row stays fully interactive.
|
|
2014
|
+
*/
|
|
2015
|
+
pinRowTo(originalIndex: number, position: 'top' | 'bottom' | null): void;
|
|
2016
|
+
/** @internal Template handler for the pin/unpin context-menu items; closes the open menus. */
|
|
2017
|
+
onPinRow(originalIndex: number, position: 'top' | 'bottom' | null): void;
|
|
1509
2018
|
/** @internal True when `col` is the configured tree column. */
|
|
1510
2019
|
isTreeCell(col: ColDef): boolean;
|
|
1511
2020
|
/** @internal Tree depth of a row item (0 when not a tree row). */
|
|
@@ -1514,8 +2023,22 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1514
2023
|
treeRowExpandable(item: GridItem): boolean;
|
|
1515
2024
|
/** @internal Whether a tree row is currently expanded. */
|
|
1516
2025
|
treeRowExpanded(item: GridItem): boolean;
|
|
2026
|
+
/** @internal Display-only final path segment for a datasource-backed path-tree leaf. */
|
|
2027
|
+
treeCellDisplayOverride(item: GridItem, col: ColDef): string | null;
|
|
2028
|
+
/** @internal Whether the configured info action is visible for this cell. */
|
|
2029
|
+
showCellInfoIcon(col: ColDef, row: Record<string, unknown>): boolean;
|
|
2030
|
+
/** @internal Emits the typed cell information action. */
|
|
2031
|
+
onCellInfo(originalIndex: number, col: ColDef, row: Record<string, unknown>): void;
|
|
2032
|
+
/** @internal Label of a generated path-tree branch. */
|
|
2033
|
+
pathTreeLabel(item: GridItem): string;
|
|
1517
2034
|
/** @internal Toggle the expand/collapse state of a tree row from its twisty. */
|
|
1518
2035
|
onTreeToggle(item: GridItem): void;
|
|
2036
|
+
/** @internal Emits the generated path-tree branch click event. */
|
|
2037
|
+
onTreeNodeClick(item: GridItem): void;
|
|
2038
|
+
/** @internal Emits the generated path-tree branch double-click event. */
|
|
2039
|
+
onTreeNodeDoubleClick(item: GridItem): void;
|
|
2040
|
+
private toTreeNodeClickEvent;
|
|
2041
|
+
private toggleTreeCell;
|
|
1519
2042
|
/** Expand every expandable node in the tree. No-op when not in tree mode. */
|
|
1520
2043
|
expandAllNodes(): void;
|
|
1521
2044
|
/** Collapse every node in the tree. No-op when not in tree mode. */
|
|
@@ -1540,6 +2063,22 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1540
2063
|
/** @internal Whether more than one column is currently sorted. */
|
|
1541
2064
|
hasMultiSort(): boolean;
|
|
1542
2065
|
getTextFilter(field: string): string;
|
|
2066
|
+
/** @internal Condition input type for a column, or `null` when unsupported. */
|
|
2067
|
+
getMenuFilterType(field: string): 'text' | 'number' | 'date' | null;
|
|
2068
|
+
/** @internal Short label for an active header condition. */
|
|
2069
|
+
getConditionButtonLabel(field: string): string;
|
|
2070
|
+
/** @internal */
|
|
2071
|
+
getMenuOperator(field: string): FilterOperator | null;
|
|
2072
|
+
/** @internal */
|
|
2073
|
+
getMenuOperand(field: string): string;
|
|
2074
|
+
/** @internal */
|
|
2075
|
+
getMenuOperand2(field: string): string;
|
|
2076
|
+
/** @internal */
|
|
2077
|
+
onMenuOperatorChange(field: string, operator: FilterOperator | null): void;
|
|
2078
|
+
/** @internal */
|
|
2079
|
+
onMenuOperandChange(field: string, value: string): void;
|
|
2080
|
+
/** @internal */
|
|
2081
|
+
onMenuOperand2Change(field: string, value: string): void;
|
|
1543
2082
|
/** @internal */
|
|
1544
2083
|
getSort(field: string): 'asc' | 'desc' | null;
|
|
1545
2084
|
/** @internal */
|
|
@@ -1583,6 +2122,18 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1583
2122
|
onStartEdit(originalIndex: number, ci: number): void;
|
|
1584
2123
|
/** @internal */
|
|
1585
2124
|
onDraftChange(value: unknown): void;
|
|
2125
|
+
private quickFilterTimer;
|
|
2126
|
+
/**
|
|
2127
|
+
* @internal Quick-filter input handler. Stores the text on the control (drives the bound value
|
|
2128
|
+
* and client-side filtering) and, in server mode, emits a debounced `quickFilterChange` instead.
|
|
2129
|
+
*/
|
|
2130
|
+
onQuickFilterInput(event: Event): void;
|
|
2131
|
+
/** @internal Whether a column is editable in the current grid state (drives boolean checkboxes). */
|
|
2132
|
+
isColEditable(col: ColDef, originalIndex?: number): boolean;
|
|
2133
|
+
/** @internal Inline validation message for a cell, or `null` when the cell has no active error. */
|
|
2134
|
+
cellValidationError(originalIndex: number, ci: number): string | null;
|
|
2135
|
+
/** @internal Commit a boolean-column checkbox toggle directly to the data source. */
|
|
2136
|
+
onBooleanToggle(originalIndex: number, ci: number, value: boolean): void;
|
|
1586
2137
|
/** @internal Starts a fill-handle drag from the bottom-right corner of the selection. */
|
|
1587
2138
|
onCellPointerDown(event: PointerEvent, originalIndex: number, colIndex: number): void;
|
|
1588
2139
|
/** @internal Main keyboard handler delegated from the wrapper div. */
|
|
@@ -1597,6 +2148,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1597
2148
|
onFindInput(value: string): void;
|
|
1598
2149
|
/** @internal */
|
|
1599
2150
|
goToFindMatch(direction: 1 | -1): void;
|
|
2151
|
+
private revealFindMatch;
|
|
1600
2152
|
/** @internal Ghost cell display during a reorder drag. */
|
|
1601
2153
|
getGhostCellDisplay(col: ColDef): string;
|
|
1602
2154
|
/** @internal Delegates to AgridDragHandler. */
|
|
@@ -1627,6 +2179,30 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1627
2179
|
onCellContextMenu(event: MouseEvent, rowIndex: number, colIndex: number, col: ColDef, row: Record<string, unknown>): void;
|
|
1628
2180
|
/** @internal */
|
|
1629
2181
|
closeCellContextMenu(): void;
|
|
2182
|
+
/** @internal Closes any row, cell, menu-bar, group-action, or column menu owned by this grid. */
|
|
2183
|
+
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
|
+
/** @internal Closes the currently open menu-bar dropdown. */
|
|
2203
|
+
closeMenuBarMenu(): void;
|
|
2204
|
+
/** @internal Synchronizes dropdown state and closes competing grid menus when one opens. */
|
|
2205
|
+
onMenuBarOpenItemChange(id: string | null): void;
|
|
1630
2206
|
/** @internal Runs a typed provider context-menu action against erased controller state. */
|
|
1631
2207
|
runCellMenuItem(item: CellContextMenuItem<T>, menu: AgridCellContextMenu): void;
|
|
1632
2208
|
/** @internal Copy one field from the target and marked rows. */
|
|
@@ -1723,9 +2299,136 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1723
2299
|
getColumnWidth(col: ColDef): number;
|
|
1724
2300
|
private getColumnWidthToken;
|
|
1725
2301
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgridComponent<any>, never>;
|
|
1726
|
-
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"; "rowChanged": "rowChanged"; "pageChange": "pageChange"; "filterChange": "filterChange"; "sortChange": "sortChange"; }, never, never, true, 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>;
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
/** Identifier supported by the standalone page selector. */
|
|
2306
|
+
type AgridPageId = string | number;
|
|
2307
|
+
/** One selectable page. IDs must be unique within the item list. */
|
|
2308
|
+
interface AgridPageItem<TId extends AgridPageId = AgridPageId> {
|
|
2309
|
+
id: string;
|
|
2310
|
+
pageNumber: TId;
|
|
2311
|
+
label: string;
|
|
2312
|
+
}
|
|
2313
|
+
/** Compact previous/input/dropdown/next control for navigating a labeled page list. */
|
|
2314
|
+
declare class AgridPageSelectorComponent<TId extends AgridPageId = AgridPageId> {
|
|
2315
|
+
private readonly elementRef;
|
|
2316
|
+
readonly listboxId: string;
|
|
2317
|
+
items: _angular_core.InputSignal<readonly AgridPageItem<TId>[]>;
|
|
2318
|
+
selectedId: _angular_core.InputSignal<string | null>;
|
|
2319
|
+
selectedPageNumber: _angular_core.InputSignal<TId | null>;
|
|
2320
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
2321
|
+
previousLabel: _angular_core.InputSignal<string>;
|
|
2322
|
+
nextLabel: _angular_core.InputSignal<string>;
|
|
2323
|
+
inputLabel: _angular_core.InputSignal<string>;
|
|
2324
|
+
menuLabel: _angular_core.InputSignal<string>;
|
|
2325
|
+
emptyText: _angular_core.InputSignal<string>;
|
|
2326
|
+
selectPage: _angular_core.OutputEmitterRef<AgridPageItem<TId>>;
|
|
2327
|
+
readonly menuOpen: _angular_core.WritableSignal<boolean>;
|
|
2328
|
+
readonly draft: _angular_core.WritableSignal<string>;
|
|
2329
|
+
readonly invalid: _angular_core.WritableSignal<boolean>;
|
|
2330
|
+
readonly activeId: _angular_core.WritableSignal<string | null>;
|
|
2331
|
+
readonly focusedOptionIndex: _angular_core.WritableSignal<number>;
|
|
2332
|
+
readonly activeIndex: _angular_core.Signal<number>;
|
|
2333
|
+
readonly hasPrevious: _angular_core.Signal<boolean>;
|
|
2334
|
+
readonly hasNext: _angular_core.Signal<boolean>;
|
|
2335
|
+
constructor();
|
|
2336
|
+
previous(): void;
|
|
2337
|
+
next(): void;
|
|
2338
|
+
toggleMenu(event: Event): void;
|
|
2339
|
+
openMenu(): void;
|
|
2340
|
+
closeMenu(): void;
|
|
2341
|
+
onInput(event: Event): void;
|
|
2342
|
+
onInputKeydown(event: KeyboardEvent): void;
|
|
2343
|
+
choose(item: AgridPageItem<TId>): void;
|
|
2344
|
+
optionId(index: number): string;
|
|
2345
|
+
isSelected(item: AgridPageItem<TId>): boolean;
|
|
2346
|
+
onDocumentPointerDown(event: PointerEvent): void;
|
|
2347
|
+
private selectDraft;
|
|
2348
|
+
private resetDraft;
|
|
2349
|
+
private moveOption;
|
|
2350
|
+
private scrollFocusedOptionIntoView;
|
|
2351
|
+
private idsEqual;
|
|
2352
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgridPageSelectorComponent<any>, never>;
|
|
2353
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgridPageSelectorComponent<any>, "agrid-page-selector", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "selectedId": { "alias": "selectedId"; "required": false; "isSignal": true; }; "selectedPageNumber": { "alias": "selectedPageNumber"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "previousLabel": { "alias": "previousLabel"; "required": false; "isSignal": true; }; "nextLabel": { "alias": "nextLabel"; "required": false; "isSignal": true; }; "inputLabel": { "alias": "inputLabel"; "required": false; "isSignal": true; }; "menuLabel": { "alias": "menuLabel"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; }, { "selectPage": "selectPage"; }, never, never, true, never>;
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
/** Configuration accepted by {@link AgridTreeProvider}. */
|
|
2357
|
+
interface AgridTreeProviderConfig<T extends object> {
|
|
2358
|
+
datasource: AgridDataSource<T>;
|
|
2359
|
+
treeConfig: AgridTreeConfig<T>;
|
|
2360
|
+
/** Label for parent-linked rows. Defaults to the configured `treeField` value. */
|
|
2361
|
+
getLabel?: (row: T) => string;
|
|
2362
|
+
/** Optional secondary text shown beneath a row label. */
|
|
2363
|
+
getDescription?: (row: T) => string | undefined;
|
|
2364
|
+
/** Selection behavior. Defaults to `single`. */
|
|
2365
|
+
selection?: AgridTreeSelectionMode;
|
|
2366
|
+
/** Fixed node height in pixels. Defaults to `36`. */
|
|
2367
|
+
rowHeight?: number;
|
|
2368
|
+
/** Accessible name for the tree. Defaults to `Tree`. */
|
|
2369
|
+
ariaLabel?: string;
|
|
2370
|
+
/** Text shown when the datasource is empty. */
|
|
2371
|
+
emptyText?: string;
|
|
2372
|
+
}
|
|
2373
|
+
/** Provider-style configuration and datasource container for `<agrid-tree>`. */
|
|
2374
|
+
declare class AgridTreeProvider<T extends object = any> {
|
|
2375
|
+
readonly datasource: AgridDataSource<T>;
|
|
2376
|
+
readonly treeConfig: AgridTreeConfig<T>;
|
|
2377
|
+
readonly getLabel?: (row: T) => string;
|
|
2378
|
+
readonly getDescription?: (row: T) => string | undefined;
|
|
2379
|
+
readonly selection: AgridTreeSelectionMode;
|
|
2380
|
+
readonly rowHeight: number;
|
|
2381
|
+
readonly ariaLabel: string;
|
|
2382
|
+
readonly emptyText: string;
|
|
2383
|
+
constructor(config: AgridTreeProviderConfig<T>);
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
type StandaloneTreeItem<T extends object> = TreeRowItem<T> | PathTreeNodeItem;
|
|
2387
|
+
/** Standalone accessible tree control backed by the same projection logic as `AgridComponent`. */
|
|
2388
|
+
declare class AgridTreeComponent<T extends object = any> {
|
|
2389
|
+
provider: _angular_core.InputSignal<AgridTreeProvider<T>>;
|
|
2390
|
+
nodeClick: _angular_core.OutputEmitterRef<AgridTreeNodeEvent<T>>;
|
|
2391
|
+
nodeDoubleClicked: _angular_core.OutputEmitterRef<AgridTreeNodeEvent<T>>;
|
|
2392
|
+
selectionChange: _angular_core.OutputEmitterRef<AgridTreeSelectionEvent<T>>;
|
|
2393
|
+
private readonly treeController;
|
|
2394
|
+
private readonly treeElement;
|
|
2395
|
+
private initializedProvider;
|
|
2396
|
+
readonly focusedIndex: _angular_core.WritableSignal<number>;
|
|
2397
|
+
readonly selectedKeys: _angular_core.WritableSignal<Set<string>>;
|
|
2398
|
+
readonly expandedIds: _angular_core.WritableSignal<Set<string | number>>;
|
|
2399
|
+
readonly items: _angular_core.Signal<StandaloneTreeItem<T>[]>;
|
|
2400
|
+
constructor();
|
|
2401
|
+
/** Expands every branch currently represented by the datasource. */
|
|
2402
|
+
expandAllNodes(): void;
|
|
2403
|
+
/** Collapses every branch. */
|
|
2404
|
+
collapseAllNodes(): void;
|
|
2405
|
+
/** Toggles one expandable node. */
|
|
2406
|
+
toggleNode(item: StandaloneTreeItem<T>): void;
|
|
2407
|
+
/** @internal */
|
|
2408
|
+
label(item: StandaloneTreeItem<T>): string;
|
|
2409
|
+
/** @internal */
|
|
2410
|
+
description(item: StandaloneTreeItem<T>): string | undefined;
|
|
2411
|
+
/** @internal */
|
|
2412
|
+
isSelected(item: StandaloneTreeItem<T>): boolean;
|
|
2413
|
+
/** @internal */
|
|
2414
|
+
onNodeClick(event: MouseEvent, item: StandaloneTreeItem<T>, index: number): void;
|
|
2415
|
+
/** @internal */
|
|
2416
|
+
onNodeDoubleClick(event: MouseEvent, item: StandaloneTreeItem<T>): void;
|
|
2417
|
+
/** @internal */
|
|
2418
|
+
onKeydown(event: KeyboardEvent, item: StandaloneTreeItem<T>, index: number): void;
|
|
2419
|
+
/** @internal */
|
|
2420
|
+
trackItem(_index: number, item: StandaloneTreeItem<T>): string;
|
|
2421
|
+
private select;
|
|
2422
|
+
private toEvent;
|
|
2423
|
+
private expansionId;
|
|
2424
|
+
private selectionKey;
|
|
2425
|
+
private moveFocus;
|
|
2426
|
+
private focusNode;
|
|
2427
|
+
private findParentIndex;
|
|
2428
|
+
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>;
|
|
1727
2430
|
}
|
|
1728
2431
|
|
|
1729
|
-
export { AGRID_LOCALE_TEXT, AgridComponent, AgridControl, AgridDataSource, AgridProvider, ColDefAutoSize };
|
|
1730
|
-
export type { AgridControlState, AgridField, AgridLocaleKey, AgridLocaleText, AgridLocaleTextOverrides, AgridProviderConfig, AgridTreeConfig, CellContextMenuItem, CellPosition, ColDef, FilterChangeEvent, GridEditEvent, GroupAction, HeaderGroup, HistoryEntry, HistoryItem, NewRecord, PageChangeEvent, RecordEditEvent, RowClickEvent, RowRemovedEvent, RowReorderEvent, RowSelectEvent, RowUpdateEvent, SortChangeEvent, TreeRowItem, ValueOption };
|
|
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 };
|
|
1731
2434
|
//# sourceMappingURL=thkl-agrid.d.ts.map
|