@angular/material 19.2.0-next.2 → 19.2.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 (81) hide show
  1. package/bottom-sheet/index.d.ts +1 -2
  2. package/button/_button-base.scss +1 -1
  3. package/checkbox/_checkbox-common.scss +29 -16
  4. package/chips/index.d.ts +0 -2
  5. package/core/tokens/m3/definitions/_md-sys-color.scss +5 -5
  6. package/datepicker/index.d.ts +2 -3
  7. package/dialog/index.d.ts +5 -2
  8. package/dialog/testing/index.d.ts +1 -1
  9. package/expansion/index.d.ts +7 -4
  10. package/fesm2022/badge.mjs +3 -2
  11. package/fesm2022/badge.mjs.map +1 -1
  12. package/fesm2022/bottom-sheet.mjs +72 -13
  13. package/fesm2022/bottom-sheet.mjs.map +1 -1
  14. package/fesm2022/button-toggle.mjs +3 -3
  15. package/fesm2022/button-toggle.mjs.map +1 -1
  16. package/fesm2022/button.mjs +16 -16
  17. package/fesm2022/checkbox.mjs +2 -2
  18. package/fesm2022/checkbox.mjs.map +1 -1
  19. package/fesm2022/chips.mjs +15 -15
  20. package/fesm2022/chips.mjs.map +1 -1
  21. package/fesm2022/core.mjs +4 -3
  22. package/fesm2022/core.mjs.map +1 -1
  23. package/fesm2022/datepicker.mjs +102 -21
  24. package/fesm2022/datepicker.mjs.map +1 -1
  25. package/fesm2022/dialog/testing.mjs +1 -1
  26. package/fesm2022/dialog/testing.mjs.map +1 -1
  27. package/fesm2022/dialog.mjs +92 -16
  28. package/fesm2022/dialog.mjs.map +1 -1
  29. package/fesm2022/expansion.mjs +72 -16
  30. package/fesm2022/expansion.mjs.map +1 -1
  31. package/fesm2022/form-field.mjs +34 -9
  32. package/fesm2022/form-field.mjs.map +1 -1
  33. package/fesm2022/list.mjs +2 -2
  34. package/fesm2022/list.mjs.map +1 -1
  35. package/fesm2022/menu.mjs +84 -21
  36. package/fesm2022/menu.mjs.map +1 -1
  37. package/fesm2022/select.mjs +110 -38
  38. package/fesm2022/select.mjs.map +1 -1
  39. package/fesm2022/sidenav.mjs +72 -22
  40. package/fesm2022/sidenav.mjs.map +1 -1
  41. package/fesm2022/snack-bar.mjs +60 -15
  42. package/fesm2022/snack-bar.mjs.map +1 -1
  43. package/fesm2022/sort.mjs +286 -43
  44. package/fesm2022/sort.mjs.map +1 -1
  45. package/fesm2022/stepper.mjs +141 -31
  46. package/fesm2022/stepper.mjs.map +1 -1
  47. package/fesm2022/tabs.mjs +128 -30
  48. package/fesm2022/tabs.mjs.map +1 -1
  49. package/fesm2022/timepicker.mjs +11 -2
  50. package/fesm2022/timepicker.mjs.map +1 -1
  51. package/fesm2022/tooltip.mjs +49 -22
  52. package/fesm2022/tooltip.mjs.map +1 -1
  53. package/form-field/index.d.ts +1 -2
  54. package/menu/index.d.ts +4 -5
  55. package/package.json +2 -3
  56. package/prebuilt-themes/azure-blue.css +1 -1
  57. package/prebuilt-themes/cyan-orange.css +1 -1
  58. package/prebuilt-themes/magenta-violet.css +1 -1
  59. package/prebuilt-themes/rose-red.css +1 -1
  60. package/schematics/ng-add/index.js +2 -3
  61. package/schematics/ng-add/index.mjs +2 -3
  62. package/schematics/ng-add/schema.d.ts +0 -2
  63. package/schematics/ng-add/schema.js +1 -1
  64. package/schematics/ng-add/schema.json +0 -14
  65. package/schematics/ng-add/schema.mjs +1 -1
  66. package/schematics/ng-add/setup-project.d.ts +0 -1
  67. package/schematics/ng-add/setup-project.js +1 -23
  68. package/schematics/ng-add/setup-project.mjs +1 -23
  69. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
  70. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
  71. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
  72. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
  73. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
  74. package/select/index.d.ts +4 -4
  75. package/sidenav/index.d.ts +1 -2
  76. package/snack-bar/index.d.ts +1 -2
  77. package/sort/index.d.ts +6 -7
  78. package/stepper/index.d.ts +2 -3
  79. package/tabs/index.d.ts +1 -2
  80. package/timepicker/index.d.ts +6 -0
  81. package/tooltip/index.d.ts +1 -8
