@angular/cdk 21.1.0-next.2 → 21.1.0-next.4

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 (48) hide show
  1. package/LICENSE +1 -1
  2. package/fesm2022/_a11y-module-chunk.mjs +7 -9
  3. package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
  4. package/fesm2022/_focus-monitor-chunk.mjs +2 -4
  5. package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
  6. package/fesm2022/_list-key-manager-chunk.mjs +1 -1
  7. package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
  8. package/fesm2022/_overlay-module-chunk.mjs +28 -17
  9. package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
  10. package/fesm2022/_selection-model-chunk.mjs +1 -1
  11. package/fesm2022/_selection-model-chunk.mjs.map +1 -1
  12. package/fesm2022/bidi.mjs +1 -1
  13. package/fesm2022/bidi.mjs.map +1 -1
  14. package/fesm2022/cdk.mjs +1 -1
  15. package/fesm2022/cdk.mjs.map +1 -1
  16. package/fesm2022/clipboard.mjs +1 -1
  17. package/fesm2022/clipboard.mjs.map +1 -1
  18. package/fesm2022/dialog.mjs +2 -2
  19. package/fesm2022/dialog.mjs.map +1 -1
  20. package/fesm2022/drag-drop.mjs +261 -258
  21. package/fesm2022/drag-drop.mjs.map +1 -1
  22. package/fesm2022/listbox.mjs +1 -1
  23. package/fesm2022/listbox.mjs.map +1 -1
  24. package/fesm2022/menu.mjs +6 -9
  25. package/fesm2022/menu.mjs.map +1 -1
  26. package/fesm2022/observers.mjs.map +1 -1
  27. package/fesm2022/portal.mjs +4 -4
  28. package/fesm2022/portal.mjs.map +1 -1
  29. package/fesm2022/scrolling.mjs +8 -5
  30. package/fesm2022/scrolling.mjs.map +1 -1
  31. package/fesm2022/stepper.mjs.map +1 -1
  32. package/fesm2022/table.mjs +3 -3
  33. package/fesm2022/table.mjs.map +1 -1
  34. package/fesm2022/testing-testbed.mjs +7 -1
  35. package/fesm2022/testing-testbed.mjs.map +1 -1
  36. package/fesm2022/testing.mjs +10 -13
  37. package/fesm2022/testing.mjs.map +1 -1
  38. package/fesm2022/text-field.mjs +1 -1
  39. package/fesm2022/text-field.mjs.map +1 -1
  40. package/fesm2022/tree.mjs +8 -12
  41. package/fesm2022/tree.mjs.map +1 -1
  42. package/package.json +1 -1
  43. package/schematics/ng-add/index.js +1 -1
  44. package/types/_harness-environment-chunk.d.ts +0 -2
  45. package/types/_overlay-module-chunk.d.ts +3 -1
  46. package/types/drag-drop.d.ts +23 -7
  47. package/types/menu.d.ts +1 -3
  48. package/types/testing-testbed.d.ts +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cdk",
3
- "version": "21.1.0-next.2",
3
+ "version": "21.1.0-next.4",
4
4
  "description": "Angular Material Component Development Kit",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,6 +26,6 @@ function default_1() {
26
26
  // In order to align the CDK version with other Angular dependencies that are setup by
27
27
  // `@schematics/angular`, we use tilde instead of caret. This is default for Angular
28
28
  // dependencies in new CLI projects.
29
- return (0, utility_1.addDependency)('@angular/cdk', `~21.1.0-next.2`, { existing: utility_1.ExistingBehavior.Skip });
29
+ return (0, utility_1.addDependency)('@angular/cdk', `~21.1.0-next.4`, { existing: utility_1.ExistingBehavior.Skip });
30
30
  }
31
31
  //# sourceMappingURL=index.js.map
@@ -687,8 +687,6 @@ declare class HarnessPredicate<T extends ComponentHarness> {
687
687
  getDescription(): string;
688
688
  /** Gets the selector used to find candidate elements. */
689
689
  getSelector(): string;
690
- /** Adds base options common to all harness types. */
691
- private _addBaseOptions;
692
690
  }
693
691
 
