@angular/cdk-experimental 20.0.0-next.8 → 20.0.0-next.9

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 (43) hide show
  1. package/column-resize/index.d.ts +39 -5
  2. package/combobox/index.d.ts +1 -2
  3. package/fesm2022/cdk-experimental.mjs +1 -1
  4. package/fesm2022/cdk-experimental.mjs.map +1 -1
  5. package/fesm2022/column-resize.mjs +77 -9
  6. package/fesm2022/column-resize.mjs.map +1 -1
  7. package/fesm2022/combobox.mjs +6 -9
  8. package/fesm2022/combobox.mjs.map +1 -1
  9. package/fesm2022/deferred-content.mjs +1 -1
  10. package/fesm2022/deferred-content.mjs.map +1 -1
  11. package/fesm2022/{list-focus-CSTLIgwc.mjs → list-focus-Di7m_z_6.mjs} +3 -3
  12. package/fesm2022/list-focus-Di7m_z_6.mjs.map +1 -0
  13. package/fesm2022/listbox.mjs +29 -9
  14. package/fesm2022/listbox.mjs.map +1 -1
  15. package/fesm2022/{option-D1-Zcobx.mjs → option-f_gNslw8.mjs} +32 -3
  16. package/fesm2022/option-f_gNslw8.mjs.map +1 -0
  17. package/fesm2022/{polyfill-DRXnWbMt.mjs → polyfill-CXksG4af.mjs} +2 -2
  18. package/fesm2022/polyfill-CXksG4af.mjs.map +1 -0
  19. package/fesm2022/popover-edit.mjs +12 -9
  20. package/fesm2022/popover-edit.mjs.map +1 -1
  21. package/fesm2022/scrolling.mjs +1 -1
  22. package/fesm2022/scrolling.mjs.map +1 -1
  23. package/fesm2022/selection.mjs +2 -2
  24. package/fesm2022/selection.mjs.map +1 -1
  25. package/fesm2022/table-scroll-container.mjs.map +1 -1
  26. package/fesm2022/{tabs-C0pLghH2.mjs → tabs-BunANY1M.mjs} +14 -23
  27. package/fesm2022/tabs-BunANY1M.mjs.map +1 -0
  28. package/fesm2022/tabs.mjs +5 -4
  29. package/fesm2022/tabs.mjs.map +1 -1
  30. package/fesm2022/ui-patterns.mjs +3 -3
  31. package/fesm2022/ui-patterns.mjs.map +1 -1
  32. package/{list-navigation.d-cy63EByU.d.ts → list-navigation.d-DfOSxsSp.d.ts} +2 -2
  33. package/listbox/index.d.ts +15 -6
  34. package/{listbox.d-DJqDR_H3.d.ts → listbox.d-QWPLmxRe.d.ts} +16 -3
  35. package/package.json +2 -2
  36. package/popover-edit/index.d.ts +2 -2
  37. package/tabs/index.d.ts +2 -2
  38. package/{tabs.d-CWu2orP4.d.ts → tabs.d-BAo141mw.d.ts} +6 -3
  39. package/ui-patterns/index.d.ts +3 -3
  40. package/fesm2022/list-focus-CSTLIgwc.mjs.map +0 -1
  41. package/fesm2022/option-D1-Zcobx.mjs.map +0 -1
  42. package/fesm2022/polyfill-DRXnWbMt.mjs.map +0 -1
  43. package/fesm2022/tabs-C0pLghH2.mjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, AfterViewInit, OnDestroy, ElementRef, NgZone, Provider, OnInit, Injector, ViewContainerRef, ChangeDetectorRef, Type } from '@angular/core';
3
- import { Observable, Subject } from 'rxjs';
4
- import { CdkTable, CdkColumnDef, _CoalescedStyleScheduler } from '@angular/cdk/table';
3
+ import { Subject, Observable } from 'rxjs';
4
+ import { CdkTable, CdkColumnDef } from '@angular/cdk/table';
5
5
  import { Directionality } from '@angular/cdk/bidi';
6
- import { OverlayRef, Overlay } from '@angular/cdk/overlay';
6
+ import { OverlayRef } from '@angular/cdk/overlay';
7
7
 
8
8
  /** Indicates the width of a column. */
