@angular/cdk-experimental 20.0.0-next.1 → 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.
Files changed (46) hide show
  1. package/column-resize/index.d.ts +39 -4
  2. package/combobox/index.d.ts +3 -2
  3. package/deferred-content/index.d.ts +37 -0
  4. package/fesm2022/cdk-experimental.mjs +1 -1
  5. package/fesm2022/cdk-experimental.mjs.map +1 -1
  6. package/fesm2022/column-resize.mjs +134 -61
  7. package/fesm2022/column-resize.mjs.map +1 -1
  8. package/fesm2022/combobox.mjs +19 -22
  9. package/fesm2022/combobox.mjs.map +1 -1
  10. package/fesm2022/deferred-content.mjs +60 -0
  11. package/fesm2022/deferred-content.mjs.map +1 -0
  12. package/fesm2022/list-focus-Di7m_z_6.mjs +382 -0
  13. package/fesm2022/list-focus-Di7m_z_6.mjs.map +1 -0
  14. package/fesm2022/listbox.mjs +42 -17
  15. package/fesm2022/listbox.mjs.map +1 -1
  16. package/fesm2022/option-f_gNslw8.mjs +367 -0
  17. package/fesm2022/option-f_gNslw8.mjs.map +1 -0
  18. package/fesm2022/{polyfill-ae40ec6f.mjs → polyfill-CXksG4af.mjs} +1 -1
  19. package/fesm2022/polyfill-CXksG4af.mjs.map +1 -0
  20. package/fesm2022/popover-edit.mjs +92 -65
  21. package/fesm2022/popover-edit.mjs.map +1 -1
  22. package/fesm2022/scrolling.mjs +7 -7
  23. package/fesm2022/scrolling.mjs.map +1 -1
  24. package/fesm2022/selection.mjs +19 -19
  25. package/fesm2022/selection.mjs.map +1 -1
  26. package/fesm2022/table-scroll-container.mjs +8 -9
  27. package/fesm2022/table-scroll-container.mjs.map +1 -1
  28. package/fesm2022/tabs-BunANY1M.mjs +176 -0
  29. package/fesm2022/tabs-BunANY1M.mjs.map +1 -0
  30. package/fesm2022/tabs.mjs +225 -0
  31. package/fesm2022/tabs.mjs.map +1 -0
  32. package/fesm2022/ui-patterns.mjs +14 -1
  33. package/fesm2022/ui-patterns.mjs.map +1 -1
  34. package/list-navigation.d-DfOSxsSp.d.ts +247 -0
  35. package/listbox/index.d.ts +30 -17
  36. package/listbox.d-QWPLmxRe.d.ts +193 -0
  37. package/package.json +13 -2
  38. package/popover-edit/index.d.ts +6 -4
  39. package/selection/index.d.ts +2 -1
  40. package/tabs/index.d.ts +128 -0
  41. package/tabs.d-BAo141mw.d.ts +110 -0
  42. package/ui-patterns/index.d.ts +3 -1
  43. package/fesm2022/option-d2bb1041.mjs +0 -607
  44. package/fesm2022/option-d2bb1041.mjs.map +0 -1
  45. package/fesm2022/polyfill-ae40ec6f.mjs.map +0 -1
  46. package/listbox.d-8e28229b.d.ts +0 -376
@@ -11,4 +11,4 @@ function closest(element, selector) {
11
11
  }
12
12
 
13
13
  export { closest as c };
14
- //# sourceMappingURL=polyfill-ae40ec6f.mjs.map
14
+ //# sourceMappingURL=polyfill-CXksG4af.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfill-CXksG4af.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/popover-edit/polyfill.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** closest implementation that is able to start from non-Element Nodes. */\nexport function closest(\n element: EventTarget | Element | null | undefined,\n selector: string,\n): Element | null {\n if (!(element instanceof Node)) {\n return null;\n }\n\n let curr: Node | null = element;\n while (curr != null && !(curr instanceof Element)) {\n curr = curr.parentNode;\n }\n\n return curr?.closest(selector) ?? null;\n}\n"],"names":[],"mappings":"AAQA;AACgB,SAAA,OAAO,CACrB,OAAiD,EACjD,QAAgB,EAAA;AAEhB,IAAA,IAAI,EAAE,OAAO,YAAY,IAAI,CAAC,EAAE;AAC9B,QAAA,OAAO,IAAI;;IAGb,IAAI,IAAI,GAAgB,OAAO;IAC/B,OAAO,IAAI,IAAI,IAAI,IAAI,EAAE,IAAI,YAAY,OAAO,CAAC,EAAE;AACjD,QAAA,IAAI,GAAG,IAAI,CAAC,UAAU;;IAGxB,OAAO,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI;AACxC;;;;"}
@@ -1,18 +1,15 @@
1
- import { c as closest } from './polyfill-ae40ec6f.mjs';
2
- export { c as _closest } from './polyfill-ae40ec6f.mjs';
1
+ import { c as closest } from './polyfill-CXksG4af.mjs';
3
2
  import * as i0 from '@angular/core';
