@one-grid-core/angular 0.2.0 → 0.4.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/README.md +55 -9
- package/esm2022/lib/components/one-grid/one-grid.component.mjs +244 -11
- package/esm2022/lib/components/one-grid-body/one-grid-body.component.mjs +446 -34
- package/esm2022/lib/components/one-grid-cell-currency/one-grid-cell-currency.component.mjs +6 -5
- package/esm2022/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.mjs +3 -3
- package/esm2022/lib/components/one-grid-cell-option-menu/one-grid-cell-option-menu.component.mjs +3 -3
- package/esm2022/lib/components/one-grid-checkbox/one-grid-checkbox.component.mjs +7 -18
- package/esm2022/lib/components/one-grid-checkbox-header/one-grid-checkbox-header.component.mjs +6 -6
- package/esm2022/lib/components/one-grid-header/one-grid-header.component.mjs +221 -17
- package/esm2022/lib/components/one-grid-header-menu/one-grid-header-menu.component.mjs +137 -0
- package/esm2022/lib/components/one-grid-pagination/one-grid-pagination.component.mjs +6 -5
- package/esm2022/lib/components/one-grid-row-action/one-grid-row-action.component.mjs +4 -4
- package/esm2022/lib/components/one-grid-row-drag-handle/one-grid-row-drag-handle.component.mjs +5 -3
- package/esm2022/lib/components/one-grid-status/one-grid-status.component.mjs +4 -4
- package/esm2022/lib/core/directives/one-cell-input-validator.directive.mjs +3 -3
- package/esm2022/lib/core/directives/one-cell-renderer-component.directive.mjs +3 -3
- package/esm2022/lib/core/directives/one-cell-text-expand.directive.mjs +3 -3
- package/esm2022/lib/core/icons/one-grid-icons.mjs +38 -0
- package/esm2022/lib/core/instants/one-grid-api.class.mjs +296 -3
- package/esm2022/lib/core/models/one-column-def-types.model.mjs +1 -1
- package/esm2022/lib/core/models/one-event-types.model.mjs +1 -1
- package/esm2022/lib/core/models/one-filter.model.mjs +1 -1
- package/esm2022/lib/core/pipes/aria-sort.pipe.mjs +31 -0
- package/esm2022/lib/core/pipes/cell-action-button-enable.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/cell-editable.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/cell-invalid.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/cell-key.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/cell-level-padding.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/cell-selected.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/cell-state-renderer.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/column-sort-state.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/header-checkbox-checked.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/header-checkbox-disabled.pipe.mjs +3 -3
- package/esm2022/lib/core/pipes/header-checkbox-indeterminate.pipe.mjs +3 -3
- package/esm2022/lib/core/services/og-column.service.mjs +153 -30
- package/esm2022/lib/core/services/one-grid-cell.service.mjs +39 -15
- package/esm2022/lib/helpers/one-cell.helper.mjs +30 -1
- package/esm2022/lib/helpers/one-column-def.helper.mjs +16 -1
- package/esm2022/lib/helpers/one-csv.helper.mjs +58 -0
- package/esm2022/lib/helpers/one-filter.helper.mjs +11 -1
- package/esm2022/lib/helpers/one-row-grouping.helper.mjs +103 -0
- package/esm2022/lib/index.mjs +3 -1
- package/esm2022/lib/one-grid.module.mjs +24 -114
- package/fesm2022/one-grid-core-angular.mjs +2322 -823
- package/fesm2022/one-grid-core-angular.mjs.map +1 -1
- package/lib/components/one-grid/one-grid.component.d.ts +101 -4
- package/lib/components/one-grid-body/one-grid-body.component.d.ts +83 -2
- package/lib/components/one-grid-cell-currency/one-grid-cell-currency.component.d.ts +1 -1
- package/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.d.ts +1 -1
- package/lib/components/one-grid-cell-option-menu/one-grid-cell-option-menu.component.d.ts +1 -1
- package/lib/components/one-grid-checkbox/one-grid-checkbox.component.d.ts +1 -1
- package/lib/components/one-grid-checkbox-header/one-grid-checkbox-header.component.d.ts +1 -1
- package/lib/components/one-grid-header/one-grid-header.component.d.ts +69 -4
- package/lib/components/one-grid-header-menu/one-grid-header-menu.component.d.ts +52 -0
- package/lib/components/one-grid-pagination/one-grid-pagination.component.d.ts +1 -1
- package/lib/components/one-grid-row-action/one-grid-row-action.component.d.ts +1 -1
- package/lib/components/one-grid-row-drag-handle/one-grid-row-drag-handle.component.d.ts +1 -1
- package/lib/components/one-grid-status/one-grid-status.component.d.ts +1 -1
- package/lib/core/directives/one-cell-input-validator.directive.d.ts +1 -1
- package/lib/core/directives/one-cell-renderer-component.directive.d.ts +1 -1
- package/lib/core/directives/one-cell-text-expand.directive.d.ts +1 -1
- package/lib/core/icons/one-grid-icons.d.ts +35 -0
- package/lib/core/instants/one-grid-api.class.d.ts +115 -1
- package/lib/core/models/one-column-def-types.model.d.ts +77 -2
- package/lib/core/models/one-event-types.model.d.ts +19 -0
- package/lib/core/models/one-filter.model.d.ts +8 -1
- package/lib/core/pipes/aria-sort.pipe.d.ts +15 -0
- package/lib/core/pipes/cell-action-button-enable.pipe.d.ts +1 -1
- package/lib/core/pipes/cell-editable.pipe.d.ts +1 -1
- package/lib/core/pipes/cell-invalid.pipe.d.ts +1 -1
- package/lib/core/pipes/cell-key.pipe.d.ts +1 -1
- package/lib/core/pipes/cell-level-padding.pipe.d.ts +1 -1
- package/lib/core/pipes/cell-selected.pipe.d.ts +1 -1
- package/lib/core/pipes/cell-state-renderer.pipe.d.ts +1 -1
- package/lib/core/pipes/column-sort-state.pipe.d.ts +1 -1
- package/lib/core/pipes/header-checkbox-checked.pipe.d.ts +1 -1
- package/lib/core/pipes/header-checkbox-disabled.pipe.d.ts +1 -1
- package/lib/core/pipes/header-checkbox-indeterminate.pipe.d.ts +1 -1
- package/lib/core/services/og-column.service.d.ts +46 -2
- package/lib/core/services/one-grid-cell.service.d.ts +16 -3
- package/lib/helpers/one-cell.helper.d.ts +17 -0
- package/lib/helpers/one-column-def.helper.d.ts +9 -0
- package/lib/helpers/one-csv.helper.d.ts +29 -0
- package/lib/helpers/one-row-grouping.helper.d.ts +35 -0
- package/lib/index.d.ts +2 -0
- package/lib/one-grid.module.d.ts +15 -37
- package/package.json +1 -1
- package/scss/_one-grid.scss +127 -0
- package/esm2022/lib/core/pipes/cell-action-button-visible.pipe.mjs +0 -17
- package/esm2022/lib/core/pipes/cell-field-value-empty.pipe.mjs +0 -26
- package/esm2022/lib/core/pipes/cell-field-value.pipe.mjs +0 -25
- package/esm2022/lib/core/pipes/cell-field.pipe.mjs +0 -20
- package/esm2022/lib/core/pipes/cell-number-value.pipe.mjs +0 -19
- package/esm2022/lib/core/pipes/cell-state-group-renderer.pipe.mjs +0 -21
- package/esm2022/lib/core/pipes/cell-value-getter.pipe.mjs +0 -23
- package/lib/core/pipes/cell-action-button-visible.pipe.d.ts +0 -9
- package/lib/core/pipes/cell-field-value-empty.pipe.d.ts +0 -7
- package/lib/core/pipes/cell-field-value.pipe.d.ts +0 -7
- package/lib/core/pipes/cell-field.pipe.d.ts +0 -7
- package/lib/core/pipes/cell-number-value.pipe.d.ts +0 -7
- package/lib/core/pipes/cell-state-group-renderer.pipe.d.ts +0 -9
- package/lib/core/pipes/cell-value-getter.pipe.d.ts +0 -9
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, Type } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, Type } from '@angular/core';
|
|
2
2
|
import { OneColumnDef, OneGroupColumnDef } from '../../core/models/one-column-def-types.model';
|
|
3
3
|
import { OneGridApi } from '../../core/instants/one-grid-api.class';
|
|
4
4
|
import { OneRowNode } from '../../core/instants/one-row-node.class';
|
|
5
5
|
import { OneGridReadyEvent, OneGridRowActionEvent, OneGridType } from '../../core/models/one-grid-types.model';
|
|
6
6
|
import { OneGridEventService } from '../../core/services/one-grid-event.service';
|
|
7
7
|
import { OnePaginationParams } from '../../core/models/one-pagination-types.model';
|
|
8
|
-
import { CellOptionMenuSelectedEvent, ExpansionChangedEvent, RowSelectionMode, SelectionChangedEvent } from '../../core/models/one-event-types.model';
|
|
8
|
+
import { CellOptionMenuSelectedEvent, CellValueChangedEvent, ColumnMovedEvent, ColumnResizedEvent, ExpansionChangedEvent, RowSelectionMode, SelectionChangedEvent, SortChangedEvent } from '../../core/models/one-event-types.model';
|
|
9
9
|
import { Subject } from 'rxjs';
|
|
10
10
|
import { OneDetailCellRendererParams } from '../../core/models/one-master-detail.model';
|
|
11
11
|
import { OneCellRendererComponent } from '../../core/models/one-tree-data.model';
|
|
@@ -15,6 +15,7 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
|
|
|
15
15
|
protected api: OneGridApi;
|
|
16
16
|
protected eventService: OneGridEventService;
|
|
17
17
|
private elementRef;
|
|
18
|
+
private cdr;
|
|
18
19
|
/**
|
|
19
20
|
* Get General Data from Parent
|
|
20
21
|
*/
|
|
@@ -25,6 +26,14 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
|
|
|
25
26
|
context: any;
|
|
26
27
|
rowData: T[];
|
|
27
28
|
rowSelection: RowSelectionMode;
|
|
29
|
+
/**
|
|
30
|
+
* The grid's accessible name.
|
|
31
|
+
*
|
|
32
|
+
* A `role="grid"` with no name is announced as an unlabelled grid, which
|
|
33
|
+
* tells a screen-reader user nothing about what they have landed in. Set it
|
|
34
|
+
* to whatever the grid is showing — "Employees", "Order lines".
|
|
35
|
+
*/
|
|
36
|
+
gridLabel: string;
|
|
28
37
|
enableGroupColumnDefs: boolean;
|
|
29
38
|
groupColumnDefs: OneGroupColumnDef[];
|
|
30
39
|
defaultColumnDef: OneColumnDef<T>;
|
|
@@ -61,6 +70,41 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
|
|
|
61
70
|
* pointer is in flight — and only when the position actually changed.
|
|
62
71
|
*/
|
|
63
72
|
rowDragEnd: EventEmitter<OneRowDragEvent<T>>;
|
|
73
|
+
/**
|
|
74
|
+
* The header's ⋮ button was pressed for this column.
|
|
75
|
+
*
|
|
76
|
+
* The grid has no column menu of its own — this reports the intent so the
|
|
77
|
+
* host can show whatever a column menu means in its app. Set
|
|
78
|
+
* `columnDef.suppressHeaderMenuButton` to hide the button entirely.
|
|
79
|
+
*/
|
|
80
|
+
headerMenuClick: EventEmitter<OneColumnDef<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Render the grid's own column menu behind the header ⋮ button: sort, pin,
|
|
83
|
+
* hide. Opt-in — a host that built its menu on `(headerMenuClick)` keeps
|
|
84
|
+
* exactly what it had, and the intent still emits either way.
|
|
85
|
+
*/
|
|
86
|
+
headerMenu: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Render a filter input under every column whose `filterable` resolves
|
|
89
|
+
* true. The inputs feed `api.setFilterModel` with contains-conditions,
|
|
90
|
+
* debounced; filters on fields without an input are left untouched.
|
|
91
|
+
*/
|
|
92
|
+
filterRow: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Record committed cell edits so `api.undoCellEditing` /
|
|
95
|
+
* `api.redoCellEditing` (and Ctrl+Z / Ctrl+Y in the grid) can walk them.
|
|
96
|
+
* Programmatic `setDataValue` writes are not recorded.
|
|
97
|
+
*/
|
|
98
|
+
undoRedoCellEditing: boolean;
|
|
99
|
+
/** How many edits the undo stack keeps. */
|
|
100
|
+
undoRedoCellEditingLimit: number;
|
|
101
|
+
/**
|
|
102
|
+
* `'fullRow'` opens every editable cell of the row on a double-click and
|
|
103
|
+
* commits them together — Enter anywhere in the row, or focus leaving the
|
|
104
|
+
* row. Escape closes the whole row without committing. Default: cells edit
|
|
105
|
+
* one at a time.
|
|
106
|
+
*/
|
|
107
|
+
editType: 'fullRow' | null;
|
|
64
108
|
onGridReady: EventEmitter<OneGridReadyEvent<T>>;
|
|
65
109
|
onRowGotoDetail: EventEmitter<OneGridRowActionEvent<T>>;
|
|
66
110
|
onRowAddNew: EventEmitter<OneGridRowActionEvent<T>>;
|
|
@@ -80,6 +124,22 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
|
|
|
80
124
|
rowCountChanged: EventEmitter<number>;
|
|
81
125
|
selectionChanged: EventEmitter<SelectionChangedEvent<T>>;
|
|
82
126
|
expansionChanged: EventEmitter<ExpansionChangedEvent<T>>;
|
|
127
|
+
/**
|
|
128
|
+
* The sort model changed — a header click or `api.onSortChanged`. Carries
|
|
129
|
+
* the re-sorted nodes and the model that produced them; `api.sortModel`
|
|
130
|
+
* stays readable between emissions.
|
|
131
|
+
*/
|
|
132
|
+
sortChanged: EventEmitter<SortChangedEvent<T>>;
|
|
133
|
+
/**
|
|
134
|
+
* An inline edit was committed with a value different from the one it
|
|
135
|
+
* started with. Programmatic `node.setDataValue` does not emit here — the
|
|
136
|
+
* caller already holds both values.
|
|
137
|
+
*/
|
|
138
|
+
cellValueChanged: EventEmitter<CellValueChangedEvent<T>>;
|
|
139
|
+
/** A header drag finished somewhere other than where it started. */
|
|
140
|
+
columnMoved: EventEmitter<ColumnMovedEvent>;
|
|
141
|
+
/** A resize gesture finished — one event per gesture, not per pixel. */
|
|
142
|
+
columnResized: EventEmitter<ColumnResizedEvent>;
|
|
83
143
|
cellOptionSelect: EventEmitter<CellOptionMenuSelectedEvent<any>>;
|
|
84
144
|
onRowCellOption: EventEmitter<OneGridRowActionEvent<T>>;
|
|
85
145
|
/**
|
|
@@ -87,18 +147,37 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
|
|
|
87
147
|
*/
|
|
88
148
|
pagination: boolean;
|
|
89
149
|
paginate: OnePaginationParams;
|
|
150
|
+
/**
|
|
151
|
+
* Let the grid page its own rows. The bar renders, the grid slices the
|
|
152
|
+
* filtered rows to the current page, and the navigation buttons work
|
|
153
|
+
* without the host handling anything — `[paginate]` is ignored in this
|
|
154
|
+
* mode (the grid owns those numbers) except for `pageSizeOptions`. The
|
|
155
|
+
* navigation outputs still emit, as notifications rather than intents.
|
|
156
|
+
* Selection, filtering and sorting keep operating on the whole dataset.
|
|
157
|
+
*/
|
|
158
|
+
clientSidePagination: boolean;
|
|
159
|
+
/** Rows per page for `clientSidePagination`. */
|
|
160
|
+
pageSize: number;
|
|
90
161
|
goToFirst: EventEmitter<any>;
|
|
91
162
|
goToPrevious: EventEmitter<any>;
|
|
92
163
|
goToNext: EventEmitter<any>;
|
|
93
164
|
goToLast: EventEmitter<any>;
|
|
94
165
|
pageSizeChange: EventEmitter<number>;
|
|
166
|
+
/** The paging numbers the bar shows when the grid pages its own rows. */
|
|
167
|
+
protected internalPaginate: OnePaginationParams;
|
|
168
|
+
/**
|
|
169
|
+
* Recompute the bar's numbers from the filtered row count and the API's
|
|
170
|
+
* paging state. Deferred a tick for the same reason the aria counts are:
|
|
171
|
+
* the count arrives while the first change detection pass is still running.
|
|
172
|
+
*/
|
|
173
|
+
private refreshClientPagination;
|
|
95
174
|
/**
|
|
96
175
|
* One Grid Properties
|
|
97
176
|
*/
|
|
98
177
|
protected bodyScrollLeft: number;
|
|
99
178
|
private _oneRowNumberColumnDef;
|
|
100
179
|
private subscriptions;
|
|
101
|
-
constructor(api: OneGridApi, eventService: OneGridEventService, elementRef: ElementRef);
|
|
180
|
+
constructor(api: OneGridApi, eventService: OneGridEventService, elementRef: ElementRef, cdr: ChangeDetectorRef);
|
|
102
181
|
ngOnChanges(changes: SimpleChanges): void;
|
|
103
182
|
ngOnInit(): void;
|
|
104
183
|
ngAfterViewInit(): void;
|
|
@@ -133,7 +212,25 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
|
|
|
133
212
|
invokeRowActionCellOption(event: OneGridRowActionEvent<T>): void;
|
|
134
213
|
invokeRowActionSelection(event: OneGridRowActionEvent<T>): void;
|
|
135
214
|
invokeShiftDoubleClick(event: OneGridRowActionEvent<T>): void;
|
|
215
|
+
/**
|
|
216
|
+
* Totals for `aria-rowcount` / `aria-colcount`.
|
|
217
|
+
*
|
|
218
|
+
* Held as fields rather than computed in the template: they are read on every
|
|
219
|
+
* change detection pass and only actually change when the data or the columns
|
|
220
|
+
* do. `-1` is the ARIA value for "unknown", which is the honest answer before
|
|
221
|
+
* the first row arrives.
|
|
222
|
+
*/
|
|
223
|
+
protected ariaRowCount: number;
|
|
224
|
+
protected ariaColCount: number;
|
|
136
225
|
invokeRowCountChanged(length: number): void;
|
|
226
|
+
/**
|
|
227
|
+
* Recompute the totals a screen reader is told about.
|
|
228
|
+
*
|
|
229
|
+
* `aria-rowcount` counts every row the grid represents, not the handful the
|
|
230
|
+
* virtual scroller currently has in the DOM — the header row, the pinned rows
|
|
231
|
+
* either side, and all the data rows.
|
|
232
|
+
*/
|
|
233
|
+
private refreshAriaCounts;
|
|
137
234
|
cellOptionMenuSelected(event: CellOptionMenuSelectedEvent): void;
|
|
138
235
|
/**
|
|
139
236
|
* Bing Pagination Events to Parent Component
|
|
@@ -150,5 +247,5 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
|
|
|
150
247
|
*/
|
|
151
248
|
ngOnDestroy(): void;
|
|
152
249
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridComponent<any>, never>;
|
|
153
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridComponent<any>, "one-grid", never, { "rowNumber": { "alias": "rowNumber"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; "submitted": { "alias": "submitted"; "required": false; }; "context": { "alias": "context"; "required": false; }; "rowData": { "alias": "rowData"; "required": false; }; "rowSelection": { "alias": "rowSelection"; "required": false; }; "enableGroupColumnDefs": { "alias": "enableGroupColumnDefs"; "required": false; }; "groupColumnDefs": { "alias": "groupColumnDefs"; "required": false; }; "defaultColumnDef": { "alias": "defaultColumnDef"; "required": false; }; "columnDefs": { "alias": "columnDefs"; "required": false; }; "pinnedTopRowData": { "alias": "pinnedTopRowData"; "required": false; }; "pinnedBottomRowData": { "alias": "pinnedBottomRowData"; "required": false; }; "gridType": { "alias": "gridType"; "required": false; }; "masterDetail": { "alias": "masterDetail"; "required": false; }; "masterNode": { "alias": "masterNode"; "required": false; }; "detailCellRendererParams": { "alias": "detailCellRendererParams"; "required": false; }; "detailRendererComponent": { "alias": "detailRendererComponent"; "required": false; }; "treeData": { "alias": "treeData"; "required": false; }; "treeDataChildrenField": { "alias": "treeDataChildrenField"; "required": false; }; "autoGroupColumnDef": { "alias": "autoGroupColumnDef"; "required": false; }; "groupDefaultExpanded": { "alias": "groupDefaultExpanded"; "required": false; }; "pagination": { "alias": "pagination"; "required": false; }; "paginate": { "alias": "paginate"; "required": false; }; }, { "rowDragEnd": "rowDragEnd"; "onGridReady": "onGridReady"; "onRowGotoDetail": "onRowGotoDetail"; "onRowAddNew": "onRowAddNew"; "onRowView": "onRowView"; "onRowLocation": "onRowLocation"; "onRowDocument": "onRowDocument"; "onRowCopy": "onRowCopy"; "onRowDelete": "onRowDelete"; "onRowGotoList": "onRowGotoList"; "onRowEdit": "onRowEdit"; "onRowPrint": "onRowPrint"; "onRowHistory": "onRowHistory"; "onRowOption": "onRowOption"; "onRowLanguage": "onRowLanguage"; "onRowSelection": "onRowSelection"; "onShiftDoubleClick": "onShiftDoubleClick"; "rowCountChanged": "rowCountChanged"; "selectionChanged": "selectionChanged"; "expansionChanged": "expansionChanged"; "cellOptionSelect": "cellOptionSelect"; "onRowCellOption": "onRowCellOption"; "goToFirst": "goToFirst"; "goToPrevious": "goToPrevious"; "goToNext": "goToNext"; "goToLast": "goToLast"; "pageSizeChange": "pageSizeChange"; }, never, never,
|
|
250
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridComponent<any>, "one-grid", never, { "rowNumber": { "alias": "rowNumber"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; "submitted": { "alias": "submitted"; "required": false; }; "context": { "alias": "context"; "required": false; }; "rowData": { "alias": "rowData"; "required": false; }; "rowSelection": { "alias": "rowSelection"; "required": false; }; "gridLabel": { "alias": "gridLabel"; "required": false; }; "enableGroupColumnDefs": { "alias": "enableGroupColumnDefs"; "required": false; }; "groupColumnDefs": { "alias": "groupColumnDefs"; "required": false; }; "defaultColumnDef": { "alias": "defaultColumnDef"; "required": false; }; "columnDefs": { "alias": "columnDefs"; "required": false; }; "pinnedTopRowData": { "alias": "pinnedTopRowData"; "required": false; }; "pinnedBottomRowData": { "alias": "pinnedBottomRowData"; "required": false; }; "gridType": { "alias": "gridType"; "required": false; }; "masterDetail": { "alias": "masterDetail"; "required": false; }; "masterNode": { "alias": "masterNode"; "required": false; }; "detailCellRendererParams": { "alias": "detailCellRendererParams"; "required": false; }; "detailRendererComponent": { "alias": "detailRendererComponent"; "required": false; }; "treeData": { "alias": "treeData"; "required": false; }; "treeDataChildrenField": { "alias": "treeDataChildrenField"; "required": false; }; "autoGroupColumnDef": { "alias": "autoGroupColumnDef"; "required": false; }; "groupDefaultExpanded": { "alias": "groupDefaultExpanded"; "required": false; }; "headerMenu": { "alias": "headerMenu"; "required": false; }; "filterRow": { "alias": "filterRow"; "required": false; }; "undoRedoCellEditing": { "alias": "undoRedoCellEditing"; "required": false; }; "undoRedoCellEditingLimit": { "alias": "undoRedoCellEditingLimit"; "required": false; }; "editType": { "alias": "editType"; "required": false; }; "pagination": { "alias": "pagination"; "required": false; }; "paginate": { "alias": "paginate"; "required": false; }; "clientSidePagination": { "alias": "clientSidePagination"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; }, { "rowDragEnd": "rowDragEnd"; "headerMenuClick": "headerMenuClick"; "onGridReady": "onGridReady"; "onRowGotoDetail": "onRowGotoDetail"; "onRowAddNew": "onRowAddNew"; "onRowView": "onRowView"; "onRowLocation": "onRowLocation"; "onRowDocument": "onRowDocument"; "onRowCopy": "onRowCopy"; "onRowDelete": "onRowDelete"; "onRowGotoList": "onRowGotoList"; "onRowEdit": "onRowEdit"; "onRowPrint": "onRowPrint"; "onRowHistory": "onRowHistory"; "onRowOption": "onRowOption"; "onRowLanguage": "onRowLanguage"; "onRowSelection": "onRowSelection"; "onShiftDoubleClick": "onShiftDoubleClick"; "rowCountChanged": "rowCountChanged"; "selectionChanged": "selectionChanged"; "expansionChanged": "expansionChanged"; "sortChanged": "sortChanged"; "cellValueChanged": "cellValueChanged"; "columnMoved": "columnMoved"; "columnResized": "columnResized"; "cellOptionSelect": "cellOptionSelect"; "onRowCellOption": "onRowCellOption"; "goToFirst": "goToFirst"; "goToPrevious": "goToPrevious"; "goToNext": "goToNext"; "goToLast": "goToLast"; "pageSizeChange": "pageSizeChange"; }, never, never, true, never>;
|
|
154
251
|
}
|
|
@@ -23,7 +23,7 @@ export declare class OneGridBodyComponent<T> implements OnInit, AfterViewInit, O
|
|
|
23
23
|
/**
|
|
24
24
|
* Core Properties
|
|
25
25
|
*/
|
|
26
|
-
bodyRef: ElementRef
|
|
26
|
+
bodyRef: ElementRef<HTMLElement>;
|
|
27
27
|
rowData: T[];
|
|
28
28
|
rowNumber: boolean;
|
|
29
29
|
api: OneGridApi<T>;
|
|
@@ -31,6 +31,12 @@ export declare class OneGridBodyComponent<T> implements OnInit, AfterViewInit, O
|
|
|
31
31
|
allowedEdit: boolean;
|
|
32
32
|
enableGroupColumnDefs: boolean;
|
|
33
33
|
submitted: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* `'fullRow'`: a double-click opens every editable cell of the row, Enter or
|
|
36
|
+
* focus leaving the row commits them together, Escape closes them all
|
|
37
|
+
* without committing. Default: one cell at a time.
|
|
38
|
+
*/
|
|
39
|
+
editType: 'fullRow' | null;
|
|
34
40
|
context: any;
|
|
35
41
|
getRowId: (params: OneGridGetRowIdParams<T>) => string;
|
|
36
42
|
gridCopy$: Subject<ClipboardEvent>;
|
|
@@ -219,10 +225,30 @@ export declare class OneGridBodyComponent<T> implements OnInit, AfterViewInit, O
|
|
|
219
225
|
* Save Cell Edit Mode
|
|
220
226
|
*/
|
|
221
227
|
stopEdit(node: OneRowNode<T>, column: OneColumnDef<T>, event: any): void;
|
|
228
|
+
/**
|
|
229
|
+
* Save a `select` editor's choice.
|
|
230
|
+
*
|
|
231
|
+
* Separate from `stopEdit` because the value is not the element's string:
|
|
232
|
+
* the chosen index maps back into `selectOptions`, so the committed value
|
|
233
|
+
* keeps whatever type the option declared.
|
|
234
|
+
*/
|
|
235
|
+
stopEditSelect(node: OneRowNode<T>, column: OneColumnDef<T>, event: any): void;
|
|
236
|
+
/** Close the editor and announce the commit. Shared by both editor kinds. */
|
|
237
|
+
private finishEdit;
|
|
222
238
|
/**
|
|
223
239
|
* Cancel Cell Edit Mode
|
|
224
240
|
*/
|
|
225
241
|
cancelEdit(node: OneRowNode<T>, column: OneColumnDef<T>): void;
|
|
242
|
+
/**
|
|
243
|
+
* Full-row commit, routed from any one editor's Enter or blur.
|
|
244
|
+
*
|
|
245
|
+
* A blur that lands on another editor in the same row is the user tabbing
|
|
246
|
+
* between fields, not leaving the row — the editors stay open and their
|
|
247
|
+
* typed values stay in the DOM until the row commits.
|
|
248
|
+
*/
|
|
249
|
+
private stopRowEditFromEvent;
|
|
250
|
+
/** Commit every open editor of one row, reading each from the DOM. */
|
|
251
|
+
private stopRowEdit;
|
|
226
252
|
/**
|
|
227
253
|
* Set Cell Value
|
|
228
254
|
*/
|
|
@@ -251,6 +277,8 @@ export declare class OneGridBodyComponent<T> implements OnInit, AfterViewInit, O
|
|
|
251
277
|
* go stale on the first move.
|
|
252
278
|
*/
|
|
253
279
|
ngAfterViewInit(): void;
|
|
280
|
+
private flexResizeObserver?;
|
|
281
|
+
private applyFlexWidths;
|
|
254
282
|
/**
|
|
255
283
|
* The params every per-cell callback receives.
|
|
256
284
|
*
|
|
@@ -269,6 +297,59 @@ export declare class OneGridBodyComponent<T> implements OnInit, AfterViewInit, O
|
|
|
269
297
|
* config goes first so the grid's own fields win a name collision.
|
|
270
298
|
*/
|
|
271
299
|
protected rendererParams(node: OneRowNode<T>, column: OneColumnDef<T>): OneCellRendererParams<T>;
|
|
300
|
+
/**
|
|
301
|
+
* `aria-rowindex` is 1-based over the whole grid, not over what is rendered.
|
|
302
|
+
*
|
|
303
|
+
* That is the point of it: the body virtualises, so the DOM holds a sliding
|
|
304
|
+
* window of rows and the index is how a screen reader knows where the window
|
|
305
|
+
* sits. Row 1 is the header, then any pinned-top rows, then the data.
|
|
306
|
+
*/
|
|
307
|
+
protected dataRowAriaIndex(node: OneRowNode<T>): number;
|
|
308
|
+
/** Pinned rows bracket the data: top ones follow the header, bottom ones end the grid. */
|
|
309
|
+
protected pinnedRowAriaIndex(node: OneRowNode<T>, side: 'top' | 'bottom'): number;
|
|
310
|
+
/**
|
|
311
|
+
* Whether rows can be selected at all.
|
|
312
|
+
*
|
|
313
|
+
* `aria-selected="false"` on every row of a grid nobody can select announces
|
|
314
|
+
* a selection affordance that does not exist, so the attribute is omitted
|
|
315
|
+
* rather than set false.
|
|
316
|
+
*/
|
|
317
|
+
protected get rowSelectionEnabled(): boolean;
|
|
318
|
+
/** The cell holding the grid's tab stop. Null until something is focused. */
|
|
319
|
+
protected activeCell: {
|
|
320
|
+
rowId: string;
|
|
321
|
+
field: string;
|
|
322
|
+
} | null;
|
|
323
|
+
protected isActiveCell(node: OneRowNode<T>, column: OneColumnDef<T>): boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Adopt whatever the user focused, however they got there — click, tab, or
|
|
326
|
+
* the arrow keys below. Keeping this in one place is what stops the roving
|
|
327
|
+
* tabindex drifting away from the element that actually has focus.
|
|
328
|
+
*/
|
|
329
|
+
protected onCellFocus(node: OneRowNode<T>, column: OneColumnDef<T>): void;
|
|
330
|
+
protected onGridKeydown(event: KeyboardEvent): void;
|
|
331
|
+
/** The row a shift-extended selection is measured from. */
|
|
332
|
+
private selectionAnchorRowId;
|
|
333
|
+
private toggleRowSelection;
|
|
334
|
+
private extendSelectionTo;
|
|
335
|
+
/**
|
|
336
|
+
* Columns a cell cursor can land on.
|
|
337
|
+
*
|
|
338
|
+
* A column with no field renders no cell state and is keyed by field, so it
|
|
339
|
+
* cannot be addressed — an action-only column is a legitimate example.
|
|
340
|
+
*/
|
|
341
|
+
private navigableColumns;
|
|
342
|
+
private activeCellPosition;
|
|
343
|
+
private rowsPerPage;
|
|
344
|
+
/**
|
|
345
|
+
* Move the cursor, scrolling the row into view first when it is outside the
|
|
346
|
+
* rendered window.
|
|
347
|
+
*
|
|
348
|
+
* The scroll is the reason focusing is deferred: a virtualised row that is
|
|
349
|
+
* not on screen has no element to focus until the viewport has rendered it.
|
|
350
|
+
*/
|
|
351
|
+
private focusCell;
|
|
352
|
+
private focusCellElement;
|
|
272
353
|
/** Is this the row currently being moved? */
|
|
273
354
|
protected isRowDragging(node: OneRowNode<T>): boolean;
|
|
274
355
|
/**
|
|
@@ -299,5 +380,5 @@ export declare class OneGridBodyComponent<T> implements OnInit, AfterViewInit, O
|
|
|
299
380
|
private refreshRowDragSuppressed;
|
|
300
381
|
ngOnDestroy(): void;
|
|
301
382
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridBodyComponent<any>, never>;
|
|
302
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridBodyComponent<any>, "one-grid-body", never, { "rowData": { "alias": "rowData"; "required": true; }; "rowNumber": { "alias": "rowNumber"; "required": false; }; "api": { "alias": "api"; "required": false; }; "pagination": { "alias": "pagination"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; "enableGroupColumnDefs": { "alias": "enableGroupColumnDefs"; "required": false; }; "submitted": { "alias": "submitted"; "required": false; }; "context": { "alias": "context"; "required": false; }; "getRowId": { "alias": "getRowId"; "required": false; }; "gridCopy$": { "alias": "gridCopy$"; "required": true; }; "pinnedTopRowData": { "alias": "pinnedTopRowData"; "required": false; }; "pinnedBottomRowData": { "alias": "pinnedBottomRowData"; "required": false; }; "gridType": { "alias": "gridType"; "required": false; }; "masterDetail": { "alias": "masterDetail"; "required": false; }; "masterNode": { "alias": "masterNode"; "required": false; }; "detailRowMaxHeight": { "alias": "detailRowMaxHeight"; "required": false; }; "detailCellRendererParams": { "alias": "detailCellRendererParams"; "required": false; }; "detailGridTemplate": { "alias": "detailGridTemplate"; "required": false; }; "detailRendererComponent": { "alias": "detailRendererComponent"; "required": false; }; "treeData": { "alias": "treeData"; "required": false; }; "treeDataChildrenField": { "alias": "treeDataChildrenField"; "required": false; }; "autoGroupColumnDef": { "alias": "autoGroupColumnDef"; "required": false; }; "groupDefaultExpanded": { "alias": "groupDefaultExpanded"; "required": false; }; }, { "onRowGotoDetail": "onRowGotoDetail"; "onRowAddNew": "onRowAddNew"; "onRowView": "onRowView"; "onRowCopy": "onRowCopy"; "onRowLocation": "onRowLocation"; "onRowDocument": "onRowDocument"; "onRowDelete": "onRowDelete"; "onRowGotoList": "onRowGotoList"; "onRowEdit": "onRowEdit"; "onRowPrint": "onRowPrint"; "onRowHistory": "onRowHistory"; "onRowOption": "onRowOption"; "onRowLanguage": "onRowLanguage"; "onRowCellOption": "onRowCellOption"; "onRowSelection": "onRowSelection"; "onShiftDoubleClick": "onShiftDoubleClick"; "rowCountChanged": "rowCountChanged"; "expansionChanged": "expansionChanged"; "bodyScroll": "bodyScroll"; "cellOptionSelect": "cellOptionSelect"; "rowDragEnd": "rowDragEnd"; }, never, never,
|
|
383
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridBodyComponent<any>, "one-grid-body", never, { "rowData": { "alias": "rowData"; "required": true; }; "rowNumber": { "alias": "rowNumber"; "required": false; }; "api": { "alias": "api"; "required": false; }; "pagination": { "alias": "pagination"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; "enableGroupColumnDefs": { "alias": "enableGroupColumnDefs"; "required": false; }; "submitted": { "alias": "submitted"; "required": false; }; "editType": { "alias": "editType"; "required": false; }; "context": { "alias": "context"; "required": false; }; "getRowId": { "alias": "getRowId"; "required": false; }; "gridCopy$": { "alias": "gridCopy$"; "required": true; }; "pinnedTopRowData": { "alias": "pinnedTopRowData"; "required": false; }; "pinnedBottomRowData": { "alias": "pinnedBottomRowData"; "required": false; }; "gridType": { "alias": "gridType"; "required": false; }; "masterDetail": { "alias": "masterDetail"; "required": false; }; "masterNode": { "alias": "masterNode"; "required": false; }; "detailRowMaxHeight": { "alias": "detailRowMaxHeight"; "required": false; }; "detailCellRendererParams": { "alias": "detailCellRendererParams"; "required": false; }; "detailGridTemplate": { "alias": "detailGridTemplate"; "required": false; }; "detailRendererComponent": { "alias": "detailRendererComponent"; "required": false; }; "treeData": { "alias": "treeData"; "required": false; }; "treeDataChildrenField": { "alias": "treeDataChildrenField"; "required": false; }; "autoGroupColumnDef": { "alias": "autoGroupColumnDef"; "required": false; }; "groupDefaultExpanded": { "alias": "groupDefaultExpanded"; "required": false; }; }, { "onRowGotoDetail": "onRowGotoDetail"; "onRowAddNew": "onRowAddNew"; "onRowView": "onRowView"; "onRowCopy": "onRowCopy"; "onRowLocation": "onRowLocation"; "onRowDocument": "onRowDocument"; "onRowDelete": "onRowDelete"; "onRowGotoList": "onRowGotoList"; "onRowEdit": "onRowEdit"; "onRowPrint": "onRowPrint"; "onRowHistory": "onRowHistory"; "onRowOption": "onRowOption"; "onRowLanguage": "onRowLanguage"; "onRowCellOption": "onRowCellOption"; "onRowSelection": "onRowSelection"; "onShiftDoubleClick": "onShiftDoubleClick"; "rowCountChanged": "rowCountChanged"; "expansionChanged": "expansionChanged"; "bodyScroll": "bodyScroll"; "cellOptionSelect": "cellOptionSelect"; "rowDragEnd": "rowDragEnd"; }, never, never, true, never>;
|
|
303
384
|
}
|
|
@@ -23,5 +23,5 @@ export declare class OneGridCellCurrencyComponent {
|
|
|
23
23
|
cancelEdit(node: OneRowNode<any>, column: OneColumnDef<any>): void;
|
|
24
24
|
ngOnDestroy(): void;
|
|
25
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridCellCurrencyComponent, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCellCurrencyComponent, "app-one-grid-cell-currency", never, { "allowedEdit": { "alias": "allowedEdit"; "required": false; }; }, {}, never, never,
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCellCurrencyComponent, "app-one-grid-cell-currency", never, { "allowedEdit": { "alias": "allowedEdit"; "required": false; }; }, {}, never, never, true, never>;
|
|
27
27
|
}
|
package/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.d.ts
CHANGED
|
@@ -17,5 +17,5 @@ export declare class OneGridCellGroupRendererComponent<T> {
|
|
|
17
17
|
*/
|
|
18
18
|
invokeChangedClick(event: MouseEvent): void;
|
|
19
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridCellGroupRendererComponent<any>, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCellGroupRendererComponent<any>, "one-grid-cell-group-renderer", never, { "node": { "alias": "node"; "required": false; }; "masterDetail": { "alias": "masterDetail"; "required": false; }; "detailCellRendererParams": { "alias": "detailCellRendererParams"; "required": false; }; "detailRendererComponent": { "alias": "detailRendererComponent"; "required": false; }; }, { "expansionChanged": "expansionChanged"; }, never, never,
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCellGroupRendererComponent<any>, "one-grid-cell-group-renderer", never, { "node": { "alias": "node"; "required": false; }; "masterDetail": { "alias": "masterDetail"; "required": false; }; "detailCellRendererParams": { "alias": "detailCellRendererParams"; "required": false; }; "detailRendererComponent": { "alias": "detailRendererComponent"; "required": false; }; }, { "expansionChanged": "expansionChanged"; }, never, never, true, never>;
|
|
21
21
|
}
|
|
@@ -34,5 +34,5 @@ export declare class OneGridCellOptionMenuComponent implements AfterViewInit {
|
|
|
34
34
|
onOptionSelected(option: any): void;
|
|
35
35
|
private close;
|
|
36
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridCellOptionMenuComponent, never>;
|
|
37
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCellOptionMenuComponent, "one-grid-cell-option-menu", never, { "column": { "alias": "column"; "required": false; }; "node": { "alias": "node"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "cellOptionMenuSelect": "cellOptionMenuSelect"; "cellOptionMenuClose": "cellOptionMenuClose"; }, never, never,
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCellOptionMenuComponent, "one-grid-cell-option-menu", never, { "column": { "alias": "column"; "required": false; }; "node": { "alias": "node"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "cellOptionMenuSelect": "cellOptionMenuSelect"; "cellOptionMenuClose": "cellOptionMenuClose"; }, never, never, true, never>;
|
|
38
38
|
}
|
|
@@ -15,5 +15,5 @@ export declare class OneGridCheckboxComponent<T> {
|
|
|
15
15
|
constructor(selectionService: OneGridSelectionService, eventService: OneGridEventService);
|
|
16
16
|
onToggleSelection(event: any): void;
|
|
17
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridCheckboxComponent<any>, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCheckboxComponent<any>, "one-grid-checkbox", never, { "node": { "alias": "node"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; "api": { "alias": "api"; "required": false; }; }, { "onRowSelection": "onRowSelection"; }, never, never,
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCheckboxComponent<any>, "one-grid-checkbox", never, { "node": { "alias": "node"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; "api": { "alias": "api"; "required": false; }; }, { "onRowSelection": "onRowSelection"; }, never, never, true, never>;
|
|
19
19
|
}
|
|
@@ -23,5 +23,5 @@ export declare class OneGridCheckboxHeaderComponent<T> implements OnInit, OnDest
|
|
|
23
23
|
*/
|
|
24
24
|
toggleSelectionAll(event: any): void;
|
|
25
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridCheckboxHeaderComponent<any>, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCheckboxHeaderComponent<any>, "one-grid-checkbox-header", never, { "api": { "alias": "api"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; }, {}, never, never,
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridCheckboxHeaderComponent<any>, "one-grid-checkbox-header", never, { "api": { "alias": "api"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; }, {}, never, never, true, never>;
|
|
27
27
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { AfterViewInit, ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { OneColumnDef, OneGroupColumnDef } from '../../core/models/one-column-def-types.model';
|
|
3
3
|
import { OneGridApi } from '../../core/instants/one-grid-api.class';
|
|
4
4
|
import { OneGridEventService } from '../../core/services/one-grid-event.service';
|
|
5
|
+
import { OneHeaderMenuAction } from '../one-grid-header-menu/one-grid-header-menu.component';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class OneGridHeaderComponent<T> implements OnInit, AfterViewInit, OnDestroy {
|
|
7
8
|
private eventService;
|
|
8
9
|
private cdr;
|
|
10
|
+
private elementRef;
|
|
9
11
|
private headerViewport?;
|
|
10
12
|
/**
|
|
11
13
|
* Horizontal offset of the body, mirrored here so the header tracks it.
|
|
@@ -25,15 +27,71 @@ export declare class OneGridHeaderComponent<T> implements OnInit, AfterViewInit,
|
|
|
25
27
|
private sortModel;
|
|
26
28
|
private subscriptions;
|
|
27
29
|
private draggedIndex;
|
|
30
|
+
/** Where the drag started, for reporting the completed move as one event. */
|
|
31
|
+
private dragSourceIndex;
|
|
28
32
|
private resizing;
|
|
29
33
|
private resizeColumnIndex;
|
|
30
34
|
private startX;
|
|
31
35
|
private startWidth;
|
|
32
|
-
constructor(eventService: OneGridEventService, cdr: ChangeDetectorRef);
|
|
36
|
+
constructor(eventService: OneGridEventService, cdr: ChangeDetectorRef, elementRef: ElementRef);
|
|
37
|
+
/**
|
|
38
|
+
* Render a filter input under each column whose `filterable` resolves true.
|
|
39
|
+
*
|
|
40
|
+
* The inputs build a contains-filter per column and hand it to
|
|
41
|
+
* `api.setFilterModel`, debounced. Fields without a filter input are left
|
|
42
|
+
* alone: a programmatic filter on a non-filterable column survives typing
|
|
43
|
+
* here, while the filterable fields belong to the row — last writer wins.
|
|
44
|
+
*/
|
|
45
|
+
filterRow: boolean;
|
|
46
|
+
/** Current filter text per field. */
|
|
47
|
+
protected filterTexts: Record<string, string>;
|
|
48
|
+
private filterInput$;
|
|
49
|
+
/** Debounce for the filter row, in ms. */
|
|
50
|
+
private static readonly FILTER_DEBOUNCE;
|
|
51
|
+
protected onFilterInput(col: OneColumnDef<T>, event: Event): void;
|
|
52
|
+
private applyFilterRow;
|
|
33
53
|
ngOnInit(): void;
|
|
34
54
|
ngAfterViewInit(): void;
|
|
35
55
|
private applyScrollLeft;
|
|
36
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Minimum a column can be resized to, by pointer or keyboard.
|
|
58
|
+
*
|
|
59
|
+
* Exposed to the template for `aria-valuemin`, so what the resizer announces
|
|
60
|
+
* and what it enforces cannot drift apart.
|
|
61
|
+
*/
|
|
62
|
+
protected readonly MIN_COLUMN_WIDTH = 50;
|
|
63
|
+
/**
|
|
64
|
+
* The header's ⋮ button was a div with an empty handler — it rendered,
|
|
65
|
+
* looked interactive, and did nothing at all. Making it keyboard-reachable
|
|
66
|
+
* without giving it a purpose would only have added a dead tab stop per
|
|
67
|
+
* column, so it now reports the press the same way every row action does and
|
|
68
|
+
* the host decides what a column menu means.
|
|
69
|
+
*/
|
|
70
|
+
headerMenuClick: EventEmitter<OneColumnDef<T>>;
|
|
71
|
+
/**
|
|
72
|
+
* Render the grid's default column menu behind the ⋮ button.
|
|
73
|
+
*
|
|
74
|
+
* Opt-in: hosts that bound `(headerMenuClick)` to open their own menu keep
|
|
75
|
+
* exactly the behaviour they had — the intent still emits either way.
|
|
76
|
+
*/
|
|
77
|
+
headerMenu: boolean;
|
|
78
|
+
/** The column whose default menu is open, or null. */
|
|
79
|
+
protected openMenuColumn: OneColumnDef<T> | null;
|
|
80
|
+
/** Distance from the header's right edge to the open column's, in px. */
|
|
81
|
+
protected menuOffsetRight: number;
|
|
82
|
+
onHeaderMenuOptionClick(columnDef: OneColumnDef<T>, event?: MouseEvent): void;
|
|
83
|
+
/** The open column's current sort, so the menu offers the other states. */
|
|
84
|
+
protected menuSortState(col: OneColumnDef<T>): 'asc' | 'desc' | null;
|
|
85
|
+
protected onHeaderMenuAction(action: OneHeaderMenuAction, col: OneColumnDef<T>): void;
|
|
86
|
+
protected closeHeaderMenu(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Resize from the keyboard.
|
|
89
|
+
*
|
|
90
|
+
* The pointer path is a drag, and WCAG 2.5.7 requires a single-pointer
|
|
91
|
+
* alternative that is not one. Arrows step, shift steps coarser, and
|
|
92
|
+
* Home/End go to the column's own bounds.
|
|
93
|
+
*/
|
|
94
|
+
protected onResizeKeydown(event: KeyboardEvent, columnIndex: number): void;
|
|
37
95
|
onHeaderMenuSortClick(colId: keyof T): void;
|
|
38
96
|
private cycleSort;
|
|
39
97
|
onResizeStart(event: MouseEvent, columnIndex: number): void;
|
|
@@ -43,7 +101,14 @@ export declare class OneGridHeaderComponent<T> implements OnInit, AfterViewInit,
|
|
|
43
101
|
onDragColumnOver(event: DragEvent, targetIndex: number): void;
|
|
44
102
|
onDragColumnEnd(event: DragEvent): void;
|
|
45
103
|
onDropColumn(event: DragEvent): void;
|
|
104
|
+
/**
|
|
105
|
+
* The reorder itself already happened, step by step, during dragover — this
|
|
106
|
+
* only reports the completed move. Both `drop` and `dragend` funnel here and
|
|
107
|
+
* both can fire for one gesture; nulling the indexes makes the second call a
|
|
108
|
+
* no-op, so one gesture reports once.
|
|
109
|
+
*/
|
|
110
|
+
private finishColumnDrag;
|
|
46
111
|
ngOnDestroy(): void;
|
|
47
112
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridHeaderComponent<any>, never>;
|
|
48
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridHeaderComponent<any>, "one-grid-header", never, { "scrollLeft": { "alias": "scrollLeft"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; "enableGroupColumnDefs": { "alias": "enableGroupColumnDefs"; "required": false; }; "api": { "alias": "api"; "required": false; }; }, {}, never, never,
|
|
113
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridHeaderComponent<any>, "one-grid-header", never, { "scrollLeft": { "alias": "scrollLeft"; "required": false; }; "allowedEdit": { "alias": "allowedEdit"; "required": false; }; "enableGroupColumnDefs": { "alias": "enableGroupColumnDefs"; "required": false; }; "api": { "alias": "api"; "required": false; }; "filterRow": { "alias": "filterRow"; "required": false; }; "headerMenu": { "alias": "headerMenu"; "required": false; }; }, { "headerMenuClick": "headerMenuClick"; }, never, never, true, never>;
|
|
49
114
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { OneColumnDef } from '../../core/models/one-column-def-types.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** What a default header menu entry does when chosen. */
|
|
5
|
+
export type OneHeaderMenuAction = 'sortAsc' | 'sortDesc' | 'clearSort' | 'pinLeft' | 'pinRight' | 'unpin' | 'hide';
|
|
6
|
+
interface HeaderMenuEntry {
|
|
7
|
+
action: OneHeaderMenuAction;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The grid's default column menu, opened by the header's ⋮ button when the
|
|
12
|
+
* grid sets `[headerMenu]="true"`.
|
|
13
|
+
*
|
|
14
|
+
* Entries follow the column: sorting only on a sortable column and only the
|
|
15
|
+
* transitions that make sense from the current state, pinning without the
|
|
16
|
+
* side it is already on, hiding never for the last visible column. The menu
|
|
17
|
+
* only reports the chosen action — the header executes it against the API,
|
|
18
|
+
* for the same reason the cell option menu does not mutate rows itself.
|
|
19
|
+
*
|
|
20
|
+
* Keyboard behaviour is the menu pattern the cell option menu established:
|
|
21
|
+
* focus moves in on open, arrows rove, Escape and outside clicks close.
|
|
22
|
+
*/
|
|
23
|
+
export declare class OneGridHeaderMenuComponent implements OnInit, AfterViewInit {
|
|
24
|
+
private elementRef;
|
|
25
|
+
column: OneColumnDef;
|
|
26
|
+
/** The column's current sort, so the menu offers only the other states. */
|
|
27
|
+
sortState: 'asc' | 'desc' | null;
|
|
28
|
+
/** False when this is the last visible column, which must stay visible. */
|
|
29
|
+
canHide: boolean;
|
|
30
|
+
menuAction: EventEmitter<OneHeaderMenuAction>;
|
|
31
|
+
menuClose: EventEmitter<void>;
|
|
32
|
+
private items?;
|
|
33
|
+
protected entries: HeaderMenuEntry[];
|
|
34
|
+
protected activeIndex: number;
|
|
35
|
+
protected get menuLabel(): string;
|
|
36
|
+
constructor(elementRef: ElementRef);
|
|
37
|
+
/**
|
|
38
|
+
* Built once on open rather than in a getter: the entries feed the roving
|
|
39
|
+
* tabindex, and a list that re-derives mid-interaction would move focus.
|
|
40
|
+
*/
|
|
41
|
+
ngOnInit(): void;
|
|
42
|
+
ngAfterViewInit(): void;
|
|
43
|
+
protected onEntrySelected(entry: HeaderMenuEntry): void;
|
|
44
|
+
protected onItemKeydown(event: KeyboardEvent, index: number, entry: HeaderMenuEntry): void;
|
|
45
|
+
private focusItem;
|
|
46
|
+
onDocumentClick(event: MouseEvent): void;
|
|
47
|
+
onEscape(): void;
|
|
48
|
+
onScroll(): void;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridHeaderMenuComponent, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridHeaderMenuComponent, "one-grid-header-menu", never, { "column": { "alias": "column"; "required": false; }; "sortState": { "alias": "sortState"; "required": false; }; "canHide": { "alias": "canHide"; "required": false; }; }, { "menuAction": "menuAction"; "menuClose": "menuClose"; }, never, never, true, never>;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -36,5 +36,5 @@ export declare class OneGridPaginationComponent {
|
|
|
36
36
|
goToLastPage(): void;
|
|
37
37
|
onPageSizeChange(event: Event): void;
|
|
38
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridPaginationComponent, never>;
|
|
39
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridPaginationComponent, "one-grid-pagination", never, { "paginate": { "alias": "paginate"; "required": false; }; }, { "goToFirst": "goToFirst"; "goToPrevious": "goToPrevious"; "goToNext": "goToNext"; "goToLast": "goToLast"; "pageSizeChange": "pageSizeChange"; }, never, never,
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridPaginationComponent, "one-grid-pagination", never, { "paginate": { "alias": "paginate"; "required": false; }; }, { "goToFirst": "goToFirst"; "goToPrevious": "goToPrevious"; "goToNext": "goToNext"; "goToLast": "goToLast"; "pageSizeChange": "pageSizeChange"; }, never, never, true, never>;
|
|
40
40
|
}
|
|
@@ -99,5 +99,5 @@ export declare class OneGridRowActionComponent<T> implements OnInit {
|
|
|
99
99
|
invokeRowActionLanguage(node: OneRowNode<T>, column: OneColumnDef<T>): void;
|
|
100
100
|
invokeRowActionCellOption(node: OneRowNode<T>, column: OneColumnDef<T>): void;
|
|
101
101
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridRowActionComponent<any>, never>;
|
|
102
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridRowActionComponent<any>, "one-grid-row-action", never, { "column": { "alias": "column"; "required": true; }; "node": { "alias": "node"; "required": true; }; "allowedEdit": { "alias": "allowedEdit"; "required": true; }; "masterDetail": { "alias": "masterDetail"; "required": false; }; "masterNode": { "alias": "masterNode"; "required": false; }; "cellRendererParams": { "alias": "cellRendererParams"; "required": false; }; "gridType": { "alias": "gridType"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "onRowGotoDetail": "onRowGotoDetail"; "onRowAddNew": "onRowAddNew"; "onRowView": "onRowView"; "onRowLocation": "onRowLocation"; "onRowDocument": "onRowDocument"; "onRowCopy": "onRowCopy"; "onRowDelete": "onRowDelete"; "onRowGotoList": "onRowGotoList"; "onRowEdit": "onRowEdit"; "onRowPrint": "onRowPrint"; "onRowHistory": "onRowHistory"; "onRowOption": "onRowOption"; "onRowLanguage": "onRowLanguage"; "onRowCellOption": "onRowCellOption"; }, never, never,
|
|
102
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridRowActionComponent<any>, "one-grid-row-action", never, { "column": { "alias": "column"; "required": true; }; "node": { "alias": "node"; "required": true; }; "allowedEdit": { "alias": "allowedEdit"; "required": true; }; "masterDetail": { "alias": "masterDetail"; "required": false; }; "masterNode": { "alias": "masterNode"; "required": false; }; "cellRendererParams": { "alias": "cellRendererParams"; "required": false; }; "gridType": { "alias": "gridType"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "onRowGotoDetail": "onRowGotoDetail"; "onRowAddNew": "onRowAddNew"; "onRowView": "onRowView"; "onRowLocation": "onRowLocation"; "onRowDocument": "onRowDocument"; "onRowCopy": "onRowCopy"; "onRowDelete": "onRowDelete"; "onRowGotoList": "onRowGotoList"; "onRowEdit": "onRowEdit"; "onRowPrint": "onRowPrint"; "onRowHistory": "onRowHistory"; "onRowOption": "onRowOption"; "onRowLanguage": "onRowLanguage"; "onRowCellOption": "onRowCellOption"; }, never, never, true, never>;
|
|
103
103
|
}
|
|
@@ -35,5 +35,5 @@ export declare class OneGridRowDragHandleComponent<T> {
|
|
|
35
35
|
protected onBlur(): void;
|
|
36
36
|
private emit;
|
|
37
37
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridRowDragHandleComponent<any>, never>;
|
|
38
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridRowDragHandleComponent<any>, "one-grid-row-drag-handle", never, { "node": { "alias": "node"; "required": true; }; "suppressedReason": { "alias": "suppressedReason"; "required": false; }; }, { "dragEnd": "dragEnd"; }, never, never,
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridRowDragHandleComponent<any>, "one-grid-row-drag-handle", never, { "node": { "alias": "node"; "required": true; }; "suppressedReason": { "alias": "suppressedReason"; "required": false; }; }, { "dragEnd": "dragEnd"; }, never, never, true, never>;
|
|
39
39
|
}
|
|
@@ -11,5 +11,5 @@ export declare class OneGridStatusComponent implements OneCellRendererComponent
|
|
|
11
11
|
private getType;
|
|
12
12
|
private getLabel;
|
|
13
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneGridStatusComponent, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridStatusComponent, "one-grid-status", never, {}, {}, never, never,
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OneGridStatusComponent, "one-grid-status", never, {}, {}, never, never, true, never>;
|
|
15
15
|
}
|
|
@@ -11,5 +11,5 @@ export declare class OneCellInputValidatorDirective {
|
|
|
11
11
|
onKeyPress(event: KeyboardEvent): void;
|
|
12
12
|
onKeyDown(event: KeyboardEvent): void;
|
|
13
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneCellInputValidatorDirective, never>;
|
|
14
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<OneCellInputValidatorDirective, "[oneCellInputValidator]", never, { "validationType": { "alias": "validationType"; "required": false; }; "regex": { "alias": "regex"; "required": false; }; }, {}, never, never,
|
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<OneCellInputValidatorDirective, "[oneCellInputValidator]", never, { "validationType": { "alias": "validationType"; "required": false; }; "regex": { "alias": "regex"; "required": false; }; }, {}, never, never, true, never>;
|
|
15
15
|
}
|
|
@@ -16,5 +16,5 @@ export declare class OneCellRendererComponentDirective implements OnInit, OnChan
|
|
|
16
16
|
private destroyComponent;
|
|
17
17
|
ngOnDestroy(): void;
|
|
18
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneCellRendererComponentDirective, never>;
|
|
19
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<OneCellRendererComponentDirective, "[oneCellRendererComponent]", never, { "cellRendererComponent": { "alias": "cellRendererComponent"; "required": true; }; "params": { "alias": "params"; "required": true; }; }, {}, never, never,
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<OneCellRendererComponentDirective, "[oneCellRendererComponent]", never, { "cellRendererComponent": { "alias": "cellRendererComponent"; "required": true; }; "params": { "alias": "params"; "required": true; }; }, {}, never, never, true, never>;
|
|
20
20
|
}
|
|
@@ -29,5 +29,5 @@ export declare class OneCellTextExpandDirective implements OnDestroy {
|
|
|
29
29
|
private expand;
|
|
30
30
|
private collapse;
|
|
31
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<OneCellTextExpandDirective, never>;
|
|
32
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<OneCellTextExpandDirective, "[oneCellTextExpand]", never, {}, {}, never, never,
|
|
32
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<OneCellTextExpandDirective, "[oneCellTextExpand]", never, {}, {}, never, never, true, never>;
|
|
33
33
|
}
|