9
9
  interface ColumnSize {
@@ -231,6 +231,40 @@ declare class ResizeRef {
231
231
  constructor(origin: ElementRef, overlayRef: OverlayRef, minWidthPx: number, maxWidthPx: number, liveUpdates?: boolean);
232
232
  }
233
233
 
234
+ /**
235
+ * @docs-private
236
+ */
237
+ declare class _Schedule {
238
+ tasks: (() => unknown)[];
239
+ endTasks: (() => unknown)[];
240
+ }
241
+ /** Injection token used to provide a coalesced style scheduler. */
242
+ declare const _COALESCED_STYLE_SCHEDULER: InjectionToken<_CoalescedStyleScheduler>;
243
+ /**
244
+ * Allows grouping up CSSDom mutations after the current execution context.
245
+ * This can significantly improve performance when separate consecutive functions are
246
+ * reading from the CSSDom and then mutating it.
247
+ *
248
+ * @docs-private
249
+ */
250
+ declare class _CoalescedStyleScheduler {
251
+ private _currentSchedule;
252
+ private _ngZone;
253
+ constructor(...args: unknown[]);
254
+ /**
255
+ * Schedules the specified task to run at the end of the current VM turn.
256
+ */
257
+ schedule(task: () => unknown): void;
258
+ /**
259
+ * Schedules the specified task to run after other scheduled tasks at the end of the current
260
+ * VM turn.
261
+ */
262
+ scheduleEnd(task: () => unknown): void;
263
+ private _createScheduleIfNeeded;
264
+ static ɵfac: i0.ɵɵFactoryDeclaration<_CoalescedStyleScheduler, never>;
265
+ static ɵprov: i0.ɵɵInjectableDeclaration<_CoalescedStyleScheduler>;
266
+ }
267
+
234
268
  /**
235
269
  * Base class for a component shown over the edge of a resizable column that is responsible
236
270
  * for handling column resize mouse events and displaying any visible UI on the column edge.
@@ -363,13 +397,13 @@ declare abstract class Resizable<HandleComponent extends ResizeOverlayHandle> im
363
397
  protected abstract readonly eventDispatcher: HeaderRowEventDispatcher;
364
398
  protected abstract readonly injector: Injector;
365
399
  protected abstract readonly ngZone: NgZone;
366
- protected abstract readonly overlay: Overlay;
367
400
  protected abstract readonly resizeNotifier: ColumnResizeNotifierSource;
368
401
  protected abstract readonly resizeStrategy: ResizeStrategy;
369
402
  protected abstract readonly styleScheduler: _CoalescedStyleScheduler;
370
403
  protected abstract readonly viewContainerRef: ViewContainerRef;
371
404
  protected abstract readonly changeDetectorRef: ChangeDetectorRef;
372
405
  protected readonly columnSizeStore: ColumnSizeStore | null;
406
+ private _injector;
373
407
  private _viewInitialized;
374
408
  private _isDestroyed;
375
409
  /** The minimum width to allow the column to be sized to. */
@@ -399,5 +433,5 @@ declare abstract class Resizable<HandleComponent extends ResizeOverlayHandle> im
399
433
  static ɵdir: i0.ɵɵDirectiveDeclaration<Resizable<any>, never, never, {}, {}, never, never, true, never>;
400
434
  }
401
435
 
402
- export { COLUMN_RESIZE_OPTIONS, CdkColumnResize, CdkColumnResizeDefaultEnabledModule, CdkColumnResizeFlex, CdkColumnResizeModule, CdkDefaultEnabledColumnResize, CdkDefaultEnabledColumnResizeFlex, CdkFlexTableResizeStrategy, ColumnResize, ColumnResizeNotifier, ColumnResizeNotifierSource, ColumnSizeStore, FLEX_RESIZE_STRATEGY_PROVIDER, HeaderRowEventDispatcher, Resizable, ResizeOverlayHandle, ResizeRef, ResizeStrategy, TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER, TableLayoutFixedResizeStrategy };
436
+ export { COLUMN_RESIZE_OPTIONS, CdkColumnResize, CdkColumnResizeDefaultEnabledModule, CdkColumnResizeFlex, CdkColumnResizeModule, CdkDefaultEnabledColumnResize, CdkDefaultEnabledColumnResizeFlex, CdkFlexTableResizeStrategy, ColumnResize, ColumnResizeNotifier, ColumnResizeNotifierSource, ColumnSizeStore, FLEX_RESIZE_STRATEGY_PROVIDER, HeaderRowEventDispatcher, Resizable, ResizeOverlayHandle, ResizeRef, ResizeStrategy, TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER, TableLayoutFixedResizeStrategy, _COALESCED_STYLE_SCHEDULER, _CoalescedStyleScheduler, _Schedule };
403
437
  export type { ColumnResizeOptions, ColumnSize, ColumnSizeAction };
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnDestroy, ViewContainerRef, TemplateRef, EventEmitter, InjectionToken, OnInit } from '@angular/core';
2
+ import { InjectionToken, OnDestroy, ViewContainerRef, TemplateRef, EventEmitter, OnInit } from '@angular/core';
3
3
  import * as i1 from '@angular/cdk/overlay';
4
4
  import { BooleanInput } from '@angular/cdk/coercion';
5
5
 
