@angular/cdk-experimental 20.0.0-next.0 → 20.0.0-next.10
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/column-resize/index.d.ts +276 -289
- package/combobox/index.d.ts +15 -39
- package/deferred-content/index.d.ts +37 -0
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +139 -70
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +19 -26
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs +60 -0
- package/fesm2022/deferred-content.mjs.map +1 -0
- package/fesm2022/list-focus-Di7m_z_6.mjs +382 -0
- package/fesm2022/list-focus-Di7m_z_6.mjs.map +1 -0
- package/fesm2022/listbox.mjs +42 -21
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/option-f_gNslw8.mjs +367 -0
- package/fesm2022/option-f_gNslw8.mjs.map +1 -0
- package/fesm2022/polyfill-CXksG4af.mjs +14 -0
- package/fesm2022/polyfill-CXksG4af.mjs.map +1 -0
- package/fesm2022/popover-edit.mjs +92 -81
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +7 -11
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs +19 -27
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs +8 -13
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/tabs-BunANY1M.mjs +176 -0
- package/fesm2022/tabs-BunANY1M.mjs.map +1 -0
- package/fesm2022/tabs.mjs +225 -0
- package/fesm2022/tabs.mjs.map +1 -0
- package/fesm2022/ui-patterns.mjs +12 -603
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/list-navigation.d-DfOSxsSp.d.ts +247 -0
- package/listbox/index.d.ts +46 -39
- package/listbox.d-QWPLmxRe.d.ts +193 -0
- package/package.json +13 -2
- package/popover-edit/index.d.ts +269 -315
- package/scrolling/index.d.ts +34 -47
- package/selection/index.d.ts +119 -161
- package/table-scroll-container/index.d.ts +6 -14
- package/tabs/index.d.ts +128 -0
- package/tabs.d-BAo141mw.d.ts +110 -0
- package/ui-patterns/index.d.ts +4 -391
package/popover-edit/index.d.ts
CHANGED
|
@@ -1,255 +1,27 @@
|
|
|
1
|
-
import {
|
|
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
6
|
import { OverlayRef } from '@angular/cdk/overlay';
|
|
17
|
-
import {
|
|
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
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
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
|
-
}
|
|
7
|
+
import { FocusTrapFactory, FocusTrap, InteractivityChecker } from '@angular/cdk/a11y';
|
|
8
|
+
import { ScrollDispatcher, ViewportRuler } from '@angular/cdk/scrolling';
|
|
177
9
|
|
|
178
10
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
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
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,110 @@ 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
|
-
*
|
|
417
|
-
*
|
|
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<Item, {name: string}>();
|
|
172
|
+
* }
|
|
173
|
+
*
|
|
174
|
+
* <form cdkEditControl [(cdkEditControlPreservedFormValue)]="nameEditValues.for(item).value">
|
|
418
175
|
*/
|
|
419
|
-
declare class
|
|
420
|
-
private
|
|
421
|
-
|
|
422
|
-
|
|
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 scrollDispatcher: ScrollDispatcher;
|
|
264
|
+
readonly viewportRuler: ViewportRuler;
|
|
265
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditServices, never>;
|
|
266
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EditServices>;
|
|
423
267
|
}
|
|
424
268
|
|
|
425
269
|
/** Value indicating whether focus left the target area before or after the enclosed elements. */
|
|
@@ -427,7 +271,15 @@ declare enum FocusEscapeNotifierDirection {
|
|
|
427
271
|
START = 0,
|
|
428
272
|
END = 1
|
|
429
273
|
}
|
|
430
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Like FocusTrap, but rather than trapping focus within a dom region, notifies subscribers when
|
|
276
|
+
* focus leaves the region.
|
|
277
|
+
*/
|
|
278
|
+
declare class FocusEscapeNotifier extends FocusTrap {
|
|
279
|
+
private readonly _escapeSubject;
|
|
280
|
+
constructor(element: HTMLElement, checker: InteractivityChecker, ngZone: NgZone, document: Document);
|
|
281
|
+
escapes(): Observable<FocusEscapeNotifierDirection>;
|
|
282
|
+
}
|
|
431
283
|
/** Factory that allows easy instantiation of focus escape notifiers. */
|
|
432
284
|
declare class FocusEscapeNotifierFactory {
|
|
433
285
|
private _checker;
|
|
@@ -444,53 +296,155 @@ declare class FocusEscapeNotifierFactory {
|
|
|
444
296
|
}
|
|
445
297
|
|
|
446
298
|
/**
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
* class MyComponent {
|
|
451
|
-
* readonly nameEditValues = new FormValueContainer<Item, {name: string}>();
|
|
452
|
-
* }
|
|
453
|
-
*
|
|
454
|
-
* <form cdkEditControl [(cdkEditControlPreservedFormValue)]="nameEditValues.for(item).value">
|
|
299
|
+
* Describes the number of columns before and after the originating cell that the
|
|
300
|
+
* edit popup should span. In left to right locales, before means left and after means
|
|
301
|
+
* right. In right to left locales before means right and after means left.
|
|
455
302
|
*/
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
303
|
+
interface CdkPopoverEditColspan {
|
|
304
|
+
before?: number;
|
|
305
|
+
after?: number;
|
|
459
306
|
}
|
|
460
|
-
|
|
461
307
|
/**
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
* ON - Rendered and fully visible.
|
|
308
|
+
* A directive that must be attached to enable editability on a table.
|
|
309
|
+
* It is responsible for setting up delegated event handlers and providing the
|
|
310
|
+
* EditEventDispatcher service for use by the other edit directives.
|
|
466
311
|
*/
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
312
|
+
declare class CdkEditable implements AfterViewInit, OnDestroy {
|
|
313
|
+
protected readonly elementRef: ElementRef<any>;
|
|
314
|
+
protected readonly editEventDispatcher: EditEventDispatcher<EditRef<unknown>>;
|
|
315
|
+
protected readonly focusDispatcher: FocusDispatcher;
|
|
316
|
+
protected readonly ngZone: NgZone;
|
|
317
|
+
private readonly _renderer;
|
|
318
|
+
protected readonly destroyed: Subject<void>;
|
|
319
|
+
private _rowsRendered;
|
|
320
|
+
private _rowMutationObserver;
|
|
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
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
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
|
+
private _injector;
|
|
339
|
+
/** The edit lens template shown over the cell on edit. */
|
|
340
|
+
template: TemplateRef<any> | null;
|
|
341
|
+
/**
|
|
342
|
+
* Implicit context to pass along to the template. Can be omitted if the template
|
|
343
|
+
* is defined within the cell.
|
|
344
|
+
*/
|
|
345
|
+
context?: C;
|
|
346
|
+
/** Aria label to set on the popover dialog element. */
|
|
347
|
+
ariaLabel?: string;
|
|
348
|
+
/**
|
|
349
|
+
* Specifies that the popup should cover additional table cells before and/or after
|
|
350
|
+
* this one.
|
|
351
|
+
*/
|
|
352
|
+
get colspan(): CdkPopoverEditColspan;
|
|
353
|
+
set colspan(value: CdkPopoverEditColspan);
|
|
354
|
+
private _colspan;
|
|
355
|
+
/** Whether popover edit is disabled for this cell. */
|
|
356
|
+
get disabled(): boolean;
|
|
357
|
+
set disabled(value: boolean);
|
|
358
|
+
private _disabled;
|
|
359
|
+
protected focusTrap?: FocusTrap;
|
|
360
|
+
protected overlayRef?: OverlayRef;
|
|
361
|
+
protected readonly destroyed: Subject<void>;
|
|
362
|
+
ngAfterViewInit(): void;
|
|
363
|
+
ngOnDestroy(): void;
|
|
364
|
+
protected initFocusTrap(): void;
|
|
365
|
+
protected closeEditOverlay(): void;
|
|
366
|
+
protected panelClass(): string;
|
|
367
|
+
private _startListeningToEditEvents;
|
|
368
|
+
private _createEditOverlay;
|
|
369
|
+
private _showEditOverlay;
|
|
370
|
+
private _getOverlayCells;
|
|
371
|
+
private _getPositionStrategy;
|
|
372
|
+
private _updateOverlaySize;
|
|
373
|
+
private _maybeReturnFocusToCell;
|
|
374
|
+
private _sizeConfigForCells;
|
|
375
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEdit<any>, never>;
|
|
376
|
+
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>;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Attaches an ng-template to a cell and shows it when instructed to by the
|
|
380
|
+
* EditEventDispatcher service.
|
|
381
|
+
* Makes the cell focusable.
|
|
382
|
+
*/
|
|
383
|
+
declare class CdkPopoverEditTabOut<C> extends CdkPopoverEdit<C> {
|
|
384
|
+
protected readonly focusEscapeNotifierFactory: FocusEscapeNotifierFactory;
|
|
385
|
+
protected focusTrap?: FocusEscapeNotifier;
|
|
386
|
+
protected initFocusTrap(): void;
|
|
387
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEditTabOut<any>, never>;
|
|
388
|
+
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>;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* A structural directive that shows its contents when the table row containing
|
|
392
|
+
* it is hovered or when an element in the row has focus.
|
|
393
|
+
*/
|
|
394
|
+
declare class CdkRowHoverContent implements AfterViewInit, OnDestroy {
|
|
395
|
+
protected readonly services: EditServices;
|
|
396
|
+
protected readonly elementRef: ElementRef<any>;
|
|
397
|
+
protected readonly templateRef: TemplateRef<any>;
|
|
398
|
+
protected readonly viewContainerRef: ViewContainerRef;
|
|
399
|
+
protected readonly destroyed: Subject<void>;
|
|
400
|
+
protected viewRef: EmbeddedViewRef<any> | null;
|
|
401
|
+
private _row?;
|
|
402
|
+
ngAfterViewInit(): void;
|
|
403
|
+
ngOnDestroy(): void;
|
|
404
|
+
/**
|
|
405
|
+
* Called immediately after the hover content is created and added to the dom.
|
|
406
|
+
* In the CDK version, this is a noop but subclasses such as MatRowHoverContent use this
|
|
407
|
+
* to prepare/style the inserted element.
|
|
408
|
+
*/
|
|
409
|
+
protected initElement(_: HTMLElement): void;
|
|
410
|
+
/**
|
|
411
|
+
* Called when the hover content needs to be focusable to preserve a reasonable tab ordering
|
|
412
|
+
* but should not yet be shown.
|
|
413
|
+
*/
|
|
414
|
+
protected makeElementHiddenButFocusable(element: HTMLElement): void;
|
|
415
|
+
/**
|
|
416
|
+
* Called when the hover content needs to be focusable to preserve a reasonable tab ordering
|
|
417
|
+
* but should not yet be shown.
|
|
418
|
+
*/
|
|
419
|
+
protected makeElementVisible(element: HTMLElement): void;
|
|
420
|
+
private _listenForHoverAndFocusEvents;
|
|
421
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkRowHoverContent, never>;
|
|
422
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkRowHoverContent, "[cdkRowHoverContent]", never, {}, {}, never, never, true, never>;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Opens the closest edit popover to this element, whether it's associated with this exact
|
|
426
|
+
* element or an ancestor element.
|
|
427
|
+
*/
|
|
428
|
+
declare class CdkEditOpen {
|
|
429
|
+
protected readonly elementRef: ElementRef<HTMLElement>;
|
|
430
|
+
protected readonly editEventDispatcher: EditEventDispatcher<EditRef<unknown>>;
|
|
431
|
+
constructor();
|
|
432
|
+
openEdit(evt: Event): void;
|
|
433
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkEditOpen, never>;
|
|
434
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkEditOpen, "[cdkEditOpen]", never, {}, {}, never, never, true, never>;
|
|
482
435
|
}
|
|
483
436
|
|
|
484
|
-
declare
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
CdkEditRevert,
|
|
489
|
-
CdkEditClose
|
|
490
|
-
}
|
|
437
|
+
declare class CdkPopoverEditModule {
|
|
438
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkPopoverEditModule, never>;
|
|
439
|
+
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]>;
|
|
440
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CdkPopoverEditModule>;
|
|
491
441
|
}
|
|
492
442
|
|
|
493
|
-
/**
|
|
494
|
-
|
|
443
|
+
/** Selector for finding table cells. */
|
|
444
|
+
declare const CELL_SELECTOR = ".cdk-cell, .mat-cell, td";
|
|
445
|
+
|
|
446
|
+
/** closest implementation that is able to start from non-Element Nodes. */
|
|
447
|
+
declare function closest(element: EventTarget | Element | null | undefined, selector: string): Element | null;
|
|
495
448
|
|
|
496
|
-
export { }
|
|
449
|
+
export { CdkEditClose, CdkEditControl, CdkEditOpen, CdkEditRevert, CdkEditable, CdkPopoverEdit, CdkPopoverEditModule, CdkPopoverEditTabOut, CdkRowHoverContent, EditEventDispatcher, EditRef, FocusDispatcher, FormValueContainer, HoverContentState, CELL_SELECTOR as _CELL_SELECTOR, closest as _closest };
|
|
450
|
+
export type { CdkPopoverEditColspan, Entry, PopoverEditClickOutBehavior };
|