@angular/cdk-experimental 19.2.2 → 19.2.4

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.
@@ -1,255 +1,27 @@
1
- import { AfterViewInit } from '@angular/core';
2
- import { Directionality } from '@angular/cdk/bidi';
3
- import { ElementRef } from '@angular/core';
4
- import { EmbeddedViewRef } from '@angular/core';
5
- import { EventEmitter } from '@angular/core';
6
- import { FocusTrap } from '@angular/cdk/a11y';
7
- import { FocusTrapFactory } from '@angular/cdk/a11y';
1
+ import { Subject, Observable, PartialObserver } from 'rxjs';
8
2
  import * as i0 from '@angular/core';
3
+ import { OnDestroy, OnInit, ElementRef, EventEmitter, NgZone, AfterViewInit, ViewContainerRef, TemplateRef, EmbeddedViewRef } from '@angular/core';
4
+ import { Directionality } from '@angular/cdk/bidi';
9
5
  import * as i1 from '@angular/cdk/overlay';
10
- import { InteractivityChecker } from '@angular/cdk/a11y';
11
- import { NgZone } from '@angular/core';
12
- import { Observable } from 'rxjs';
13
- import { OnDestroy } from '@angular/core';
14
- import { OnInit } from '@angular/core';
15
- import { Overlay } from '@angular/cdk/overlay';
16
- import { OverlayRef } from '@angular/cdk/overlay';
17
- import { PartialObserver } from 'rxjs';
18
- import { ScrollDispatcher } from '@angular/cdk/scrolling';
19
- import { Subject } from 'rxjs';
20
- import { TemplateRef } from '@angular/core';
21
- import { ViewContainerRef } from '@angular/core';
22
- import { ViewportRuler } from '@angular/cdk/scrolling';
23
-
24
- /**
25
- * A directive that must be attached to enable editability on a table.
26
- * It is responsible for setting up delegated event handlers and providing the
27
- * EditEventDispatcher service for use by the other edit directives.
28
- */
29
- export declare class CdkEditable implements AfterViewInit, OnDestroy {
30
- protected readonly elementRef: ElementRef<any>;
31
- protected readonly editEventDispatcher: EditEventDispatcher<EditRef<unknown>>;
32
- protected readonly focusDispatcher: FocusDispatcher;
33
- protected readonly ngZone: NgZone;
34
- private readonly _renderer;
35
- protected readonly destroyed: Subject<void>;
36
- private _rendered;
37
- constructor();
38
- ngAfterViewInit(): void;
39
- ngOnDestroy(): void;
40
- private _observableFromEvent;
41
- private _listenForTableEvents;
42
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditable, never>;
43
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditable, "table[editable], cdk-table[editable], mat-table[editable]", never, {}, {}, never, never, true, never>;
44
- }
45
-
46
- /** Closes the lens on click. */
47
- export declare class CdkEditClose<FormValue> {
48
- protected readonly elementRef: ElementRef<HTMLElement>;
49
- protected readonly editRef: EditRef<FormValue>;
50
- constructor();
51
- closeEdit(): void;
52
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditClose<any>, never>;
53
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditClose<any>, "[cdkEditClose]", never, {}, {}, never, never, true, never>;
54
- }
55
-
56
- /**
57
- * A directive that attaches to a form within the edit lens.
58
- * It coordinates the form state with the table-wide edit system and handles
59
- * closing the edit lens when the form is submitted or the user clicks
60
- * out.
61
- */
62
- export declare class CdkEditControl<FormValue> implements OnDestroy, OnInit {
63
- protected readonly elementRef: ElementRef<any>;
64
- readonly editRef: EditRef<FormValue>;
65
- protected readonly destroyed: Subject<void>;
66
- /**
67
- * Specifies what should happen when the user clicks outside of the edit lens.
68
- * The default behavior is to close the lens without submitting the form.
69
- */
70
- clickOutBehavior: PopoverEditClickOutBehavior;
71
- /**
72
- * A two-way binding for storing unsubmitted form state. If not provided
73
- * then form state will be discarded on close. The PeristBy directive is offered
74
- * as a convenient shortcut for these bindings.
75
- */
76
- preservedFormValue?: FormValue;
77
- readonly preservedFormValueChange: EventEmitter<FormValue>;
78
- /**
79
- * Determines whether the lens will close on form submit if the form is not in a valid
80
- * state. By default the lens will remain open.
81
- */
82
- ignoreSubmitUnlessValid: boolean;
83
- ngOnInit(): void;
84
- ngOnDestroy(): void;
85
- /**
86
- * Called when the form submits. If ignoreSubmitUnlessValid is true, checks
87
- * the form for validity before proceeding.
88
- * Updates the revert state with the latest submitted value then closes the edit.
89
- */
90
- handleFormSubmit(): void;
91
- /** Called on Escape keyup. Closes the edit. */
92
- close(): void;
93
- /**
94
- * Called on click anywhere in the document.
95
- * If the click was outside of the lens, trigger the specified click out behavior.
96
- */
97
- handlePossibleClickOut(evt: Event): void;
98
- _handleKeydown(event: KeyboardEvent): void;
99
- /** Triggers submit on tab out if clickOutBehavior is 'submit'. */
100
- private _handleBlur;
101
- private _triggerFormSubmit;
102
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditControl<any>, never>;
103
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditControl<any>, "form[cdkEditControl]", never, { "clickOutBehavior": { "alias": "cdkEditControlClickOutBehavior"; "required": false; }; "preservedFormValue": { "alias": "cdkEditControlPreservedFormValue"; "required": false; }; "ignoreSubmitUnlessValid": { "alias": "cdkEditControlIgnoreSubmitUnlessValid"; "required": false; }; }, { "preservedFormValueChange": "cdkEditControlPreservedFormValueChange"; }, never, never, true, never>;
104
- }
6
+ import { Overlay, OverlayRef } from '@angular/cdk/overlay';
7
+ import { FocusTrapFactory, FocusTrap, InteractivityChecker } from '@angular/cdk/a11y';
8
+ import { ScrollDispatcher, ViewportRuler } from '@angular/cdk/scrolling';
105
9
 