@@ -1,6 +1,6 @@
1
1
  import { Overlay, CdkOverlayOrigin, CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
2
2
  import * as i0 from '@angular/core';
3
- import { InjectionToken, inject, ChangeDetectorRef, ElementRef, Renderer2, NgZone, ANIMATION_MODULE_TYPE, EventEmitter, HostAttributeToken, booleanAttribute, numberAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChildren, ContentChild, Input, ViewChild, Output, Directive, NgModule } from '@angular/core';
3
+ import { InjectionToken, inject, ChangeDetectorRef, ElementRef, Renderer2, ANIMATION_MODULE_TYPE, EventEmitter, HostAttributeToken, booleanAttribute, numberAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChildren, ContentChild, Input, ViewChild, Output, Directive, NgModule } from '@angular/core';
4
4
  import { _countGroupLabelsBeforeOption, _getOptionScrollPosition, ErrorStateMatcher, _ErrorStateTracker, MAT_OPTION_PARENT_COMPONENT, MatOption, MAT_OPTGROUP, MatOptionModule, MatCommonModule } from '@angular/material/core';
5
5
  export { MatOptgroup, MatOption } from '@angular/material/core';
6
6
  import { MAT_FORM_FIELD, MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';
@@ -14,7 +14,6 @@ import { NgControl, Validators, NgForm, FormGroupDirective } from '@angular/form
14
14
  import { Subject, defer, merge } from 'rxjs';
15
15
  import { startWith, switchMap, filter, map, takeUntil, take } from 'rxjs/operators';
16
16
  import { NgClass } from '@angular/common';
17
- import { trigger, transition, query, animateChild, state, style, animate } from '@angular/animations';
18
17
 
19
18
  // Note that these have been copied over verbatim from
20
19
  // `material/select` so that we don't have to expose them publicly.
@@ -90,7 +89,6 @@ class MatSelect {
90
89
  _dir = inject(Directionality, { optional: true });
91
90
  _idGenerator = inject(_IdGenerator);
92
91
  _renderer = inject(Renderer2);
93
- _ngZone = inject(NgZone);
94
92
  _parentFormField = inject(MAT_FORM_FIELD, { optional: true });
95
93
  ngControl = inject(NgControl, { self: true, optional: true });
96
94
  _liveAnnouncer = inject(LiveAnnouncer);
@@ -575,31 +573,36 @@ class MatSelect {
575
573
  /** Triggers the exit animation and detaches the overlay at the end. */
576
574
  _exitAndDetach() {
577
575
  if (this._animationsDisabled || !this.panel) {
578
- this._overlayDir.detachOverlay();
576
+ this._detachOverlay();
579
577
  return;
580
578
  }
581
- this._ngZone.runOutsideAngular(() => {
582
- this._cleanupDetach?.();
583
- this._cleanupDetach = () => {
584
- cleanupEvent();
585
- clearTimeout(exitFallbackTimer);
586
- this._cleanupDetach = undefined;
587
- };
588
- const panel = this.panel.nativeElement;
589
- const cleanupEvent = this._renderer.listen(panel, 'animationend', (event) => {
590
- if (event.animationName === '_mat-select-exit') {
591
- this._cleanupDetach?.();
592
- this._overlayDir.detachOverlay();
593
- }
594
- });
595
- // Since closing the overlay depends on the animation, we have a fallback in case the panel
596
- // doesn't animate. This can happen in some internal tests that do `* {animation: none}`.
597
- const exitFallbackTimer = setTimeout(() => {
579
+ this._cleanupDetach?.();
580
+ this._cleanupDetach = () => {
581
+ cleanupEvent();
582
+ clearTimeout(exitFallbackTimer);
583
+ this._cleanupDetach = undefined;
584
+ };
585
+ const panel = this.panel.nativeElement;
586
+ const cleanupEvent = this._renderer.listen(panel, 'animationend', (event) => {
587
+ if (event.animationName === '_mat-select-exit') {
598
588
  this._cleanupDetach?.();
599
- this._overlayDir.detachOverlay();
600
- }, 200);
601
- panel.classList.add('mat-select-panel-exit');
589
+ this._detachOverlay();
590
+ }
602
591
  });
592
+ // Since closing the overlay depends on the animation, we have a fallback in case the panel
593
+ // doesn't animate. This can happen in some internal tests that do `* {animation: none}`.
594
+ const exitFallbackTimer = setTimeout(() => {
595
+ this._cleanupDetach?.();
596
+ this._detachOverlay();
597
+ }, 200);
598
+ panel.classList.add('mat-select-panel-exit');
599
+ }
600
+ /** Detaches the current overlay directive. */
601
+ _detachOverlay() {
602
+ this._overlayDir.detachOverlay();
603
+ // Some of the overlay detachment logic depends on change detection.
604
+ // Mark for check to ensure that things get picked up in a timely manner.
605
+ this._changeDetectorRef.markForCheck();
603
606
  }
604
607
  /**
605
608
  * Sets the select's value. Part of the ControlValueAccessor interface
@@ -1285,26 +1288,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
1285
1288
  * @breaking-change 21.0.0
1286
1289
  */
1287
1290
  const matSelectAnimations = {
1291
+ // Represents
1292
+ // trigger('transformPanelWrap', [
1293
+ // transition('* => void', query('@transformPanel', [animateChild()], {optional: true})),
1294
+ // ])
1288
1295
  /**
1289
1296
  * This animation ensures the select's overlay panel animation (transformPanel) is called when
1290
1297
  * closing the select.
1291
1298
  * This is needed due to https://github.com/angular/angular/issues/23302
1292
1299
  */
1293
- transformPanelWrap: trigger('transformPanelWrap', [
1294
- transition('* => void', query('@transformPanel', [animateChild()], { optional: true })),
1295
- ]),
1300
+ transformPanelWrap: {
1301
+ type: 7,
1302
+ name: 'transformPanelWrap',
1303
+ definitions: [
1304
+ {
1305
+ type: 1,
1306
+ expr: '* => void',
1307
+ animation: {
1308
+ type: 11,
1309
+ selector: '@transformPanel',
1310
+ animation: [{ type: 9, options: null }],
1311
+ options: { optional: true },
1312
+ },
1313
+ options: null,
1314
+ },
1315
+ ],
1316
+ options: {},
1317
+ },
1318
+ // Represents
1319
+ // trigger('transformPanel', [
1320
+ // state(
1321
+ // 'void',
1322
+ // style({
1323
+ // opacity: 0,
1324
+ // transform: 'scale(1, 0.8)',
1325
+ // }),
1326
+ // ),
1327
+ // transition(
1328
+ // 'void => showing',
1329
+ // animate(
1330
+ // '120ms cubic-bezier(0, 0, 0.2, 1)',
1331
+ // style({
1332
+ // opacity: 1,
1333
+ // transform: 'scale(1, 1)',
1334
+ // }),
1335
+ // ),
1336
+ // ),
1337
+ // transition('* => void', animate('100ms linear', style({opacity: 0}))),
1338
+ // ])
1296
1339
  /** This animation transforms the select's overlay panel on and off the page. */
1297
- transformPanel: trigger('transformPanel', [
1298
- state('void', style({
1299
- opacity: 0,
1300
- transform: 'scale(1, 0.8)',
1301
- })),
1302
- transition('void => showing', animate('120ms cubic-bezier(0, 0, 0.2, 1)', style({
1303
- opacity: 1,
1304
- transform: 'scale(1, 1)',
1305
- }))),
1306
- transition('* => void', animate('100ms linear', style({ opacity: 0 }))),
1307
- ]),
1340
+ transformPanel: {
1341
+ type: 7,
1342
+ name: 'transformPanel',
1343
+ definitions: [
1344
+ {
1345
+ type: 0,
1346
+ name: 'void',
1347
+ styles: {
1348
+ type: 6,
1349
+ styles: { opacity: 0, transform: 'scale(1, 0.8)' },
1350
+ offset: null,
1351
+ },
1352
+ },
1353
+ {
1354
+ type: 1,
1355
+ expr: 'void => showing',
1356
+ animation: {
1357
+ type: 4,
1358
+ styles: {
1359
+ type: 6,
1360
+ styles: { opacity: 1, transform: 'scale(1, 1)' },
1361
+ offset: null,
1362
+ },
1363
+ timings: '120ms cubic-bezier(0, 0, 0.2, 1)',
1364
+ },
1365
+ options: null,
1366
+ },
1367
+ {
1368
+ type: 1,
1369
+ expr: '* => void',
1370
+ animation: {
1371
+ type: 4,
1372
+ styles: { type: 6, styles: { opacity: 0 }, offset: null },
1373
+ timings: '100ms linear',
1374
+ },
1375
+ options: null,
1376
+ },
1377
+ ],
1378
+ options: {},
1379
+ },
1308
1380
  };
1309
1381
 
1310
1382
  /**