@angular/cdk-experimental 19.0.0-next.9 → 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/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +129 -152
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +31 -29
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/popover-edit.mjs +166 -163
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +44 -30
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs +65 -42
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs +17 -17
- 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,8 +210,8 @@ 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
216
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditEventDispatcher, decorators: [{
|
|
217
217
|
type: Injectable
|
|
@@ -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,8 +312,8 @@ 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
318
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditRef, decorators: [{
|
|
317
319
|
type: Injectable
|
|
@@ -322,8 +324,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
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,8 +381,8 @@ 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
387
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FocusDispatcher, decorators: [{
|
|
384
388
|
type: Injectable,
|
|
@@ -396,9 +400,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
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,8 +504,8 @@ 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
510
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditControl, decorators: [{
|
|
505
511
|
type: Directive,
|
|
@@ -521,16 +527,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
521
527
|
}] });
|
|
522
528
|
/** Reverts the form to its initial or previously submitted state on click. */
|
|
523
529
|
class CdkEditRevert {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
this.type = 'button';
|
|
528
|
-
}
|
|
530
|
+
editRef = inject(EditRef);
|
|
531
|
+
/** Type of the button. Defaults to `button` to avoid accident form submits. */
|
|
532
|
+
type = 'button';
|
|
529
533
|
revertEdit() {
|
|
530
534
|
this.editRef.reset();
|
|
531
535
|
}
|
|
532
|
-
static
|
|
533
|
-
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 });
|
|
534
538
|
}
|
|
535
539
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditRevert, decorators: [{
|
|
536
540
|
type: Directive,
|
|
@@ -546,9 +550,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
546
550
|
}] } });
|
|
547
551
|
/** Closes the lens on click. */
|
|
548
552
|
class CdkEditClose {
|
|
553
|
+
elementRef = inject(ElementRef);
|
|
554
|
+
editRef = inject(EditRef);
|
|
549
555
|
constructor() {
|
|
550
|
-
this.elementRef = inject(ElementRef);
|
|
551
|
-
this.editRef = inject(EditRef);
|
|
552
556
|
const nativeElement = this.elementRef.nativeElement;
|
|
553
557
|
// Prevent accidental form submits.
|
|
554
558
|
if (nativeElement.nodeName === 'BUTTON' && !nativeElement.getAttribute('type')) {
|
|
@@ -563,8 +567,8 @@ class CdkEditClose {
|
|
|
563
567
|
// the same event sequence if focus was moved quickly.
|
|
564
568
|
this.editRef.close();
|
|
565
569
|
}
|
|
566
|
-
static
|
|
567
|
-
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 });
|
|
568
572
|
}
|
|
569
573
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditClose, decorators: [{
|
|
570
574
|
type: Directive,
|
|
@@ -585,18 +589,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
585
589
|
* and 56 bytes of memory per instance.
|
|
586
590
|
*/
|
|
587
591
|
class EditServices {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
598
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditServices, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
599
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", 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 });
|
|
600
602
|
}
|
|
601
603
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: EditServices, decorators: [{
|
|
602
604
|
type: Injectable
|
|
@@ -613,9 +615,9 @@ var FocusEscapeNotifierDirection;
|
|
|
613
615
|
* focus leaves the region.
|
|
614
616
|
*/
|
|
615
617
|
class FocusEscapeNotifier extends FocusTrap {
|
|
618
|
+
_escapeSubject = new Subject();
|
|
616
619
|
constructor(element, checker, ngZone, document) {
|
|
617
620
|
super(element, checker, ngZone, document, true /* deferAnchors */);
|
|
618
|
-
this._escapeSubject = new Subject();
|
|
619
621
|
// The focus trap adds "anchors" at the beginning and end of a trapped region that redirect
|
|
620
622
|
// focus. We override that redirect behavior here with simply emitting on a stream.
|
|
621
623
|
this.startAnchorListener = () => {
|
|
@@ -634,11 +636,9 @@ class FocusEscapeNotifier extends FocusTrap {
|
|
|
634
636
|
}
|
|
635
637
|
/** Factory that allows easy instantiation of focus escape notifiers. */
|
|
636
638
|
class FocusEscapeNotifierFactory {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
this._document = inject(DOCUMENT);
|
|
641
|
-
}
|
|
639
|
+
_checker = inject(InteractivityChecker);
|
|
640
|
+
_ngZone = inject(NgZone);
|
|
641
|
+
_document = inject(DOCUMENT);
|
|
642
642
|
/**
|
|
643
643
|
* Creates a focus escape notifier region around the given element.
|
|
644
644
|
* @param element The element around which focus will be monitored.
|
|
@@ -647,8 +647,8 @@ class FocusEscapeNotifierFactory {
|
|
|
647
647
|
create(element) {
|
|
648
648
|
return new FocusEscapeNotifier(element, this._checker, this._ngZone, this._document);
|
|
649
649
|
}
|
|
650
|
-
static
|
|
651
|
-
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' });
|
|
652
652
|
}
|
|
653
653
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: FocusEscapeNotifierFactory, decorators: [{
|
|
654
654
|
type: Injectable,
|
|
@@ -663,13 +663,13 @@ const MOUSE_MOVE_THROTTLE_TIME_MS = 10;
|
|
|
663
663
|
* EditEventDispatcher service for use by the other edit directives.
|
|
664
664
|
*/
|
|
665
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();
|
|
666
672
|
constructor() {
|
|
667
|
-
this.elementRef = inject(ElementRef);
|
|
668
|
-
this.editEventDispatcher = inject(EditEventDispatcher);
|
|
669
|
-
this.focusDispatcher = inject(FocusDispatcher);
|
|
670
|
-
this.ngZone = inject(NgZone);
|
|
671
|
-
this.destroyed = new Subject();
|
|
672
|
-
this._rendered = new Subject();
|
|
673
673
|
afterRender(() => {
|
|
674
674
|
this._rendered.next();
|
|
675
675
|
});
|
|
@@ -723,8 +723,8 @@ class CdkEditable {
|
|
|
723
723
|
.subscribe(this.focusDispatcher.keyObserver);
|
|
724
724
|
});
|
|
725
725
|
}
|
|
726
|
-
static
|
|
727
|
-
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 });
|
|
728
728
|
}
|
|
729
729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditable, decorators: [{
|
|
730
730
|
type: Directive,
|
|
@@ -751,16 +751,18 @@ const POPOVER_EDIT_INPUTS = [
|
|
|
751
751
|
* Makes the cell focusable.
|
|
752
752
|
*/
|
|
753
753
|
class CdkPopoverEdit {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
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;
|
|
764
766
|
/**
|
|
765
767
|
* Specifies that the popup should cover additional table cells before and/or after
|
|
766
768
|
* this one.
|
|
@@ -778,6 +780,7 @@ class CdkPopoverEdit {
|
|
|
778
780
|
}
|
|
779
781
|
}
|
|
780
782
|
}
|
|
783
|
+
_colspan = {};
|
|
781
784
|
/** Whether popover edit is disabled for this cell. */
|
|
782
785
|
get disabled() {
|
|
783
786
|
return this._disabled;
|
|
@@ -792,6 +795,10 @@ class CdkPopoverEdit {
|
|
|
792
795
|
this.services.editEventDispatcher.disabledCells.delete(this.elementRef.nativeElement);
|
|
793
796
|
}
|
|
794
797
|
}
|
|
798
|
+
_disabled = false;
|
|
799
|
+
focusTrap;
|
|
800
|
+
overlayRef;
|
|
801
|
+
destroyed = new Subject();
|
|
795
802
|
ngAfterViewInit() {
|
|
796
803
|
this._startListeningToEditEvents();
|
|
797
804
|
}
|
|
@@ -917,8 +924,8 @@ class CdkPopoverEdit {
|
|
|
917
924
|
}
|
|
918
925
|
return { width: lastCell.getBoundingClientRect().right - firstCell.getBoundingClientRect().left };
|
|
919
926
|
}
|
|
920
|
-
static
|
|
921
|
-
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 });
|
|
922
929
|
}
|
|
923
930
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEdit, decorators: [{
|
|
924
931
|
type: Directive,
|
|
@@ -934,11 +941,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
934
941
|
* Makes the cell focusable.
|
|
935
942
|
*/
|
|
936
943
|
class CdkPopoverEditTabOut extends CdkPopoverEdit {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
this.focusEscapeNotifierFactory = inject(FocusEscapeNotifierFactory);
|
|
940
|
-
this.focusTrap = undefined;
|
|
941
|
-
}
|
|
944
|
+
focusEscapeNotifierFactory = inject(FocusEscapeNotifierFactory);
|
|
945
|
+
focusTrap = undefined;
|
|
942
946
|
initFocusTrap() {
|
|
943
947
|
this.focusTrap = this.focusEscapeNotifierFactory.create(this.overlayRef.overlayElement);
|
|
944
948
|
this.focusTrap
|
|
@@ -950,8 +954,8 @@ class CdkPopoverEditTabOut extends CdkPopoverEdit {
|
|
|
950
954
|
this.closeEditOverlay();
|
|
951
955
|
});
|
|
952
956
|
}
|
|
953
|
-
static
|
|
954
|
-
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 });
|
|
955
959
|
}
|
|
956
960
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditTabOut, decorators: [{
|
|
957
961
|
type: Directive,
|
|
@@ -966,14 +970,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
966
970
|
* it is hovered or when an element in the row has focus.
|
|
967
971
|
*/
|
|
968
972
|
class CdkRowHoverContent {
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
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;
|
|
977
980
|
ngAfterViewInit() {
|
|
978
981
|
this._row = closest(this.elementRef.nativeElement, ROW_SELECTOR);
|
|
979
982
|
this.services.editEventDispatcher.registerRowWithHoverContent(this._row);
|
|
@@ -1038,8 +1041,8 @@ class CdkRowHoverContent {
|
|
|
1038
1041
|
}
|
|
1039
1042
|
});
|
|
1040
1043
|
}
|
|
1041
|
-
static
|
|
1042
|
-
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 });
|
|
1043
1046
|
}
|
|
1044
1047
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkRowHoverContent, decorators: [{
|
|
1045
1048
|
type: Directive,
|
|
@@ -1052,9 +1055,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
1052
1055
|
* element or an ancestor element.
|
|
1053
1056
|
*/
|
|
1054
1057
|
class CdkEditOpen {
|
|
1058
|
+
elementRef = inject(ElementRef);
|
|
1059
|
+
editEventDispatcher = inject(EditEventDispatcher);
|
|
1055
1060
|
constructor() {
|
|
1056
|
-
this.elementRef = inject(ElementRef);
|
|
1057
|
-
this.editEventDispatcher = inject(EditEventDispatcher);
|
|
1058
1061
|
const elementRef = this.elementRef;
|
|
1059
1062
|
const nativeElement = elementRef.nativeElement;
|
|
1060
1063
|
// Prevent accidental form submits.
|
|
@@ -1066,8 +1069,8 @@ class CdkEditOpen {
|
|
|
1066
1069
|
this.editEventDispatcher.editing.next(closest(this.elementRef.nativeElement, CELL_SELECTOR));
|
|
1067
1070
|
evt.stopPropagation();
|
|
1068
1071
|
}
|
|
1069
|
-
static
|
|
1070
|
-
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 });
|
|
1071
1074
|
}
|
|
1072
1075
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkEditOpen, decorators: [{
|
|
1073
1076
|
type: Directive,
|
|
@@ -1090,8 +1093,8 @@ const EXPORTED_DECLARATIONS = [
|
|
|
1090
1093
|
CdkEditOpen,
|
|
1091
1094
|
];
|
|
1092
1095
|
class CdkPopoverEditModule {
|
|
1093
|
-
static
|
|
1094
|
-
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,
|
|
1095
1098
|
CdkPopoverEditTabOut,
|
|
1096
1099
|
CdkRowHoverContent,
|
|
1097
1100
|
CdkEditControl,
|
|
@@ -1105,8 +1108,8 @@ class CdkPopoverEditModule {
|
|
|
1105
1108
|
CdkEditRevert,
|
|
1106
1109
|
CdkEditClose,
|
|
1107
1110
|
CdkEditable,
|
|
1108
|
-
CdkEditOpen] });
|
|
1109
|
-
static
|
|
1111
|
+
CdkEditOpen] });
|
|
1112
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditModule, imports: [OverlayModule] });
|
|
1110
1113
|
}
|
|
1111
1114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: CdkPopoverEditModule, decorators: [{
|
|
1112
1115
|
type: NgModule,
|