4
- import { inject, NgZone, Injectable, Injector, afterNextRender, ElementRef, EventEmitter, Directive, Input, Renderer2, afterRender, ViewContainerRef, TemplateRef, NgModule } from '@angular/core';
3
+ import { inject, NgZone, Injectable, Injector, afterNextRender, ElementRef, EventEmitter, Directive, Input, DOCUMENT, Renderer2, ViewContainerRef, TemplateRef, NgModule } from '@angular/core';
5
4
  import { Subject, pipe, combineLatest, Observable, merge } from 'rxjs';
6
5
  import { distinctUntilChanged, startWith, shareReplay, filter, map, auditTime, audit, debounceTime, skip, takeUntil, mapTo, throttleTime, share, withLatestFrom } from 'rxjs/operators';
7
6
  import { ControlContainer } from '@angular/forms';
8
7
  import { Directionality } from '@angular/cdk/bidi';
9
8
  import { RIGHT_ARROW, LEFT_ARROW, DOWN_ARROW, UP_ARROW, hasModifierKey } from '@angular/cdk/keycodes';
10
- import { Overlay, OverlayModule } from '@angular/cdk/overlay';
9
+ import { createOverlayRef, createRepositionScrollStrategy, createFlexibleConnectedPositionStrategy, OverlayModule } from '@angular/cdk/overlay';
11
10
  import { TemplatePortal } from '@angular/cdk/portal';
12
11
  import { FocusTrapFactory, InteractivityChecker, FocusTrap } from '@angular/cdk/a11y';
13
12
  import { ScrollDispatcher, ViewportRuler } from '@angular/cdk/scrolling';
14
- import { DOCUMENT } from '@angular/common';
15
- import { _bindEventWithOptions } from '@angular/cdk/platform';
16
13
 
17
14
  /** Selector for finding table cells. */
18
15
  const CELL_SELECTOR = '.cdk-cell, .mat-cell, td';
@@ -26,6 +23,8 @@ const TABLE_SELECTOR = 'table, cdk-table, mat-table';
26
23
  const EDIT_PANE_CLASS = 'cdk-edit-pane';
27
24
  /** Selector for finding the edit lens pane. */
28
25
  const EDIT_PANE_SELECTOR = `.${EDIT_PANE_CLASS}, .mat-edit-pane`;
26
+ /** Selector for table rows that should be skipped when moving focus. */
27
+ const SKIP_ROW_FOCUS_SELECTOR = '.cdk-popover-edit-skip-focus, .mat-popover-edit-skip-focus';
29
28
 
30
29
  /** The delay applied to mouse events before hiding or showing hover content. */
31
30
  const MOUSE_EVENT_DELAY_MS = 40;
@@ -201,10 +200,10 @@ class EditEventDispatcher {
201
200
  _mapAllRowsToSingleRow(mapper) {
202
201
  return this.allRows.pipe(map(mapper), this._startWithNullDistinct);
203
202
  }
204
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditEventDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
205
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditEventDispatcher });
203
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditEventDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
204
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditEventDispatcher });
206
205
  }
207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditEventDispatcher, decorators: [{
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditEventDispatcher, decorators: [{
208
207
  type: Injectable
209
208
  }], ctorParameters: () => [] });
210
209
  function computeHoverContentState([firstRow, lastRow, activeRow, hoverRow,]) {
@@ -303,10 +302,10 @@ class EditRef {
303
302
  reset(value) {
304
303
  this._form.reset(value || this._revertFormValue);
305
304
  }
306
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
307
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditRef });
305
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
306
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditRef });
308
307
  }
