@thkl/agrid 0.1.11 → 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 +74 -4
- package/fesm2022/thkl-agrid.mjs +2490 -502
- package/fesm2022/thkl-agrid.mjs.map +1 -1
- package/package.json +1 -1
- package/types/thkl-agrid.d.ts +748 -58
- 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. */
|
|
@@ -150,12 +162,38 @@ declare class AgridControl {
|
|
|
150
162
|
private readonly _loading;
|
|
151
163
|
private readonly _readonly;
|
|
152
164
|
private readonly _autoAddRows;
|
|
165
|
+
private readonly _rowIndications;
|
|
166
|
+
private readonly _changedCells;
|
|
167
|
+
private readonly rowIndicationTimers;
|
|
153
168
|
/** @param state Optional initial state, e.g. deserialized from storage. */
|
|
154
169
|
constructor(state?: Partial<AgridControlState>);
|
|
155
170
|
/** Whether the grid displays its loading overlay. This transient state is not serialized. */
|
|
156
171
|
readonly loading: Signal<boolean>;
|
|
157
172
|
/** Show or hide the grid loading overlay. */
|
|
158
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;
|
|
159
197
|
/** Whether all grid editing and mutation UI is disabled. This transient state is not serialized. */
|
|
160
198
|
readonly readonly: Signal<boolean>;
|
|
161
199
|
/** Enable or disable readonly mode at runtime. */
|
|
@@ -567,6 +605,7 @@ interface AgridLocaleText {
|
|
|
567
605
|
close: string;
|
|
568
606
|
columnMenu: string;
|
|
569
607
|
columns: string;
|
|
608
|
+
collapse: string;
|
|
570
609
|
detail: string;
|
|
571
610
|
toggleDetail: string;
|
|
572
611
|
hiddenColumn: string;
|
|
@@ -606,6 +645,7 @@ interface AgridLocaleText {
|
|
|
606
645
|
lastPage: string;
|
|
607
646
|
loading: string;
|
|
608
647
|
markRow: string;
|
|
648
|
+
moreInformation: string;
|
|
609
649
|
next: string;
|
|
610
650
|
noRows: string;
|
|
611
651
|
pagination: string;
|
|
@@ -622,6 +662,7 @@ interface AgridLocaleText {
|
|
|
622
662
|
unpinRow: string;
|
|
623
663
|
previous: string;
|
|
624
664
|
resizeColumn: string;
|
|
665
|
+
expand: string;
|
|
625
666
|
rows: (count: number) => string;
|
|
626
667
|
quickFilterPlaceholder: string;
|
|
627
668
|
searchValuesPlaceholder: string;
|
|
@@ -632,6 +673,11 @@ interface AgridLocaleText {
|
|
|
632
673
|
ungroup: string;
|
|
633
674
|
unpinColumn: string;
|
|
634
675
|
save: string;
|
|
676
|
+
saveConfig: string;
|
|
677
|
+
export: string;
|
|
678
|
+
exportCsv: string;
|
|
679
|
+
exportXlsx: string;
|
|
680
|
+
templates: string;
|
|
635
681
|
}
|
|
636
682
|
/** Partial locale text supplied to {@link AgridProvider.addLocalization}. */
|
|
637
683
|
type AgridLocaleTextOverrides = Partial<AgridLocaleText>;
|
|
@@ -698,6 +744,8 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
698
744
|
showControlColumn?: boolean;
|
|
699
745
|
/** Show row-marking checkboxes in a 48 px control column for clipboard inclusion. @default false */
|
|
700
746
|
enableRowMarking?: boolean;
|
|
747
|
+
/** Allow clicking column headers to mark complete columns. @default false */
|
|
748
|
+
enableColumnMarking?: boolean;
|
|
701
749
|
/** Show the sidebar panel. */
|
|
702
750
|
showSidebar?: boolean;
|
|
703
751
|
/** Automatically open the detail panel when a row is selected. */
|
|
@@ -752,6 +800,12 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
752
800
|
cellMenuItems?: (CellContextMenuItem<T> | null)[];
|
|
753
801
|
/** Shade every other row slightly for easier reading. @default false */
|
|
754
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;
|
|
755
809
|
/** Show a color marker on cells changed through grid editing. @default false */
|
|
756
810
|
showChangedCellIndicator?: boolean;
|
|
757
811
|
/** Ask for confirmation before grid row-delete actions. @default false */
|
|
@@ -808,8 +862,18 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
808
862
|
detailRenderer?: (params: {
|
|
809
863
|
row: T;
|
|
810
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>[];
|
|
811
869
|
/** Fixed height in pixels of an expanded detail panel row. @default 200 */
|
|
812
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;
|
|
813
877
|
}
|
|
814
878
|
/**
|
|
815
879
|
* Bundles a grid's data source, control state, columns, and display options.
|
|
@@ -817,6 +881,15 @@ interface AgridProviderConfig<T extends object = any> extends Partial<AGridOptio
|
|
|
817
881
|
* Create one provider per independent grid instance. A provider may be selected
|
|
818
882
|
* from an array when a component renders multiple grids.
|
|
819
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
|
+
}
|
|
820
893
|
declare class AgridProvider<T extends object = any> {
|
|
821
894
|
/** Mutable row data consumed by the grid. */
|
|
822
895
|
datasource: AgridDataSource<T>;
|
|
@@ -840,6 +913,20 @@ declare class AgridProvider<T extends object = any> {
|
|
|
840
913
|
/** Shared grid options such as locale. */
|
|
841
914
|
options: AGridOptions;
|
|
842
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;
|
|
843
930
|
/** Read-only view of registered per-locale text overrides. Used by the grid to resolve locale text. */
|
|
844
931
|
get localizations(): ReadonlyMap<string, AgridLocaleTextOverrides>;
|
|
845
932
|
/**
|
|
@@ -863,6 +950,8 @@ declare class AgridProvider<T extends object = any> {
|
|
|
863
950
|
showControlColumn: boolean;
|
|
864
951
|
/** Whether rows can be marked for inclusion in clipboard copies. */
|
|
865
952
|
enableRowMarking: boolean;
|
|
953
|
+
/** Whether complete columns can be marked from their headers. */
|
|
954
|
+
enableColumnMarking: boolean;
|
|
866
955
|
/** Whether the sidebar is available. */
|
|
867
956
|
showSidebar: boolean;
|
|
868
957
|
/** Whether selecting a row automatically opens its detail panel. */
|
|
@@ -891,6 +980,8 @@ declare class AgridProvider<T extends object = any> {
|
|
|
891
980
|
cellMenuItems: (CellContextMenuItem<T> | null)[];
|
|
892
981
|
/** Whether alternating data rows receive stripe styling. */
|
|
893
982
|
zebraStripes: boolean;
|
|
983
|
+
/** Scrollable-column count above which column virtualization activates. */
|
|
984
|
+
columnVirtualizationThreshold: number;
|
|
894
985
|
/** Whether committed cell changes receive a visual marker. */
|
|
895
986
|
showChangedCellIndicator: boolean;
|
|
896
987
|
/** Whether grid row-delete actions require in-row confirmation. */
|
|
@@ -912,8 +1003,18 @@ declare class AgridProvider<T extends object = any> {
|
|
|
912
1003
|
detailRenderer?: (params: {
|
|
913
1004
|
row: T;
|
|
914
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>[];
|
|
915
1010
|
/** Fixed height in pixels of an expanded detail panel row. */
|
|
916
1011
|
detailRowHeight: number;
|
|
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;
|
|
917
1018
|
/** @deprecated Use `control.loading` and `control.setLoading()` instead. */
|
|
918
1019
|
readonly loading: WritableSignal<boolean>;
|
|
919
1020
|
/** @deprecated Use `control.readonly` and `control.setReadonly()` instead. */
|
|
@@ -933,6 +1034,31 @@ declare class AgridProvider<T extends object = any> {
|
|
|
933
1034
|
* signal-backed. Unknown versions and pivot fields fail early with actionable errors.
|
|
934
1035
|
*/
|
|
935
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;
|
|
936
1062
|
}
|
|
937
1063
|
|
|
938
1064
|
/** String-valued property names available on a row type. */
|
|
@@ -970,6 +1096,8 @@ interface CellReadonlyParams<T extends object = any, K extends AgridField<T> = A
|
|
|
970
1096
|
}
|
|
971
1097
|
/** Parameters passed to a row-aware cell formatting resolver. */
|
|
972
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>;
|
|
973
1101
|
/** Supported visual overrides returned by {@link ColDefBase.cellFormat}. */
|
|
974
1102
|
interface CellFormat {
|
|
975
1103
|
/** CSS background color, such as `'#fff4cc'` or `'var(--warning-bg)'`. */
|
|
@@ -1087,6 +1215,21 @@ interface HeaderGroup {
|
|
|
1087
1215
|
/** Text displayed in the grouped header row. */
|
|
1088
1216
|
label: string;
|
|
1089
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
|
+
}
|
|
1090
1233
|
/** Defines the behavior shared by every typed column. */
|
|
1091
1234
|
interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
1092
1235
|
/** Data field name — must match a key in the row object. */
|
|
@@ -1095,6 +1238,8 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
1095
1238
|
header: string;
|
|
1096
1239
|
/** Optional header-group identifier configured through `AgridProvider.headerGroups`. */
|
|
1097
1240
|
group?: string;
|
|
1241
|
+
/** Custom commands appended to this column's header menu. */
|
|
1242
|
+
headerMenuItems?: AgridColumnHeaderMenuItem[];
|
|
1098
1243
|
/**
|
|
1099
1244
|
* Default column width in pixels. Can be overridden at runtime via {@link AgridControl}.
|
|
1100
1245
|
* Use `-1` (or omit) to make the column auto-scale and fill available space (`1fr`).
|
|
@@ -1141,6 +1286,24 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
1141
1286
|
* ```
|
|
1142
1287
|
*/
|
|
1143
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);
|
|
1144
1307
|
/**
|
|
1145
1308
|
* Fixed list of allowed values shown in a `<select>` dropdown when editing.
|
|
1146
1309
|
*
|
|
@@ -1241,10 +1404,26 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
1241
1404
|
* ```
|
|
1242
1405
|
*/
|
|
1243
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>;
|
|
1244
1419
|
/**
|
|
1245
1420
|
* Custom cell renderer. Returns an HTML string displayed instead of the plain text value.
|
|
1246
1421
|
* Angular's built-in HTML sanitization is applied automatically.
|
|
1247
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
|
+
*
|
|
1248
1427
|
* @example
|
|
1249
1428
|
* ```ts
|
|
1250
1429
|
* { field: 'status', cellRenderer: ({ value }) =>
|
|
@@ -1255,6 +1434,18 @@ interface ColDefBase<T extends object, K extends AgridField<T>> {
|
|
|
1255
1434
|
value: T[K];
|
|
1256
1435
|
row: T;
|
|
1257
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>;
|
|
1258
1449
|
/**
|
|
1259
1450
|
* Show a right-aligned info button in this column's cells.
|
|
1260
1451
|
* Pass a predicate to show it only for selected rows or values.
|
|
@@ -1285,6 +1476,21 @@ interface GroupAction {
|
|
|
1285
1476
|
/** Called with the group's display label when the item is clicked. */
|
|
1286
1477
|
action: (groupLabel: string) => void;
|
|
1287
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
|
+
}
|
|
1288
1494
|
/**
|
|
1289
1495
|
* Internal row item used in the virtual scroll list.
|
|
1290
1496
|
* - `{ row, originalIndex }` — a real data row
|
|
@@ -1511,7 +1717,7 @@ interface ValidationFailedEvent<T extends object = any> {
|
|
|
1511
1717
|
/** Message returned by the `validate` hook. */
|
|
1512
1718
|
message: string;
|
|
1513
1719
|
/** Which editing surface produced the rejected edit. */
|
|
1514
|
-
source: 'inline' | 'sidebar';
|
|
1720
|
+
source: 'inline' | 'sidebar' | 'detail';
|
|
1515
1721
|
}
|
|
1516
1722
|
/** Emitted by `(cellEdit)` after the user commits a cell change. */
|
|
1517
1723
|
type GridEditEvent<T extends object = any> = {
|
|
@@ -1573,6 +1779,45 @@ interface RowSelectEvent<T extends object = any> {
|
|
|
1573
1779
|
originalIndex: number;
|
|
1574
1780
|
}[];
|
|
1575
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
|
+
}
|
|
1576
1821
|
/** Emitted when the user clicks a data row. */
|
|
1577
1822
|
interface RowClickEvent<T extends object = any> {
|
|
1578
1823
|
/** Snapshot of the clicked row. */
|
|
@@ -1604,6 +1849,14 @@ interface RowUpdateEvent<T extends object = any> {
|
|
|
1604
1849
|
/** Zero-based index of the updated row in the data source. */
|
|
1605
1850
|
originalIndex: number;
|
|
1606
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
|
+
}
|
|
1607
1860
|
/**
|
|
1608
1861
|
* Emitted by `(rowReorder)` when the user finishes dragging a row to a new position.
|
|
1609
1862
|
* The grid does **not** reorder data itself — call `dataSource.moveRow(oldIndex, newIndex)`
|
|
@@ -1675,6 +1928,50 @@ interface NewRecord<T extends object = any> {
|
|
|
1675
1928
|
/** Exact data source containing the inserted row. */
|
|
1676
1929
|
datasource: AgridDataSource<T>;
|
|
1677
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
|
+
}
|
|
1678
1975
|
|
|
1679
1976
|
/** View state for the floating column header shown during a reorder drag. @internal */
|
|
1680
1977
|
interface AgridColumnDragPreview {
|
|
@@ -1731,17 +2028,26 @@ interface AgridColumnMenuValueItem {
|
|
|
1731
2028
|
/** Position and target field of the open column menu. @internal */
|
|
1732
2029
|
type AgridColumnMenuState = {
|
|
1733
2030
|
field: string;
|
|
2031
|
+
mode: 'column' | 'condition';
|
|
1734
2032
|
x: number;
|
|
1735
2033
|
y: number;
|
|
1736
2034
|
};
|
|
1737
2035
|
|
|
1738
|
-
/**
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
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;
|
|
1745
2051
|
}
|
|
1746
2052
|
|
|
1747
2053
|
/** Rectangular bounds in projected row and visible column coordinates. @internal */
|
|
@@ -1752,6 +2058,20 @@ type VisibleCellBounds = {
|
|
|
1752
2058
|
colEnd: number;
|
|
1753
2059
|
};
|
|
1754
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
|
+
|
|
1755
2075
|
/** Dependencies and callbacks required by {@link AgridDragHandler}. @internal */
|
|
1756
2076
|
interface AgridDragHandlerOptions {
|
|
1757
2077
|
dataSource: Signal<AgridDataSource>;
|
|
@@ -1880,23 +2200,25 @@ interface AgridSidebarDetailField {
|
|
|
1880
2200
|
* | Escape | Close any open menu or cancel edit |
|
|
1881
2201
|
* | Tab / Enter (while editing) | Commit and move according to navigation settings |
|
|
1882
2202
|
*/
|
|
1883
|
-
declare class AgridComponent<T extends object = any> {
|
|
2203
|
+
declare class AgridComponent<T extends object = any> implements OnChanges {
|
|
1884
2204
|
/** Grid provider containing columns, data source, control, and options. */
|
|
1885
2205
|
provider: _angular_core.InputSignal<AgridProvider<T>>;
|
|
2206
|
+
private restoredProvider?;
|
|
1886
2207
|
readonly rowHeight: Signal<number>;
|
|
1887
2208
|
readonly minHeight: Signal<string | undefined>;
|
|
1888
2209
|
readonly maxHeight: Signal<string | undefined>;
|
|
1889
2210
|
readonly allowAddRows: Signal<boolean>;
|
|
1890
2211
|
readonly autoAddRows: Signal<boolean>;
|
|
1891
2212
|
readonly enableRowMarking: Signal<boolean>;
|
|
2213
|
+
readonly enableColumnMarking: Signal<boolean>;
|
|
1892
2214
|
readonly showControlColumn: Signal<boolean>;
|
|
1893
|
-
readonly controlColumnWidth: Signal<
|
|
2215
|
+
readonly controlColumnWidth: Signal<24 | 48>;
|
|
1894
2216
|
readonly showSidebar: Signal<boolean>;
|
|
1895
2217
|
readonly autoOpenDetail: Signal<boolean>;
|
|
1896
2218
|
readonly serverSideFiltering: Signal<boolean>;
|
|
1897
2219
|
readonly filterDebounceMs: Signal<number>;
|
|
1898
2220
|
readonly enableQuickFilter: Signal<boolean>;
|
|
1899
|
-
readonly menuBarItems: Signal<AgridMenuBarItem<T>[]>;
|
|
2221
|
+
readonly menuBarItems: Signal<_thkl_agrid.AgridMenuBarItem<T>[]>;
|
|
1900
2222
|
readonly quickFilterValue: Signal<string>;
|
|
1901
2223
|
readonly sortOption: Signal<"single" | "multi" | "none">;
|
|
1902
2224
|
readonly rowSelection: Signal<"single" | "multi" | "none">;
|
|
@@ -1915,6 +2237,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1915
2237
|
readonly loading: Signal<boolean>;
|
|
1916
2238
|
readonly emptyText: Signal<string | undefined>;
|
|
1917
2239
|
readonly useSidebarEditor: Signal<boolean>;
|
|
2240
|
+
readonly hideGridStatusBar: Signal<boolean | undefined>;
|
|
1918
2241
|
/** Host callback for per-row CSS classes, or `undefined`. */
|
|
1919
2242
|
readonly rowClassFn: Signal<((params: {
|
|
1920
2243
|
row: Record<string, unknown>;
|
|
@@ -1934,6 +2257,10 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1934
2257
|
readonly masterDetail: Signal<boolean>;
|
|
1935
2258
|
/** Fixed detail-panel height in pixels. */
|
|
1936
2259
|
readonly detailRowHeight: Signal<number>;
|
|
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>[]>;
|
|
1937
2264
|
/** Read-only pivot rows and generated columns, or `null` in the normal datasource view. */
|
|
1938
2265
|
private readonly pivotResult;
|
|
1939
2266
|
/** Reactive row projection linked into a stable datasource instance for pivot mode. */
|
|
@@ -1954,6 +2281,8 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1954
2281
|
readonly localeText: Signal<AgridLocaleText>;
|
|
1955
2282
|
/** Effective empty-state label. */
|
|
1956
2283
|
readonly emptyTextLabel: Signal<string>;
|
|
2284
|
+
readonly gridId: Signal<string | undefined>;
|
|
2285
|
+
readonly enableExportButtons: Signal<boolean | undefined>;
|
|
1957
2286
|
/** Emitted after the user commits a cell edit. */
|
|
1958
2287
|
cellEdit: _angular_core.OutputEmitterRef<GridEditEvent<T>>;
|
|
1959
2288
|
/**
|
|
@@ -1969,6 +2298,14 @@ declare class AgridComponent<T extends object = any> {
|
|
|
1969
2298
|
rowReorder: _angular_core.OutputEmitterRef<RowReorderEvent<T>>;
|
|
1970
2299
|
/** Emitted when the row selection changes. `null` = selection cleared. */
|
|
1971
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>>;
|
|
1972
2309
|
rowDoubleClicked: _angular_core.OutputEmitterRef<RowClickEvent<T>>;
|
|
1973
2310
|
/** Emitted when the user single-clicks a data row. */
|
|
1974
2311
|
rowClick: _angular_core.OutputEmitterRef<RowClickEvent<T>>;
|
|
@@ -2005,10 +2342,10 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2005
2342
|
cellInfo: _angular_core.OutputEmitterRef<CellInfoEvent<T>>;
|
|
2006
2343
|
/** Emitted for every enabled menu-bar button or dropdown item, carrying its configured id. */
|
|
2007
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>>;
|
|
2008
2347
|
/** Currently focused cell, or `null`. */
|
|
2009
2348
|
readonly selectedCell: _angular_core.WritableSignal<CellPosition | null>;
|
|
2010
|
-
/** Original index of the row awaiting delete confirmation, or `null`. */
|
|
2011
|
-
readonly pendingDeleteRow: _angular_core.WritableSignal<number | null>;
|
|
2012
2349
|
/** Original indices of rows whose master/detail panel is currently expanded. */
|
|
2013
2350
|
private readonly _expandedDetailIds;
|
|
2014
2351
|
/**
|
|
@@ -2018,12 +2355,12 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2018
2355
|
*/
|
|
2019
2356
|
private readonly _pinnedRows;
|
|
2020
2357
|
private readonly markedIndices;
|
|
2358
|
+
private readonly markedFields;
|
|
2359
|
+
private firstDataRenderedEmitted;
|
|
2021
2360
|
/** Original datasource indices marked for inclusion in copy operations. */
|
|
2022
2361
|
readonly markedRowIndices: Signal<ReadonlySet<number>>;
|
|
2023
|
-
/**
|
|
2024
|
-
readonly
|
|
2025
|
-
/** Visible width available to the delete prompt. */
|
|
2026
|
-
readonly deleteConfirmationWidth: _angular_core.WritableSignal<number>;
|
|
2362
|
+
/** Fields currently marked as complete columns. */
|
|
2363
|
+
readonly markedColumnFields: Signal<ReadonlySet<string>>;
|
|
2027
2364
|
/** Rectangular cell range selected by Shift+arrow or Shift+click. */
|
|
2028
2365
|
readonly selectedRange: _angular_core.WritableSignal<CellRange | null>;
|
|
2029
2366
|
/** @internal Stable callback passed to child components for row-aware editability checks. */
|
|
@@ -2050,25 +2387,20 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2050
2387
|
loadSettings(settings: AgridSettings): void;
|
|
2051
2388
|
/** Emit when the active state is JSON-safe; custom function aggregates remain host-owned. */
|
|
2052
2389
|
private emitSettingsChange;
|
|
2390
|
+
ngOnChanges(): void;
|
|
2053
2391
|
/** @internal */
|
|
2054
2392
|
onSidebarDetailEdit(event: AgridSidebarEdit): void;
|
|
2055
2393
|
/** @internal Commit an edit made via the detail panel. */
|
|
2056
2394
|
commitDetailEdit(field: string, col: ColDef, stringValue: string): void;
|
|
2057
2395
|
onSidebarDetailSave(_event: AgridSidebarDetailField[]): void;
|
|
2058
|
-
/**
|
|
2059
|
-
* Download the currently visible, filtered rows as a CSV file.
|
|
2060
|
-
* Uses display values (ValueOption labels, formatters) and respects column visibility.
|
|
2061
|
-
* Group header rows are excluded — only data rows are exported.
|
|
2062
|
-
*
|
|
2063
|
-
* @param filename Output filename, defaults to `'export.csv'`.
|
|
2064
|
-
*/
|
|
2065
|
-
exportCsv(filename?: string): void;
|
|
2066
2396
|
/** @internal */ goToFirstPage(): void;
|
|
2067
2397
|
/** @internal */ goToLastPage(): void;
|
|
2068
2398
|
/** @internal */ goToNextPage(): void;
|
|
2069
2399
|
/** @internal */ goToPrevPage(): void;
|
|
2070
2400
|
/** Resize every visible column to fit its header and current row values. */
|
|
2071
2401
|
autosizeAllColumns(): void;
|
|
2402
|
+
/** return yes if we have saved config so a autosize from the client can be surpressed */
|
|
2403
|
+
hasSavedSizeConfig(): boolean;
|
|
2072
2404
|
/**
|
|
2073
2405
|
* Clears changed-cell markers after persistence succeeds.
|
|
2074
2406
|
* Omit `originalIndex` to clear every marker; omit `fields` to clear the whole row.
|
|
@@ -2076,6 +2408,12 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2076
2408
|
clearChangedCells(originalIndex?: number, fields?: readonly string[]): void;
|
|
2077
2409
|
/** @internal Whether a cell has an unsaved-change marker. */
|
|
2078
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;
|
|
2079
2417
|
/** @internal Full display value for a cell — used as the `title` tooltip attribute. */
|
|
2080
2418
|
getCellTitle(col: ColDef, value: unknown): string;
|
|
2081
2419
|
/** @internal Dynamic CSS class string for a cell from `ColDef.cellClass`. */
|
|
@@ -2111,6 +2449,31 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2111
2449
|
readonly pinnedHeaderGroupRuns: Signal<AgridHeaderGroupRun[]>;
|
|
2112
2450
|
readonly scrollableHeaderGroupRuns: Signal<AgridHeaderGroupRun[]>;
|
|
2113
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;
|
|
2114
2477
|
private readonly columnState;
|
|
2115
2478
|
private readonly projection;
|
|
2116
2479
|
private readonly editController;
|
|
@@ -2142,11 +2505,29 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2142
2505
|
readonly totalWidth: Signal<number>;
|
|
2143
2506
|
readonly pinnedPaneWidth: Signal<number>;
|
|
2144
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>;
|
|
2145
2521
|
/**
|
|
2146
2522
|
* Filtered, sorted, and optionally grouped row list for `*cdkVirtualFor`.
|
|
2147
2523
|
* Appends `null` when the explicit add-row placeholder is active.
|
|
2148
2524
|
*/
|
|
2149
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>[]>;
|
|
2150
2531
|
/** Virtual scroll source — injects ghost row during a reorder drag. */
|
|
2151
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. */
|
|
2152
2533
|
readonly dataRowIsOdd: Signal<Map<number, boolean>>;
|
|
@@ -2186,6 +2567,16 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2186
2567
|
private readonly browser;
|
|
2187
2568
|
private viewReady;
|
|
2188
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>;
|
|
2189
2580
|
private readonly columnSizing;
|
|
2190
2581
|
private readonly columnMenuController;
|
|
2191
2582
|
readonly filterMenu: _angular_core.WritableSignal<AgridColumnMenuState | null>;
|
|
@@ -2206,18 +2597,29 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2206
2597
|
readonly findQuery: _angular_core.WritableSignal<string>;
|
|
2207
2598
|
readonly findActiveIndex: _angular_core.WritableSignal<number>;
|
|
2208
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>;
|
|
2209
2605
|
private readonly navigationController;
|
|
2606
|
+
/** Maps logical covered columns to a rendered span anchor (or past it when moving right). */
|
|
2607
|
+
private resolveSpannedColumn;
|
|
2210
2608
|
private readonly rowController;
|
|
2211
2609
|
readonly selectedRowIndices: Signal<ReadonlySet<number>>;
|
|
2212
2610
|
readonly selectedRowIndex: Signal<number | null>;
|
|
2213
2611
|
readonly contextMenu: _angular_core.WritableSignal<AgridRowContextMenu | null>;
|
|
2214
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;
|
|
2215
2617
|
/** Id of the menu-bar button whose dropdown is open, or `null`. */
|
|
2216
2618
|
readonly openMenuBarItemId: _angular_core.WritableSignal<string | null>;
|
|
2217
2619
|
/** Runtime state passed to menu-bar visibility, active, and disabled resolvers. */
|
|
2218
|
-
readonly menuBarContext: Signal<AgridMenuBarContext<T>>;
|
|
2620
|
+
readonly menuBarContext: Signal<_thkl_agrid.AgridMenuBarContext<T>>;
|
|
2219
2621
|
/** Menu-bar buttons currently allowed by their visibility resolvers. */
|
|
2220
|
-
readonly visibleMenuBarItems: Signal<AgridMenuBarItem<T>[]>;
|
|
2622
|
+
readonly visibleMenuBarItems: Signal<(_thkl_agrid.AgridMenuBarItem<any> | _thkl_agrid.AgridMenuBarItem<T>)[]>;
|
|
2221
2623
|
private readonly sidebarController;
|
|
2222
2624
|
readonly sidebarOpen: _angular_core.WritableSignal<boolean>;
|
|
2223
2625
|
/** @internal Per-field sidebar validation messages. */
|
|
@@ -2233,6 +2635,8 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2233
2635
|
readonly columnDragPreview: _angular_core.WritableSignal<AgridColumnDragPreview | null>;
|
|
2234
2636
|
/** @internal Start a column header drag. */
|
|
2235
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;
|
|
2236
2640
|
/** @internal Start dragging all columns in one contiguous grouped-header segment. */
|
|
2237
2641
|
onHeaderGroupPointerDown(event: PointerEvent, fields: string[], label: string): void;
|
|
2238
2642
|
/** @internal Whether any field in a grouped-header segment is being dragged. */
|
|
@@ -2249,18 +2653,14 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2249
2653
|
private readonly _seededControls;
|
|
2250
2654
|
private readonly dirtyInlineRows;
|
|
2251
2655
|
private dirtyRowsDataSource;
|
|
2252
|
-
private readonly changedCells;
|
|
2253
2656
|
private changedCellsDataSource;
|
|
2254
2657
|
private emitEditEvents;
|
|
2255
2658
|
private emitSidebarEditEvents;
|
|
2256
2659
|
private emitRecordEdit;
|
|
2257
2660
|
private markInlineRowDirty;
|
|
2258
2661
|
private markCellChanged;
|
|
2259
|
-
private changedCellKey;
|
|
2260
|
-
private parseChangedCellKey;
|
|
2261
2662
|
private flushDirtyInlineRows;
|
|
2262
2663
|
private reconcileDirtyInlineRowsAfterRemoval;
|
|
2263
|
-
private reconcileChangedCellsAfterRemoval;
|
|
2264
2664
|
private emitRowChanged;
|
|
2265
2665
|
private createRecordEvent;
|
|
2266
2666
|
constructor();
|
|
@@ -2290,6 +2690,23 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2290
2690
|
rowPx(item: GridItem): number;
|
|
2291
2691
|
/** @internal Resolved HTML for an expanded detail panel (auto-sanitized by `[innerHTML]`). */
|
|
2292
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;
|
|
2293
2710
|
/** @internal Resolved per-row CSS classes from the host `getRowClass` callback. */
|
|
2294
2711
|
getRowClass(row: Record<string, unknown>, index: number): string;
|
|
2295
2712
|
/** Whether the master/detail panel for `originalIndex` is currently expanded. */
|
|
@@ -2428,6 +2845,10 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2428
2845
|
onStartEdit(originalIndex: number, ci: number): void;
|
|
2429
2846
|
/** @internal */
|
|
2430
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;
|
|
2431
2852
|
private quickFilterTimer;
|
|
2432
2853
|
/**
|
|
2433
2854
|
* @internal Quick-filter input handler. Stores the text on the control (drives the bound value
|
|
@@ -2461,12 +2882,24 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2461
2882
|
onHandlePointerDown(event: PointerEvent, originalIndex: number): void;
|
|
2462
2883
|
/** @internal Handles the control column without letting the row receive a second pointer event. */
|
|
2463
2884
|
onControlPointerDown(event: PointerEvent, originalIndex: number): void;
|
|
2464
|
-
/** @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. */
|
|
2465
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;
|
|
2466
2891
|
/** @internal Returns whether a row is marked for copying. */
|
|
2467
2892
|
isRowMarked(originalIndex: number): boolean;
|
|
2468
2893
|
/** Clear every row marked for clipboard inclusion. */
|
|
2469
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;
|
|
2470
2903
|
/** @internal Copy the active range or cell as TSV. */
|
|
2471
2904
|
onCopy(event: ClipboardEvent): void;
|
|
2472
2905
|
/** @internal Paste TSV/CSV-like plain text into the current cell. */
|
|
@@ -2487,28 +2920,12 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2487
2920
|
closeCellContextMenu(): void;
|
|
2488
2921
|
/** @internal Closes any row, cell, menu-bar, group-action, or column menu owned by this grid. */
|
|
2489
2922
|
closeOpenMenus(): boolean;
|
|
2490
|
-
/** @internal Resolves a menu-bar state callback against the current grid state. */
|
|
2491
|
-
resolveMenuBarState(state: AgridMenuBarState<T> | undefined, fallback: boolean): boolean;
|
|
2492
|
-
/** @internal Whether a menu-bar button or dropdown item should be rendered. */
|
|
2493
|
-
isMenuBarItemVisible(item: AgridMenuBarMenuItem<T>): boolean;
|
|
2494
|
-
/** @internal Whether a menu-bar button or dropdown item is active. */
|
|
2495
|
-
isMenuBarItemActive(item: AgridMenuBarMenuItem<T>): boolean;
|
|
2496
|
-
/** @internal Whether a menu-bar button or dropdown item is disabled. */
|
|
2497
|
-
isMenuBarItemDisabled(item: AgridMenuBarMenuItem<T>): boolean;
|
|
2498
|
-
/** @internal Visible dropdown entries for a menu-bar button. */
|
|
2499
|
-
visibleMenuBarChildren(item: AgridMenuBarItem<T>): AgridMenuBarMenuItem<T>[];
|
|
2500
|
-
/** @internal Emits one menu-bar action and closes its dropdown. */
|
|
2501
|
-
runMenuBarAction(event: Event, item: AgridMenuBarMenuItem<T>): void;
|
|
2502
|
-
/** @internal Opens or closes a split button's additional command menu. */
|
|
2503
|
-
toggleMenuBarMenu(event: Event, item: AgridMenuBarItem<T>): void;
|
|
2504
|
-
/** @internal Opens a dropdown from the keyboard and focuses its first/last enabled item. */
|
|
2505
|
-
onMenuBarTriggerKeydown(event: KeyboardEvent, item: AgridMenuBarItem<T>): void;
|
|
2506
|
-
/** @internal Provides standard keyboard navigation within an open menu-bar dropdown. */
|
|
2507
|
-
onMenuBarMenuKeydown(event: KeyboardEvent): void;
|
|
2508
2923
|
/** @internal Closes the currently open menu-bar dropdown. */
|
|
2509
2924
|
closeMenuBarMenu(): void;
|
|
2510
2925
|
/** @internal Synchronizes dropdown state and closes competing grid menus when one opens. */
|
|
2511
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;
|
|
2512
2929
|
/** @internal Runs a typed provider context-menu action against erased controller state. */
|
|
2513
2930
|
runCellMenuItem(item: CellContextMenuItem<T>, menu: AgridCellContextMenu): void;
|
|
2514
2931
|
/** @internal Copy one field from the target and marked rows. */
|
|
@@ -2525,8 +2942,6 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2525
2942
|
confirmPendingRowDelete(): void;
|
|
2526
2943
|
/** @internal Cancel the active row-delete confirmation. */
|
|
2527
2944
|
cancelRowDelete(): void;
|
|
2528
|
-
private deleteRowImmediately;
|
|
2529
|
-
private updateDeleteConfirmationPosition;
|
|
2530
2945
|
/** @internal */
|
|
2531
2946
|
onGroupHeaderClick(label: string): void;
|
|
2532
2947
|
/** Expand all groups. No-op when grouping is not active. */
|
|
@@ -2544,7 +2959,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2544
2959
|
/** @internal */
|
|
2545
2960
|
onTextFilterChange(event: Event, field: string): void;
|
|
2546
2961
|
/** @internal */
|
|
2547
|
-
openFilterMenu(event: MouseEvent, field: string): void;
|
|
2962
|
+
openFilterMenu(event: MouseEvent, field: string, mode?: 'column' | 'condition'): void;
|
|
2548
2963
|
/** @internal */
|
|
2549
2964
|
closeFilterMenu(): void;
|
|
2550
2965
|
/** @internal */
|
|
@@ -2572,6 +2987,8 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2572
2987
|
private ensureServerRowsVisible;
|
|
2573
2988
|
/** @internal Keeps the row-delete prompt visible while columns scroll horizontally. */
|
|
2574
2989
|
onHorizontalScroll(): void;
|
|
2990
|
+
/** @internal Refreshes the scroll offset / viewport width driving column virtualization. */
|
|
2991
|
+
private syncColumnViewportMetrics;
|
|
2575
2992
|
/** @internal */
|
|
2576
2993
|
onRightPinnedBodyScroll(): void;
|
|
2577
2994
|
/** @internal */
|
|
@@ -2606,7 +3023,7 @@ declare class AgridComponent<T extends object = any> {
|
|
|
2606
3023
|
getColumnWidth(col: ColDef): number;
|
|
2607
3024
|
private getColumnWidthToken;
|
|
2608
3025
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgridComponent<any>, never>;
|
|
2609
|
-
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"; "settingsChange": "settingsChange"; "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>;
|
|
2610
3027
|
}
|
|
2611
3028
|
|
|
2612
3029
|
/** Identifier supported by the standalone page selector. */
|
|
@@ -2708,6 +3125,7 @@ type StandaloneTreeItem<T extends object> = TreeRowItem<T> | PathTreeNodeItem;
|
|
|
2708
3125
|
/** Standalone accessible tree control backed by the same projection logic as `AgridComponent`. */
|
|
2709
3126
|
declare class AgridTreeComponent<T extends object = any> {
|
|
2710
3127
|
provider: _angular_core.InputSignal<AgridTreeProvider<T>>;
|
|
3128
|
+
localeText: _angular_core.InputSignal<AgridLocaleText>;
|
|
2711
3129
|
nodeClick: _angular_core.OutputEmitterRef<AgridTreeNodeEvent<T>>;
|
|
2712
3130
|
nodeDoubleClicked: _angular_core.OutputEmitterRef<AgridTreeNodeEvent<T>>;
|
|
2713
3131
|
selectionChange: _angular_core.OutputEmitterRef<AgridTreeSelectionEvent<T>>;
|
|
@@ -2747,9 +3165,281 @@ declare class AgridTreeComponent<T extends object = any> {
|
|
|
2747
3165
|
private focusNode;
|
|
2748
3166
|
private findParentIndex;
|
|
2749
3167
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgridTreeComponent<any>, never>;
|
|
2750
|
-
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>;
|
|
2751
3441
|
}
|
|
2752
3442
|
|
|
2753
|
-
export { AGRID_LOCALE_TEXT, AgridComponent, AgridControl, AgridDataSource, AgridPageSelectorComponent, AgridProvider, AgridServerSideRowModel, AgridTreeComponent, AgridTreeProvider, ColDefAutoSize };
|
|
2754
|
-
export type { AgridAggregate, AgridControlState, AgridEnterEditAction, AgridField, AgridLocaleKey, AgridLocaleText, AgridLocaleTextOverrides, AgridMenuBarContext, AgridMenuBarItem, AgridMenuBarMenuItem, AgridMenuBarState, AgridPageId, AgridPageItem, AgridParentTreeConfig, AgridPathSegmentParams, AgridPathTreeConfig, AgridPivotConfig, AgridPivotSettings, AgridProviderConfig, AgridServerSideDatasource, AgridServerSideRequest, AgridServerSideResult, AgridServerSideRowModelConfig, AgridServerSideSort, AgridSettings, AgridTreeConfig, AgridTreeNodeEvent, AgridTreeProviderConfig, AgridTreeSelectionEvent, AgridTreeSelectionMode, CellContextMenuItem, CellFormat, CellFormatParams, 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 };
|
|
2755
3445
|
//# sourceMappingURL=thkl-agrid.d.ts.map
|