106
10
  /**
107
- * Opens the closest edit popover to this element, whether it's associated with this exact
108
- * element or an ancestor element.
109
- */
110
- export declare class CdkEditOpen {
111
- protected readonly elementRef: ElementRef<HTMLElement>;
112
- protected readonly editEventDispatcher: EditEventDispatcher<EditRef<unknown>>;
113
- constructor();
114
- openEdit(evt: Event): void;
115
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditOpen, never>;
116
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditOpen, "[cdkEditOpen]", never, {}, {}, never, never, true, never>;
117
- }
118
-
119
- /** Reverts the form to its initial or previously submitted state on click. */
120
- export declare class CdkEditRevert<FormValue> {
121
- protected readonly editRef: EditRef<FormValue>;
122
- /** Type of the button. Defaults to `button` to avoid accident form submits. */
123
- type: string;
124
- revertEdit(): void;
125
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditRevert<any>, never>;
126
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditRevert<any>, "button[cdkEditRevert]", never, { "type": { "alias": "type"; "required": false; }; }, {}, never, never, true, never>;
127
- }
128
-
129
- /**
130
- * Attaches an ng-template to a cell and shows it when instructed to by the
131
- * EditEventDispatcher service.
132
- * Makes the cell focusable.
133
- */
134
- export declare class CdkPopoverEdit<C> implements AfterViewInit, OnDestroy {
135
- protected readonly services: EditServices;
136
- protected readonly elementRef: ElementRef<any>;
137
- protected readonly viewContainerRef: ViewContainerRef;
138
- /** The edit lens template shown over the cell on edit. */
139
- template: TemplateRef<any> | null;
140
- /**
141
- * Implicit context to pass along to the template. Can be omitted if the template
142
- * is defined within the cell.
143
- */
144
- context?: C;
145
- /** Aria label to set on the popover dialog element. */
146
- ariaLabel?: string;
147
- /**
148
- * Specifies that the popup should cover additional table cells before and/or after
149
- * this one.
150
- */
151
- get colspan(): CdkPopoverEditColspan;
152
- set colspan(value: CdkPopoverEditColspan);
153
- private _colspan;
154
- /** Whether popover edit is disabled for this cell. */
155
- get disabled(): boolean;
156
- set disabled(value: boolean);
157
- private _disabled;
158
- protected focusTrap?: FocusTrap;
159
- protected overlayRef?: OverlayRef;
160
- protected readonly destroyed: Subject<void>;
161
- ngAfterViewInit(): void;
162
- ngOnDestroy(): void;
163
- protected initFocusTrap(): void;
164
- protected closeEditOverlay(): void;
165
- protected panelClass(): string;
166
- private _startListeningToEditEvents;
167
- private _createEditOverlay;
168
- private _showEditOverlay;
169
- private _getOverlayCells;
170
- private _getPositionStrategy;
171
- private _updateOverlaySize;
172
- private _maybeReturnFocusToCell;
173
- private _sizeConfigForCells;
174
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEdit<any>, never>;
175
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkPopoverEdit<any>, "[cdkPopoverEdit]:not([cdkPopoverEditTabOut])", never, { "template": { "alias": "cdkPopoverEdit"; "required": false; }; "context": { "alias": "cdkPopoverEditContext"; "required": false; }; "colspan": { "alias": "cdkPopoverEditColspan"; "required": false; }; "disabled": { "alias": "cdkPopoverEditDisabled"; "required": false; }; "ariaLabel": { "alias": "cdkPopoverEditAriaLabel"; "required": false; }; }, {}, never, never, true, never>;
176
- }
177
-
178
- /**
179
- * Describes the number of columns before and after the originating cell that the
180
- * edit popup should span. In left to right locales, before means left and after means
181
- * right. In right to left locales before means right and after means left.
182
- */
183
- export declare interface CdkPopoverEditColspan {
184
- before?: number;
185
- after?: number;
186
- }
187
-
188
- export declare class CdkPopoverEditModule {
189
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEditModule, never>;
190
- static ɵmod: i0.ɵɵNgModuleDeclaration<CdkPopoverEditModule, never, [typeof i1.OverlayModule, typeof i2.CdkPopoverEdit, typeof i2.CdkPopoverEditTabOut, typeof i2.CdkRowHoverContent, typeof i3.CdkEditControl, typeof i3.CdkEditRevert, typeof i3.CdkEditClose, typeof i2.CdkEditable, typeof i2.CdkEditOpen], [typeof i2.CdkPopoverEdit, typeof i2.CdkPopoverEditTabOut, typeof i2.CdkRowHoverContent, typeof i3.CdkEditControl, typeof i3.CdkEditRevert, typeof i3.CdkEditClose, typeof i2.CdkEditable, typeof i2.CdkEditOpen]>;
191
- static ɵinj: i0.ɵɵInjectorDeclaration<CdkPopoverEditModule>;
192
- }
193
-
194
- /**
195
- * Attaches an ng-template to a cell and shows it when instructed to by the
196
- * EditEventDispatcher service.
197
- * Makes the cell focusable.
198
- */
199
- export declare class CdkPopoverEditTabOut<C> extends CdkPopoverEdit<C> {
200
- protected readonly focusEscapeNotifierFactory: FocusEscapeNotifierFactory;
201
- protected focusTrap?: FocusEscapeNotifier;
202
- protected initFocusTrap(): void;
203
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEditTabOut<any>, never>;
204
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkPopoverEditTabOut<any>, "[cdkPopoverEdit][cdkPopoverEditTabOut]", never, { "template": { "alias": "cdkPopoverEdit"; "required": false; }; "context": { "alias": "cdkPopoverEditContext"; "required": false; }; "colspan": { "alias": "cdkPopoverEditColspan"; "required": false; }; "disabled": { "alias": "cdkPopoverEditDisabled"; "required": false; }; "ariaLabel": { "alias": "cdkPopoverEditAriaLabel"; "required": false; }; }, {}, never, never, true, never>;
205
- }
206
-
207
- /**
208
- * A structural directive that shows its contents when the table row containing
209
- * it is hovered or when an element in the row has focus.
11
+ * The possible states for hover content:
12
+ * OFF - Not rendered.
13
+ * FOCUSABLE - Rendered in the dom and styled for its contents to be focusable but invisible.
14
+ * ON - Rendered and fully visible.
210
15
  */