@@ -10,7 +10,6 @@ declare const CDK_COMBOBOX: InjectionToken<CdkCombobox<unknown>>;
10
10
  declare class CdkCombobox<T = unknown> implements OnDestroy {
11
11
  private readonly _tagName;
12
12
  private readonly _elementRef;
13
- private readonly _overlay;
14
13
  protected readonly _viewContainerRef: ViewContainerRef;
15
14
  private readonly _injector;
16
15
  private readonly _doc;
@@ -1,7 +1,7 @@
1
1
  import { Version } from '@angular/core';
2
2
 
3
3
  /** Current version of the CDK Experimental package. */
4
- const VERSION = new Version('20.0.0-next.8');
4
+ const VERSION = new Version('20.0.0-next.9');
5
5
 
6
6
  export { VERSION };
7
7
  //# sourceMappingURL=cdk-experimental.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cdk-experimental.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/version.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\nimport {Version} from '@angular/core';\n\n/** Current version of the CDK Experimental package. */\nexport const VERSION = new Version('20.0.0-next.8');\n"],"names":[],"mappings":";;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
1
+ {"version":3,"file":"cdk-experimental.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/version.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\nimport {Version} from '@angular/core';\n\n/** Current version of the CDK Experimental package. */\nexport const VERSION = new Version('20.0.0-next.9');\n"],"names":[],"mappings":";;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
@@ -1,12 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Renderer2, Input, Directive, Injectable, NgZone, CSP_NONCE, DOCUMENT, ElementRef, NgModule, Injector, runInInjectionContext, afterNextRender } from '@angular/core';
2
+ import { InjectionToken, inject, Renderer2, Directive, Input, Injectable, NgZone, CSP_NONCE, DOCUMENT, ElementRef, NgModule, Injector, runInInjectionContext, afterNextRender } from '@angular/core';
3
3
  import { _IdGenerator } from '@angular/cdk/a11y';
4
4
  import { Subject, merge, combineLatest, Observable } from 'rxjs';
5
5
  import { mapTo, take, takeUntil, startWith, pairwise, distinctUntilChanged, share, map, skip, filter } from 'rxjs/operators';
6
- import { closest } from './polyfill-DRXnWbMt.mjs';
7
- import { _COALESCED_STYLE_SCHEDULER, CdkTable } from '@angular/cdk/table';
6
+ import { c as closest } from './polyfill-CXksG4af.mjs';
7
+ import { CdkTable } from '@angular/cdk/table';
8
8
  import { coerceCssPixelValue } from '@angular/cdk/coercion';
9
9
  import { ComponentPortal } from '@angular/cdk/portal';
10
+ import { createFlexibleConnectedPositionStrategy, createOverlayRef, createRepositionScrollStrategy } from '@angular/cdk/overlay';
10
11
  import { ESCAPE } from '@angular/cdk/keycodes';
11
12
 
12
13
  // TODO: Figure out how to remove `mat-` classes from the CDK part of the
@@ -197,6 +198,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5",
197
198
  type: Injectable
198
199
  }] });
199
200
 