694
692
  /**
@@ -393,7 +393,7 @@ declare function validateHorizontalPosition(property: string, value: HorizontalC
393
393
  /** Container inside which all overlays will render. */
394
394
  declare class OverlayContainer implements OnDestroy {
395
395
  protected _platform: Platform;
396
- protected _containerElement: HTMLElement;
396
+ protected _containerElement: HTMLElement | undefined;
397
397
  protected _document: Document;
398
398
  protected _styleLoader: _CdkPrivateStyleLoader;
399
399
  constructor(...args: unknown[]);
@@ -713,6 +713,8 @@ declare class FlexibleConnectedPositionStrategy implements PositionStrategy {
713
713
  private _getViewportMarginBottom;
714
714
  /** Returns the DOMRect of the current origin. */
715
715
  private _getOriginRect;
716
+ /** Gets the dimensions of the overlay container. */
717
+ private _getContainerRect;
716
718
  }
717
719
  /** A simple (x, y) coordinate. */
718
720
  interface Point {
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, ElementRef, NgZone, OnDestroy, EventEmitter, AfterViewInit, TemplateRef, OnChanges, SimpleChanges, ViewContainerRef, Renderer2 } from '@angular/core';
2
+ import { InjectionToken, Injector, ElementRef, NgZone, OnDestroy, EventEmitter, AfterViewInit, TemplateRef, OnChanges, SimpleChanges, ViewContainerRef, Renderer2 } from '@angular/core';
3
3
  import { Direction } from './_bidi-module-chunk.js';
4
4
  import { Subject, Observable } from 'rxjs';
5
5
  import { ViewportRuler } from './scrolling.js';
@@ -41,6 +41,12 @@ interface DragDropConfig extends Partial<DragRefConfig> {
41
41
  previewContainer?: 'global' | 'parent';
42
42
  }
43
43
 
44
+ /**
45
+ * Creates a `DropListRef` for an element, turning it into a drop list.
46
+ * @param injector Injector used to resolve dependencies.
47
+ * @param element Element to which to attach the drop list functionality.
48
+ */
49
+ declare function createDropListRef<T = unknown>(injector: Injector, element: ElementRef<HTMLElement> | HTMLElement): DropListRef<T>;
44
50
  /**
45
51
  * Reference to a drop list. Used to manipulate or dispose of the container.
46
52
  */
@@ -924,6 +930,13 @@ interface Point {
924
930
  * Same advantages and disadvantages as `parent`.
925
931
  */
926
932
  type PreviewContainer = 'global' | 'parent' | ElementRef<HTMLElement> | HTMLElement;
933
+ /**
934
+ * Creates a `DragRef` for an element, turning it into a draggable item.
935
+ * @param injector Injector used to resolve dependencies.
936
+ * @param element Element to which to attach the dragging functionality.
937
+ * @param config Object used to configure the dragging behavior.
938
+ */
939
+ declare function createDragRef<T = unknown>(injector: Injector, element: ElementRef<HTMLElement> | HTMLElement, config?: DragRefConfig): DragRef<T>;
927
940
  /**
928
941
  * Reference to a draggable item. Used to manipulate or dispose of the item.
929
942
  */
@@ -1320,23 +1333,26 @@ declare class DragRef<T = any> {
1320
1333
 
1321
1334
  /**
1322
1335
  * Service that allows for drag-and-drop functionality to be attached to DOM elements.
1336
+ * @deprecated Use the `createDragRef` or `createDropListRef` function for better tree shaking.
1337
+ * Will be removed in v23.
1338
+ * @breaking-change 23.0.0
1323
1339
  */
1324
1340
  declare class DragDrop {
1325
- private _document;
1326
- private _ngZone;
1327
- private _viewportRuler;
1328
- private _dragDropRegistry;
1329
- private _renderer;
1341
+ private _injector;
1330
1342
  constructor(...args: unknown[]);
1331
1343
  /**
1332
1344
  * Turns an element into a draggable item.
1333
1345
  * @param element Element to which to attach the dragging functionality.
1334
1346
  * @param config Object used to configure the dragging behavior.
1347
+ * @deprecated Use the `createDragRef` function that provides better tree shaking.
1348
+ * @breaking-change 23.0.0
1335
1349
  */
1336
1350
  createDrag<T = any>(element: ElementRef<HTMLElement> | HTMLElement, config?: DragRefConfig): DragRef<T>;
1337
1351
  /**
1338
1352
  * Turns an element into a drop list.
1339
1353
  * @param element Element to which to attach the drop list functionality.
1354
+ * @deprecated Use the `createDropListRef` function that provides better tree shaking.
1355
+ * @breaking-change 23.0.0
1340
1356
  */
1341
1357
  createDropList<T = any>(element: ElementRef<HTMLElement> | HTMLElement): DropListRef<T>;
1342
1358
  static ɵfac: i0.ɵɵFactoryDeclaration<DragDrop, never>;
@@ -1406,5 +1422,5 @@ declare class DragDropModule {
1406
1422
  static ɵinj: i0.ɵɵInjectorDeclaration<DragDropModule>;
1407
1423
  }
1408
1424
 
1409
- export { CDK_DRAG_CONFIG, CDK_DRAG_HANDLE, CDK_DRAG_PARENT, CDK_DRAG_PLACEHOLDER, CDK_DRAG_PREVIEW, CDK_DROP_LIST, CDK_DROP_LIST_GROUP, CdkDrag, CdkDragHandle, CdkDragPlaceholder, CdkDragPreview, CdkDropList, CdkDropListGroup, DragDrop, DragDropModule, DragDropRegistry, DragRef, DropListRef, copyArrayItem, moveItemInArray, transferArrayItem };
1425
+ export { CDK_DRAG_CONFIG, CDK_DRAG_HANDLE, CDK_DRAG_PARENT, CDK_DRAG_PLACEHOLDER, CDK_DRAG_PREVIEW, CDK_DROP_LIST, CDK_DROP_LIST_GROUP, CdkDrag, CdkDragHandle, CdkDragPlaceholder, CdkDragPreview, CdkDropList, CdkDropListGroup, DragDrop, DragDropModule, DragDropRegistry, DragRef, DropListRef, copyArrayItem, createDragRef, createDropListRef, moveItemInArray, transferArrayItem };
1410
1426
  export type { CdkDragDrop, CdkDragEnd, CdkDragEnter, CdkDragExit, CdkDragMove, CdkDragRelease, CdkDragSortEvent, CdkDragStart, DragAxis, DragConstrainPosition, DragDropConfig, DragRefConfig, DragStartDelay, DropListOrientation, Point, PreviewContainer };
package/types/menu.d.ts CHANGED
@@ -347,7 +347,7 @@ declare abstract class CdkMenuTriggerBase implements OnDestroy {
347
347
  * Get the portal to be attached to the overlay which contains the menu. Allows for the menu
348
348
  * content to change dynamically and be reflected in the application.
349
349
  */
350
- protected getMenuContentPortal(): TemplatePortal<any>;
350
+ protected getMenuContentPortal(): TemplatePortal<any> | undefined;
351
351
  /**
352
352
  * Whether the given element is inside the scope of this trigger's menu stack.
353
353
  * @param element The element to check.
@@ -744,8 +744,6 @@ declare class CdkMenuItemRadio extends CdkMenuItemSelectable implements OnDestro
744
744
  trigger(options?: {
745
745
  keepOpen: boolean;
746
746
  }): void;
747
- /** Configure the unique selection dispatcher listener in order to toggle the checked state */
748
- private _registerDispatcherListener;
749
747
  static ɵfac: i0.ɵɵFactoryDeclaration<CdkMenuItemRadio, never>;
750
748
  static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuItemRadio, "[cdkMenuItemRadio]", ["cdkMenuItemRadio"], {}, {}, never, never, true, never>;
751
749
  }
@@ -43,6 +43,9 @@ declare class TestbedHarnessEnvironment extends HarnessEnvironment<Element> {
43
43
  /**
44
44
  * Waits for all scheduled or running async tasks to complete. This allows harness
45
45
  * authors to wait for async tasks outside of the Angular zone.
46
+ *
47
+ * This only works when Zone.js is present _and_ patches are applied to the test framework
48
+ * by `zone.js/testing` (Jasmine and Jest only) or another script.
46
49
  */
47
50
  waitForTasksOutsideAngular(): Promise<void>;
48
51
  /** Gets the root element for the document. */