309
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditRef, decorators: [{
308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditRef, decorators: [{
310
309
  type: Injectable
311
310
  }], ctorParameters: () => [] });
312
311
 
@@ -339,7 +338,10 @@ class FocusDispatcher {
339
338
  const rows = Array.from(closest(currentRow, TABLE_SELECTOR).querySelectorAll(ROW_SELECTOR));
340
339
  const currentRowIndex = rows.indexOf(currentRow);
341
340
  const currentIndexWithinRow = Array.from(currentRow.querySelectorAll(EDITABLE_CELL_SELECTOR)).indexOf(currentCell);
342
- const newRowIndex = currentRowIndex + offset;
341
+ let newRowIndex = currentRowIndex + offset;
342
+ while (rows[newRowIndex]?.matches(SKIP_ROW_FOCUS_SELECTOR)) {
343
+ newRowIndex = newRowIndex + (offset > 0 ? 1 : -1);
344
+ }
343
345
  if (rows[newRowIndex]) {
344
346
  const rowToFocus = Array.from(rows[newRowIndex].querySelectorAll(EDITABLE_CELL_SELECTOR));
345
347
  if (rowToFocus[currentIndexWithinRow]) {
@@ -372,10 +374,10 @@ class FocusDispatcher {
372
374
  }
373
375
  event.preventDefault();
374
376
  }
375
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: FocusDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
376
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: FocusDispatcher, providedIn: 'root' });
377
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: FocusDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
378
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: FocusDispatcher, providedIn: 'root' });
377
379
  }
378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: FocusDispatcher, decorators: [{
380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: FocusDispatcher, decorators: [{
379
381
  type: Injectable,
380
382
  args: [{ providedIn: 'root' }]
381
383
  }], ctorParameters: () => [] });
@@ -493,10 +495,10 @@ class CdkEditControl {
493
495
  _triggerFormSubmit() {
494
496
  this.elementRef.nativeElement.dispatchEvent(new Event('submit'));
495
497
  }
496
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
497
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.1", 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 });
498
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
499
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.5", 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 });
498
500
  }