201
+ /**
202
+ * @docs-private
203
+ */
204
+ class _Schedule {
205
+ tasks = [];
206
+ endTasks = [];
207
+ }
208
+ /** Injection token used to provide a coalesced style scheduler. */
209
+ const _COALESCED_STYLE_SCHEDULER = new InjectionToken('_COALESCED_STYLE_SCHEDULER');
210
+ /**
211
+ * Allows grouping up CSSDom mutations after the current execution context.
212
+ * This can significantly improve performance when separate consecutive functions are
213
+ * reading from the CSSDom and then mutating it.
214
+ *
215
+ * @docs-private
216
+ */
217
+ class _CoalescedStyleScheduler {
218
+ _currentSchedule = null;
219
+ _ngZone = inject(NgZone);
220
+ constructor() { }
221
+ /**
222
+ * Schedules the specified task to run at the end of the current VM turn.
223
+ */
224
+ schedule(task) {
225
+ this._createScheduleIfNeeded();
226
+ this._currentSchedule.tasks.push(task);
227
+ }
228
+ /**
229
+ * Schedules the specified task to run after other scheduled tasks at the end of the current
230
+ * VM turn.
231
+ */
232
+ scheduleEnd(task) {
233
+ this._createScheduleIfNeeded();
234
+ this._currentSchedule.endTasks.push(task);
235
+ }
236
+ _createScheduleIfNeeded() {
237
+ if (this._currentSchedule) {
238
+ return;
239
+ }
240
+ this._currentSchedule = new _Schedule();
241
+ this._ngZone.runOutsideAngular(() =>
242
+ // TODO(mmalerba): Scheduling this using something that runs less frequently
243
+ // (e.g. requestAnimationFrame, setTimeout, etc.) causes noticeable jank with the column
244
+ // resizer. We should audit the usages of schedule / scheduleEnd in that component and see
245
+ // if we can refactor it so that we don't need to flush the tasks quite so frequently.
246
+ queueMicrotask(() => {
247
+ while (this._currentSchedule.tasks.length || this._currentSchedule.endTasks.length) {
248
+ const schedule = this._currentSchedule;
249
+ // Capture new tasks scheduled by the current set of tasks.
250
+ this._currentSchedule = new _Schedule();
251
+ for (const task of schedule.tasks) {
252
+ task();
253
+ }
254
+ for (const task of schedule.endTasks) {
255
+ task();
256
+ }
257
+ }
258
+ this._currentSchedule = null;
259
+ }));
260
+ }
261
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: _CoalescedStyleScheduler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
262
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: _CoalescedStyleScheduler });
263
+ }
264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: _CoalescedStyleScheduler, decorators: [{
265
+ type: Injectable
266
+ }], ctorParameters: () => [] });
267
+
200
268
  /**
201
269
  * Provides an implementation for resizing a column.
202
270
  * The details of how resizing works for tables for flex mat-tables are quite different.
@@ -434,6 +502,7 @@ const PROVIDERS = [
434
502
  ColumnResizeNotifier,
435
503
  HeaderRowEventDispatcher,
436
504
  ColumnResizeNotifierSource,
505
+ { provide: _COALESCED_STYLE_SCHEDULER, useClass: _CoalescedStyleScheduler },
437
506
  ];
438
507
  const TABLE_PROVIDERS = [
439
508
  ...PROVIDERS,
@@ -613,6 +682,7 @@ class Resizable {
613
682
  overlayRef;
614
683
  destroyed = new Subject();
615
684
  columnSizeStore = inject(ColumnSizeStore, { optional: true });
685
+ _injector = inject(Injector);
616
686
  _viewInitialized = false;
617
687
  _isDestroyed = false;
618
688
  /** The minimum width to allow the column to be sized to. */
@@ -673,9 +743,7 @@ class Resizable {
673
743
  // of two table cells and is also useful for displaying a resize thumb
674
744
  // over both cells and extending it down the table as needed.
675
745
  const isRtl = this.directionality.value === 'rtl';
676
- const positionStrategy = this.overlay
677
- .position()
678
- .flexibleConnectedTo(this.elementRef.nativeElement)
746
+ const positionStrategy = createFlexibleConnectedPositionStrategy(this._injector, this.elementRef.nativeElement)
679
747
  .withFlexibleDimensions(false)
680
748
  .withGrowAfterOpen(false)
681
749
  .withPush(false)
@@ -688,12 +756,12 @@ class Resizable {
688
756
  overlayY: 'top',
689
757
  },
690
758
  ]);
691
- return this.overlay.create({
759
+ return createOverlayRef(this._injector, {
692
760
  // Always position the overlay based on left-indexed coordinates.
693
761
  direction: 'ltr',
694
762
  disposeOnNavigation: true,
695
763
  positionStrategy,
696
- scrollStrategy: this.overlay.scrollStrategies.reposition(),
764
+ scrollStrategy: createRepositionScrollStrategy(this._injector),
697
765
  width: '16px',
698
766
  });
699
767
  }
@@ -968,5 +1036,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5",
968
1036
  type: Directive
969
1037
  }] });
970
1038
 
971
- export { COLUMN_RESIZE_OPTIONS, CdkColumnResize, CdkColumnResizeDefaultEnabledModule, CdkColumnResizeFlex, CdkColumnResizeModule, CdkDefaultEnabledColumnResize, CdkDefaultEnabledColumnResizeFlex, CdkFlexTableResizeStrategy, ColumnResize, ColumnResizeNotifier, ColumnResizeNotifierSource, ColumnSizeStore, FLEX_RESIZE_STRATEGY_PROVIDER, HeaderRowEventDispatcher, Resizable, ResizeOverlayHandle, ResizeRef, ResizeStrategy, TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER, TableLayoutFixedResizeStrategy };
1039
+ export { COLUMN_RESIZE_OPTIONS, CdkColumnResize, CdkColumnResizeDefaultEnabledModule, CdkColumnResizeFlex, CdkColumnResizeModule, CdkDefaultEnabledColumnResize, CdkDefaultEnabledColumnResizeFlex, CdkFlexTableResizeStrategy, ColumnResize, ColumnResizeNotifier, ColumnResizeNotifierSource, ColumnSizeStore, FLEX_RESIZE_STRATEGY_PROVIDER, HeaderRowEventDispatcher, Resizable, ResizeOverlayHandle, ResizeRef, ResizeStrategy, TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER, TableLayoutFixedResizeStrategy, _COALESCED_STYLE_SCHEDULER, _CoalescedStyleScheduler, _Schedule };
972
1040
  //# sourceMappingURL=column-resize.mjs.map