@angular/material 18.1.0-next.4 → 18.1.0

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 (118) hide show
  1. package/badge/index.d.ts +5 -2
  2. package/button/_button-base.scss +13 -6
  3. package/button/_button-theme.scss +26 -27
  4. package/button/_fab-theme.scss +16 -16
  5. package/button/_icon-button-theme.scss +14 -20
  6. package/button/index.d.ts +7 -0
  7. package/card/_card-theme.scss +25 -52
  8. package/checkbox/index.d.ts +4 -2
  9. package/chips/_chips-theme.scss +22 -24
  10. package/core/m2/_typography.scss +5 -2
  11. package/core/mdc-helpers/_mdc-helpers.scss +2 -2
  12. package/core/style/_elevation.scss +5 -0
  13. package/core/tokens/_token-utils.scss +2 -2
  14. package/core/tokens/m2/mat/_app.scss +1 -2
  15. package/core/tokens/m2/mat/_autocomplete.scss +2 -2
  16. package/core/tokens/m2/mat/_datepicker.scss +3 -3
  17. package/core/tokens/m2/mat/_dialog.scss +2 -2
  18. package/core/tokens/m2/mat/_fab-small.scss +3 -9
  19. package/core/tokens/m2/mat/_fab.scss +3 -9
  20. package/core/tokens/m2/mat/_filled-button.scss +3 -9
  21. package/core/tokens/m2/mat/_form-field.scss +9 -6
  22. package/core/tokens/m2/mat/_icon-button.scss +3 -9
  23. package/core/tokens/m2/mat/_outlined-button.scss +3 -9
  24. package/core/tokens/m2/mat/_paginator.scss +10 -6
  25. package/core/tokens/m2/mat/_protected-button.scss +3 -9
  26. package/core/tokens/m2/mat/_select.scss +2 -2
  27. package/core/tokens/m2/mat/_sidenav.scss +2 -2
  28. package/core/tokens/m2/mat/_text-button.scss +3 -9
  29. package/core/tokens/m2/mdc/_chip.scss +2 -14
  30. package/core/tokens/m2/mdc/_elevated-card.scss +3 -7
  31. package/core/tokens/m2/mdc/_extended-fab.scss +13 -10
  32. package/core/tokens/m2/mdc/_fab-small.scss +15 -13
  33. package/core/tokens/m2/mdc/_fab.scss +15 -13
  34. package/core/tokens/m2/mdc/_outlined-card.scss +2 -6
  35. package/core/tokens/m2/mdc/_protected-button.scss +13 -7
  36. package/core/tokens/m3/mat/_app.scss +2 -2
  37. package/core/tokens/m3/mat/_autocomplete.scss +2 -2
  38. package/core/tokens/m3/mat/_datepicker.scss +3 -3
  39. package/core/tokens/m3/mat/_select.scss +2 -2
  40. package/core/tokens/m3/mdc/_chip.scss +1 -4
  41. package/core/tokens/m3/mdc/_elevated-card.scss +9 -2
  42. package/core/tokens/m3/mdc/_extended-fab.scss +19 -2
  43. package/core/tokens/m3/mdc/_fab-small.scss +19 -2
  44. package/core/tokens/m3/mdc/_fab.scss +19 -2
  45. package/core/tokens/m3/mdc/_outlined-card.scss +9 -2
  46. package/core/tokens/m3/mdc/_protected-button.scss +22 -5
  47. package/datepicker/index.d.ts +13 -5
  48. package/esm2022/badge/badge.mjs +6 -3
  49. package/esm2022/button/button-base.mjs +3 -3
  50. package/esm2022/button/button.mjs +4 -4
  51. package/esm2022/button/fab.mjs +9 -9
  52. package/esm2022/button/icon-button.mjs +4 -4
  53. package/esm2022/card/card.mjs +2 -2
  54. package/esm2022/checkbox/checkbox-config.mjs +1 -1
  55. package/esm2022/chips/chip-grid.mjs +26 -8
  56. package/esm2022/chips/chip-listbox.mjs +2 -2
  57. package/esm2022/chips/chip-option.mjs +3 -3
  58. package/esm2022/chips/chip-row.mjs +3 -3
  59. package/esm2022/chips/chip-set.mjs +2 -2
  60. package/esm2022/chips/chip.mjs +3 -3
  61. package/esm2022/core/internal-form-field/internal-form-field.mjs +2 -2
  62. package/esm2022/core/ripple/ripple-renderer.mjs +21 -3
  63. package/esm2022/core/version.mjs +1 -1
  64. package/esm2022/datepicker/datepicker-base.mjs +6 -4
  65. package/esm2022/datepicker/datepicker-input-base.mjs +1 -1
  66. package/esm2022/dialog/dialog-container.mjs +3 -3
  67. package/esm2022/form-field/form-field.mjs +9 -18
  68. package/esm2022/list/action-list.mjs +2 -2
  69. package/esm2022/list/list-option.mjs +18 -4
  70. package/esm2022/list/list.mjs +10 -4
  71. package/esm2022/list/nav-list.mjs +2 -2
  72. package/esm2022/list/selection-list.mjs +2 -2
  73. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  74. package/esm2022/tabs/tabs-animations.mjs +2 -2
  75. package/fesm2022/badge.mjs +5 -2
  76. package/fesm2022/badge.mjs.map +1 -1
  77. package/fesm2022/button.mjs +18 -18
  78. package/fesm2022/button.mjs.map +1 -1
  79. package/fesm2022/card.mjs +2 -2
  80. package/fesm2022/card.mjs.map +1 -1
  81. package/fesm2022/checkbox.mjs.map +1 -1
  82. package/fesm2022/chips.mjs +35 -17
  83. package/fesm2022/chips.mjs.map +1 -1
  84. package/fesm2022/core.mjs +23 -5
  85. package/fesm2022/core.mjs.map +1 -1
  86. package/fesm2022/datepicker.mjs +5 -3
  87. package/fesm2022/datepicker.mjs.map +1 -1
  88. package/fesm2022/dialog.mjs +2 -2
  89. package/fesm2022/dialog.mjs.map +1 -1
  90. package/fesm2022/form-field.mjs +8 -17
  91. package/fesm2022/form-field.mjs.map +1 -1
  92. package/fesm2022/list.mjs +32 -12
  93. package/fesm2022/list.mjs.map +1 -1
  94. package/fesm2022/slide-toggle.mjs +2 -2
  95. package/fesm2022/slide-toggle.mjs.map +1 -1
  96. package/fesm2022/tabs.mjs +1 -1
  97. package/fesm2022/tabs.mjs.map +1 -1
  98. package/form-field/_form-field-subscript.scss +2 -2
  99. package/form-field/_mdc-text-field-structure-overrides.scss +2 -3
  100. package/form-field/index.d.ts +9 -7
  101. package/list/_list-inherited-structure.scss +516 -0
  102. package/list/_list-item-hcm-indicator.scss +2 -3
  103. package/list/_list-theme.scss +17 -18
  104. package/list/index.d.ts +2 -0
  105. package/package.json +7 -7
  106. package/prebuilt-themes/azure-blue.css +1 -1
  107. package/prebuilt-themes/cyan-orange.css +1 -1
  108. package/prebuilt-themes/deeppurple-amber.css +1 -1
  109. package/prebuilt-themes/indigo-pink.css +1 -1
  110. package/prebuilt-themes/magenta-violet.css +1 -1
  111. package/prebuilt-themes/pink-bluegrey.css +1 -1
  112. package/prebuilt-themes/purple-green.css +1 -1
  113. package/prebuilt-themes/rose-red.css +1 -1
  114. package/schematics/ng-add/index.js +2 -2
  115. package/schematics/ng-add/index.mjs +2 -2
  116. package/schematics/ng-generate/m3-theme/index_bundled.js +2 -2
  117. package/schematics/ng-update/index_bundled.js +31 -31
  118. package/list/_list-option-trailing-avatar-compat.scss +0 -58