211
- export declare class CdkRowHoverContent implements AfterViewInit, OnDestroy {
212
- protected readonly services: EditServices;
213
- protected readonly elementRef: ElementRef<any>;
214
- protected readonly templateRef: TemplateRef<any>;
215
- protected readonly viewContainerRef: ViewContainerRef;
216
- protected readonly destroyed: Subject<void>;
217
- protected viewRef: EmbeddedViewRef<any> | null;
218
- private _row?;
219
- ngAfterViewInit(): void;
220
- ngOnDestroy(): void;
221
- /**
222
- * Called immediately after the hover content is created and added to the dom.
223
- * In the CDK version, this is a noop but subclasses such as MatRowHoverContent use this
224
- * to prepare/style the inserted element.
225
- */
226
- protected initElement(_: HTMLElement): void;
227
- /**
228
- * Called when the hover content needs to be focusable to preserve a reasonable tab ordering
229
- * but should not yet be shown.
230
- */
231
- protected makeElementHiddenButFocusable(element: HTMLElement): void;
232
- /**
233
- * Called when the hover content needs to be focusable to preserve a reasonable tab ordering
234
- * but should not yet be shown.
235
- */
236
- protected makeElementVisible(element: HTMLElement): void;
237
- private _listenForHoverAndFocusEvents;
238
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkRowHoverContent, never>;
239
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkRowHoverContent, "[cdkRowHoverContent]", never, {}, {}, never, never, true, never>;
16
+ declare enum HoverContentState {
17
+ OFF = 0,
18
+ FOCUSABLE = 1,
19
+ ON = 2
240
20
  }
241
-
242
- /** Selector for finding table cells. */
243
- export declare const _CELL_SELECTOR = ".cdk-cell, .mat-cell, td";
244
-
245
-
246
- /** closest implementation that is able to start from non-Element Nodes. */
247
- export declare function _closest(element: EventTarget | Element | null | undefined, selector: string): Element | null;
248
-
249
21
  /**
250
22
  * Service for sharing delegated events and state for triggering table edits.
251
23
  */
252
- export declare class EditEventDispatcher<R> {
24
+ declare class EditEventDispatcher<R> {
253
25
  private readonly _ngZone;
254
26
  /** A subject that indicates which table cell is currently editing (unless it is disabled). */
255
27
  readonly editing: Subject<Element | null>;
@@ -329,7 +101,7 @@ export declare class EditEventDispatcher<R> {
329
101
  * Used for communication between the form within the edit lens and the
330
102
  * table that launched it. Provided by CdkEditControl within the lens.
331
103
  */
332
- export declare class EditRef<FormValue> implements OnDestroy {
104
+ declare class EditRef<FormValue> implements OnDestroy {
333
105
  private readonly _form;
334
106
  private readonly _editEventDispatcher;
335
107
  /** Emits the final value of this edit instance before closing. */
@@ -366,35 +138,11 @@ export declare class EditRef<FormValue> implements OnDestroy {
366
138
  static ɵprov: i0.ɵɵInjectableDeclaration<EditRef<any>>;
367
139
  }
368
140
 
369
- /**
370
- * Optimization
371
- * Collects multiple Injectables into a singleton shared across the table. By reducing the
372
- * number of services injected into each CdkPopoverEdit, this saves about 0.023ms of cpu time
373
- * and 56 bytes of memory per instance.
374
- */
375
- declare class EditServices {
376
- readonly directionality: Directionality;
377
- readonly editEventDispatcher: EditEventDispatcher<EditRef<unknown>>;
378
- readonly focusDispatcher: FocusDispatcher;
379
- readonly focusTrapFactory: FocusTrapFactory;
380
- readonly ngZone: NgZone;
381
- readonly overlay: Overlay;
382
- readonly scrollDispatcher: ScrollDispatcher;
383
- readonly viewportRuler: ViewportRuler;
384
- static ɵfac: i0.ɵɵFactoryDeclaration<EditServices, never>;
385
- static ɵprov: i0.ɵɵInjectableDeclaration<EditServices>;
386
- }
387
-
388
-
389
- export declare interface Entry<FormValue> {
390
- value?: FormValue;
391
- }
392
-
393
141
  /**
394
142
  * Service responsible for moving cell focus around in response to keyboard events.
395
143
  * May be overridden to customize the keyboard behavior of popover edit.
396
144
  */
397
- export declare class FocusDispatcher {
145
+ declare class FocusDispatcher {
398
146
  protected readonly directionality: Directionality;
399
147
  /** Observes keydown events triggered from the table. */
400
148
  readonly keyObserver: PartialObserver<KeyboardEvent>;
@@ -412,14 +160,111 @@ export declare class FocusDispatcher {
412
160
  static ɵprov: i0.ɵɵInjectableDeclaration<FocusDispatcher>;
413
161
  }
414
162
 
163
+ interface Entry<FormValue> {
164
+ value?: FormValue;
165
+ }
415
166
  /**
416
- * Like FocusTrap, but rather than trapping focus within a dom region, notifies subscribers when
417
- * focus leaves the region.
167
+ * A convenience class for preserving unsaved form state while an edit lens is closed.
168
+ *
169
+ * Example usage:
170
+ * class MyComponent {
171
+ * readonly nameEditValues = new FormValueContainer&lt;Item, {name: string}&gt;();
172
+ * }
173
+ *
174
+ * &lt;form cdkEditControl [(cdkEditControlPreservedFormValue)]="nameEditValues.for(item).value"&gt;
418
175
  */
419
- declare class FocusEscapeNotifier extends FocusTrap {
420
- private readonly _escapeSubject;
421
- constructor(element: HTMLElement, checker: InteractivityChecker, ngZone: NgZone, document: Document);
422
- escapes(): Observable<FocusEscapeNotifierDirection>;
176
+ declare class FormValueContainer<Key extends object, FormValue> {
177
+ private _formValues;
178
+ for(key: Key): Entry<FormValue>;
179
+ }
180
+
181
+ /** Options for what do to when the user clicks outside of an edit lens. */
182
+ type PopoverEditClickOutBehavior = 'close' | 'submit' | 'noop';
183
+ /**
184
+ * A directive that attaches to a form within the edit lens.
185
+ * It coordinates the form state with the table-wide edit system and handles
186
+ * closing the edit lens when the form is submitted or the user clicks
187
+ * out.
188
+ */
189
+ declare class CdkEditControl<FormValue> implements OnDestroy, OnInit {
190
+ protected readonly elementRef: ElementRef<any>;
191
+ readonly editRef: EditRef<FormValue>;
192
+ protected readonly destroyed: Subject<void>;
193
+ /**
194
+ * Specifies what should happen when the user clicks outside of the edit lens.
195
+ * The default behavior is to close the lens without submitting the form.
196
+ */
197
+ clickOutBehavior: PopoverEditClickOutBehavior;
198
+ /**
199
+ * A two-way binding for storing unsubmitted form state. If not provided
200
+ * then form state will be discarded on close. The PeristBy directive is offered
201
+ * as a convenient shortcut for these bindings.
202
+ */
203
+ preservedFormValue?: FormValue;
204
+ readonly preservedFormValueChange: EventEmitter<FormValue>;
205
+ /**
206
+ * Determines whether the lens will close on form submit if the form is not in a valid
207
+ * state. By default the lens will remain open.
208
+ */
209
+ ignoreSubmitUnlessValid: boolean;
210
+ ngOnInit(): void;
211
+ ngOnDestroy(): void;
212
+ /**
213
+ * Called when the form submits. If ignoreSubmitUnlessValid is true, checks
214
+ * the form for validity before proceeding.
215
+ * Updates the revert state with the latest submitted value then closes the edit.
216
+ */
217
+ handleFormSubmit(): void;
218
+ /** Called on Escape keyup. Closes the edit. */
219
+ close(): void;
220
+ /**
221
+ * Called on click anywhere in the document.
222
+ * If the click was outside of the lens, trigger the specified click out behavior.
223
+ */
224
+ handlePossibleClickOut(evt: Event): void;
225
+ _handleKeydown(event: KeyboardEvent): void;
226
+ /** Triggers submit on tab out if clickOutBehavior is 'submit'. */
227
+ private _handleBlur;
228
+ private _triggerFormSubmit;
229
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditControl<any>, never>;
230
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditControl<any>, "form[cdkEditControl]", never, { "clickOutBehavior": { "alias": "cdkEditControlClickOutBehavior"; "required": false; }; "preservedFormValue": { "alias": "cdkEditControlPreservedFormValue"; "required": false; }; "ignoreSubmitUnlessValid": { "alias": "cdkEditControlIgnoreSubmitUnlessValid"; "required": false; }; }, { "preservedFormValueChange": "cdkEditControlPreservedFormValueChange"; }, never, never, true, never>;
231
+ }
232
+ /** Reverts the form to its initial or previously submitted state on click. */
233
+ declare class CdkEditRevert<FormValue> {
234
+ protected readonly editRef: EditRef<FormValue>;
235
+ /** Type of the button. Defaults to `button` to avoid accident form submits. */
236
+ type: string;
237
+ revertEdit(): void;
238
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditRevert<any>, never>;
239
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditRevert<any>, "button[cdkEditRevert]", never, { "type": { "alias": "type"; "required": false; }; }, {}, never, never, true, never>;
240
+ }
241
+ /** Closes the lens on click. */
242
+ declare class CdkEditClose<FormValue> {
243
+ protected readonly elementRef: ElementRef<HTMLElement>;
244
+ protected readonly editRef: EditRef<FormValue>;
245
+ constructor();
246
+ closeEdit(): void;
247
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditClose<any>, never>;
248
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditClose<any>, "[cdkEditClose]", never, {}, {}, never, never, true, never>;
249
+ }
250
+
251
+ /**
252
+ * Optimization
253
+ * Collects multiple Injectables into a singleton shared across the table. By reducing the
254
+ * number of services injected into each CdkPopoverEdit, this saves about 0.023ms of cpu time
255
+ * and 56 bytes of memory per instance.
256
+ */
257
+ declare class EditServices {
258
+ readonly directionality: Directionality;
259
+ readonly editEventDispatcher: EditEventDispatcher<EditRef<unknown>>;
260
+ readonly focusDispatcher: FocusDispatcher;
261
+ readonly focusTrapFactory: FocusTrapFactory;
262
+ readonly ngZone: NgZone;
263
+ readonly overlay: Overlay;
264
+ readonly scrollDispatcher: ScrollDispatcher;
265
+ readonly viewportRuler: ViewportRuler;
266
+ static ɵfac: i0.ɵɵFactoryDeclaration<EditServices, never>;
267
+ static ɵprov: i0.ɵɵInjectableDeclaration<EditServices>;
423
268
  }
424
269
 
425
270
  /** Value indicating whether focus left the target area before or after the enclosed elements. */
@@ -427,7 +272,15 @@ declare enum FocusEscapeNotifierDirection {
427
272
  START = 0,
428
273
  END = 1
429
274
  }
430
-
275
+ /**
276
+ * Like FocusTrap, but rather than trapping focus within a dom region, notifies subscribers when
277
+ * focus leaves the region.
278
+ */
279
+ declare class FocusEscapeNotifier extends FocusTrap {
280
+ private readonly _escapeSubject;
281
+ constructor(element: HTMLElement, checker: InteractivityChecker, ngZone: NgZone, document: Document);
282
+ escapes(): Observable<FocusEscapeNotifierDirection>;
283
+ }
431
284
  /** Factory that allows easy instantiation of focus escape notifiers. */
432
285
  declare class FocusEscapeNotifierFactory {
433
286
  private _checker;
@@ -444,53 +297,152 @@ declare class FocusEscapeNotifierFactory {
444
297
  }
445
298
 
446
299
  /**
447
- * A convenience class for preserving unsaved form state while an edit lens is closed.
448
- *
449
- * Example usage:
450
- * class MyComponent {
451
- * readonly nameEditValues = new FormValueContainer&lt;Item, {name: string}&gt;();
452
- * }
453
- *
454
- * &lt;form cdkEditControl [(cdkEditControlPreservedFormValue)]="nameEditValues.for(item).value"&gt;
300
+ * Describes the number of columns before and after the originating cell that the
301
+ * edit popup should span. In left to right locales, before means left and after means
302
+ * right. In right to left locales before means right and after means left.
455
303
  */
456
- export declare class FormValueContainer<Key extends object, FormValue> {
457
- private _formValues;
458
- for(key: Key): Entry<FormValue>;
304
+ interface CdkPopoverEditColspan {
305
+ before?: number;
306
+ after?: number;
459
307
  }
460
-
461
308
  /**
462
- * The possible states for hover content:
463
- * OFF - Not rendered.
464
- * FOCUSABLE - Rendered in the dom and styled for its contents to be focusable but invisible.
465
- * ON - Rendered and fully visible.
309
+ * A directive that must be attached to enable editability on a table.
310
+ * It is responsible for setting up delegated event handlers and providing the
311
+ * EditEventDispatcher service for use by the other edit directives.
466
312
  */
467
- export declare enum HoverContentState {
468
- OFF = 0,
469
- FOCUSABLE = 1,
470
- ON = 2
313
+ declare class CdkEditable implements AfterViewInit, OnDestroy {
314
+ protected readonly elementRef: ElementRef<any>;
315
+ protected readonly editEventDispatcher: EditEventDispatcher<EditRef<unknown>>;
316
+ protected readonly focusDispatcher: FocusDispatcher;
317
+ protected readonly ngZone: NgZone;
318
+ private readonly _renderer;
319
+ protected readonly destroyed: Subject<void>;
320
+ private _rendered;
321
+ constructor();
322
+ ngAfterViewInit(): void;
323
+ ngOnDestroy(): void;
324
+ private _observableFromEvent;
325
+ private _listenForTableEvents;
326
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditable, never>;
327
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditable, "table[editable], cdk-table[editable], mat-table[editable]", never, {}, {}, never, never, true, never>;
471
328
  }
472
-
473
- declare namespace i2 {
474
- export {
475
- CdkPopoverEditColspan,
476
- CdkEditable,
477
- CdkPopoverEdit,
478
- CdkPopoverEditTabOut,
479
- CdkRowHoverContent,
480
- CdkEditOpen
481
- }
329
+ /**
330
+ * Attaches an ng-template to a cell and shows it when instructed to by the
331
+ * EditEventDispatcher service.
332
+ * Makes the cell focusable.
333
+ */
334
+ declare class CdkPopoverEdit<C> implements AfterViewInit, OnDestroy {
335
+ protected readonly services: EditServices;
336
+ protected readonly elementRef: ElementRef<any>;
337
+ protected readonly viewContainerRef: ViewContainerRef;
338
+ /** The edit lens template shown over the cell on edit. */
339
+ template: TemplateRef<any> | null;
340
+ /**
341
+ * Implicit context to pass along to the template. Can be omitted if the template
342
+ * is defined within the cell.
343
+ */
344
+ context?: C;
345
+ /** Aria label to set on the popover dialog element. */
346
+ ariaLabel?: string;
347
+ /**
348
+ * Specifies that the popup should cover additional table cells before and/or after
349
+ * this one.
350
+ */
351
+ get colspan(): CdkPopoverEditColspan;
352
+ set colspan(value: CdkPopoverEditColspan);
353
+ private _colspan;
354
+ /** Whether popover edit is disabled for this cell. */
355
+ get disabled(): boolean;
356
+ set disabled(value: boolean);
357
+ private _disabled;
358
+ protected focusTrap?: FocusTrap;
359
+ protected overlayRef?: OverlayRef;
360
+ protected readonly destroyed: Subject<void>;
361
+ ngAfterViewInit(): void;
362
+ ngOnDestroy(): void;
363
+ protected initFocusTrap(): void;
364
+ protected closeEditOverlay(): void;
365
+ protected panelClass(): string;
366
+ private _startListeningToEditEvents;
367
+ private _createEditOverlay;
368
+ private _showEditOverlay;
369
+ private _getOverlayCells;
370
+ private _getPositionStrategy;
371
+ private _updateOverlaySize;
372
+ private _maybeReturnFocusToCell;
373
+ private _sizeConfigForCells;
374
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEdit<any>, never>;
375
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkPopoverEdit<any>, "[cdkPopoverEdit]:not([cdkPopoverEditTabOut])", never, { "template": { "alias": "cdkPopoverEdit"; "required": false; }; "context": { "alias": "cdkPopoverEditContext"; "required": false; }; "colspan": { "alias": "cdkPopoverEditColspan"; "required": false; }; "disabled": { "alias": "cdkPopoverEditDisabled"; "required": false; }; "ariaLabel": { "alias": "cdkPopoverEditAriaLabel"; "required": false; }; }, {}, never, never, true, never>;
376
+ }
377
+ /**
378
+ * Attaches an ng-template to a cell and shows it when instructed to by the
379
+ * EditEventDispatcher service.
380
+ * Makes the cell focusable.
381
+ */
382
+ declare class CdkPopoverEditTabOut<C> extends CdkPopoverEdit<C> {
383
+ protected readonly focusEscapeNotifierFactory: FocusEscapeNotifierFactory;
384
+ protected focusTrap?: FocusEscapeNotifier;
385
+ protected initFocusTrap(): void;
386
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEditTabOut<any>, never>;
387
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkPopoverEditTabOut<any>, "[cdkPopoverEdit][cdkPopoverEditTabOut]", never, { "template": { "alias": "cdkPopoverEdit"; "required": false; }; "context": { "alias": "cdkPopoverEditContext"; "required": false; }; "colspan": { "alias": "cdkPopoverEditColspan"; "required": false; }; "disabled": { "alias": "cdkPopoverEditDisabled"; "required": false; }; "ariaLabel": { "alias": "cdkPopoverEditAriaLabel"; "required": false; }; }, {}, never, never, true, never>;
388
+ }
389
+ /**
390
+ * A structural directive that shows its contents when the table row containing
391
+ * it is hovered or when an element in the row has focus.
392
+ */
393
+ declare class CdkRowHoverContent implements AfterViewInit, OnDestroy {
394
+ protected readonly services: EditServices;
395
+ protected readonly elementRef: ElementRef<any>;
396
+ protected readonly templateRef: TemplateRef<any>;
397
+ protected readonly viewContainerRef: ViewContainerRef;
398
+ protected readonly destroyed: Subject<void>;
399
+ protected viewRef: EmbeddedViewRef<any> | null;
400
+ private _row?;
401
+ ngAfterViewInit(): void;
402
+ ngOnDestroy(): void;
403
+ /**
404
+ * Called immediately after the hover content is created and added to the dom.
405
+ * In the CDK version, this is a noop but subclasses such as MatRowHoverContent use this
406
+ * to prepare/style the inserted element.
407
+ */
408
+ protected initElement(_: HTMLElement): void;
409
+ /**
410
+ * Called when the hover content needs to be focusable to preserve a reasonable tab ordering
411
+ * but should not yet be shown.
412
+ */
413
+ protected makeElementHiddenButFocusable(element: HTMLElement): void;
414
+ /**
415
+ * Called when the hover content needs to be focusable to preserve a reasonable tab ordering
416
+ * but should not yet be shown.
417
+ */
418
+ protected makeElementVisible(element: HTMLElement): void;
419
+ private _listenForHoverAndFocusEvents;
420
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkRowHoverContent, never>;
421
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkRowHoverContent, "[cdkRowHoverContent]", never, {}, {}, never, never, true, never>;
422
+ }
423
+ /**
424
+ * Opens the closest edit popover to this element, whether it's associated with this exact
425
+ * element or an ancestor element.
426
+ */
427
+ declare class CdkEditOpen {
428
+ protected readonly elementRef: ElementRef<HTMLElement>;
429
+ protected readonly editEventDispatcher: EditEventDispatcher<EditRef<unknown>>;
430
+ constructor();
431
+ openEdit(evt: Event): void;
432
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditOpen, never>;
433
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditOpen, "[cdkEditOpen]", never, {}, {}, never, never, true, never>;
482
434
  }
483
435
 
484
- declare namespace i3 {
485
- export {
486
- PopoverEditClickOutBehavior,
487
- CdkEditControl,
488
- CdkEditRevert,
489
- CdkEditClose
490
- }
436
+ declare class CdkPopoverEditModule {
437
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEditModule, never>;
438
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CdkPopoverEditModule, never, [typeof i1.OverlayModule, typeof CdkPopoverEdit, typeof CdkPopoverEditTabOut, typeof CdkRowHoverContent, typeof CdkEditControl, typeof CdkEditRevert, typeof CdkEditClose, typeof CdkEditable, typeof CdkEditOpen], [typeof CdkPopoverEdit, typeof CdkPopoverEditTabOut, typeof CdkRowHoverContent, typeof CdkEditControl, typeof CdkEditRevert, typeof CdkEditClose, typeof CdkEditable, typeof CdkEditOpen]>;
439
+ static ɵinj: i0.ɵɵInjectorDeclaration<CdkPopoverEditModule>;
491
440
  }
492
441
 
493
- /** Options for what do to when the user clicks outside of an edit lens. */
494
- export declare type PopoverEditClickOutBehavior = 'close' | 'submit' | 'noop';
442
+ /** Selector for finding table cells. */
443
+ declare const CELL_SELECTOR = ".cdk-cell, .mat-cell, td";
444
+
445
+ /** closest implementation that is able to start from non-Element Nodes. */
446
+ declare function closest(element: EventTarget | Element | null | undefined, selector: string): Element | null;
495
447
 
496
- export { }
448
+ export { CdkEditClose, CdkEditControl, CdkEditOpen, CdkEditRevert, CdkEditable, CdkPopoverEdit, type CdkPopoverEditColspan, CdkPopoverEditModule, CdkPopoverEditTabOut, CdkRowHoverContent, EditEventDispatcher, EditRef, type Entry, FocusDispatcher, FormValueContainer, HoverContentState, type PopoverEditClickOutBehavior, CELL_SELECTOR as _CELL_SELECTOR, closest as _closest };