@angular/cdk-experimental 19.0.0-next.8 → 19.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/column-resize/index.d.ts +3 -3
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +145 -172
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +34 -34
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/popover-edit.mjs +180 -185
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +46 -33
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs +71 -53
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs +19 -20
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/package.json +2 -2
- package/selection/index.d.ts +7 -8
|
@@ -59,61 +59,61 @@ var HoverContentState;
|
|
|
59
59
|
* Service for sharing delegated events and state for triggering table edits.
|
|
60
60
|
*/
|
|
61
61
|
class EditEventDispatcher {
|
|
62
|
+
_ngZone = inject(NgZone);
|
|
63
|
+
/** A subject that indicates which table cell is currently editing (unless it is disabled). */
|
|
64
|
+
editing = new Subject();
|
|
65
|
+
/** A subject that indicates which table row is currently hovered. */
|
|
66
|
+
hovering = new Subject();
|
|
67
|
+
/** A subject that indicates which table row currently contains focus. */
|
|
68
|
+
focused = new Subject();
|
|
69
|
+
/** A subject that indicates all elements in the table matching ROW_SELECTOR. */
|
|
70
|
+
allRows = new Subject();
|
|
71
|
+
/** A subject that emits mouse move events from the table indicating the targeted row. */
|
|
72
|
+
mouseMove = new Subject();
|
|
73
|
+
// TODO: Use WeakSet once IE11 support is dropped.
|
|
74
|
+
/**
|
|
75
|
+
* Tracks the currently disabled editable cells - edit calls will be ignored
|
|
76
|
+
* for these cells.
|
|
77
|
+
*/
|
|
78
|
+
disabledCells = new WeakMap();
|
|
62
79
|
/** The EditRef for the currently active edit lens (if any). */
|
|
63
80
|
get editRef() {
|
|
64
81
|
return this._editRef;
|
|
65
82
|
}
|
|
83
|
+
_editRef = null;
|
|
84
|
+
// Optimization: Precompute common pipeable operators used per row/cell.
|
|
85
|
+
_distinctUntilChanged = distinctUntilChanged();
|
|
86
|
+
_startWithNull = startWith(null);
|
|
87
|
+
_distinctShare = pipe(this._distinctUntilChanged, shareReplay(1));
|
|
88
|
+
_startWithNullDistinct = pipe(this._startWithNull, this._distinctUntilChanged);
|
|
89
|
+
editingAndEnabled = this.editing.pipe(filter(cell => cell == null || !this.disabledCells.has(cell)), shareReplay(1));
|
|
90
|
+
/** An observable that emits the row containing focus or an active edit. */
|
|
91
|
+
editingOrFocused = combineLatest([
|
|
92
|
+
this.editingAndEnabled.pipe(map(cell => closest(cell, ROW_SELECTOR)), this._startWithNull),
|
|
93
|
+
this.focused.pipe(this._startWithNull),
|
|
94
|
+
]).pipe(map(([editingRow, focusedRow]) => focusedRow || editingRow), this._distinctUntilChanged, auditTime(FOCUS_DELAY), // Use audit to skip over blur events to the next focused element.
|
|
95
|
+
this._distinctUntilChanged, shareReplay(1));
|
|
96
|
+
/** Tracks rows that contain hover content with a reference count. */
|
|
97
|
+
_rowsWithHoverContent = new WeakMap();
|
|
98
|
+
/** The table cell that has an active edit lens (or null). */
|
|
99
|
+
_currentlyEditing = null;
|
|
100
|
+
/** The combined set of row hover content states organized by row. */
|
|
101
|
+
_hoveredContentStateDistinct = combineLatest([
|
|
102
|
+
this._getFirstRowWithHoverContent(),
|
|
103
|
+
this._getLastRowWithHoverContent(),
|
|
104
|
+
this.editingOrFocused,
|
|
105
|
+
this.hovering.pipe(distinctUntilChanged(), audit(row => this.mouseMove.pipe(filter(mouseMoveRow => row === mouseMoveRow), this._startWithNull, debounceTime(MOUSE_EVENT_DELAY_MS))), this._startWithNullDistinct),
|
|
106
|
+
]).pipe(skip(1), // Skip the initial emission of [null, null, null, null].
|
|
107
|
+
map(computeHoverContentState), distinctUntilChanged(areMapEntriesEqual),
|
|
108
|
+
// Optimization: Enter the zone before shareReplay so that we trigger a single
|
|
109
|
+
// ApplicationRef.tick for all row updates.
|
|
110
|
+
this._enterZone(), shareReplay(1));
|
|
111
|
+
_editingAndEnabledDistinct = this.editingAndEnabled.pipe(distinctUntilChanged(), this._enterZone(), shareReplay(1));
|
|
112
|
+
// Optimization: Share row events observable with subsequent callers.
|
|
113
|
+
// At startup, calls will be sequential by row.
|
|
114
|
+
_lastSeenRow = null;
|
|
115
|
+
_lastSeenRowHoverOrFocus = null;
|
|
66
116
|
constructor() {
|
|
67
|
-
this._ngZone = inject(NgZone);
|
|
68
|
-
/** A subject that indicates which table cell is currently editing (unless it is disabled). */
|
|
69
|
-
this.editing = new Subject();
|
|
70
|
-
/** A subject that indicates which table row is currently hovered. */
|
|
71
|
-
this.hovering = new Subject();
|
|
72
|
-
/** A subject that indicates which table row currently contains focus. */
|
|
73
|
-
this.focused = new Subject();
|
|
74
|
-
/** A subject that indicates all elements in the table matching ROW_SELECTOR. */
|
|
75
|
-
this.allRows = new Subject();
|
|
76
|
-
/** A subject that emits mouse move events from the table indicating the targeted row. */
|
|
77
|
-
this.mouseMove = new Subject();
|
|
78
|
-
// TODO: Use WeakSet once IE11 support is dropped.
|
|
79
|
-
/**
|
|
80
|
-
* Tracks the currently disabled editable cells - edit calls will be ignored
|
|
81
|
-
* for these cells.
|
|
82
|
-
*/
|
|
83
|
-
this.disabledCells = new WeakMap();
|
|
84
|
-
this._editRef = null;
|
|
85
|
-
// Optimization: Precompute common pipeable operators used per row/cell.
|
|
86
|
-
this._distinctUntilChanged = distinctUntilChanged();
|
|
87
|
-
this._startWithNull = startWith(null);
|
|
88
|
-
this._distinctShare = pipe(this._distinctUntilChanged, shareReplay(1));
|
|
89
|
-
this._startWithNullDistinct = pipe(this._startWithNull, this._distinctUntilChanged);
|
|
90
|
-
this.editingAndEnabled = this.editing.pipe(filter(cell => cell == null || !this.disabledCells.has(cell)), shareReplay(1));
|
|
91
|
-
/** An observable that emits the row containing focus or an active edit. */
|
|
92
|
-
this.editingOrFocused = combineLatest([
|
|
93
|
-
this.editingAndEnabled.pipe(map(cell => closest(cell, ROW_SELECTOR)), this._startWithNull),
|
|
94
|
-
this.focused.pipe(this._startWithNull),
|
|
95
|
-
]).pipe(map(([editingRow, focusedRow]) => focusedRow || editingRow), this._distinctUntilChanged, auditTime(FOCUS_DELAY), // Use audit to skip over blur events to the next focused element.
|
|
96
|
-
this._distinctUntilChanged, shareReplay(1));
|
|
97
|
-
/** Tracks rows that contain hover content with a reference count. */
|
|
98
|
-
this._rowsWithHoverContent = new WeakMap();
|
|
99
|
-
/** The table cell that has an active edit lens (or null). */
|
|
100
|
-
this._currentlyEditing = null;
|
|
101
|
-
/** The combined set of row hover content states organized by row. */
|
|
102
|
-
this._hoveredContentStateDistinct = combineLatest([
|
|
103
|
-
this._getFirstRowWithHoverContent(),
|
|
104
|
-
this._getLastRowWithHoverContent(),
|
|
105
|
-
this.editingOrFocused,
|
|
106
|
-
this.hovering.pipe(distinctUntilChanged(), audit(row => this.mouseMove.pipe(filter(mouseMoveRow => row === mouseMoveRow), this._startWithNull, debounceTime(MOUSE_EVENT_DELAY_MS))), this._startWithNullDistinct),
|
|
107
|
-
]).pipe(skip(1), // Skip the initial emission of [null, null, null, null].
|
|
108
|
-
map(computeHoverContentState), distinctUntilChanged(areMapEntriesEqual),
|
|
109
|
-
// Optimization: Enter the zone before shareReplay so that we trigger a single
|
|
110
|
-
// ApplicationRef.tick for all row updates.
|
|
111
|
-
this._enterZone(), shareReplay(1));
|
|
112
|
-
this._editingAndEnabledDistinct = this.editingAndEnabled.pipe(distinctUntilChanged(), this._enterZone(), shareReplay(1));
|
|
113
|
-
// Optimization: Share row events observable with subsequent callers.
|
|
114
|
-
// At startup, calls will be sequential by row.
|
|
115
|
-
this._lastSeenRow = null;
|
|
116
|
-
this._lastSeenRowHoverOrFocus = null;
|
|
117
117
|
this._editingAndEnabledDistinct.subscribe(cell => {
|
|
118
118
|
this._currentlyEditing = cell;
|
|
119
119
|
});
|
|
@@ -210,10 +210,10 @@ class EditEventDispatcher {
|
|
|
210
210
|
_mapAllRowsToSingleRow(mapper) {
|
|
211
211
|
return this.allRows.pipe(map(mapper), this._startWithNullDistinct);
|
|
212
212
|
}
|
|
213
|
-
static
|
|
214
|
-
static
|
|
213
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditEventDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
214
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditEventDispatcher });
|
|
215
215
|
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditEventDispatcher, decorators: [{
|
|
217
217
|
type: Injectable
|
|
218
218
|
}], ctorParameters: () => [] });
|
|
219
219
|
function computeHoverContentState([firstRow, lastRow, activeRow, hoverRow,]) {
|
|
@@ -255,16 +255,18 @@ function areMapEntriesEqual(a, b) {
|
|
|
255
255
|
* table that launched it. Provided by CdkEditControl within the lens.
|
|
256
256
|
*/
|
|
257
257
|
class EditRef {
|
|
258
|
+
_form = inject(ControlContainer, { self: true });
|
|
259
|
+
_editEventDispatcher = inject(EditEventDispatcher);
|
|
260
|
+
/** Emits the final value of this edit instance before closing. */
|
|
261
|
+
_finalValueSubject = new Subject();
|
|
262
|
+
finalValue = this._finalValueSubject;
|
|
263
|
+
/** Emits when the user tabs out of this edit lens before closing. */
|
|
264
|
+
_blurredSubject = new Subject();
|
|
265
|
+
blurred = this._blurredSubject;
|
|
266
|
+
/** The value to set the form back to on revert. */
|
|
267
|
+
_revertFormValue;
|
|
268
|
+
_injector = inject(Injector);
|
|
258
269
|
constructor() {
|
|
259
|
-
this._form = inject(ControlContainer, { self: true });
|
|
260
|
-
this._editEventDispatcher = inject(EditEventDispatcher);
|
|
261
|
-
/** Emits the final value of this edit instance before closing. */
|
|
262
|
-
this._finalValueSubject = new Subject();
|
|
263
|
-
this.finalValue = this._finalValueSubject;
|
|
264
|
-
/** Emits when the user tabs out of this edit lens before closing. */
|
|
265
|
-
this._blurredSubject = new Subject();
|
|
266
|
-
this.blurred = this._blurredSubject;
|
|
267
|
-
this._injector = inject(Injector);
|
|
268
270
|
this._editEventDispatcher.setActiveEditRef(this);
|
|
269
271
|
}
|
|
270
272
|
/**
|
|
@@ -310,10 +312,10 @@ class EditRef {
|
|
|
310
312
|
reset(value) {
|
|
311
313
|
this._form.reset(value || this._revertFormValue);
|
|
312
314
|
}
|
|
313
|
-
static
|
|
314
|
-
static
|
|
315
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
316
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditRef });
|
|
315
317
|
}
|
|
316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditRef, decorators: [{
|
|
317
319
|
type: Injectable
|
|
318
320
|
}], ctorParameters: () => [] });
|
|
319
321
|
|
|
@@ -322,8 +324,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
322
324
|
* May be overridden to customize the keyboard behavior of popover edit.
|
|
323
325
|
*/
|
|
324
326
|
class FocusDispatcher {
|
|
327
|
+
directionality = inject(Directionality);
|
|
328
|
+
/** Observes keydown events triggered from the table. */
|
|
329
|
+
keyObserver;
|
|
325
330
|
constructor() {
|
|
326
|
-
this.directionality = inject(Directionality);
|
|
327
331
|
this.keyObserver = { next: event => this.handleKeyboardEvent(event) };
|
|
328
332
|
}
|
|
329
333
|
/**
|
|
@@ -377,10 +381,10 @@ class FocusDispatcher {
|
|
|
377
381
|
}
|
|
378
382
|
event.preventDefault();
|
|
379
383
|
}
|
|
380
|
-
static
|
|
381
|
-
static
|
|
384
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FocusDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
385
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FocusDispatcher, providedIn: 'root' });
|
|
382
386
|
}
|
|
383
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FocusDispatcher, decorators: [{
|
|
384
388
|
type: Injectable,
|
|
385
389
|
args: [{ providedIn: 'root' }]
|
|
386
390
|
}], ctorParameters: () => [] });
|
|
@@ -396,9 +400,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
396
400
|
* <form cdkEditControl [(cdkEditControlPreservedFormValue)]="nameEditValues.for(item).value">
|
|
397
401
|
*/
|
|
398
402
|
class FormValueContainer {
|
|
399
|
-
|
|
400
|
-
this._formValues = new WeakMap();
|
|
401
|
-
}
|
|
403
|
+
_formValues = new WeakMap();
|
|
402
404
|
for(key) {
|
|
403
405
|
const _formValues = this._formValues;
|
|
404
406
|
let entry = _formValues.get(key);
|
|
@@ -418,22 +420,26 @@ class FormValueContainer {
|
|
|
418
420
|
* out.
|
|
419
421
|
*/
|
|
420
422
|
class CdkEditControl {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
423
|
+
elementRef = inject(ElementRef);
|
|
424
|
+
editRef = inject(EditRef);
|
|
425
|
+
destroyed = new Subject();
|
|
426
|
+
/**
|
|
427
|
+
* Specifies what should happen when the user clicks outside of the edit lens.
|
|
428
|
+
* The default behavior is to close the lens without submitting the form.
|
|
429
|
+
*/
|
|
430
|
+
clickOutBehavior = 'close';
|
|
431
|
+
/**
|
|
432
|
+
* A two-way binding for storing unsubmitted form state. If not provided
|
|
433
|
+
* then form state will be discarded on close. The PeristBy directive is offered
|
|
434
|
+
* as a convenient shortcut for these bindings.
|
|
435
|
+
*/
|
|
436
|
+
preservedFormValue;
|
|
437
|
+
preservedFormValueChange = new EventEmitter();
|
|
438
|
+
/**
|
|
439
|
+
* Determines whether the lens will close on form submit if the form is not in a valid
|
|
440
|
+
* state. By default the lens will remain open.
|
|
441
|
+
*/
|
|
442
|
+
ignoreSubmitUnlessValid = true;
|
|
437
443
|
ngOnInit() {
|
|
438
444
|
this.editRef.init(this.preservedFormValue);
|
|
439
445
|
this.editRef.finalValue.subscribe(this.preservedFormValueChange);
|
|
@@ -498,10 +504,10 @@ class CdkEditControl {
|
|
|
498
504
|
_triggerFormSubmit() {
|
|
499
505
|
this.elementRef.nativeElement.dispatchEvent(new Event('submit'));
|
|
500
506
|
}
|
|
501
|
-
static
|
|
502
|
-
static
|
|
507
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
508
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkEditControl, isStandalone: true, selector: "form[cdkEditControl]", inputs: { clickOutBehavior: ["cdkEditControlClickOutBehavior", "clickOutBehavior"], preservedFormValue: ["cdkEditControlPreservedFormValue", "preservedFormValue"], ignoreSubmitUnlessValid: ["cdkEditControlIgnoreSubmitUnlessValid", "ignoreSubmitUnlessValid"] }, outputs: { preservedFormValueChange: "cdkEditControlPreservedFormValueChange" }, host: { listeners: { "ngSubmit": "handleFormSubmit()", "document:click": "handlePossibleClickOut($event)", "keydown": "_handleKeydown($event)" } }, providers: [EditRef], ngImport: i0 });
|
|
503
509
|
}
|
|
504
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditControl, decorators: [{
|
|
505
511
|
type: Directive,
|
|
506
512
|
args: [{
|
|
507
513
|
selector: 'form[cdkEditControl]',
|
|
@@ -517,23 +523,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
517
523
|
'(document:click)': 'handlePossibleClickOut($event)',
|
|
518
524
|
'(keydown)': '_handleKeydown($event)',
|
|
519
525
|
},
|
|
520
|
-
standalone: true,
|
|
521
526
|
}]
|
|
522
527
|
}] });
|
|
523
528
|
/** Reverts the form to its initial or previously submitted state on click. */
|
|
524
529
|
class CdkEditRevert {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
this.type = 'button';
|
|
529
|
-
}
|
|
530
|
+
editRef = inject(EditRef);
|
|
531
|
+
/** Type of the button. Defaults to `button` to avoid accident form submits. */
|
|
532
|
+
type = 'button';
|
|
530
533
|
revertEdit() {
|
|
531
534
|
this.editRef.reset();
|
|
532
535
|
}
|
|
533
|
-
static
|
|
534
|
-
static
|
|
536
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditRevert, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
537
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkEditRevert, isStandalone: true, selector: "button[cdkEditRevert]", inputs: { type: "type" }, host: { attributes: { "type": "button" }, listeners: { "click": "revertEdit()" } }, ngImport: i0 });
|
|
535
538
|
}
|
|
536
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditRevert, decorators: [{
|
|
537
540
|
type: Directive,
|
|
538
541
|
args: [{
|
|
539
542
|
selector: 'button[cdkEditRevert]',
|
|
@@ -541,16 +544,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
541
544
|
'type': 'button',
|
|
542
545
|
'(click)': 'revertEdit()',
|
|
543
546
|
},
|
|
544
|
-
standalone: true,
|
|
545
547
|
}]
|
|
546
548
|
}], propDecorators: { type: [{
|
|
547
549
|
type: Input
|
|
548
550
|
}] } });
|
|
549
551
|
/** Closes the lens on click. */
|
|
550
552
|
class CdkEditClose {
|
|
553
|
+
elementRef = inject(ElementRef);
|
|
554
|
+
editRef = inject(EditRef);
|
|
551
555
|
constructor() {
|
|
552
|
-
this.elementRef = inject(ElementRef);
|
|
553
|
-
this.editRef = inject(EditRef);
|
|
554
556
|
const nativeElement = this.elementRef.nativeElement;
|
|
555
557
|
// Prevent accidental form submits.
|
|
556
558
|
if (nativeElement.nodeName === 'BUTTON' && !nativeElement.getAttribute('type')) {
|
|
@@ -565,10 +567,10 @@ class CdkEditClose {
|
|
|
565
567
|
// the same event sequence if focus was moved quickly.
|
|
566
568
|
this.editRef.close();
|
|
567
569
|
}
|
|
568
|
-
static
|
|
569
|
-
static
|
|
570
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditClose, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
571
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkEditClose, isStandalone: true, selector: "[cdkEditClose]", host: { listeners: { "click": "closeEdit()", "keydown.enter": "closeEdit()", "keydown.space": "closeEdit()" } }, ngImport: i0 });
|
|
570
572
|
}
|
|
571
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
573
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditClose, decorators: [{
|
|
572
574
|
type: Directive,
|
|
573
575
|
args: [{
|
|
574
576
|
selector: '[cdkEditClose]',
|
|
@@ -577,7 +579,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
577
579
|
'(keydown.enter)': 'closeEdit()',
|
|
578
580
|
'(keydown.space)': 'closeEdit()',
|
|
579
581
|
},
|
|
580
|
-
standalone: true,
|
|
581
582
|
}]
|
|
582
583
|
}], ctorParameters: () => [] });
|
|
583
584
|
|
|
@@ -588,20 +589,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
588
589
|
* and 56 bytes of memory per instance.
|
|
589
590
|
*/
|
|
590
591
|
class EditServices {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}
|
|
601
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: EditServices, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
602
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.8", ngImport: i0, type: EditServices }); }
|
|
592
|
+
directionality = inject(Directionality);
|
|
593
|
+
editEventDispatcher = inject(EditEventDispatcher);
|
|
594
|
+
focusDispatcher = inject(FocusDispatcher);
|
|
595
|
+
focusTrapFactory = inject(FocusTrapFactory);
|
|
596
|
+
ngZone = inject(NgZone);
|
|
597
|
+
overlay = inject(Overlay);
|
|
598
|
+
scrollDispatcher = inject(ScrollDispatcher);
|
|
599
|
+
viewportRuler = inject(ViewportRuler);
|
|
600
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditServices, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
601
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditServices });
|
|
603
602
|
}
|
|
604
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditServices, decorators: [{
|
|
605
604
|
type: Injectable
|
|
606
605
|
}] });
|
|
607
606
|
|
|
@@ -616,9 +615,9 @@ var FocusEscapeNotifierDirection;
|
|
|
616
615
|
* focus leaves the region.
|
|
617
616
|
*/
|
|
618
617
|
class FocusEscapeNotifier extends FocusTrap {
|
|
618
|
+
_escapeSubject = new Subject();
|
|
619
619
|
constructor(element, checker, ngZone, document) {
|
|
620
620
|
super(element, checker, ngZone, document, true /* deferAnchors */);
|
|
621
|
-
this._escapeSubject = new Subject();
|
|
622
621
|
// The focus trap adds "anchors" at the beginning and end of a trapped region that redirect
|
|
623
622
|
// focus. We override that redirect behavior here with simply emitting on a stream.
|
|
624
623
|
this.startAnchorListener = () => {
|
|
@@ -637,11 +636,9 @@ class FocusEscapeNotifier extends FocusTrap {
|
|
|
637
636
|
}
|
|
638
637
|
/** Factory that allows easy instantiation of focus escape notifiers. */
|
|
639
638
|
class FocusEscapeNotifierFactory {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
this._document = inject(DOCUMENT);
|
|
644
|
-
}
|
|
639
|
+
_checker = inject(InteractivityChecker);
|
|
640
|
+
_ngZone = inject(NgZone);
|
|
641
|
+
_document = inject(DOCUMENT);
|
|
645
642
|
/**
|
|
646
643
|
* Creates a focus escape notifier region around the given element.
|
|
647
644
|
* @param element The element around which focus will be monitored.
|
|
@@ -650,10 +647,10 @@ class FocusEscapeNotifierFactory {
|
|
|
650
647
|
create(element) {
|
|
651
648
|
return new FocusEscapeNotifier(element, this._checker, this._ngZone, this._document);
|
|
652
649
|
}
|
|
653
|
-
static
|
|
654
|
-
static
|
|
650
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FocusEscapeNotifierFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
651
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FocusEscapeNotifierFactory, providedIn: 'root' });
|
|
655
652
|
}
|
|
656
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
653
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FocusEscapeNotifierFactory, decorators: [{
|
|
657
654
|
type: Injectable,
|
|
658
655
|
args: [{ providedIn: 'root' }]
|
|
659
656
|
}] });
|
|
@@ -666,13 +663,13 @@ const MOUSE_MOVE_THROTTLE_TIME_MS = 10;
|
|
|
666
663
|
* EditEventDispatcher service for use by the other edit directives.
|
|
667
664
|
*/
|
|
668
665
|
class CdkEditable {
|
|
666
|
+
elementRef = inject(ElementRef);
|
|
667
|
+
editEventDispatcher = inject(EditEventDispatcher);
|
|
668
|
+
focusDispatcher = inject(FocusDispatcher);
|
|
669
|
+
ngZone = inject(NgZone);
|
|
670
|
+
destroyed = new Subject();
|
|
671
|
+
_rendered = new Subject();
|
|
669
672
|
constructor() {
|
|
670
|
-
this.elementRef = inject(ElementRef);
|
|
671
|
-
this.editEventDispatcher = inject(EditEventDispatcher);
|
|
672
|
-
this.focusDispatcher = inject(FocusDispatcher);
|
|
673
|
-
this.ngZone = inject(NgZone);
|
|
674
|
-
this.destroyed = new Subject();
|
|
675
|
-
this._rendered = new Subject();
|
|
676
673
|
afterRender(() => {
|
|
677
674
|
this._rendered.next();
|
|
678
675
|
});
|
|
@@ -726,15 +723,14 @@ class CdkEditable {
|
|
|
726
723
|
.subscribe(this.focusDispatcher.keyObserver);
|
|
727
724
|
});
|
|
728
725
|
}
|
|
729
|
-
static
|
|
730
|
-
static
|
|
726
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditable, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
727
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkEditable, isStandalone: true, selector: "table[editable], cdk-table[editable], mat-table[editable]", providers: [EditEventDispatcher, EditServices], ngImport: i0 });
|
|
731
728
|
}
|
|
732
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditable, decorators: [{
|
|
733
730
|
type: Directive,
|
|
734
731
|
args: [{
|
|
735
732
|
selector: 'table[editable], cdk-table[editable], mat-table[editable]',
|
|
736
733
|
providers: [EditEventDispatcher, EditServices],
|
|
737
|
-
standalone: true,
|
|
738
734
|
}]
|
|
739
735
|
}], ctorParameters: () => [] });
|
|
740
736
|
const POPOVER_EDIT_HOST_BINDINGS = {
|
|
@@ -755,16 +751,18 @@ const POPOVER_EDIT_INPUTS = [
|
|
|
755
751
|
* Makes the cell focusable.
|
|
756
752
|
*/
|
|
757
753
|
class CdkPopoverEdit {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
754
|
+
services = inject(EditServices);
|
|
755
|
+
elementRef = inject(ElementRef);
|
|
756
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
757
|
+
/** The edit lens template shown over the cell on edit. */
|
|
758
|
+
template = null;
|
|
759
|
+
/**
|
|
760
|
+
* Implicit context to pass along to the template. Can be omitted if the template
|
|
761
|
+
* is defined within the cell.
|
|
762
|
+
*/
|
|
763
|
+
context;
|
|
764
|
+
/** Aria label to set on the popover dialog element. */
|
|
765
|
+
ariaLabel;
|
|
768
766
|
/**
|
|
769
767
|
* Specifies that the popup should cover additional table cells before and/or after
|
|
770
768
|
* this one.
|
|
@@ -782,6 +780,7 @@ class CdkPopoverEdit {
|
|
|
782
780
|
}
|
|
783
781
|
}
|
|
784
782
|
}
|
|
783
|
+
_colspan = {};
|
|
785
784
|
/** Whether popover edit is disabled for this cell. */
|
|
786
785
|
get disabled() {
|
|
787
786
|
return this._disabled;
|
|
@@ -796,6 +795,10 @@ class CdkPopoverEdit {
|
|
|
796
795
|
this.services.editEventDispatcher.disabledCells.delete(this.elementRef.nativeElement);
|
|
797
796
|
}
|
|
798
797
|
}
|
|
798
|
+
_disabled = false;
|
|
799
|
+
focusTrap;
|
|
800
|
+
overlayRef;
|
|
801
|
+
destroyed = new Subject();
|
|
799
802
|
ngAfterViewInit() {
|
|
800
803
|
this._startListeningToEditEvents();
|
|
801
804
|
}
|
|
@@ -921,16 +924,15 @@ class CdkPopoverEdit {
|
|
|
921
924
|
}
|
|
922
925
|
return { width: lastCell.getBoundingClientRect().right - firstCell.getBoundingClientRect().left };
|
|
923
926
|
}
|
|
924
|
-
static
|
|
925
|
-
static
|
|
927
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEdit, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
928
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkPopoverEdit, isStandalone: true, selector: "[cdkPopoverEdit]:not([cdkPopoverEditTabOut])", inputs: { template: ["cdkPopoverEdit", "template"], context: ["cdkPopoverEditContext", "context"], colspan: ["cdkPopoverEditColspan", "colspan"], disabled: ["cdkPopoverEditDisabled", "disabled"], ariaLabel: ["cdkPopoverEditAriaLabel", "ariaLabel"] }, host: { properties: { "attr.tabindex": "disabled ? null : 0", "attr.aria-haspopup": "!disabled" }, classAttribute: "cdk-popover-edit-cell" }, ngImport: i0 });
|
|
926
929
|
}
|
|
927
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
930
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEdit, decorators: [{
|
|
928
931
|
type: Directive,
|
|
929
932
|
args: [{
|
|
930
933
|
selector: '[cdkPopoverEdit]:not([cdkPopoverEditTabOut])',
|
|
931
934
|
host: POPOVER_EDIT_HOST_BINDINGS,
|
|
932
935
|
inputs: POPOVER_EDIT_INPUTS,
|
|
933
|
-
standalone: true,
|
|
934
936
|
}]
|
|
935
937
|
}] });
|
|
936
938
|
/**
|
|
@@ -939,11 +941,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
939
941
|
* Makes the cell focusable.
|
|
940
942
|
*/
|
|
941
943
|
class CdkPopoverEditTabOut extends CdkPopoverEdit {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
this.focusEscapeNotifierFactory = inject(FocusEscapeNotifierFactory);
|
|
945
|
-
this.focusTrap = undefined;
|
|
946
|
-
}
|
|
944
|
+
focusEscapeNotifierFactory = inject(FocusEscapeNotifierFactory);
|
|
945
|
+
focusTrap = undefined;
|
|
947
946
|
initFocusTrap() {
|
|
948
947
|
this.focusTrap = this.focusEscapeNotifierFactory.create(this.overlayRef.overlayElement);
|
|
949
948
|
this.focusTrap
|
|
@@ -955,16 +954,15 @@ class CdkPopoverEditTabOut extends CdkPopoverEdit {
|
|
|
955
954
|
this.closeEditOverlay();
|
|
956
955
|
});
|
|
957
956
|
}
|
|
958
|
-
static
|
|
959
|
-
static
|
|
957
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditTabOut, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
958
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkPopoverEditTabOut, isStandalone: true, selector: "[cdkPopoverEdit][cdkPopoverEditTabOut]", inputs: { template: ["cdkPopoverEdit", "template"], context: ["cdkPopoverEditContext", "context"], colspan: ["cdkPopoverEditColspan", "colspan"], disabled: ["cdkPopoverEditDisabled", "disabled"], ariaLabel: ["cdkPopoverEditAriaLabel", "ariaLabel"] }, host: { properties: { "attr.tabindex": "disabled ? null : 0", "attr.aria-haspopup": "!disabled" }, classAttribute: "cdk-popover-edit-cell" }, usesInheritance: true, ngImport: i0 });
|
|
960
959
|
}
|
|
961
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
960
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditTabOut, decorators: [{
|
|
962
961
|
type: Directive,
|
|
963
962
|
args: [{
|
|
964
963
|
selector: '[cdkPopoverEdit][cdkPopoverEditTabOut]',
|
|
965
964
|
host: POPOVER_EDIT_HOST_BINDINGS,
|
|
966
965
|
inputs: POPOVER_EDIT_INPUTS,
|
|
967
|
-
standalone: true,
|
|
968
966
|
}]
|
|
969
967
|
}] });
|
|
970
968
|
/**
|
|
@@ -972,14 +970,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
972
970
|
* it is hovered or when an element in the row has focus.
|
|
973
971
|
*/
|
|
974
972
|
class CdkRowHoverContent {
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
}
|
|
973
|
+
services = inject(EditServices);
|
|
974
|
+
elementRef = inject(ElementRef);
|
|
975
|
+
templateRef = inject(TemplateRef);
|
|
976
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
977
|
+
destroyed = new Subject();
|
|
978
|
+
viewRef = null;
|
|
979
|
+
_row;
|
|
983
980
|
ngAfterViewInit() {
|
|
984
981
|
this._row = closest(this.elementRef.nativeElement, ROW_SELECTOR);
|
|
985
982
|
this.services.editEventDispatcher.registerRowWithHoverContent(this._row);
|
|
@@ -1044,14 +1041,13 @@ class CdkRowHoverContent {
|
|
|
1044
1041
|
}
|
|
1045
1042
|
});
|
|
1046
1043
|
}
|
|
1047
|
-
static
|
|
1048
|
-
static
|
|
1044
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRowHoverContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1045
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkRowHoverContent, isStandalone: true, selector: "[cdkRowHoverContent]", ngImport: i0 });
|
|
1049
1046
|
}
|
|
1050
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
1047
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRowHoverContent, decorators: [{
|
|
1051
1048
|
type: Directive,
|
|
1052
1049
|
args: [{
|
|
1053
1050
|
selector: '[cdkRowHoverContent]',
|
|
1054
|
-
standalone: true,
|
|
1055
1051
|
}]
|
|
1056
1052
|
}] });
|
|
1057
1053
|
/**
|
|
@@ -1059,9 +1055,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
1059
1055
|
* element or an ancestor element.
|
|
1060
1056
|
*/
|
|
1061
1057
|
class CdkEditOpen {
|
|
1058
|
+
elementRef = inject(ElementRef);
|
|
1059
|
+
editEventDispatcher = inject(EditEventDispatcher);
|
|
1062
1060
|
constructor() {
|
|
1063
|
-
this.elementRef = inject(ElementRef);
|
|
1064
|
-
this.editEventDispatcher = inject(EditEventDispatcher);
|
|
1065
1061
|
const elementRef = this.elementRef;
|
|
1066
1062
|
const nativeElement = elementRef.nativeElement;
|
|
1067
1063
|
// Prevent accidental form submits.
|
|
@@ -1073,17 +1069,16 @@ class CdkEditOpen {
|
|
|
1073
1069
|
this.editEventDispatcher.editing.next(closest(this.elementRef.nativeElement, CELL_SELECTOR));
|
|
1074
1070
|
evt.stopPropagation();
|
|
1075
1071
|
}
|
|
1076
|
-
static
|
|
1077
|
-
static
|
|
1072
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1073
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: CdkEditOpen, isStandalone: true, selector: "[cdkEditOpen]", host: { listeners: { "click": "openEdit($event)" } }, ngImport: i0 });
|
|
1078
1074
|
}
|
|
1079
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
1075
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditOpen, decorators: [{
|
|
1080
1076
|
type: Directive,
|
|
1081
1077
|
args: [{
|
|
1082
1078
|
selector: '[cdkEditOpen]',
|
|
1083
1079
|
host: {
|
|
1084
1080
|
'(click)': 'openEdit($event)',
|
|
1085
1081
|
},
|
|
1086
|
-
standalone: true,
|
|
1087
1082
|
}]
|
|
1088
1083
|
}], ctorParameters: () => [] });
|
|
1089
1084
|
|
|
@@ -1098,8 +1093,8 @@ const EXPORTED_DECLARATIONS = [
|
|
|
1098
1093
|
CdkEditOpen,
|
|
1099
1094
|
];
|
|
1100
1095
|
class CdkPopoverEditModule {
|
|
1101
|
-
static
|
|
1102
|
-
static
|
|
1096
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1097
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditModule, imports: [OverlayModule, CdkPopoverEdit,
|
|
1103
1098
|
CdkPopoverEditTabOut,
|
|
1104
1099
|
CdkRowHoverContent,
|
|
1105
1100
|
CdkEditControl,
|
|
@@ -1113,10 +1108,10 @@ class CdkPopoverEditModule {
|
|
|
1113
1108
|
CdkEditRevert,
|
|
1114
1109
|
CdkEditClose,
|
|
1115
1110
|
CdkEditable,
|
|
1116
|
-
CdkEditOpen] });
|
|
1117
|
-
static
|
|
1111
|
+
CdkEditOpen] });
|
|
1112
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditModule, imports: [OverlayModule] });
|
|
1118
1113
|
}
|
|
1119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
1114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditModule, decorators: [{
|
|
1120
1115
|
type: NgModule,
|
|
1121
1116
|
args: [{
|
|
1122
1117
|
imports: [OverlayModule, ...EXPORTED_DECLARATIONS],
|