infi-grid 1.0.0
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/CHANGELOG.md +141 -0
- package/README.md +654 -0
- package/fesm2022/infi-grid.mjs +10314 -0
- package/fesm2022/infi-grid.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/cell-editor.component.d.ts +42 -0
- package/lib/components/filter-popup.component.d.ts +89 -0
- package/lib/components/filter-row.component.d.ts +104 -0
- package/lib/components/grid.component.d.ts +155 -0
- package/lib/components/header-row.component.d.ts +76 -0
- package/lib/components/row.component.d.ts +106 -0
- package/lib/components/summary-row.component.d.ts +40 -0
- package/lib/components/tooltip-controller.d.ts +43 -0
- package/lib/components/viewport.component.d.ts +217 -0
- package/lib/core/accessor.d.ts +6 -0
- package/lib/core/config-resolver.d.ts +16 -0
- package/lib/core/defaults.d.ts +7 -0
- package/lib/core/filter-engine.d.ts +44 -0
- package/lib/core/format.d.ts +11 -0
- package/lib/core/keys.d.ts +24 -0
- package/lib/core/row-ops.d.ts +20 -0
- package/lib/core/sort-engine.d.ts +11 -0
- package/lib/core/summary-engine.d.ts +35 -0
- package/lib/core/template-registry.d.ts +27 -0
- package/lib/core/theme.d.ts +2 -0
- package/lib/core/tooltip-position.d.ts +24 -0
- package/lib/core/values.d.ts +21 -0
- package/lib/core/virtual-math.d.ts +57 -0
- package/lib/directives/grid-template-component.d.ts +16 -0
- package/lib/directives/outlet.directive.d.ts +25 -0
- package/lib/directives/template.directives.d.ts +98 -0
- package/lib/grid.module.d.ts +15 -0
- package/lib/models/api.types.d.ts +249 -0
- package/lib/models/column.types.d.ts +184 -0
- package/lib/models/config.types.d.ts +390 -0
- package/lib/models/crud.types.d.ts +179 -0
- package/lib/models/data.types.d.ts +41 -0
- package/lib/models/events.types.d.ts +98 -0
- package/lib/models/filter.types.d.ts +78 -0
- package/lib/models/index.d.ts +12 -0
- package/lib/models/selection.types.d.ts +173 -0
- package/lib/models/sort.types.d.ts +22 -0
- package/lib/models/summary.types.d.ts +78 -0
- package/lib/models/template.types.d.ts +126 -0
- package/lib/models/tooltip.types.d.ts +48 -0
- package/lib/state/filter-popup.service.d.ts +30 -0
- package/lib/state/grid-api.d.ts +4 -0
- package/lib/state/grid-store.d.ts +584 -0
- package/lib/state/tooltip.service.d.ts +38 -0
- package/package.json +41 -0
- package/public-api.d.ts +8 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import type { GridDataType } from '../models/column.types';
|
|
3
|
+
import type { GridHeaderTooltipContext, GridTooltipContext } from '../models/tooltip.types';
|
|
4
|
+
import type { GridCellContext, GridDeleteConfirmContext, GridEditContext, GridEmptyContext, GridErrorContext, GridHeaderContext, GridLoadingContext, GridSummaryCellContext } from '../models/template.types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Display-mode cell template.
|
|
8
|
+
* `<ng-template infiGridCell="price" let-value let-row="row">…</ng-template>` targets one column;
|
|
9
|
+
* `<ng-template infiGridCell type="date" let-value>…</ng-template>` targets every date column.
|
|
10
|
+
*/
|
|
11
|
+
export declare class GridCellTemplateDirective<TRow = any, TValue = any> {
|
|
12
|
+
readonly templateRef: TemplateRef<GridCellContext<TRow, TValue>>;
|
|
13
|
+
/** Column field. Leave empty and set `type` to target a data type. */
|
|
14
|
+
readonly field: import("@angular/core").InputSignal<string | undefined>;
|
|
15
|
+
readonly type: import("@angular/core").InputSignal<GridDataType | undefined>;
|
|
16
|
+
static ngTemplateContextGuard<TRow, TValue>(_dir: GridCellTemplateDirective<TRow, TValue>, ctx: unknown): ctx is GridCellContext<TRow, TValue>;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridCellTemplateDirective<any, any>, never>;
|
|
18
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridCellTemplateDirective<any, any>, "ng-template[infiGridCell]", never, { "field": { "alias": "infiGridCell"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
20
|
+
/** Edit-mode cell template: `infiGridEdit="field"` or `infiGridEdit type="number"`. */
|
|
21
|
+
export declare class GridEditTemplateDirective<TRow = any, TValue = any> {
|
|
22
|
+
readonly templateRef: TemplateRef<GridEditContext<TRow, TValue>>;
|
|
23
|
+
readonly field: import("@angular/core").InputSignal<string | undefined>;
|
|
24
|
+
readonly type: import("@angular/core").InputSignal<GridDataType | undefined>;
|
|
25
|
+
static ngTemplateContextGuard<TRow, TValue>(_dir: GridEditTemplateDirective<TRow, TValue>, ctx: unknown): ctx is GridEditContext<TRow, TValue>;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridEditTemplateDirective<any, any>, never>;
|
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridEditTemplateDirective<any, any>, "ng-template[infiGridEdit]", never, { "field": { "alias": "infiGridEdit"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
29
|
+
/** Header template: `infiGridHeader="field"`, or without a field for every column. */
|
|
30
|
+
export declare class GridHeaderTemplateDirective<TRow = any> {
|
|
31
|
+
readonly templateRef: TemplateRef<GridHeaderContext<TRow>>;
|
|
32
|
+
readonly field: import("@angular/core").InputSignal<string | undefined>;
|
|
33
|
+
readonly type: import("@angular/core").InputSignal<GridDataType | undefined>;
|
|
34
|
+
static ngTemplateContextGuard<TRow>(_dir: GridHeaderTemplateDirective<TRow>, ctx: unknown): ctx is GridHeaderContext<TRow>;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridHeaderTemplateDirective<any>, never>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridHeaderTemplateDirective<any>, "ng-template[infiGridHeader]", never, { "field": { "alias": "infiGridHeader"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
/** Summary cell template: `infiGridSummary="field"`, or without a field for every column. */
|
|
39
|
+
export declare class GridSummaryTemplateDirective<TRow = any> {
|
|
40
|
+
readonly templateRef: TemplateRef<GridSummaryCellContext<TRow>>;
|
|
41
|
+
readonly field: import("@angular/core").InputSignal<string | undefined>;
|
|
42
|
+
readonly type: import("@angular/core").InputSignal<GridDataType | undefined>;
|
|
43
|
+
static ngTemplateContextGuard<TRow>(_dir: GridSummaryTemplateDirective<TRow>, ctx: unknown): ctx is GridSummaryCellContext<TRow>;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridSummaryTemplateDirective<any>, never>;
|
|
45
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridSummaryTemplateDirective<any>, "ng-template[infiGridSummary]", never, { "field": { "alias": "infiGridSummary"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
46
|
+
}
|
|
47
|
+
/** Loading template: `<ng-template infiGridLoading>…</ng-template>`. */
|
|
48
|
+
export declare class GridLoadingTemplateDirective<TRow = any> {
|
|
49
|
+
readonly templateRef: TemplateRef<GridLoadingContext<TRow>>;
|
|
50
|
+
static ngTemplateContextGuard<TRow>(_dir: GridLoadingTemplateDirective<TRow>, ctx: unknown): ctx is GridLoadingContext<TRow>;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridLoadingTemplateDirective<any>, never>;
|
|
52
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridLoadingTemplateDirective<any>, "ng-template[infiGridLoading]", never, {}, {}, never, never, true, never>;
|
|
53
|
+
}
|
|
54
|
+
/** Empty-data ("No Data Found") template: `<ng-template infiGridEmpty let-reason>…</ng-template>`. */
|
|
55
|
+
export declare class GridEmptyTemplateDirective<TRow = any> {
|
|
56
|
+
readonly templateRef: TemplateRef<GridEmptyContext<TRow>>;
|
|
57
|
+
static ngTemplateContextGuard<TRow>(_dir: GridEmptyTemplateDirective<TRow>, ctx: unknown): ctx is GridEmptyContext<TRow>;
|
|
58
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridEmptyTemplateDirective<any>, never>;
|
|
59
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridEmptyTemplateDirective<any>, "ng-template[infiGridEmpty]", never, {}, {}, never, never, true, never>;
|
|
60
|
+
}
|
|
61
|
+
/** Error template: `<ng-template infiGridError let-error>…</ng-template>`. */
|
|
62
|
+
export declare class GridErrorTemplateDirective<TRow = any> {
|
|
63
|
+
readonly templateRef: TemplateRef<GridErrorContext<TRow>>;
|
|
64
|
+
static ngTemplateContextGuard<TRow>(_dir: GridErrorTemplateDirective<TRow>, ctx: unknown): ctx is GridErrorContext<TRow>;
|
|
65
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridErrorTemplateDirective<any>, never>;
|
|
66
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridErrorTemplateDirective<any>, "ng-template[infiGridError]", never, {}, {}, never, never, true, never>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete confirmation, replacing the built-in dialog:
|
|
70
|
+
* `<ng-template infiGridDeleteConfirm let-count="count" let-confirm="confirm" let-cancel="cancel">…</ng-template>`.
|
|
71
|
+
*/
|
|
72
|
+
export declare class GridDeleteConfirmTemplateDirective<TRow = any> {
|
|
73
|
+
readonly templateRef: TemplateRef<GridDeleteConfirmContext<TRow>>;
|
|
74
|
+
static ngTemplateContextGuard<TRow>(_dir: GridDeleteConfirmTemplateDirective<TRow>, ctx: unknown): ctx is GridDeleteConfirmContext<TRow>;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridDeleteConfirmTemplateDirective<any>, never>;
|
|
76
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridDeleteConfirmTemplateDirective<any>, "ng-template[infiGridDeleteConfirm]", never, {}, {}, never, never, true, never>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Cell tooltip template: `<ng-template infiGridCellTooltip="price" let-value let-row="row">…</ng-template>`
|
|
80
|
+
* for one column, `type="date"` for a data type, or no field for every column.
|
|
81
|
+
*/
|
|
82
|
+
export declare class GridCellTooltipTemplateDirective<TRow = any, TValue = any> {
|
|
83
|
+
readonly templateRef: TemplateRef<GridTooltipContext<TRow, TValue>>;
|
|
84
|
+
readonly field: import("@angular/core").InputSignal<string | undefined>;
|
|
85
|
+
readonly type: import("@angular/core").InputSignal<GridDataType | undefined>;
|
|
86
|
+
static ngTemplateContextGuard<TRow, TValue>(_dir: GridCellTooltipTemplateDirective<TRow, TValue>, ctx: unknown): ctx is GridTooltipContext<TRow, TValue>;
|
|
87
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridCellTooltipTemplateDirective<any, any>, never>;
|
|
88
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridCellTooltipTemplateDirective<any, any>, "ng-template[infiGridCellTooltip]", never, { "field": { "alias": "infiGridCellTooltip"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
89
|
+
}
|
|
90
|
+
/** Header tooltip template: `<ng-template infiGridHeaderTooltip="price" let-column let-description="description">…</ng-template>`. */
|
|
91
|
+
export declare class GridHeaderTooltipTemplateDirective<TRow = any> {
|
|
92
|
+
readonly templateRef: TemplateRef<GridHeaderTooltipContext<TRow>>;
|
|
93
|
+
readonly field: import("@angular/core").InputSignal<string | undefined>;
|
|
94
|
+
readonly type: import("@angular/core").InputSignal<GridDataType | undefined>;
|
|
95
|
+
static ngTemplateContextGuard<TRow>(_dir: GridHeaderTooltipTemplateDirective<TRow>, ctx: unknown): ctx is GridHeaderTooltipContext<TRow>;
|
|
96
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridHeaderTooltipTemplateDirective<any>, never>;
|
|
97
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridHeaderTooltipTemplateDirective<any>, "ng-template[infiGridHeaderTooltip]", never, { "field": { "alias": "infiGridHeaderTooltip"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
98
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InfiGridComponent } from './components/grid.component';
|
|
2
|
+
import { GridTemplateComponent } from './directives/grid-template-component';
|
|
3
|
+
import { GridCellTemplateDirective, GridCellTooltipTemplateDirective, GridDeleteConfirmTemplateDirective, GridEditTemplateDirective, GridEmptyTemplateDirective, GridErrorTemplateDirective, GridHeaderTemplateDirective, GridHeaderTooltipTemplateDirective, GridLoadingTemplateDirective, GridSummaryTemplateDirective } from './directives/template.directives';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "./components/grid.component";
|
|
6
|
+
import * as i2 from "./directives/template.directives";
|
|
7
|
+
/** Everything needed in a template: `imports: [INFI_GRID]` in a standalone component. */
|
|
8
|
+
export declare const INFI_GRID: readonly [typeof InfiGridComponent, typeof GridCellTemplateDirective, typeof GridEditTemplateDirective, typeof GridHeaderTemplateDirective, typeof GridSummaryTemplateDirective, typeof GridLoadingTemplateDirective, typeof GridEmptyTemplateDirective, typeof GridErrorTemplateDirective, typeof GridDeleteConfirmTemplateDirective, typeof GridCellTooltipTemplateDirective, typeof GridHeaderTooltipTemplateDirective];
|
|
9
|
+
/** For NgModule-based applications: `imports: [InfiGridModule]`. */
|
|
10
|
+
export declare class InfiGridModule {
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InfiGridModule, never>;
|
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<InfiGridModule, never, [typeof i1.InfiGridComponent, typeof i2.GridCellTemplateDirective, typeof i2.GridEditTemplateDirective, typeof i2.GridHeaderTemplateDirective, typeof i2.GridSummaryTemplateDirective, typeof i2.GridLoadingTemplateDirective, typeof i2.GridEmptyTemplateDirective, typeof i2.GridErrorTemplateDirective, typeof i2.GridDeleteConfirmTemplateDirective, typeof i2.GridCellTooltipTemplateDirective, typeof i2.GridHeaderTooltipTemplateDirective], [typeof i1.InfiGridComponent, typeof i2.GridCellTemplateDirective, typeof i2.GridEditTemplateDirective, typeof i2.GridHeaderTemplateDirective, typeof i2.GridSummaryTemplateDirective, typeof i2.GridLoadingTemplateDirective, typeof i2.GridEmptyTemplateDirective, typeof i2.GridErrorTemplateDirective, typeof i2.GridDeleteConfirmTemplateDirective, typeof i2.GridCellTooltipTemplateDirective, typeof i2.GridHeaderTooltipTemplateDirective]>;
|
|
13
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<InfiGridModule>;
|
|
14
|
+
}
|
|
15
|
+
export { GridTemplateComponent };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import type { ColumnConfig, ResolvedColumn } from './column.types';
|
|
2
|
+
import type { GridAddRowOptions, GridBeginAddRowOptions, GridChangeSet, GridCrudResult, GridSaveResult } from './crud.types';
|
|
3
|
+
import type { GridRefreshOptions, GridRefreshResult, GridRowKey } from './data.types';
|
|
4
|
+
import type { GridSelectAllOptions, GridSelectCellOptions, GridSelectOptions, GridSelectedCell } from './selection.types';
|
|
5
|
+
import type { ResolvedGridConfig } from './config.types';
|
|
6
|
+
import type { ColumnFilterModel, FilterCondition, FilterModel } from './filter.types';
|
|
7
|
+
import type { SortDirection, SortModelItem } from './sort.types';
|
|
8
|
+
import type { GridSummaryResult, ResolvedColumnSummary } from './summary.types';
|
|
9
|
+
/** Snapshot of what the virtualization engine is rendering. */
|
|
10
|
+
export interface VirtualizationState {
|
|
11
|
+
rowVirtualization: boolean;
|
|
12
|
+
columnVirtualization: boolean;
|
|
13
|
+
/** Rows after filtering. */
|
|
14
|
+
totalRows: number;
|
|
15
|
+
/** Displayed (non-hidden) columns. */
|
|
16
|
+
totalColumns: number;
|
|
17
|
+
/** Rows currently in the viewport: `[firstVisibleRow, lastVisibleRow]`, -1 when there are none. */
|
|
18
|
+
firstVisibleRow: number;
|
|
19
|
+
lastVisibleRow: number;
|
|
20
|
+
/** Rows in the DOM including the buffer: `[firstRenderedRow, lastRenderedRow]`. */
|
|
21
|
+
firstRenderedRow: number;
|
|
22
|
+
lastRenderedRow: number;
|
|
23
|
+
firstVisibleColumn: number;
|
|
24
|
+
lastVisibleColumn: number;
|
|
25
|
+
firstRenderedColumn: number;
|
|
26
|
+
lastRenderedColumn: number;
|
|
27
|
+
renderedRowCount: number;
|
|
28
|
+
renderedColumnCount: number;
|
|
29
|
+
/** Cells in the DOM (rendered rows × rendered columns). */
|
|
30
|
+
renderedCellCount: number;
|
|
31
|
+
scrollTop: number;
|
|
32
|
+
scrollLeft: number;
|
|
33
|
+
viewportWidth: number;
|
|
34
|
+
viewportHeight: number;
|
|
35
|
+
rowHeight: number;
|
|
36
|
+
/** Full height of all rows in px. */
|
|
37
|
+
totalHeight: number;
|
|
38
|
+
totalWidth: number;
|
|
39
|
+
/** > 1 when the row count exceeds the browser's maximum element height and scrolling is scaled. */
|
|
40
|
+
scrollScale: number;
|
|
41
|
+
}
|
|
42
|
+
/** Current edit session. */
|
|
43
|
+
export interface GridEditState<TRow = any> {
|
|
44
|
+
row: TRow;
|
|
45
|
+
/** View index of the row (-1 for the inline add row). */
|
|
46
|
+
rowIndex: number;
|
|
47
|
+
/** True for the inline add row (`beginAddRow()`): the row isn't in the data yet. */
|
|
48
|
+
isNew: boolean;
|
|
49
|
+
/** Fields being edited (one field in cell mode, every editable field in row mode). */
|
|
50
|
+
fields: readonly string[];
|
|
51
|
+
mode: 'cell' | 'row';
|
|
52
|
+
/** Values typed so far, by field. */
|
|
53
|
+
values: Readonly<Record<string, unknown>>;
|
|
54
|
+
errors: Readonly<Record<string, string | null>>;
|
|
55
|
+
}
|
|
56
|
+
/** Layout of one displayed column. */
|
|
57
|
+
export interface GridColumnState {
|
|
58
|
+
field: string;
|
|
59
|
+
width: number;
|
|
60
|
+
left: number;
|
|
61
|
+
index: number;
|
|
62
|
+
hidden: boolean;
|
|
63
|
+
sort: SortDirection | null;
|
|
64
|
+
sortIndex: number | null;
|
|
65
|
+
filterActive: boolean;
|
|
66
|
+
}
|
|
67
|
+
export type GridScrollPosition = 'auto' | 'start' | 'center' | 'end';
|
|
68
|
+
/**
|
|
69
|
+
* Grid reference/API. Get it from `(gridReady)`, or from the component instance (`grid.api`).
|
|
70
|
+
* Row indexes refer to the current (sorted and filtered) view unless stated otherwise.
|
|
71
|
+
*/
|
|
72
|
+
export interface GridApi<TRow = any> {
|
|
73
|
+
/** Configuration with every default filled in. */
|
|
74
|
+
getConfig(): ResolvedGridConfig<TRow>;
|
|
75
|
+
/** All column definitions (including hidden columns). */
|
|
76
|
+
getColumns(): readonly ResolvedColumn<TRow>[];
|
|
77
|
+
getColumn(field: string): ResolvedColumn<TRow> | undefined;
|
|
78
|
+
/** Non-hidden columns in display order. */
|
|
79
|
+
getDisplayedColumns(): readonly ResolvedColumn<TRow>[];
|
|
80
|
+
/** Columns currently inside the horizontal viewport. */
|
|
81
|
+
getVisibleColumns(): readonly ResolvedColumn<TRow>[];
|
|
82
|
+
/** Width, position, sort and filter state of each displayed column. */
|
|
83
|
+
getColumnState(): readonly GridColumnState[];
|
|
84
|
+
getColumnWidth(field: string): number | undefined;
|
|
85
|
+
/** The complete data array. */
|
|
86
|
+
getData(): readonly TRow[];
|
|
87
|
+
/** Rows after filtering and sorting, in display order. */
|
|
88
|
+
getDisplayedRows(): readonly TRow[];
|
|
89
|
+
/** Rows currently inside the vertical viewport. */
|
|
90
|
+
getVisibleRows(): readonly TRow[];
|
|
91
|
+
/** Row at a view index. */
|
|
92
|
+
getRow(rowIndex: number): TRow | undefined;
|
|
93
|
+
/** The key of a row (its `primaryKey` value, or the row itself without a primary key). */
|
|
94
|
+
getRowKey(row: TRow): GridRowKey;
|
|
95
|
+
/** The row with this key, if it is in the data. Works for rows that are filtered out or not rendered. */
|
|
96
|
+
getRowByKey(key: GridRowKey): TRow | undefined;
|
|
97
|
+
/** Current view index of the row with this key, or -1 when it isn't displayed. */
|
|
98
|
+
getRowIndexByKey(key: GridRowKey): number;
|
|
99
|
+
getFilterModel(): FilterModel;
|
|
100
|
+
getSortModel(): readonly SortModelItem[];
|
|
101
|
+
/** Summary configuration of the grid and of every column. */
|
|
102
|
+
getSummaryConfig(): {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
sticky: boolean;
|
|
105
|
+
scope: 'filtered' | 'all';
|
|
106
|
+
columns: Readonly<Record<string, ResolvedColumnSummary<TRow>>>;
|
|
107
|
+
};
|
|
108
|
+
/** Calculated summaries by field. */
|
|
109
|
+
getSummaryValues(): Readonly<Record<string, GridSummaryResult>>;
|
|
110
|
+
getVirtualizationState(): VirtualizationState;
|
|
111
|
+
getEditState(): GridEditState<TRow> | null;
|
|
112
|
+
/**
|
|
113
|
+
* Filter one column. Accepts a full column model, a single condition, or `null` to remove the filter.
|
|
114
|
+
* Merges with the filters of other columns.
|
|
115
|
+
*/
|
|
116
|
+
applyFilter(field: string, filter: ColumnFilterModel | FilterCondition | null): void;
|
|
117
|
+
/** Replace the whole filter model. */
|
|
118
|
+
setFilterModel(model: FilterModel): void;
|
|
119
|
+
/** Remove the filter of one column, or of every column when no field is given. */
|
|
120
|
+
clearFilter(field?: string): void;
|
|
121
|
+
/** Remove every column's filter (same as `clearFilter()`). */
|
|
122
|
+
clearAllFilters(): void;
|
|
123
|
+
/** Whether a column (or, without a field, any column) is filtered. */
|
|
124
|
+
isFiltered(field?: string): boolean;
|
|
125
|
+
/** Rows left after filtering. */
|
|
126
|
+
getDisplayedRowCount(): number;
|
|
127
|
+
/** Open the filter popup of a column. */
|
|
128
|
+
openFilter(field: string): void;
|
|
129
|
+
closeFilter(): void;
|
|
130
|
+
/**
|
|
131
|
+
* Sort by one column (`applySort('price', 'desc')`), or set the whole sort model (`applySort([...])`).
|
|
132
|
+
* Pass `{ multi: true }` to add the column to the existing sort instead of replacing it.
|
|
133
|
+
*/
|
|
134
|
+
applySort(field: string, direction?: SortDirection, options?: {
|
|
135
|
+
multi?: boolean;
|
|
136
|
+
}): void;
|
|
137
|
+
applySort(model: readonly SortModelItem[]): void;
|
|
138
|
+
/** Remove the sort of one column, or all sorting when no field is given. */
|
|
139
|
+
clearSort(field?: string): void;
|
|
140
|
+
/** Replace the data array. Same as binding a new `[data]` array; `options` override `config.dataRefresh`. */
|
|
141
|
+
setData(data: readonly TRow[], options?: GridRefreshOptions): GridRefreshResult;
|
|
142
|
+
/** Replace the data array (1.0 name of `setData`). */
|
|
143
|
+
updateData(data: readonly TRow[], options?: GridRefreshOptions): GridRefreshResult;
|
|
144
|
+
/**
|
|
145
|
+
* Re-read the current data after changing it in place (push, splice, edited objects): re-sorts,
|
|
146
|
+
* re-filters, rebuilds the key index, recalculates summaries and reconciles the selection.
|
|
147
|
+
*/
|
|
148
|
+
refreshData(options?: GridRefreshOptions): GridRefreshResult;
|
|
149
|
+
/** Same as `refreshData()` (1.0 name). */
|
|
150
|
+
refresh(): void;
|
|
151
|
+
/** Set one cell value; only that row re-renders and only affected summaries recalculate. */
|
|
152
|
+
updateCell(rowIndex: number, field: string, value: unknown): void;
|
|
153
|
+
/** Re-render the given rows after you changed their objects in place. */
|
|
154
|
+
refreshRows(rows: readonly TRow[]): void;
|
|
155
|
+
/**
|
|
156
|
+
* Put a cell (field given) or a whole row (no field) into edit mode.
|
|
157
|
+
* Returns false when nothing there is editable.
|
|
158
|
+
*/
|
|
159
|
+
enterEditMode(rowIndex: number, field?: string): boolean;
|
|
160
|
+
/** Leave edit mode, saving (default) or discarding the edited values. Returns false if validation failed. */
|
|
161
|
+
exitEditMode(options?: {
|
|
162
|
+
commit?: boolean;
|
|
163
|
+
}): boolean;
|
|
164
|
+
isEditing(): boolean;
|
|
165
|
+
/** Switch every editable cell between display mode and edit mode. */
|
|
166
|
+
setGridEditMode(enabled: boolean): void;
|
|
167
|
+
isGridEditMode(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Add a row. The object becomes the row (with `editing.newRow`, the initializer's object does, with these
|
|
170
|
+
* values applied); column `defaultValue`s fill missing fields. Validates `required`, column validators,
|
|
171
|
+
* `editing.rowValidator` and the primary key (present and unique), then emits `rowAdding` (cancelable),
|
|
172
|
+
* `rowAdded` and `dataChange`. The new row stays visible until the filter changes, even if the filter would hide it.
|
|
173
|
+
*/
|
|
174
|
+
addRow(row: Partial<TRow>, options?: GridAddRowOptions): GridCrudResult<TRow>;
|
|
175
|
+
/** Open the inline add row (editors for new values; Enter or ✓ adds it, Escape or ✕ discards it). */
|
|
176
|
+
beginAddRow(options?: GridBeginAddRowOptions<TRow>): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Change fields of a row in place (by field or dot path). Validates like an edit, refuses key changes, then
|
|
179
|
+
* emits `rowUpdating` (cancelable), `cellValueChange` per field and `rowUpdated`. Only that row re-renders.
|
|
180
|
+
*/
|
|
181
|
+
updateRow(key: GridRowKey, changes: Partial<TRow> | Readonly<Record<string, unknown>>): GridCrudResult<TRow>;
|
|
182
|
+
/** Delete a row now (no confirmation). Emits `rowDeleting` (cancelable), `rowDeleted` and `dataChange`. */
|
|
183
|
+
deleteRow(key: GridRowKey): GridCrudResult<TRow>;
|
|
184
|
+
/** Delete several rows in one operation (no confirmation). */
|
|
185
|
+
deleteRows(keys: readonly GridRowKey[]): GridCrudResult<TRow>;
|
|
186
|
+
/** Delete rows after the configured confirmation (`editing.confirmDelete`). */
|
|
187
|
+
requestDeleteRows(keys: readonly GridRowKey[]): Promise<GridCrudResult<TRow>>;
|
|
188
|
+
/** Delete the selected rows after the configured confirmation. */
|
|
189
|
+
deleteSelectedRows(): Promise<GridCrudResult<TRow>>;
|
|
190
|
+
/** The pending adds, updates and deletes (empty outside batch mode). */
|
|
191
|
+
getPendingChanges(): GridChangeSet<TRow>;
|
|
192
|
+
hasPendingChanges(): boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Commits an open edit, passes the changes to `handler` (default `editing.saveHandler`) and, when it
|
|
195
|
+
* succeeds, applies them to the data (`changesSaved`, `dataChange`). When it throws or rejects, nothing
|
|
196
|
+
* is applied and the changes stay pending (`changesSaveFailed`). The promise never rejects.
|
|
197
|
+
*/
|
|
198
|
+
saveChanges(handler?: (changes: GridChangeSet<TRow>) => unknown): Promise<GridSaveResult<TRow>>;
|
|
199
|
+
/** Discards every pending change (`changesCancelled`). Returns what was discarded. */
|
|
200
|
+
cancelChanges(): GridChangeSet<TRow>;
|
|
201
|
+
/** Undo the last pending change. False when there is nothing to undo (or an edit is open). */
|
|
202
|
+
undo(): boolean;
|
|
203
|
+
redo(): boolean;
|
|
204
|
+
canUndo(): boolean;
|
|
205
|
+
canRedo(): boolean;
|
|
206
|
+
/** Select a row by key. In single mode it replaces the selection. False when missing, not selectable or already selected. */
|
|
207
|
+
selectRowByKey(key: GridRowKey, options?: GridSelectOptions): boolean;
|
|
208
|
+
deselectRowByKey(key: GridRowKey): boolean;
|
|
209
|
+
/** Select rows by key (added to the selection; single mode keeps the last). Returns how many were newly selected. */
|
|
210
|
+
selectRowsByKeys(keys: readonly GridRowKey[], options?: GridSelectOptions): number;
|
|
211
|
+
/** Returns how many were deselected. */
|
|
212
|
+
deselectRowsByKeys(keys: readonly GridRowKey[]): number;
|
|
213
|
+
/** Toggle a row's selection. Returns true when it is selected afterwards. */
|
|
214
|
+
toggleRowSelection(key: GridRowKey): boolean;
|
|
215
|
+
/** Select every row in scope (default `selection.selectAllScope`; multiple mode). Returns how many were newly selected. */
|
|
216
|
+
selectAll(options?: GridSelectAllOptions): number;
|
|
217
|
+
/** Deselect the rows in scope (default: every selected row). Returns how many were deselected. */
|
|
218
|
+
deselectAll(options?: GridSelectAllOptions): number;
|
|
219
|
+
/** Deselect everything. */
|
|
220
|
+
clearSelection(): void;
|
|
221
|
+
/** Selected rows in selection order (also rows that are filtered out or not rendered). */
|
|
222
|
+
getSelectedRows(): TRow[];
|
|
223
|
+
getSelectedKeys(): GridRowKey[];
|
|
224
|
+
isRowSelected(key: GridRowKey): boolean;
|
|
225
|
+
/** The selected cell, or null (also while cell selection is off). */
|
|
226
|
+
getSelectedCell(): GridSelectedCell<TRow> | null;
|
|
227
|
+
/**
|
|
228
|
+
* Select a cell by row key and field (emits `cellSelectionChange`). False when cell selection is off, the row or the
|
|
229
|
+
* column isn't displayed, or the cell is already selected.
|
|
230
|
+
*/
|
|
231
|
+
selectCell(key: GridRowKey, field: string, options?: GridSelectCellOptions): boolean;
|
|
232
|
+
/** Clear the selected cell (emits `cellSelectionChange` when one was selected). */
|
|
233
|
+
clearCellSelection(): void;
|
|
234
|
+
/** Recalculate summaries (all, or the given fields). */
|
|
235
|
+
recalculateSummary(fields?: string | readonly string[]): void;
|
|
236
|
+
scrollToRow(rowIndex: number, position?: GridScrollPosition): void;
|
|
237
|
+
/** Scroll the row with this key into view. Returns false when it isn't displayed. */
|
|
238
|
+
scrollToRowByKey(key: GridRowKey, position?: GridScrollPosition): boolean;
|
|
239
|
+
scrollToColumn(field: string | number, position?: GridScrollPosition): void;
|
|
240
|
+
setColumns(columns: readonly ColumnConfig<TRow>[]): void;
|
|
241
|
+
setColumnWidth(field: string, width: number): void;
|
|
242
|
+
/** Restore the configured width of a column, or of every resized column when no field is given. */
|
|
243
|
+
resetColumnWidth(field?: string): void;
|
|
244
|
+
setColumnVisible(field: string, visible: boolean): void;
|
|
245
|
+
setLoading(loading: boolean): void;
|
|
246
|
+
isLoading(): boolean;
|
|
247
|
+
setError(error: unknown): void;
|
|
248
|
+
getError(): unknown;
|
|
249
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { ColumnFilterConfig, FilterIconVisibility, ResolvedColumnFilter } from './filter.types';
|
|
2
|
+
import type { ColumnSortConfig, SortIconVisibility } from './sort.types';
|
|
3
|
+
import type { ColumnSummaryConfig, GridSummaryType, ResolvedColumnSummary } from './summary.types';
|
|
4
|
+
import type { GridCellContext, GridEditContext, GridHeaderContext, GridSummaryCellContext, GridTemplate } from './template.types';
|
|
5
|
+
import type { GridHeaderTooltipContext, GridTooltipContext, GridTooltipMode } from './tooltip.types';
|
|
6
|
+
/** Data types understood by the grid. The type drives formatting, sorting, filtering, editors and summaries. */
|
|
7
|
+
export type GridDataType = 'text' | 'number' | 'date' | 'boolean';
|
|
8
|
+
export type GridCellAlign = 'left' | 'center' | 'right';
|
|
9
|
+
/** Built-in editors. `select` is a dropdown; `date` is a date picker. */
|
|
10
|
+
export type GridEditorType = 'text' | 'number' | 'select' | 'checkbox' | 'date';
|
|
11
|
+
export interface GridSelectOption<TValue = unknown> {
|
|
12
|
+
label: string;
|
|
13
|
+
value: TValue;
|
|
14
|
+
}
|
|
15
|
+
/** Options passed to the built-in editors (and available to custom edit templates). */
|
|
16
|
+
export interface GridEditorOptions<TRow = any> {
|
|
17
|
+
/** Options for the `select` editor. Can be computed per row. */
|
|
18
|
+
options?: readonly GridSelectOption[] | ((row: TRow) => readonly GridSelectOption[]);
|
|
19
|
+
/** `number` editor limits. */
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
step?: number;
|
|
23
|
+
/** `text`/`number` editor placeholder. */
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** `text` editor max length. */
|
|
26
|
+
maxLength?: number;
|
|
27
|
+
}
|
|
28
|
+
export type GridClassValue = string | readonly string[] | null | undefined;
|
|
29
|
+
export type GridStyleValue = Readonly<Record<string, string | number | null | undefined>>;
|
|
30
|
+
/** Argument passed to `cellClass` / `cellStyle` functions. */
|
|
31
|
+
export interface GridCellStyleContext<TRow = any, TValue = any> {
|
|
32
|
+
row: TRow;
|
|
33
|
+
value: TValue;
|
|
34
|
+
rowIndex: number;
|
|
35
|
+
field: string;
|
|
36
|
+
column: ResolvedColumn<TRow>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Configuration for one column. Columns are passed to the grid as an array.
|
|
40
|
+
* Every behavior flag here overrides the matching global flag in `GridConfig`.
|
|
41
|
+
*/
|
|
42
|
+
export interface ColumnConfig<TRow = any, TValue = any> {
|
|
43
|
+
/** Property name or dot path (`'customer.name'`) in the row object. Must be unique across columns. */
|
|
44
|
+
field: string;
|
|
45
|
+
/** Header text. Defaults to the field name. */
|
|
46
|
+
header?: string;
|
|
47
|
+
/** Data type. Defaults to `'text'`. */
|
|
48
|
+
type?: GridDataType;
|
|
49
|
+
/** Width in px. Defaults to `defaultColumn.width` (150). */
|
|
50
|
+
width?: number;
|
|
51
|
+
minWidth?: number;
|
|
52
|
+
maxWidth?: number;
|
|
53
|
+
hidden?: boolean;
|
|
54
|
+
/** Text alignment. Numbers default to right-aligned. */
|
|
55
|
+
align?: GridCellAlign;
|
|
56
|
+
/** Allow drag-resizing of this column. */
|
|
57
|
+
resizable?: boolean;
|
|
58
|
+
/** Column-level sorting flag (overrides `sorting.enabled`). */
|
|
59
|
+
sortable?: boolean;
|
|
60
|
+
/** Column-level filtering flag (overrides `filtering.enabled`). */
|
|
61
|
+
filterable?: boolean;
|
|
62
|
+
/** Column-level editing flag (overrides `editing.enabled`). A function decides per row. */
|
|
63
|
+
editable?: boolean | ((row: TRow) => boolean);
|
|
64
|
+
/** Summary shown in the summary row: a built-in name (`'sum'`) or a full config with custom functions. */
|
|
65
|
+
summary?: ColumnSummaryConfig<TRow> | GridSummaryType;
|
|
66
|
+
/** Sorting configuration (comparator, icon visibility, sort cycle). */
|
|
67
|
+
sort?: ColumnSortConfig<TRow>;
|
|
68
|
+
/** Filtering configuration (operators, value list, custom predicate, icon visibility). */
|
|
69
|
+
filter?: ColumnFilterConfig<TRow>;
|
|
70
|
+
/** Computed value (formula column). Used for display, sorting, filtering and summaries. */
|
|
71
|
+
valueGetter?: (row: TRow) => TValue;
|
|
72
|
+
/** Writes an edited value back into the row. Needed for computed or nested fields you want to edit. */
|
|
73
|
+
valueSetter?: (row: TRow, value: TValue) => void;
|
|
74
|
+
/** Custom display text for the default cell renderer and the filter value list. */
|
|
75
|
+
valueFormatter?: (value: TValue, row: TRow | undefined) => string;
|
|
76
|
+
/** `Intl.NumberFormat` options for number columns. */
|
|
77
|
+
numberFormat?: Intl.NumberFormatOptions;
|
|
78
|
+
/** `Intl.DateTimeFormat` options for date columns. */
|
|
79
|
+
dateFormat?: Intl.DateTimeFormatOptions;
|
|
80
|
+
/** Labels used for boolean values. */
|
|
81
|
+
booleanLabels?: {
|
|
82
|
+
true: string;
|
|
83
|
+
false: string;
|
|
84
|
+
};
|
|
85
|
+
/** Display-mode template (TemplateRef or component) for the cells of this column. */
|
|
86
|
+
displayTemplate?: GridTemplate<GridCellContext<TRow, TValue>>;
|
|
87
|
+
/**
|
|
88
|
+
* Reuse key of this column's template cells. Template cells are kept and reused while scrolling sideways: a cell
|
|
89
|
+
* that leaves the view is given to a column with the same `templateKey` (and template) when one comes in, so what
|
|
90
|
+
* it rendered stays and is only updated. Set it when columns share a template but render different content, for
|
|
91
|
+
* example a template with an `@switch` on the column's type (use that type as the key). Without keys, a cell can
|
|
92
|
+
* be given to any column, and then re-renders that column's content.
|
|
93
|
+
*/
|
|
94
|
+
templateKey?: string;
|
|
95
|
+
/** Edit-mode template (TemplateRef or component) for the cells of this column. */
|
|
96
|
+
editTemplate?: GridTemplate<GridEditContext<TRow, TValue>>;
|
|
97
|
+
/** Header template (TemplateRef or component). Replaces the header label; sort/filter icons stay. */
|
|
98
|
+
headerTemplate?: GridTemplate<GridHeaderContext<TRow>>;
|
|
99
|
+
/** Summary cell template (TemplateRef or component). */
|
|
100
|
+
summaryTemplate?: GridTemplate<GridSummaryCellContext<TRow>>;
|
|
101
|
+
/**
|
|
102
|
+
* Cell tooltip: `true`/`false` turn it on or off, `'truncated'`/`'always'`/`'never'` choose when it shows,
|
|
103
|
+
* and a function returns the text (shown whenever it returns one). Default: `tooltips.cells`.
|
|
104
|
+
*/
|
|
105
|
+
tooltip?: boolean | GridTooltipMode | ((ctx: GridTooltipContext<TRow, TValue>) => string | null | undefined);
|
|
106
|
+
/** Tooltip template (TemplateRef or component) for the cells of this column. */
|
|
107
|
+
tooltipTemplate?: GridTemplate<GridTooltipContext<TRow, TValue>>;
|
|
108
|
+
/** A description of the column, always shown in the header tooltip. */
|
|
109
|
+
description?: string;
|
|
110
|
+
/** Header tooltip: `true`/`false` turn it on or off, or choose when it shows. Default: `tooltips.headers`. */
|
|
111
|
+
headerTooltip?: boolean | GridTooltipMode;
|
|
112
|
+
/** Header tooltip template (TemplateRef or component). */
|
|
113
|
+
headerTooltipTemplate?: GridTemplate<GridHeaderTooltipContext<TRow>>;
|
|
114
|
+
/** Built-in editor to use. Defaults by type: text, number, date, checkbox; `select` when `editorOptions.options` is set. */
|
|
115
|
+
editor?: GridEditorType;
|
|
116
|
+
editorOptions?: GridEditorOptions<TRow>;
|
|
117
|
+
/** Validates an edited value. Return an error message to block the commit. Also runs when rows are added. */
|
|
118
|
+
validator?: (value: TValue, row: TRow) => string | null | undefined;
|
|
119
|
+
/** The field must have a value (not empty, not only spaces) when a row is added or edited. Default `false`. */
|
|
120
|
+
required?: boolean;
|
|
121
|
+
/** Value given to new rows that don't have one (inline add row and `addRow()`). A function receives the new row. */
|
|
122
|
+
defaultValue?: TValue | ((row: TRow) => TValue);
|
|
123
|
+
/**
|
|
124
|
+
* Whether the inline add row has an editor for this column. Default: the column's `editable`; for the
|
|
125
|
+
* primary-key column, an editor only when the new row has no key yet (none generated by `editing.newRow`).
|
|
126
|
+
*/
|
|
127
|
+
editableOnAdd?: boolean | ((row: TRow) => boolean);
|
|
128
|
+
/** CSS class(es) for the cells of this column. A function styles individual cells. */
|
|
129
|
+
cellClass?: GridClassValue | ((ctx: GridCellStyleContext<TRow, TValue>) => GridClassValue);
|
|
130
|
+
/** Inline styles for the cells of this column. A function styles individual cells. */
|
|
131
|
+
cellStyle?: GridStyleValue | ((ctx: GridCellStyleContext<TRow, TValue>) => GridStyleValue | null | undefined);
|
|
132
|
+
/** CSS class(es) for the header cell. */
|
|
133
|
+
headerClass?: GridClassValue;
|
|
134
|
+
/** Inline styles for the header cell. */
|
|
135
|
+
headerStyle?: GridStyleValue;
|
|
136
|
+
/** Free-form data for your own templates. The grid never reads it. */
|
|
137
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A column after the grid has merged it with the global configuration.
|
|
141
|
+
* Returned by the grid API and passed to every template context.
|
|
142
|
+
*/
|
|
143
|
+
export interface ResolvedColumn<TRow = any> {
|
|
144
|
+
readonly field: string;
|
|
145
|
+
readonly header: string;
|
|
146
|
+
readonly type: GridDataType;
|
|
147
|
+
/** Configured width. The current width after resizing is available from `api.getColumnWidth(field)`. */
|
|
148
|
+
readonly width: number;
|
|
149
|
+
readonly minWidth: number;
|
|
150
|
+
readonly maxWidth: number;
|
|
151
|
+
readonly align: GridCellAlign;
|
|
152
|
+
readonly hidden: boolean;
|
|
153
|
+
readonly resizable: boolean;
|
|
154
|
+
readonly sortable: boolean;
|
|
155
|
+
readonly filterable: boolean;
|
|
156
|
+
readonly editable: boolean | ((row: TRow) => boolean);
|
|
157
|
+
/** The field must have a value when a row is added or edited. */
|
|
158
|
+
readonly required: boolean;
|
|
159
|
+
readonly showSortIcon: boolean;
|
|
160
|
+
readonly sortIconVisibility: SortIconVisibility;
|
|
161
|
+
readonly showFilterIcon: boolean;
|
|
162
|
+
readonly filterIconVisibility: FilterIconVisibility;
|
|
163
|
+
readonly editor: GridEditorType;
|
|
164
|
+
readonly editorOptions: GridEditorOptions<TRow>;
|
|
165
|
+
readonly summary: ResolvedColumnSummary<TRow> | null;
|
|
166
|
+
readonly sort: ColumnSortConfig<TRow>;
|
|
167
|
+
readonly filter: ResolvedColumnFilter<TRow>;
|
|
168
|
+
readonly displayTemplate: GridTemplate<GridCellContext<TRow>> | null;
|
|
169
|
+
readonly editTemplate: GridTemplate<GridEditContext<TRow>> | null;
|
|
170
|
+
readonly headerTemplate: GridTemplate<GridHeaderContext<TRow>> | null;
|
|
171
|
+
readonly summaryTemplate: GridTemplate<GridSummaryCellContext<TRow>> | null;
|
|
172
|
+
readonly tooltipTemplate: GridTemplate<GridTooltipContext<TRow>> | null;
|
|
173
|
+
readonly headerTooltipTemplate: GridTemplate<GridHeaderTooltipContext<TRow>> | null;
|
|
174
|
+
/** Position of the column in the `columns` array. */
|
|
175
|
+
readonly index: number;
|
|
176
|
+
/** The original column configuration. */
|
|
177
|
+
readonly config: ColumnConfig<TRow>;
|
|
178
|
+
/** Reads this column's value from a row (field path or `valueGetter`). */
|
|
179
|
+
readonly getValue: (row: TRow) => any;
|
|
180
|
+
/** Writes a value into a row, or `null` when the column cannot be written. */
|
|
181
|
+
readonly setValue: ((row: TRow, value: any) => void) | null;
|
|
182
|
+
/** Formats a value the same way the default cell renderer does. */
|
|
183
|
+
readonly formatValue: (value: any, row?: TRow) => string;
|
|
184
|
+
}
|