@one-grid-core/angular 0.1.0-beta.6 → 0.2.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.
Files changed (66) hide show
  1. package/README.md +49 -4
  2. package/esm2022/lib/components/one-grid/one-grid.component.mjs +67 -16
  3. package/esm2022/lib/components/one-grid-body/one-grid-body.component.mjs +282 -30
  4. package/esm2022/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.mjs +10 -7
  5. package/esm2022/lib/components/one-grid-cell-option-menu/one-grid-cell-option-menu.component.mjs +60 -4
  6. package/esm2022/lib/components/one-grid-checkbox-header/one-grid-checkbox-header.component.mjs +14 -5
  7. package/esm2022/lib/components/one-grid-header/one-grid-header.component.mjs +50 -13
  8. package/esm2022/lib/components/one-grid-pagination/one-grid-pagination.component.mjs +39 -15
  9. package/esm2022/lib/components/one-grid-row-action/one-grid-row-action.component.mjs +54 -8
  10. package/esm2022/lib/components/one-grid-row-drag-handle/one-grid-row-drag-handle.component.mjs +110 -0
  11. package/esm2022/lib/core/directives/one-cell-renderer-component.directive.mjs +9 -2
  12. package/esm2022/lib/core/directives/one-cell-text-expand.directive.mjs +33 -51
  13. package/esm2022/lib/core/instants/one-grid-api.class.mjs +429 -166
  14. package/esm2022/lib/core/instants/one-row-node.class.mjs +103 -37
  15. package/esm2022/lib/core/models/one-column-def-types.model.mjs +1 -1
  16. package/esm2022/lib/core/models/one-event-types.model.mjs +1 -1
  17. package/esm2022/lib/core/models/one-grid-types.model.mjs +1 -1
  18. package/esm2022/lib/core/models/one-row-drag.model.mjs +2 -0
  19. package/esm2022/lib/core/models/one-row.model.mjs +1 -1
  20. package/esm2022/lib/core/models/one-tree-data.model.mjs +1 -1
  21. package/esm2022/lib/core/models/one-validation.model.mjs +1 -1
  22. package/esm2022/lib/core/pipes/cell-field-value-empty.pipe.mjs +8 -3
  23. package/esm2022/lib/core/pipes/column-sort-state.pipe.mjs +3 -1
  24. package/esm2022/lib/core/services/og-column.service.mjs +120 -13
  25. package/esm2022/lib/core/services/one-grid-cell.service.mjs +123 -20
  26. package/esm2022/lib/core/services/one-grid-row-drag.service.mjs +351 -0
  27. package/esm2022/lib/core/services/one-grid-selection.service.mjs +19 -6
  28. package/esm2022/lib/helpers/one-column-def.helper.mjs +27 -2
  29. package/esm2022/lib/helpers/one-filter.helper.mjs +71 -12
  30. package/esm2022/lib/helpers/one-validation.helper.mjs +7 -2
  31. package/esm2022/lib/index.mjs +6 -1
  32. package/esm2022/lib/one-grid.module.mjs +7 -16
  33. package/fesm2022/one-grid-core-angular.mjs +1964 -421
  34. package/fesm2022/one-grid-core-angular.mjs.map +1 -1
  35. package/lib/components/one-grid/one-grid.component.d.ts +16 -1
  36. package/lib/components/one-grid-body/one-grid-body.component.d.ts +132 -5
  37. package/lib/components/one-grid-cell-group-renderer/one-grid-cell-group-renderer.component.d.ts +6 -1
  38. package/lib/components/one-grid-cell-option-menu/one-grid-cell-option-menu.component.d.ts +19 -2
  39. package/lib/components/one-grid-checkbox-header/one-grid-checkbox-header.component.d.ts +5 -2
  40. package/lib/components/one-grid-header/one-grid-header.component.d.ts +15 -7
  41. package/lib/components/one-grid-pagination/one-grid-pagination.component.d.ts +24 -5
  42. package/lib/components/one-grid-row-action/one-grid-row-action.component.d.ts +44 -0
  43. package/lib/components/one-grid-row-drag-handle/one-grid-row-drag-handle.component.d.ts +39 -0
  44. package/lib/core/directives/one-cell-text-expand.directive.d.ts +21 -9
  45. package/lib/core/instants/one-grid-api.class.d.ts +212 -26
  46. package/lib/core/instants/one-row-node.class.d.ts +67 -14
  47. package/lib/core/models/one-column-def-types.model.d.ts +89 -15
  48. package/lib/core/models/one-event-types.model.d.ts +24 -1
  49. package/lib/core/models/one-grid-types.model.d.ts +36 -1
  50. package/lib/core/models/one-row-drag.model.d.ts +44 -0
  51. package/lib/core/models/one-row.model.d.ts +0 -5
  52. package/lib/core/models/one-tree-data.model.d.ts +13 -0
  53. package/lib/core/models/one-validation.model.d.ts +12 -2
  54. package/lib/core/pipes/column-sort-state.pipe.d.ts +1 -1
  55. package/lib/core/services/og-column.service.d.ts +44 -3
  56. package/lib/core/services/one-grid-cell.service.d.ts +52 -4
  57. package/lib/core/services/one-grid-row-drag.service.d.ts +113 -0
  58. package/lib/core/services/one-grid-selection.service.d.ts +9 -0
  59. package/lib/helpers/one-column-def.helper.d.ts +19 -1
  60. package/lib/helpers/one-filter.helper.d.ts +29 -4
  61. package/lib/index.d.ts +5 -0
  62. package/lib/one-grid.module.d.ts +17 -19
  63. package/package.json +1 -2
  64. package/scss/_one-grid.scss +389 -17
  65. package/esm2022/lib/core/pipes/cell-disable-resolver.pipe.mjs +0 -26
  66. package/lib/core/pipes/cell-disable-resolver.pipe.d.ts +0 -9
