@angular/material 16.0.2 → 16.1.0-next.1

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 (63) hide show
  1. package/autocomplete/index.d.ts +28 -0
  2. package/autocomplete/testing/index.d.ts +3 -1
  3. package/chips/_chips-theme.scss +44 -60
  4. package/core/mdc-helpers/_mdc-helpers.scss +6 -6
  5. package/core/tokens/m2/mdc/_chip.scss +313 -0
  6. package/core/tokens/m2/mdc/_plain-tooltip.scss +80 -0
  7. package/esm2022/autocomplete/autocomplete-trigger.mjs +58 -3
  8. package/esm2022/autocomplete/testing/autocomplete-harness.mjs +5 -1
  9. package/esm2022/chips/chip-option.mjs +2 -2
  10. package/esm2022/chips/chip-row.mjs +2 -2
  11. package/esm2022/chips/chip.mjs +2 -2
  12. package/esm2022/core/option/option.mjs +3 -3
  13. package/esm2022/core/version.mjs +1 -1
  14. package/esm2022/form-field/directives/floating-label.mjs +66 -5
  15. package/esm2022/form-field/directives/notched-outline.mjs +14 -16
  16. package/esm2022/form-field/form-field.mjs +30 -36
  17. package/esm2022/legacy-tooltip/testing/tooltip-harness.mjs +2 -1
  18. package/esm2022/legacy-tooltip/tooltip.mjs +3 -2
  19. package/esm2022/select/select.mjs +60 -4
  20. package/esm2022/snack-bar/snack-bar-container.mjs +4 -2
  21. package/esm2022/tabs/tab-group.mjs +3 -2
  22. package/esm2022/tabs/tab-header.mjs +2 -2
  23. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +12 -3
  24. package/esm2022/tooltip/testing/tooltip-harness.mjs +7 -1
  25. package/esm2022/tooltip/tooltip.mjs +5 -4
  26. package/fesm2022/autocomplete/testing.mjs +4 -0
  27. package/fesm2022/autocomplete/testing.mjs.map +1 -1
  28. package/fesm2022/autocomplete.mjs +57 -3
  29. package/fesm2022/autocomplete.mjs.map +1 -1
  30. package/fesm2022/chips.mjs +6 -6
  31. package/fesm2022/chips.mjs.map +1 -1
  32. package/fesm2022/core.mjs +3 -3
  33. package/fesm2022/core.mjs.map +1 -1
  34. package/fesm2022/form-field.mjs +102 -50
  35. package/fesm2022/form-field.mjs.map +1 -1
  36. package/fesm2022/legacy-tooltip/testing.mjs +1 -0
  37. package/fesm2022/legacy-tooltip/testing.mjs.map +1 -1
  38. package/fesm2022/legacy-tooltip.mjs +2 -1
  39. package/fesm2022/legacy-tooltip.mjs.map +1 -1
  40. package/fesm2022/select.mjs +59 -3
  41. package/fesm2022/select.mjs.map +1 -1
  42. package/fesm2022/snack-bar.mjs +3 -1
  43. package/fesm2022/snack-bar.mjs.map +1 -1
  44. package/fesm2022/tabs.mjs +15 -5
  45. package/fesm2022/tabs.mjs.map +1 -1
  46. package/fesm2022/tooltip/testing.mjs +6 -0
  47. package/fesm2022/tooltip/testing.mjs.map +1 -1
  48. package/fesm2022/tooltip.mjs +4 -3
  49. package/fesm2022/tooltip.mjs.map +1 -1
  50. package/form-field/index.d.ts +44 -12
  51. package/legacy-tooltip/testing/index.d.ts +1 -0
  52. package/package.json +7 -7
  53. package/prebuilt-themes/deeppurple-amber.css +1 -1
  54. package/prebuilt-themes/indigo-pink.css +1 -1
  55. package/prebuilt-themes/pink-bluegrey.css +1 -1
  56. package/prebuilt-themes/purple-green.css +1 -1
  57. package/schematics/ng-add/index.js +2 -2
  58. package/schematics/ng-add/index.mjs +2 -2
  59. package/select/index.d.ts +28 -0
  60. package/tabs/_tabs-common.scss +4 -0
  61. package/tabs/index.d.ts +4 -1
  62. package/tooltip/_tooltip-theme.scss +18 -22
  63. package/tooltip/testing/index.d.ts +4 -0
@@ -20,6 +20,14 @@ import { Platform } from '@angular/cdk/platform';
20
20
  import { QueryList } from '@angular/core';
21
21
  import { ThemePalette } from '@angular/material/core';
22
22
 
23
+ /** An injion token for the parent form-field. */
24
+ declare const FLOATING_LABEL_PARENT: InjectionToken<FloatingLabelParent>;
25
+
26
+ /** An interface that the parent form-field should implement to receive resize events. */
27
+ declare interface FloatingLabelParent {
28
+ _handleLabelResized(): void;
29
+ }
30
+
23
31
  /** Type for the available floatLabel values. */