499
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditControl, decorators: [{
501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditControl, decorators: [{
500
502
  type: Directive,
501
503
  args: [{
502
504
  selector: 'form[cdkEditControl]',
@@ -522,10 +524,10 @@ class CdkEditRevert {
522
524
  revertEdit() {
523
525
  this.editRef.reset();
524
526
  }
525
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditRevert, deps: [], target: i0.ɵɵFactoryTarget.Directive });
526
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.1", type: CdkEditRevert, isStandalone: true, selector: "button[cdkEditRevert]", inputs: { type: "type" }, host: { attributes: { "type": "button" }, listeners: { "click": "revertEdit()" } }, ngImport: i0 });
527
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditRevert, deps: [], target: i0.ɵɵFactoryTarget.Directive });
528
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.5", type: CdkEditRevert, isStandalone: true, selector: "button[cdkEditRevert]", inputs: { type: "type" }, host: { attributes: { "type": "button" }, listeners: { "click": "revertEdit()" } }, ngImport: i0 });
527
529
  }
528
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditRevert, decorators: [{
530
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditRevert, decorators: [{
529
531
  type: Directive,
530
532
  args: [{
531
533
  selector: 'button[cdkEditRevert]',
@@ -556,10 +558,10 @@ class CdkEditClose {
556
558
  // the same event sequence if focus was moved quickly.
557
559
  this.editRef.close();
558
560
  }
559
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditClose, deps: [], target: i0.ɵɵFactoryTarget.Directive });
560
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.1", type: CdkEditClose, isStandalone: true, selector: "[cdkEditClose]", host: { listeners: { "click": "closeEdit()", "keydown.enter": "closeEdit()", "keydown.space": "closeEdit()" } }, ngImport: i0 });
561
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditClose, deps: [], target: i0.ɵɵFactoryTarget.Directive });
562
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.5", type: CdkEditClose, isStandalone: true, selector: "[cdkEditClose]", host: { listeners: { "click": "closeEdit()", "keydown.enter": "closeEdit()", "keydown.space": "closeEdit()" } }, ngImport: i0 });
561
563
  }
562
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditClose, decorators: [{
564
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditClose, decorators: [{
563
565
  type: Directive,
564
566
  args: [{
565
567
  selector: '[cdkEditClose]',
@@ -583,13 +585,12 @@ class EditServices {
583
585
  focusDispatcher = inject(FocusDispatcher);
584
586
  focusTrapFactory = inject(FocusTrapFactory);
585
587
  ngZone = inject(NgZone);
586
- overlay = inject(Overlay);
587
588
  scrollDispatcher = inject(ScrollDispatcher);
588
589
  viewportRuler = inject(ViewportRuler);
589
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditServices, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
590
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditServices });
590
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditServices, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
591
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditServices });
591
592
  }
592
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: EditServices, decorators: [{
593
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditServices, decorators: [{
593
594
  type: Injectable
594
595
  }] });
595
596
 
@@ -636,16 +637,31 @@ class FocusEscapeNotifierFactory {
636
637
  create(element) {
637
638
  return new FocusEscapeNotifier(element, this._checker, this._ngZone, this._document);
638
639
  }
639
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: FocusEscapeNotifierFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
640
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: FocusEscapeNotifierFactory, providedIn: 'root' });
640
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: FocusEscapeNotifierFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
641
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: FocusEscapeNotifierFactory, providedIn: 'root' });
641
642
  }
642
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: FocusEscapeNotifierFactory, decorators: [{
643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: FocusEscapeNotifierFactory, decorators: [{
643
644
  type: Injectable,
644
645
  args: [{ providedIn: 'root' }]
645
646
  }] });
646
647
 
647
648
  /** Used for rate-limiting mousemove events. */
648
649
  const MOUSE_MOVE_THROTTLE_TIME_MS = 10;
650
+ function hasRowElement(nl) {
651
+ for (let i = 0; i < nl.length; i++) {
652
+ const el = nl[i];
653
+ if (!(el instanceof HTMLElement)) {
654
+ continue;
655
+ }
656
+ if (el.matches(ROW_SELECTOR)) {
657
+ return true;
658
+ }
659
+ }
660
+ return false;
661
+ }
662
+ function isRowMutation(mutation) {
663
+ return hasRowElement(mutation.addedNodes) || hasRowElement(mutation.removedNodes);
664
+ }
649
665
  /**
650
666
  * A directive that must be attached to enable editability on a table.
651
667
  * It is responsible for setting up delegated event handlers and providing the
@@ -658,10 +674,23 @@ class CdkEditable {
658
674
  ngZone = inject(NgZone);
659
675
  _renderer = inject(Renderer2);
660
676
  destroyed = new Subject();
661
- _rendered = new Subject();
677
+ _rowsRendered = new Subject();
678
+ _rowMutationObserver = globalThis.MutationObserver
679
+ ? new globalThis.MutationObserver(mutations => {
680
+ if (mutations.some(isRowMutation)) {
681
+ this._rowsRendered.next();
682
+ }
683
+ })
684
+ : null;
662
685
  constructor() {
663
- afterRender(() => {
664
- this._rendered.next();
686
+ // TODO: consider a design where instead of polling for row changes we just use
687
+ // afterRenderEffect + a signal of the rows.
688
+ afterNextRender(() => {
689
+ this._rowsRendered.next();
690
+ this._rowMutationObserver?.observe(this.elementRef.nativeElement, {
691
+ childList: true,
692
+ subtree: true,
693
+ });
665
694
  });
666
695
  }
667
696
  ngAfterViewInit() {
@@ -670,14 +699,12 @@ class CdkEditable {
670
699
  ngOnDestroy() {
671
700
  this.destroyed.next();
672
701
  this.destroyed.complete();
673
- this._rendered.complete();
702
+ this._rowMutationObserver?.disconnect();
674
703
  }
675
704
  _observableFromEvent(element, name, options) {
676
705
  return new Observable(subscriber => {
677
706
  const handler = (event) => subscriber.next(event);
678
- const cleanup = options
679
- ? _bindEventWithOptions(this._renderer, element, name, handler, options)
680
- : this._renderer.listen(element, name, handler, options);
707
+ const cleanup = this._renderer.listen(element, name, handler, options);
681
708
  return () => {
682
709
  cleanup();
683
710
  subscriber.complete();
@@ -708,9 +735,10 @@ class CdkEditable {
708
735
  // Keep track of rows within the table. This is used to know which rows with hover content
709
736
  // are first or last in the table. They are kept focusable in case focus enters from above
710
737
  // or below the table.
711
- this._rendered
738
+ this._rowsRendered
712
739
  .pipe(
713
740
  // Avoid some timing inconsistencies since Angular v19.
741
+ // TODO: see if we can remove this now that we're using MutationObserver.
714
742
  debounceTime(0),
715
743
  // Optimization: ignore dom changes while focus is within the table as we already
716
744
  // ensure that rows above and below the focused/active row are tabbable.
@@ -725,10 +753,10 @@ class CdkEditable {
725
753
  .subscribe(this.focusDispatcher.keyObserver);
726
754
  });
727
755
  }
728
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditable, deps: [], target: i0.ɵɵFactoryTarget.Directive });
729
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.1", type: CdkEditable, isStandalone: true, selector: "table[editable], cdk-table[editable], mat-table[editable]", providers: [EditEventDispatcher, EditServices], ngImport: i0 });
756
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditable, deps: [], target: i0.ɵɵFactoryTarget.Directive });
757
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.5", type: CdkEditable, isStandalone: true, selector: "table[editable], cdk-table[editable], mat-table[editable]", providers: [EditEventDispatcher, EditServices], ngImport: i0 });
730
758
  }
731
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditable, decorators: [{
759
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditable, decorators: [{
732
760
  type: Directive,
733
761
  args: [{
734
762
  selector: 'table[editable], cdk-table[editable], mat-table[editable]',
@@ -756,6 +784,7 @@ class CdkPopoverEdit {
756
784
  services = inject(EditServices);
757
785
  elementRef = inject(ElementRef);
758
786
  viewContainerRef = inject(ViewContainerRef);
787
+ _injector = inject(Injector);
759
788
  /** The edit lens template shown over the cell on edit. */
760
789
  template = null;
761
790
  /**
@@ -842,11 +871,11 @@ class CdkPopoverEdit {
842
871
  });
843
872
  }
844
873
  _createEditOverlay() {
845
- this.overlayRef = this.services.overlay.create({
874
+ this.overlayRef = createOverlayRef(this._injector, {
846
875
  disposeOnNavigation: true,
847
876
  panelClass: this.panelClass(),
848
877
  positionStrategy: this._getPositionStrategy(),
849
- scrollStrategy: this.services.overlay.scrollStrategies.reposition(),
878
+ scrollStrategy: createRepositionScrollStrategy(this._injector),
850
879
  direction: this.services.directionality,
851
880
  });
852
881
  this.initFocusTrap();
@@ -885,9 +914,7 @@ class CdkPopoverEdit {
885
914
  }
886
915
  _getPositionStrategy() {
887
916
  const cells = this._getOverlayCells();
888
- return this.services.overlay
889
- .position()
890
- .flexibleConnectedTo(cells[0])
917
+ return createFlexibleConnectedPositionStrategy(this._injector, cells[0])
891
918
  .withGrowAfterOpen()
892
919
  .withPush()
893
920
  .withViewportMargin(16)
@@ -926,10 +953,10 @@ class CdkPopoverEdit {
926
953
  }
927
954
  return { width: lastCell.getBoundingClientRect().right - firstCell.getBoundingClientRect().left };
928
955
  }
929
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkPopoverEdit, deps: [], target: i0.ɵɵFactoryTarget.Directive });
930
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.1", 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 });
956
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkPopoverEdit, deps: [], target: i0.ɵɵFactoryTarget.Directive });
957
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.5", 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 });
931
958
  }
932
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkPopoverEdit, decorators: [{
959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkPopoverEdit, decorators: [{
933
960
  type: Directive,
934
961
  args: [{
935
962
  selector: '[cdkPopoverEdit]:not([cdkPopoverEditTabOut])',
@@ -956,10 +983,10 @@ class CdkPopoverEditTabOut extends CdkPopoverEdit {
956
983
  this.closeEditOverlay();
957
984
  });
958
985
  }
959
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkPopoverEditTabOut, deps: null, target: i0.ɵɵFactoryTarget.Directive });
960
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.1", 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 });
986
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkPopoverEditTabOut, deps: null, target: i0.ɵɵFactoryTarget.Directive });
987
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.5", 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 });
961
988
  }
962
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkPopoverEditTabOut, decorators: [{
989
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkPopoverEditTabOut, decorators: [{
963
990
  type: Directive,
964
991
  args: [{
965
992
  selector: '[cdkPopoverEdit][cdkPopoverEditTabOut]',
@@ -1043,10 +1070,10 @@ class CdkRowHoverContent {
1043
1070
  }
1044
1071
  });
1045
1072
  }
1046
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkRowHoverContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1047
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.1", type: CdkRowHoverContent, isStandalone: true, selector: "[cdkRowHoverContent]", ngImport: i0 });
1073
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkRowHoverContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1074
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.5", type: CdkRowHoverContent, isStandalone: true, selector: "[cdkRowHoverContent]", ngImport: i0 });
1048
1075
  }
1049
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkRowHoverContent, decorators: [{
1076
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkRowHoverContent, decorators: [{
1050
1077
  type: Directive,
1051
1078
  args: [{
1052
1079
  selector: '[cdkRowHoverContent]',
@@ -1071,10 +1098,10 @@ class CdkEditOpen {
1071
1098
  this.editEventDispatcher.editing.next(closest(this.elementRef.nativeElement, CELL_SELECTOR));
1072
1099
  evt.stopPropagation();
1073
1100
  }
1074
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1075
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.1", type: CdkEditOpen, isStandalone: true, selector: "[cdkEditOpen]", host: { listeners: { "click": "openEdit($event)" } }, ngImport: i0 });
1101
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1102
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0-next.5", type: CdkEditOpen, isStandalone: true, selector: "[cdkEditOpen]", host: { listeners: { "click": "openEdit($event)" } }, ngImport: i0 });
1076
1103
  }
1077
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkEditOpen, decorators: [{
1104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkEditOpen, decorators: [{
1078
1105
  type: Directive,
1079
1106
  args: [{
1080
1107
  selector: '[cdkEditOpen]',
@@ -1095,8 +1122,8 @@ const EXPORTED_DECLARATIONS = [
1095
1122
  CdkEditOpen,
1096
1123
  ];
1097
1124
  class CdkPopoverEditModule {
1098
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkPopoverEditModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1099
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkPopoverEditModule, imports: [OverlayModule, CdkPopoverEdit,
1125
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkPopoverEditModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1126
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkPopoverEditModule, imports: [OverlayModule, CdkPopoverEdit,
1100
1127
  CdkPopoverEditTabOut,
1101
1128
  CdkRowHoverContent,
1102
1129
  CdkEditControl,
@@ -1111,9 +1138,9 @@ class CdkPopoverEditModule {
1111
1138
  CdkEditClose,
1112
1139
  CdkEditable,
1113
1140
  CdkEditOpen] });
1114
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkPopoverEditModule, imports: [OverlayModule] });
1141
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkPopoverEditModule, imports: [OverlayModule] });
1115
1142
  }
1116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkPopoverEditModule, decorators: [{
1143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkPopoverEditModule, decorators: [{
1117
1144
  type: NgModule,
1118
1145
  args: [{
1119
1146
  imports: [OverlayModule, ...EXPORTED_DECLARATIONS],
@@ -1121,5 +1148,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1",
1121
1148
  }]
1122
1149
  }] });
1123
1150
 
1124
- export { CdkEditClose, CdkEditControl, CdkEditOpen, CdkEditRevert, CdkEditable, CdkPopoverEdit, CdkPopoverEditModule, CdkPopoverEditTabOut, CdkRowHoverContent, EditEventDispatcher, EditRef, FocusDispatcher, FormValueContainer, HoverContentState, CELL_SELECTOR as _CELL_SELECTOR };
1151
+ export { CdkEditClose, CdkEditControl, CdkEditOpen, CdkEditRevert, CdkEditable, CdkPopoverEdit, CdkPopoverEditModule, CdkPopoverEditTabOut, CdkRowHoverContent, EditEventDispatcher, EditRef, FocusDispatcher, FormValueContainer, HoverContentState, CELL_SELECTOR as _CELL_SELECTOR, closest as _closest };
1125
1152
  //# sourceMappingURL=popover-edit.mjs.map