@@ -9,6 +9,7 @@ import { CellOptionMenuSelectedEvent, ExpansionChangedEvent, RowSelectionMode, S
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';
12
+ import { OneRowDragEvent } from '../../core/models/one-row-drag.model';
12
13
  import * as i0 from "@angular/core";
13
14
  export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterViewInit, OnDestroy {
14
15
  protected api: OneGridApi;
@@ -28,6 +29,14 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
28
29
  groupColumnDefs: OneGroupColumnDef[];
29
30
  defaultColumnDef: OneColumnDef<T>;
30
31
  columnDefs: OneColumnDef<T>[];
32
+ /**
33
+ * Rows anchored above the scrolling area — a header summary, or an entry line.
34
+ * They keep column alignment and scroll sideways with the body, but are not
35
+ * data: sorting, filtering, selection and the row count all pass them by.
36
+ */
37
+ pinnedTopRowData: T[];
38
+ /** Rows anchored below the scrolling area, typically a totals row. */
39
+ pinnedBottomRowData: T[];
31
40
  protected gridCopy$: Subject<ClipboardEvent>;
32
41
  /**
33
42
  * Master Detail Feature
@@ -47,6 +56,11 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
47
56
  /**
48
57
  * Bind Row Action Events & Data to Parent
49
58
  */
59
+ /**
60
+ * A row finished moving. Fires once per completed reorder — not while the
61
+ * pointer is in flight — and only when the position actually changed.
62
+ */
63
+ rowDragEnd: EventEmitter<OneRowDragEvent<T>>;
50
64
  onGridReady: EventEmitter<OneGridReadyEvent<T>>;
51
65
  onRowGotoDetail: EventEmitter<OneGridRowActionEvent<T>>;
52
66
  onRowAddNew: EventEmitter<OneGridRowActionEvent<T>>;
@@ -129,11 +143,12 @@ export declare class OneGridComponent<T> implements OnInit, OnChanges, AfterView
129
143
  invokeGoToNext(): void;
130
144
  invokeGoToLast(): void;
131
145
  invokePageSizeChange(pageSize: number): void;
146
+ invokeRowDragEnd(event: OneRowDragEvent<T>): void;
132
147
  invokeExpansionChangedClick(event: ExpansionChangedEvent<T>): void;
133
148
  /**
134
149
  * Handle Unsubscribe All Event Listenders
135
150
  */
136
151
  ngOnDestroy(): void;
137
152
  static ɵfac: i0.ɵɵFactoryDeclaration<OneGridComponent<any>, never>;
138
- 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; }; "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; }; }, { "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, false, 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, false, never>;
139
154
  }