package/fesm2022/core.mjs CHANGED
@@ -13,7 +13,7 @@ import { startWith } from 'rxjs/operators';
13
13
  import { ENTER, SPACE, hasModifierKey } from '@angular/cdk/keycodes';
14
14
 
15
15
  /** Current version of Angular Material. */
16
- const VERSION = new Version('18.1.0-next.4');
16
+ const VERSION = new Version('18.1.0');
17
17
 
18
18
  /** @docs-private */
19
19
  class AnimationCurves {
@@ -968,14 +968,29 @@ class RippleRenderer {
968
968
  // are set to zero. The events won't fire anyway and we can save resources here.
969
969
  if (!animationForciblyDisabledThroughCss && (enterDuration || animationConfig.exitDuration)) {
970
970
  this._ngZone.runOutsideAngular(() => {
971
- const onTransitionEnd = () => this._finishRippleTransition(rippleRef);
971
+ const onTransitionEnd = () => {
972
+ // Clear the fallback timer since the transition fired correctly.
973
+ if (eventListeners) {
974
+ eventListeners.fallbackTimer = null;
975
+ }
976
+ clearTimeout(fallbackTimer);
977
+ this._finishRippleTransition(rippleRef);
978
+ };
972
979
  const onTransitionCancel = () => this._destroyRipple(rippleRef);
980
+ // In some cases where there's a higher load on the browser, it can choose not to dispatch
981
+ // neither `transitionend` nor `transitioncancel` (see b/227356674). This timer serves as a
982
+ // fallback for such cases so that the ripple doesn't become stuck. We add a 100ms buffer
983
+ // because timers aren't precise. Note that another approach can be to transition the ripple
984
+ // to the `VISIBLE` state immediately above and to `FADING_IN` afterwards inside
985
+ // `transitionstart`. We go with the timer because it's one less event listener and
986
+ // it's less likely to break existing tests.
987
+ const fallbackTimer = setTimeout(onTransitionCancel, enterDuration + 100);
973
988
  ripple.addEventListener('transitionend', onTransitionEnd);
974
989
  // If the transition is cancelled (e.g. due to DOM removal), we destroy the ripple
975
990
  // directly as otherwise we would keep it part of the ripple container forever.
976
991
  // https://www.w3.org/TR/css-transitions-1/#:~:text=no%20longer%20in%20the%20document.
977
992
  ripple.addEventListener('transitioncancel', onTransitionCancel);
978
- eventListeners = { onTransitionEnd, onTransitionCancel };
993
+ eventListeners = { onTransitionEnd, onTransitionCancel, fallbackTimer };
979
994
  });
980
995
  }
981
996
  // Add the ripple reference to the list of all active ripples.
@@ -1106,6 +1121,9 @@ class RippleRenderer {
1106
1121
  if (eventListeners !== null) {
1107
1122
  rippleRef.element.removeEventListener('transitionend', eventListeners.onTransitionEnd);
1108
1123
  rippleRef.element.removeEventListener('transitioncancel', eventListeners.onTransitionCancel);
1124
+ if (eventListeners.fallbackTimer !== null) {
1125
+ clearTimeout(eventListeners.fallbackTimer);
1126
+ }
1109
1127
  }
1110
1128
  rippleRef.element.remove();
1111
1129
  }
@@ -1913,14 +1931,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.3",
1913
1931
  */
1914
1932
  class _MatInternalFormField {
1915
1933
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0-next.3", ngImport: i0, type: _MatInternalFormField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1916
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0-next.3", type: _MatInternalFormField, isStandalone: true, selector: "div[mat-internal-form-field]", inputs: { labelPosition: "labelPosition" }, host: { properties: { "class.mdc-form-field--align-end": "labelPosition === \"before\"" }, classAttribute: "mdc-form-field mat-internal-form-field" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [".mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1934
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0-next.3", type: _MatInternalFormField, isStandalone: true, selector: "div[mat-internal-form-field]", inputs: { labelPosition: "labelPosition" }, host: { properties: { "class.mdc-form-field--align-end": "labelPosition === \"before\"" }, classAttribute: "mdc-form-field mat-internal-form-field" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [".mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1917
1935
  }
1918
1936
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0-next.3", ngImport: i0, type: _MatInternalFormField, decorators: [{
1919
1937
  type: Component,
1920
1938
  args: [{ selector: 'div[mat-internal-form-field]', standalone: true, template: '<ng-content></ng-content>', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
1921
1939
  'class': 'mdc-form-field mat-internal-form-field',
1922
1940
  '[class.mdc-form-field--align-end]': 'labelPosition === "before"',
1923
- }, styles: [".mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}"] }]
1941
+ }, styles: [".mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}"] }]
1924
1942
  }], propDecorators: { labelPosition: [{
1925
1943
  type: Input,
1926
1944
  args: [{ required: true }]