24
32
  export declare type FloatLabelType = 'always' | 'auto';
25
33
 
@@ -80,6 +88,8 @@ declare namespace i6 {
80
88
 
81
89
  declare namespace i7 {
82
90
  export {
91
+ FloatingLabelParent,
92
+ FLOATING_LABEL_PARENT,
83
93
  MatFormFieldFloatingLabel
84
94
  }
85
95
  }
@@ -139,7 +149,7 @@ export declare class MatError {
139
149
  }
140
150
 
141
151
  /** Container for form controls that applies Material Design styling and behavior. */
142
- export declare class MatFormField implements AfterContentInit, AfterContentChecked, AfterViewInit, OnDestroy {
152
+ export declare class MatFormField implements FloatingLabelParent, AfterContentInit, AfterContentChecked, AfterViewInit, OnDestroy {
143
153
  _elementRef: ElementRef;
144
154
  private _changeDetectorRef;
145
155
  private _ngZone;
@@ -147,7 +157,6 @@ export declare class MatFormField implements AfterContentInit, AfterContentCheck
147
157
  private _platform;
148
158
  private _defaults?;
149
159
  _animationMode?: string | undefined;
150
- private _document?;
151
160
  _textField: ElementRef<HTMLElement>;
152
161
  _iconPrefixContainer: ElementRef<HTMLElement>;
153
162
  _textPrefixContainer: ElementRef<HTMLElement>;
@@ -195,8 +204,6 @@ export declare class MatFormField implements AfterContentInit, AfterContentCheck
195
204
  readonly _hintLabelId: string;
196
205
  /** State of the mat-hint and mat-error animations. */
197
206
  _subscriptAnimationState: string;
198
- /** Width of the label element (at scale=1). */
199
- _labelWidth: number;
200
207
  /** Gets the current form field control */
201
208
  get _control(): MatFormFieldControl<any>;
202
209
  set _control(value: MatFormFieldControl<any>);
@@ -204,7 +211,12 @@ export declare class MatFormField implements AfterContentInit, AfterContentCheck
204
211
  private _isFocused;
205
212
  private _explicitFormFieldControl;
206
213
  private _needsOutlineLabelOffsetUpdateOnStable;
207
- constructor(_elementRef: ElementRef, _changeDetectorRef: ChangeDetectorRef, _ngZone: NgZone, _dir: Directionality, _platform: Platform, _defaults?: MatFormFieldDefaultOptions | undefined, _animationMode?: string | undefined, _document?: any);
214
+ constructor(_elementRef: ElementRef, _changeDetectorRef: ChangeDetectorRef, _ngZone: NgZone, _dir: Directionality, _platform: Platform, _defaults?: MatFormFieldDefaultOptions | undefined, _animationMode?: string | undefined,
215
+ /**
216
+ * @deprecated not needed, to be removed.
217
+ * @breaking-change 17.0.0 remove this param
218
+ */
219
+ _unusedDocument?: any);
208
220
  ngAfterViewInit(): void;
209
221
  ngAfterContentInit(): void;
210
222
  ngAfterContentChecked(): void;
@@ -264,6 +276,8 @@ export declare class MatFormField implements AfterContentInit, AfterContentCheck
264
276
  _shouldForward(prop: keyof AbstractControlDirective): boolean;
265
277
  /** Determines whether to display hints or errors. */
266
278
  _getDisplayedMessages(): 'error' | 'hint';
279
+ /** Handle label resize events. */
280
+ _handleLabelResized(): void;
267
281
  /** Refreshes the width of the outline-notch, if present. */
268
282
  _refreshOutlineNotchWidth(): void;
269
283
  /** Does any extra processing that is required when handling the hints. */
@@ -391,17 +405,36 @@ export declare interface MatFormFieldDefaultOptions {
391
405
  * width for the outline notch, and providing inputs that can be used to toggle the
392
406
  * label's floating or required state.
393
407
  */
394
- declare class MatFormFieldFloatingLabel {
408
+ declare class MatFormFieldFloatingLabel implements OnDestroy {
395
409
  private _elementRef;
396
410
  /** Whether the label is floating. */
397
- floating: boolean;
411
+ get floating(): boolean;
412
+ set floating(value: boolean);
413
+ private _floating;
414
+ /** Whether to monitor for resize events on the floating label. */
415
+ get monitorResize(): boolean;
416
+ set monitorResize(value: boolean);
417
+ private _monitorResize;
418
+ /** The shared ResizeObserver. */
419
+ private _resizeObserver;
420
+ /** The Angular zone. */
421
+ private _ngZone;
422
+ /** The parent form-field. */
423
+ private _parent;
424
+ /** The current resize event subscription. */
425
+ private _resizeSubscription;
398
426
  constructor(_elementRef: ElementRef<HTMLElement>);
427
+ ngOnDestroy(): void;
399
428
  /** Gets the width of the label. Used for the outline notch. */
400
429
  getWidth(): number;
401
430
  /** Gets the HTML element for the floating label. */
402
431
  get element(): HTMLElement;
432
+ /** Handles resize events from the ResizeObserver. */
433
+ private _handleResize;
434
+ /** Subscribes to resize events. */
435
+ private _subscribeToResize;
403
436
  static ɵfac: i0.ɵɵFactoryDeclaration<MatFormFieldFloatingLabel, never>;
404
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatFormFieldFloatingLabel, "label[matFormFieldFloatingLabel]", never, { "floating": { "alias": "floating"; "required": false; }; }, {}, never, never, false, never>;
437
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatFormFieldFloatingLabel, "label[matFormFieldFloatingLabel]", never, { "floating": { "alias": "floating"; "required": false; }; "monitorResize": { "alias": "monitorResize"; "required": false; }; }, {}, never, never, false, never>;
405
438
  }
406
439
 
407
440
  /**
@@ -438,15 +471,14 @@ export declare class MatFormFieldModule {
438
471
  declare class MatFormFieldNotchedOutline implements AfterViewInit {
439
472
  private _elementRef;
440
473
  private _ngZone;
441
- /** Width of the label (original scale) */
442
- labelWidth: number;
443
474
  /** Whether the notch should be opened. */
444
475
  open: boolean;
476
+ _notch: ElementRef;
445
477
  constructor(_elementRef: ElementRef<HTMLElement>, _ngZone: NgZone);
446
478
  ngAfterViewInit(): void;
447
- _getNotchWidth(): string | null;
479
+ _setNotchWidth(labelWidth: number): void;
448
480
  static ɵfac: i0.ɵɵFactoryDeclaration<MatFormFieldNotchedOutline, never>;
449
- static ɵcmp: i0.ɵɵComponentDeclaration<MatFormFieldNotchedOutline, "div[matFormFieldNotchedOutline]", never, { "labelWidth": { "alias": "matFormFieldNotchedOutlineLabelWidth"; "required": false; }; "open": { "alias": "matFormFieldNotchedOutlineOpen"; "required": false; }; }, {}, never, ["*"], false, never>;
481
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatFormFieldNotchedOutline, "div[matFormFieldNotchedOutline]", never, { "open": { "alias": "matFormFieldNotchedOutlineOpen"; "required": false; }; }, {}, never, ["*"], false, never>;
450
482
  }
451
483
 
452
484
  /** Hint text to be shown underneath the form field control. */
@@ -14,6 +14,7 @@ export { LegacyTooltipHarnessFilters }
14
14
  export declare class MatLegacyTooltipHarness extends _MatTooltipHarnessBase {
15
15
  protected _optionalPanel: AsyncFactoryFn<TestElement | null>;
16
16
  protected _hiddenClass: string;
17
+ protected _disabledClass: string;
17
18
  protected _showAnimationName: string;
18
19
  protected _hideAnimationName: string;
19
20
  static hostSelector: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/material",
3
- "version": "16.0.2",
3
+ "version": "16.1.0-next.1",
4
4
  "description": "Angular Material",
5
5
  "repository": {
6
6
  "type": "git",
@@ -756,12 +756,12 @@
756
756
  }
757
757
  },
758
758
  "peerDependencies": {
759
- "@angular/animations": "^16.0.0 || ^17.0.0",
760
- "@angular/cdk": "16.0.2",
761
- "@angular/core": "^16.0.0 || ^17.0.0",
762
- "@angular/common": "^16.0.0 || ^17.0.0",
763
- "@angular/forms": "^16.0.0 || ^17.0.0",
764
- "@angular/platform-browser": "^16.0.0 || ^17.0.0",
759
+ "@angular/animations": "^16.0.0-0 || ^16.1.0-0 || ^16.2.0-0 || ^16.3.0-0 || ^17.0.0-0",
760
+ "@angular/cdk": "16.1.0-next.1",
761
+ "@angular/core": "^16.0.0-0 || ^16.1.0-0 || ^16.2.0-0 || ^16.3.0-0 || ^17.0.0-0",
762
+ "@angular/common": "^16.0.0-0 || ^16.1.0-0 || ^16.2.0-0 || ^16.3.0-0 || ^17.0.0-0",
763
+ "@angular/forms": "^16.0.0-0 || ^16.1.0-0 || ^16.2.0-0 || ^16.3.0-0 || ^17.0.0-0",
764
+ "@angular/platform-browser": "^16.0.0-0 || ^16.1.0-0 || ^16.2.0-0 || ^16.3.0-0 || ^17.0.0-0",
765
765
  "rxjs": "^6.5.3 || ^7.4.0"
766
766
  },
767
767
  "dependencies": {