@@ -1,5 +1,5 @@
1
- import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef, Type } from '@angular/core';
2
- import { OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef, Type } from '@angular/core';
2
+ import { OneCellPresentationParams, OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';
3
3
  import { OneCellRendererComponent } from '../../core/models/one-tree-data.model';
4
4
  import { OneRowNode } from '../../core/instants/one-row-node.class';
5
5
  import { OneGridApi } from '../../core/instants/one-grid-api.class';
@@ -11,11 +11,14 @@ import { OneDetailCellRendererParams } from '../../core/models/one-master-detail
11
11
  import { OneGridCellService } from '../../core/services/one-grid-cell.service';
12
12
  import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
13
13
  import { OgColumnService } from '../../core/services/og-column.service';
14
+ import { OneGridRowDragService } from '../../core/services/one-grid-row-drag.service';
15
+ import { OneRowDragEvent, OneRowDragState, OneRowDragSuppressedReason } from '../../core/models/one-row-drag.model';
14
16
  import * as i0 from "@angular/core";
15
- export declare class OneGridBodyComponent<T> implements OnInit, OnDestroy {
17
+ export declare class OneGridBodyComponent<T> implements OnInit, AfterViewInit, OnDestroy {
16
18
  protected colService: OgColumnService;
17
19
  protected cellService: OneGridCellService;
18
20
  private eventService;
21
+ protected rowDragService: OneGridRowDragService<T>;
19
22
  private cdr;
20
23
  /**
21
24
  * Core Properties
@@ -31,6 +34,19 @@ export declare class OneGridBodyComponent<T> implements OnInit, OnDestroy {
31
34
  context: any;
32
35
  getRowId: (params: OneGridGetRowIdParams<T>) => string;
33
36
  gridCopy$: Subject<ClipboardEvent>;
37
+ /**
38
+ * Pinned rows are bound only so the component re-renders when they change;
39
+ * the nodes themselves come from the API, which owns them.
40
+ */
41
+ pinnedTopRowData: T[];
42
+ pinnedBottomRowData: T[];
43
+ /**
44
+ * The pinned row containers sit outside the scroll viewport, so they have to
45
+ * be told the horizontal offset — the same arrangement the header uses.
46
+ */
47
+ private pinnedViewports?;
48
+ protected pinnedTopNodes: OneRowNode<T>[];
49
+ protected pinnedBottomNodes: OneRowNode<T>[];
34
50
  viewport: CdkVirtualScrollViewport;
35
51
  protected columnDefs: OneColumnDef<T>[];
36
52
  protected cellRenderer: boolean;
@@ -74,11 +90,19 @@ export declare class OneGridBodyComponent<T> implements OnInit, OnDestroy {
74
90
  expansionChanged: EventEmitter<ExpansionChangedEvent<T>>;
75
91
  bodyScroll: EventEmitter<number>;
76
92
  cellOptionSelect: EventEmitter<any>;
93
+ rowDragEnd: EventEmitter<OneRowDragEvent<T>>;
77
94
  /**
78
95
  * Selection Range Variables
79
96
  */
80
97
  protected rowWidth: number;
81
98
  protected nodes: OneRowNode<T>[];
99
+ /**
100
+ * Row drag state, mirrored from the service so the template can read it
101
+ * synchronously. `null` whenever no drag is in flight.
102
+ */
103
+ protected dragState: OneRowDragState | null;
104
+ protected dragAnnouncement: string;
105
+ protected rowDragSuppressed: OneRowDragSuppressedReason | null;
82
106
  protected selectedCells: Set<string>;
83
107
  private isMouseDown;
84
108
  private startCell;
@@ -92,10 +116,19 @@ export declare class OneGridBodyComponent<T> implements OnInit, OnDestroy {
92
116
  protected itemSize: number;
93
117
  protected minBufferPx: number;
94
118
  protected maxBufferPx: number;
95
- constructor(colService: OgColumnService, cellService: OneGridCellService, eventService: OneGridEventService, cdr: ChangeDetectorRef);
119
+ constructor(colService: OgColumnService, cellService: OneGridCellService, eventService: OneGridEventService, rowDragService: OneGridRowDragService<T>, cdr: ChangeDetectorRef);
96
120
  ngOnInit(): void;
97
121
  onGridReady(params: OneGridReadyEvent): void;
98
122
  onBodyScroll(event: Event): void;
123
+ /**
124
+ * Keep the pinned rows in step with the body's horizontal position.
125
+ *
126
+ * Assigned rather than transformed, for the same reason as the header: sticky
127
+ * positioning for pinned *columns* has to resolve against a real scrollport,
128
+ * and a transformed ancestor is not one. Pinned rows and pinned columns
129
+ * therefore compose — a frozen corner cell stays frozen on both axes.
130
+ */
131
+ private syncPinnedRows;
99
132
  /**
100
133
  * Track Rendering Row Node By Row ID
101
134
  */
@@ -139,8 +172,39 @@ export declare class OneGridBodyComponent<T> implements OnInit, OnDestroy {
139
172
  invokeRowActionHistory(event: OneGridRowActionEvent<T>): void;
140
173
  invokeRowActionOption(event: OneGridRowActionEvent<T>): void;
141
174
  invokeRowActionLanguage(event: OneGridRowActionEvent<T>): void;
175
+ /**
176
+ * Open the cell option menu, and tell the host it was asked for.
177
+ *
178
+ * The opening is the part that was missing. Everything else existed — the
179
+ * trigger button behind `cellRendererParams.cellOptionButtonStatus`, the menu
180
+ * component, the `cellOptionMenu` column property, the selection event wired
181
+ * through to the grid's output — but nothing ever set the flag the template
182
+ * renders on, so the button did nothing at all.
183
+ *
184
+ * Done here rather than in the row-action component because this is the
185
+ * component whose template renders the menu, and so the one that has to be
186
+ * marked for check.
187
+ */
142
188
  invokeRowActionCellOption(event: OneGridRowActionEvent<T>): void;
189
+ /**
190
+ * The menu closed itself — on select, on Escape, or on a click outside. It
191
+ * has already cleared its own flag; this is what repaints without it.
192
+ */
193
+ cellOptionMenuClosed(): void;
143
194
  invokeRowActionSelection(event: OneGridRowActionEvent<T>): void;
195
+ /**
196
+ * Toggle a group / master row, then report the result.
197
+ *
198
+ * The group renderer is presentational: it says "the expander was clicked"
199
+ * and nothing more. Performing the state change belongs here, where the API
200
+ * is available. Previously this method only re-emitted, so the expander
201
+ * rendered, animated on hover and did nothing at all — every consumer had to
202
+ * discover for itself that `expansionChanged` was a request rather than the
203
+ * notification its past-tense name promises.
204
+ *
205
+ * The event is re-emitted *after* the toggle, so `event.node.expanded` is the
206
+ * new state, which is what a past-tense event should carry.
207
+ */
144
208
  invokeExpansionChangedClick(event: ExpansionChangedEvent): void;
145
209
  cellOptionMenuSelected(event: CellOptionMenuSelectedEvent): void;
146
210
  /**
@@ -165,12 +229,75 @@ export declare class OneGridBodyComponent<T> implements OnInit, OnDestroy {
165
229
  setCellValueByRowId(rowId: string, column: OneColumnDef, value: any): void;
166
230
  /**
167
231
  * Virtual Scroll Properties
232
+ *
233
+ * The buffer scales with the row count so small grids render in one pass, but
234
+ * it is capped: `itemSize * items * 1.5` is 1.5x the *total* content height,
235
+ * and CdkFixedSizeVirtualScroll expands its rendered range until the buffer is
236
+ * satisfied. Uncapped, that makes the viewport materialise every row and
237
+ * virtual scrolling stops doing anything at all (100k rows locked the tab).
238
+ * MAX_BUFFER_PX keeps roughly twenty rows of overscan either side instead.
168
239
  */
240
+ private readonly MAX_BUFFER_PX;
169
241
  setVirtualScroll(items?: number): void;
170
242
  /**
171
243
  * Unsubscribe All Subscriptions
172
244
  */
245
+ /**
246
+ * Hand the drag service what it needs to run a gesture.
247
+ *
248
+ * Deferred to here because the viewport element does not exist until the view
249
+ * is up, and `nodes` is passed as a getter rather than a value — a drag
250
+ * mutates the order underneath it, so a snapshot taken at attach time would
251
+ * go stale on the first move.
252
+ */
253
+ ngAfterViewInit(): void;
254
+ /**
255
+ * The params every per-cell callback receives.
256
+ *
257
+ * Built here rather than inline in the template so the whole documented
258
+ * shape is passed — `value`, `field`, `rowIndex`, `api` and `context` were
259
+ * all declared on `OneCellRendererParams` and none of them were being sent,
260
+ * so a `cellClass` reading `params.value` silently got `undefined`.
261
+ */
262
+ protected cellParams(node: OneRowNode<T>, column: OneColumnDef<T>): OneCellPresentationParams<T>;
263
+ /**
264
+ * Params for a component cell renderer.
265
+ *
266
+ * The cell params, plus whatever the column declared in
267
+ * `cellRendererParams` — a field that exists precisely so a renderer can be
268
+ * configured per column, and that nothing had ever forwarded to it. Column
269
+ * config goes first so the grid's own fields win a name collision.
270
+ */
271
+ protected rendererParams(node: OneRowNode<T>, column: OneColumnDef<T>): OneCellRendererParams<T>;
272
+ /** Is this the row currently being moved? */
273
+ protected isRowDragging(node: OneRowNode<T>): boolean;
274
+ /**
275
+ * Where to paint the drop indicator, in pixels from the top of the body.
276
+ *
277
+ * `insertAt` is a boundary, so the line sits at row-height times the number
278
+ * of rows above it — in content space. The indicator is a sibling of the
279
+ * viewport rather than a child, because anything inside it either scrolls
280
+ * away with the transformed content wrapper or ignores the scroll entirely,
281
+ * so the viewport's own scroll offset and its position within the body are
282
+ * both subtracted back out here.
283
+ *
284
+ * A field rather than a getter: it is read from the template on every change
285
+ * detection pass, and it only actually moves when the drag state or the
286
+ * scroll position does.
287
+ */
288
+ protected dropIndicatorTop: number | null;
289
+ /**
290
+ * How wide the line is drawn. Rows are `width: fit-content`, so they are
291
+ * often narrower than the viewport — a full-bleed line would hang past the
292
+ * last column into empty space and read as part of the frame rather than the
293
+ * rows. This is the visible extent of the row content, which also shrinks
294
+ * correctly as the grid is scrolled sideways.
295
+ */
296
+ protected dropIndicatorWidth: number;
297
+ private updateDropIndicator;
298
+ protected onRowDragEnd(event: OneRowDragEvent<T>): void;
299
+ private refreshRowDragSuppressed;
173
300
  ngOnDestroy(): void;
174
301
  static ɵfac: i0.ɵɵFactoryDeclaration<OneGridBodyComponent<any>, never>;
175
- 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; }; "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"; }, never, never, false, 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, false, never>;
176
303
  }
@@ -10,7 +10,12 @@ export declare class OneGridCellGroupRendererComponent<T> {
10
10
  detailCellRendererParams: OneDetailCellRendererParams;
11
11
  detailRendererComponent: Type<OneCellRendererComponent>;
12
12
  expansionChanged: EventEmitter<ExpansionChangedEvent<T>>;
13
- invokeChangedClick(): void;
13
+ /**
14
+ * Presentational only: report the click and let the body, which holds the
15
+ * API, perform the toggle. The click is stopped from bubbling so it is not
16
+ * also read as a cell click by the cell underneath.
17
+ */
18
+ invokeChangedClick(event: MouseEvent): void;
14
19
  static ɵfac: i0.ɵɵFactoryDeclaration<OneGridCellGroupRendererComponent<any>, never>;
15
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, false, never>;
16
21
  }
@@ -1,16 +1,33 @@
1
- import { ElementRef, EventEmitter } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, EventEmitter } from '@angular/core';
2
2
  import { OneRowNode } from '../../core/instants/one-row-node.class';
3
3
  import { OneColumnDef } from '../../core/models/one-column-def-types.model';
4
4
  import { CellOptionMenuSelectedEvent, OneCellOptionMenu } from '../../core/models/one-event-types.model';
5
5
  import * as i0 from "@angular/core";
6
- export declare class OneGridCellOptionMenuComponent {
6
+ export declare class OneGridCellOptionMenuComponent implements AfterViewInit {
7
7
  private elementRef;
8
8
  column: OneColumnDef;
9
9
  node: OneRowNode;
10
10
  options: OneCellOptionMenu[];
11
11
  cellOptionMenuSelect: EventEmitter<CellOptionMenuSelectedEvent<any>>;
12
12
  cellOptionMenuClose: EventEmitter<void>;
13
+ private items?;
14
+ /**
15
+ * Roving tabindex: one item is tabbable and the arrows move which. Standard
16
+ * for a menu — a list of separately tabbable buttons makes a keyboard user
17
+ * tab through every option to get past the menu.
18
+ */
19
+ protected activeIndex: number;
20
+ protected get menuLabel(): string;
13
21
  constructor(elementRef: ElementRef);
22
+ /**
23
+ * Move focus into the menu once it exists.
24
+ *
25
+ * Opening a menu and leaving focus on the trigger strands a keyboard user:
26
+ * the menu is on screen and nothing they press reaches it.
27
+ */
28
+ ngAfterViewInit(): void;
29
+ protected onItemKeydown(event: KeyboardEvent, index: number, option: OneCellOptionMenu): void;
30
+ private focusItem;
14
31
  onDocumentClick(event: MouseEvent): void;
15
32
  onEscape(): void;
16
33
  onScroll(): void;
@@ -1,20 +1,23 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { OneGridSelectionService } from '../../core/services/one-grid-selection.service';
3
3
  import { OneRowNode } from '../../core/instants/one-row-node.class';
4
4
  import { OneGridApi } from '../../core/instants/one-grid-api.class';
5
5
  import { OneGridEventService } from '../../core/services/one-grid-event.service';
6
6
  import { OneCheckboxState, RowSelectionMode } from '../../core/models/one-event-types.model';
7
7
  import * as i0 from "@angular/core";
8
- export declare class OneGridCheckboxHeaderComponent<T> implements OnInit {
8
+ export declare class OneGridCheckboxHeaderComponent<T> implements OnInit, OnDestroy {
9
9
  private eventService;
10
10
  private selectionService;
11
11
  api: OneGridApi<T>;
12
12
  allowedEdit: boolean;
13
+ /** Unsubscribe callbacks for the two grid listeners below. */
14
+ private readonly teardown;
13
15
  state: OneCheckboxState;
14
16
  rowNodes: OneRowNode<T>[];
15
17
  selectionMode: RowSelectionMode;
16
18
  constructor(eventService: OneGridEventService, selectionService: OneGridSelectionService);
17
19
  ngOnInit(): void;
20
+ ngOnDestroy(): void;
18
21
  /**
19
22
  * Toggle Selection Action
20
23
  */
@@ -1,19 +1,28 @@
1
- import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
1
+ import { AfterViewInit, ChangeDetectorRef, 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
5
  import * as i0 from "@angular/core";
6
- export declare class OneGridHeaderComponent<T> implements OnInit, OnDestroy {
6
+ export declare class OneGridHeaderComponent<T> implements OnInit, AfterViewInit, OnDestroy {
7
7
  private eventService;
8
8
  private cdr;
9
- scrollLeft: number;
9
+ private headerViewport?;
10
+ /**
11
+ * Horizontal offset of the body, mirrored here so the header tracks it.
12
+ *
13
+ * Applied to the viewport's `scrollLeft` rather than as a transform on the
14
+ * row: sticky positioning needs a real scrollport above it. The group row,
15
+ * which is a sibling of that viewport, still reads this for its transform.
16
+ */
17
+ set scrollLeft(value: number);
18
+ get scrollLeft(): number;
19
+ private _scrollLeft;
10
20
  allowedEdit: boolean;
11
21
  enableGroupColumnDefs: boolean;
12
22
  api: OneGridApi<T>;
13
23
  protected groupColumnDefs: OneGroupColumnDef[];
14
24
  protected columnDefs: OneColumnDef<T>[];
15
25
  private sortModel;
16
- private destroy$;
17
26
  private subscriptions;
18
27
  private draggedIndex;
19
28
  private resizing;
@@ -22,6 +31,8 @@ export declare class OneGridHeaderComponent<T> implements OnInit, OnDestroy {
22
31
  private startWidth;
23
32
  constructor(eventService: OneGridEventService, cdr: ChangeDetectorRef);
24
33
  ngOnInit(): void;
34
+ ngAfterViewInit(): void;
35
+ private applyScrollLeft;
25
36
  onHeaderMenuOptionClick(columnDef: OneColumnDef<T>): void;
26
37
  onHeaderMenuSortClick(colId: keyof T): void;
27
38
  private cycleSort;
@@ -32,9 +43,6 @@ export declare class OneGridHeaderComponent<T> implements OnInit, OnDestroy {
32
43
  onDragColumnOver(event: DragEvent, targetIndex: number): void;
33
44
  onDragColumnEnd(event: DragEvent): void;
34
45
  onDropColumn(event: DragEvent): void;
35
- /**
36
- * Clear All Subscriptions
37
- */
38
46
  ngOnDestroy(): void;
39
47
  static ɵfac: i0.ɵɵFactoryDeclaration<OneGridHeaderComponent<any>, never>;
40
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, false, never>;
@@ -1,16 +1,35 @@
1
- import { AfterViewInit, EventEmitter } from '@angular/core';
1
+ import { EventEmitter } from '@angular/core';
2
2
  import { OnePaginationParams } from '../../core/models/one-pagination-types.model';
3
3
  import * as i0 from "@angular/core";
4
- export declare class OneGridPaginationComponent implements AfterViewInit {
4
+ export declare class OneGridPaginationComponent {
5
5
  paginate: OnePaginationParams;
6
6
  goToFirst: EventEmitter<any>;
7
7
  goToPrevious: EventEmitter<any>;
8
8
  goToNext: EventEmitter<any>;
9
9
  goToLast: EventEmitter<any>;
10
10
  pageSizeChange: EventEmitter<any>;
11
- pageSize: number;
12
- pageSizeOptions: number[];
13
- ngAfterViewInit(): void;
11
+ /**
12
+ * The page size the bar shows.
13
+ *
14
+ * Derived from the input rather than held locally. The bar is a display of
15
+ * the host's paging state — it does not own it — and a local copy meant a
16
+ * host that supplied `perPage: 50` still saw "25 rows" selected.
17
+ */
18
+ get pageSize(): number;
19
+ /**
20
+ * The size options offered.
21
+ *
22
+ * Also derived. These used to be copied out of the input in
23
+ * `ngAfterViewInit` — after the view had already been checked with the
24
+ * defaults — so any grid supplying its own options threw `NG0100` in dev
25
+ * mode, and later changes to the list were ignored entirely.
26
+ */
27
+ get pageSizeOptions(): number[];
28
+ /** Whether there is a page before the current one. */
29
+ get hasPrevious(): boolean;
30
+ /** Whether there is a page after the current one. */
31
+ get hasNext(): boolean;
32
+ private get pageCount();
14
33
  goToFirstPage(): void;
15
34
  goToPreviousPage(): void;
16
35
  goToNextPage(): void;
@@ -2,8 +2,10 @@ import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { OneRowNode } from '../../core/instants/one-row-node.class';
3
3
  import { OneGridRowActionEvent, OneGridType } from '../../core/models/one-grid-types.model';
4
4
  import { OneCellRendererParams, OneColumnDef } from '../../core/models/one-column-def-types.model';
5
+ import { OneGridCellService } from '../../core/services/one-grid-cell.service';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class OneGridRowActionComponent<T> implements OnInit {
8
+ private readonly cellService;
7
9
  /**
8
10
  * Get Node & Cell Renderer From Parent Component
9
11
  */
@@ -35,6 +37,48 @@ export declare class OneGridRowActionComponent<T> implements OnInit {
35
37
  protected detailActiveExcludeLevels: Set<number>;
36
38
  protected gotoDetailExcludeLevels: Set<number>;
37
39
  protected addNewExcludeLevels: Set<number>;
40
+ /**
41
+ * Accessible names for the action buttons.
42
+ *
43
+ * Every one of them is an icon with no text, and none carried a label — a
44
+ * screen reader announced "button" and nothing more, fourteen times per row.
45
+ * These are also the `title`, so the icons are identifiable by pointer too.
46
+ */
47
+ protected readonly labels: {
48
+ readonly gotoDetail: "Open detail";
49
+ readonly addNew: "Add new row";
50
+ readonly view: "View row";
51
+ readonly location: "Show location";
52
+ readonly document: "Open document";
53
+ readonly copy: "Copy row";
54
+ readonly delete: "Delete row";
55
+ readonly gotoList: "Open list";
56
+ readonly edit: "Edit row";
57
+ readonly print: "Print row";
58
+ readonly history: "View history";
59
+ readonly option: "Row options";
60
+ readonly language: "Change language";
61
+ readonly cellOption: "Cell options";
62
+ };
63
+ constructor(cellService: OneGridCellService);
64
+ /**
65
+ * Whether this column's action buttons are hidden for this row.
66
+ *
67
+ * The templates read `column?.hideActionButton` directly, which is truthy for
68
+ * any function — so a predicate asking to hide the buttons showed them, and
69
+ * one asking to show them showed them too. Resolved here instead, with the
70
+ * same params every other row-scoped predicate gets.
71
+ */
72
+ protected get hideActionButton(): boolean;
73
+ /**
74
+ * Whether this column's action buttons are disabled for this row.
75
+ *
76
+ * `disable` used to be resolved by `CellDisableResolverPipe`, which built its
77
+ * own params — a different set from every other row-scoped predicate. It goes
78
+ * through the shared builder now, so `disable` sees exactly what `editable`
79
+ * and `hideActionButton` see.
80
+ */
81
+ protected get actionDisabled(): boolean;
38
82
  ngOnInit(): void;
39
83
  /**
40
84
  * Trigger Invoke Click Event
@@ -0,0 +1,39 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { OneRowNode } from '../../core/instants/one-row-node.class';
3
+ import { OneGridRowDragService } from '../../core/services/one-grid-row-drag.service';
4
+ import { OneRowDragEvent, OneRowDragSuppressedReason } from '../../core/models/one-row-drag.model';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * The grab handle for one row.
8
+ *
9
+ * A real `<button>`, not a styled div: it has to be focusable and operable from
10
+ * the keyboard, because WCAG 2.5.7 requires everything achievable by dragging
11
+ * to have a non-dragging alternative. Space picks the row up, the arrows move
12
+ * it, space drops it and escape puts it back.
13
+ *
14
+ * When reordering is unavailable the handle is disabled and says why, rather
15
+ * than disappearing — a control that vanishes when the user sorts looks like a
16
+ * bug, and one that silently does nothing is worse.
17
+ */
18
+ export declare class OneGridRowDragHandleComponent<T> {
19
+ private readonly dragService;
20
+ node: OneRowNode<T>;
21
+ /** Non-null when the grid's order is not its own; see the model docs. */
22
+ suppressedReason: OneRowDragSuppressedReason | null;
23
+ dragEnd: EventEmitter<OneRowDragEvent<T>>;
24
+ constructor(dragService: OneGridRowDragService<T>);
25
+ protected get disabled(): boolean;
26
+ protected get label(): string;
27
+ /** True while this specific row is the one being moved. */
28
+ protected get grabbed(): boolean;
29
+ protected onPointerDown(event: PointerEvent): void;
30
+ protected onKeyDown(event: KeyboardEvent): void;
31
+ /**
32
+ * A row that is picked up and dropped where it started produces no event.
33
+ * Blur while grabbed would otherwise strand the row mid-move, so it cancels.
34
+ */
35
+ protected onBlur(): void;
36
+ private emit;
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, false, never>;
39
+ }
@@ -1,19 +1,31 @@
1
- import { AfterViewChecked, AfterViewInit, ElementRef, OnDestroy, Renderer2 } from '@angular/core';
1
+ import { ElementRef, OnDestroy, Renderer2 } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- export declare class OneCellTextExpandDirective implements AfterViewInit, AfterViewChecked, OnDestroy {
3
+ /**
4
+ * Reveals a truncated cell in full while the pointer rests on it.
5
+ *
6
+ * Presentation lives in the stylesheet, under `.one-cell-text-expanded`. It
7
+ * used to be applied as inline styles here, one of which was
8
+ * `background: var(--ins-card-bg)` — a token from the application this library
9
+ * was extracted from, which no consumer defines. The expanded cell therefore
10
+ * had a transparent background and its text overlapped the next column. The
11
+ * inline rules also set `z-index` on a statically positioned element, where it
12
+ * does nothing.
13
+ *
14
+ * Overflow is measured on hover rather than after every view check. The old
15
+ * version measured on init and on every text change, and reading `scrollWidth`
16
+ * forces a synchronous layout — several hundred of them per render for a
17
+ * normal viewport, to answer a question only the hovered cell ever asks.
18
+ */
19
+ export declare class OneCellTextExpandDirective implements OnDestroy {
4
20
  private cell;
5
21
  private renderer;
6
- private overflowing;
22
+ private static readonly EXPANDED_CLASS;
23
+ private static readonly HOVER_DELAY_MS;
7
24
  private timer;
8
- private lastText;
9
25
  constructor(cell: ElementRef<HTMLElement>, renderer: Renderer2);
10
- ngAfterViewInit(): void;
11
- ngAfterViewChecked(): void;
12
- ngOnDestroy(): void;
13
- private checkOverflow;
14
- onResize(): void;
15
26
  onMouseEnter(): void;
16
27
  onMouseLeave(): void;
28
+ ngOnDestroy(): void;
17
29
  private expand;
18
30
  private collapse;
19
31
  static ɵfac: i0.ɵɵFactoryDeclaration<OneCellTextExpandDirective, never>;