@angular/material 17.0.3 → 17.0.5

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 (98) hide show
  1. package/LICENSE +1 -1
  2. package/_index.scss +1 -1
  3. package/button/_button-theme.scss +11 -11
  4. package/core/index.d.ts +6 -2
  5. package/core/tokens/m2/mat/_form-field.scss +50 -1
  6. package/core/tokens/m2/mat/_slider.scss +34 -8
  7. package/core/tokens/m2/mat/_tab-header.scss +6 -1
  8. package/core/tokens/m2/mdc/_filled-button.scss +7 -6
  9. package/core/tokens/m2/mdc/_outlined-button.scss +7 -7
  10. package/core/tokens/m2/mdc/_protected-button.scss +7 -6
  11. package/core/tokens/m2/mdc/_text-button.scss +7 -8
  12. package/esm2022/autocomplete/autocomplete-trigger.mjs +12 -4
  13. package/esm2022/autocomplete/autocomplete.mjs +2 -3
  14. package/esm2022/button/button-base.mjs +2 -1
  15. package/esm2022/button/button.mjs +4 -4
  16. package/esm2022/chips/chip-listbox.mjs +2 -3
  17. package/esm2022/chips/chip.mjs +2 -1
  18. package/esm2022/chips/tokens.mjs +8 -2
  19. package/esm2022/core/private/ripple-loader.mjs +27 -9
  20. package/esm2022/core/ripple/ripple-renderer.mjs +1 -1
  21. package/esm2022/core/version.mjs +1 -1
  22. package/esm2022/datepicker/datepicker-base.mjs +8 -2
  23. package/esm2022/expansion/accordion.mjs +2 -3
  24. package/esm2022/expansion/expansion-panel.mjs +3 -3
  25. package/esm2022/form-field/form-field.mjs +3 -3
  26. package/esm2022/list/tokens.mjs +2 -2
  27. package/esm2022/menu/menu-trigger.mjs +8 -2
  28. package/esm2022/menu/menu.mjs +2 -3
  29. package/esm2022/select/select.mjs +22 -16
  30. package/esm2022/sidenav/drawer.mjs +16 -12
  31. package/esm2022/sidenav/sidenav.mjs +4 -7
  32. package/esm2022/slider/slider-input.mjs +24 -19
  33. package/esm2022/slider/slider-interface.mjs +1 -1
  34. package/esm2022/slider/slider-thumb.mjs +9 -2
  35. package/esm2022/slider/slider.mjs +3 -4
  36. package/esm2022/snack-bar/snack-bar-container.mjs +6 -9
  37. package/esm2022/tabs/ink-bar.mjs +4 -4
  38. package/esm2022/tabs/tab-group.mjs +11 -2
  39. package/esm2022/tabs/tab-header.mjs +2 -2
  40. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
  41. package/esm2022/tooltip/tooltip.mjs +9 -3
  42. package/expansion/index.d.ts +2 -2
  43. package/fesm2022/autocomplete.mjs +12 -5
  44. package/fesm2022/autocomplete.mjs.map +1 -1
  45. package/fesm2022/button.mjs +5 -4
  46. package/fesm2022/button.mjs.map +1 -1
  47. package/fesm2022/chips.mjs +8 -3
  48. package/fesm2022/chips.mjs.map +1 -1
  49. package/fesm2022/core.mjs +27 -9
  50. package/fesm2022/core.mjs.map +1 -1
  51. package/fesm2022/datepicker.mjs +7 -1
  52. package/fesm2022/datepicker.mjs.map +1 -1
  53. package/fesm2022/expansion.mjs +3 -4
  54. package/fesm2022/expansion.mjs.map +1 -1
  55. package/fesm2022/form-field.mjs +2 -2
  56. package/fesm2022/form-field.mjs.map +1 -1
  57. package/fesm2022/list.mjs +1 -1
  58. package/fesm2022/list.mjs.map +1 -1
  59. package/fesm2022/menu.mjs +8 -3
  60. package/fesm2022/menu.mjs.map +1 -1
  61. package/fesm2022/select.mjs +21 -15
  62. package/fesm2022/select.mjs.map +1 -1
  63. package/fesm2022/sidenav.mjs +18 -17
  64. package/fesm2022/sidenav.mjs.map +1 -1
  65. package/fesm2022/slider.mjs +32 -22
  66. package/fesm2022/slider.mjs.map +1 -1
  67. package/fesm2022/snack-bar.mjs +6 -8
  68. package/fesm2022/snack-bar.mjs.map +1 -1
  69. package/fesm2022/tabs.mjs +17 -8
  70. package/fesm2022/tabs.mjs.map +1 -1
  71. package/fesm2022/tooltip.mjs +8 -2
  72. package/fesm2022/tooltip.mjs.map +1 -1
  73. package/form-field/_form-field-subscript.scss +1 -2
  74. package/form-field/_form-field-theme.scss +4 -2
  75. package/form-field/_mdc-text-field-density-overrides.scss +60 -0
  76. package/list/index.d.ts +1 -1
  77. package/package.json +2 -2
  78. package/paginator/_paginator-theme.scss +5 -4
  79. package/prebuilt-themes/deeppurple-amber.css +1 -1
  80. package/prebuilt-themes/indigo-pink.css +1 -1
  81. package/prebuilt-themes/pink-bluegrey.css +1 -1
  82. package/prebuilt-themes/purple-green.css +1 -1
  83. package/schematics/ng-add/index.js +1 -1
  84. package/schematics/ng-add/index.mjs +1 -1
  85. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
  86. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
  87. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +5 -3
  88. package/schematics/ng-generate/mdc-migration/schema.json +0 -1
  89. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
  90. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
  91. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
  92. package/slider/_slider-theme.scss +10 -12
  93. package/slider/index.d.ts +3 -12
  94. package/snack-bar/index.d.ts +2 -2
  95. package/tabs/_tabs-common.scss +20 -1
  96. package/tabs/index.d.ts +6 -2
  97. package/form-field/_form-field-density.scss +0 -118
  98. package/form-field/_form-field-sizing.scss +0 -40
package/slider/index.d.ts CHANGED
@@ -141,7 +141,6 @@ export declare class MatSlider extends _MatSliderMixinBase implements AfterViewI
141
141
  /** The radius of the native slider's knob. AFAIK there is no way to avoid hardcoding this. */
142
142
  _knobRadius: number;
143
143
  _inputPadding: number;
144
- _inputOffset: number;
145
144
  ngAfterViewInit(): void;
146
145
  private _initUINonRange;
147
146
  private _initUIRange;
@@ -238,17 +237,6 @@ declare interface _MatSlider {
238
237
  * thumb ripple extends past the end of the slider track clickable.
239
238
  */
240
239
  _inputPadding: number;
241
- /**
242
- * The offset represents left most translateX of the slider knob. Inversely,
243
- * (slider width - offset) = the right most translateX of the slider knob.
244
- *
245
- * Note:
246
- * * The native slider knob differs from the visual slider. It's knob cannot slide past
247
- * the end of the track AT ALL.
248
- * * The visual slider knob CAN slide past the end of the track slightly. It's knob can slide
249
- * past the end of the track such that it's center lines up with the end of the track.
250
- */
251
- _inputOffset: number;
252
240
  /** The radius of the visual slider's ripple. */
253
241
  _rippleRadius: number;
254
242
  /** The global configuration for `matRipple` instances. */
@@ -418,6 +406,8 @@ export declare class MatSliderThumb implements _MatSliderThumb, OnDestroy, Contr
418
406
  _valuetext: string;
419
407
  /** The radius of a native html slider's knob. */
420
408
  _knobRadius: number;
409
+ /** The distance in px from the start of the slider track to the first tick mark. */
410
+ _tickMarkOffset: number;
421
411
  /** Whether user's cursor is currently in a mouse down state on the input. */
422
412
  _isActive: boolean;
423
413
  /** Whether the input is currently focused (either by tab or after clicking). */
@@ -626,6 +616,7 @@ export declare class MatSliderVisualThumb implements _MatSliderVisualThumb, Afte
626
616
  _isValueIndicatorVisible: boolean;
627
617
  /** The host native HTML input element. */
628
618
  _hostElement: HTMLElement;
619
+ private _platform;
629
620
  constructor(_cdr: ChangeDetectorRef, _ngZone: NgZone, _elementRef: ElementRef<HTMLElement>, _slider: _MatSlider);
630
621
  ngAfterViewInit(): void;
631
622
  ngOnDestroy(): void;
@@ -256,8 +256,8 @@ export declare class MatSnackBarContainer extends BasePortalOutlet implements On
256
256
  /** Makes sure the exit callbacks have been invoked when the element is destroyed. */
257
257
  ngOnDestroy(): void;
258
258
  /**
259
- * Waits for the zone to settle before removing the element. Helps prevent
260
- * errors where we end up removing an element which is in the middle of an animation.
259
+ * Removes the element in a microtask. Helps prevent errors where we end up
260
+ * removing an element which is in the middle of an animation.
261
261
  */
262
262
  private _completeExit;
263
263
  /**
@@ -338,11 +338,30 @@ $mat-tab-animation-duration: 500ms !default;
338
338
  }
339
339
 
340
340
  // Structural styles for the element that wraps the paginated container's content.
341
- @mixin paginated-tab-header-container {
341
+ // Include a selector for an inverted header if the header may be optionally positioned on the
342
+ // bottom of the content.
343
+ @mixin paginated-tab-header-container($inverted-header-selector: null) {
342
344
  display: flex;
343
345
  flex-grow: 1;
344
346
  overflow: hidden;
345
347
  z-index: 1;
348
+ @include token-utils.use-tokens(
349
+ tokens-mat-tab-header.$prefix,
350
+ tokens-mat-tab-header.get-token-slots()
351
+ ) {
352
+ border-bottom-style: solid;
353
+ @include token-utils.create-token-slot(border-bottom-width, divider-height);
354
+ @include token-utils.create-token-slot(border-bottom-color, divider-color);
355
+
356
+ @if ($inverted-header-selector) {
357
+ #{$inverted-header-selector} & {
358
+ border-bottom: none;
359
+ border-top-style: solid;
360
+ @include token-utils.create-token-slot(border-top-width, divider-height);
361
+ @include token-utils.create-token-slot(border-top-color, divider-color);
362
+ }
363
+ }
364
+ }
346
365
  }
347
366
 
348
367
  @mixin paginated-tab-header-with-background($header-selector, $tab-selector) {
package/tabs/index.d.ts CHANGED
@@ -166,7 +166,7 @@ export declare class MatInkBar {
166
166
  */
167
167
  declare interface MatInkBarItem extends OnInit, OnDestroy {
168
168
  elementRef: ElementRef<HTMLElement>;
169
- activateInkBar(previousIndicatorClientRect?: ClientRect): void;
169
+ activateInkBar(previousIndicatorClientRect?: DOMRect): void;
170
170
  deactivateInkBar(): void;
171
171
  fitInkBarToContent: boolean;
172
172
  }
@@ -614,7 +614,11 @@ export declare class MatTabGroup extends _MatTabGroupMixinBase implements AfterC
614
614
  get preserveContent(): boolean;
615
615
  set preserveContent(value: BooleanInput);
616
616
  private _preserveContent;
617
- /** Background color of the tab group. */
617
+ /**
618
+ * Background color of the tab group.
619
+ * @deprecated The background color should be customized through Sass theming APIs.
620
+ * @breaking-change 20.0.0 Remove this input
621
+ */
618
622
  get backgroundColor(): ThemePalette;
619
623
  set backgroundColor(value: ThemePalette);
620
624
  private _backgroundColor;
@@ -1,118 +0,0 @@
1
- @use 'sass:map';
2
- @use 'sass:math';
3
- @use '@material/density' as mdc-density;
4
- @use '@material/textfield' as mdc-textfield;
5
- @use '../core/theming/inspection';
6
-
7
- @use './form-field-sizing';
8
-
9
- // Mixin that sets the vertical spacing for the infix container of filled form fields.
10
- // We need to apply spacing to the infix container because we removed the input padding
11
- // provided by MDC in order to support arbitrary form-field controls.
12
- @mixin _infix-vertical-spacing-filled($with-label-padding, $no-label-padding) {
13
- .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix {
14
- padding-top: map.get($with-label-padding, top);
15
- padding-bottom: map.get($with-label-padding, bottom);
16
- }
17
-
18
- .mdc-text-field--no-label:not(.mdc-text-field--outlined):not(.mdc-text-field--textarea)
19
- .mat-mdc-form-field-infix {
20
- padding-top: map.get($no-label-padding, top);
21
- padding-bottom: map.get($no-label-padding, bottom);
22
- }
23
- }
24
-
25
- // Mixin that sets the vertical spacing for the infix container of outlined form fields.
26
- // We need to apply spacing to the infix container because we removed the input padding
27
- // provided by MDC in order to support arbitrary form-field controls.
28
- @mixin _infix-vertical-spacing-outlined($padding) {
29
- .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix {
30
- padding-top: map.get($padding, top);
31
- padding-bottom: map.get($padding, bottom);
32
- }
33
- }
34
-
35
- // Mixin that includes the density styles for form fields. MDC provides their own density
36
- // styles for MDC text-field which we cannot use. MDC relies on input elements to stretch
37
- // vertically when the height is reduced as per density scale. This doesn't work for our
38
- // form field since we support custom form field controls without a fixed height. Instead, we
39
- // provide spacing that makes arbitrary controls align as specified in the Material Design
40
- // specification. In order to support density, we need to adjust the vertical spacing to be
41
- // based on the density scale.
42
- @mixin private-form-field-density($theme) {
43
- // Height of the form field that is based on the current density scale.
44
- $height: mdc-density.prop-value(
45
- $density-config: mdc-textfield.$density-config,
46
- $density-scale: inspection.get-theme-density($theme),
47
- $property-name: height,
48
- );
49
-
50
- // Whether floating labels for filled form fields should be hidden. MDC hides the label in
51
- // their density styles when the height decreases too much. We match their density styles.
52
- $hide-filled-floating-label: $height < mdc-textfield.$minimum-height-for-filled-label;
53
- // We computed the desired height of the form-field using the density configuration. The
54
- // spec only describes vertical spacing/alignment in non-dense mode. This means that we
55
- // cannot update the spacing to explicit numbers based on the density scale. Instead, we
56
- // determine the height reduction and equally subtract it from the default `top` and `bottom`
57
- // padding that is provided by the Material Design specification.
58
- $vertical-deduction: math.div(mdc-textfield.$height - $height, 2);
59
- // Map that describes the padding for form-fields with label.
60
- $with-label-padding: (
61
- top: form-field-sizing.$mat-form-field-with-label-input-padding-top - $vertical-deduction,
62
- bottom: form-field-sizing.$mat-form-field-with-label-input-padding-bottom - $vertical-deduction,
63
- );
64
- // Map that describes the padding for form-fields without label.
65
- $no-label-padding: (
66
- top: form-field-sizing.$mat-form-field-no-label-padding-top - $vertical-deduction,
67
- bottom: form-field-sizing.$mat-form-field-no-label-padding-bottom - $vertical-deduction,
68
- );
69
-
70
- // We add a minimum height to the infix container in order to ensure that custom controls have
71
- // the same default vertical space as text-field inputs (with respect to the vertical padding).
72
- .mat-mdc-form-field-infix {
73
- min-height: $height;
74
- }
75
-
76
- // By default, MDC aligns the label using percentage. This will be overwritten based
77
- // on whether a textarea is used. This is not possible in our implementation of the
78
- // form-field because we do not know what type of form-field control is set up. Hence
79
- // we always use a fixed position for the label. This does not have any implications.
80
- .mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label {
81
- top: math.div($height, 2);
82
- }
83
-
84
- // For the outline appearance, we re-create the active floating label transform. This is
85
- // necessary because the transform for docked floating labels can be updated to account for
86
- // the width of prefix container.
87
- .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded
88
- .mdc-floating-label--float-above {
89
- --mat-mdc-form-field-label-transform: translateY(
90
- -#{mdc-textfield.get-outlined-label-position-y($height)})
91
- scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));
92
- transform: var(--mat-mdc-form-field-label-transform);
93
- }
94
-
95
- // Add vertical spacing to the infix to ensure that outlined form fields have their controls
96
- // aligned as if there is no label. This is done similarly in MDC and is specified in the
97
- // Material Design specification. Outline form fields position the control as if there is no
98
- // label. This is because the label overflows the form-field and doesn't need space at the top.
99
- @include _infix-vertical-spacing-outlined($no-label-padding);
100
-
101
- // MDC hides labels for filled form fields when the form field height decreases. We match
102
- // this behavior in our custom density styles.
103
- @if $hide-filled-floating-label {
104
- // Update the spacing for filled form fields to account for the hidden floating label.
105
- @include _infix-vertical-spacing-filled(
106
- $no-label-padding, $no-label-padding);
107
- .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-floating-label {
108
- display: none;
109
- }
110
- }
111
- @else {
112
- // By default, filled form fields align their controls differently based on whether there
113
- // is a label or not. MDC does this too, but we cannot rely on their styles as we support
114
- // arbitrary form field controls and MDC only applies their spacing to the `<input>` elements.
115
- @include _infix-vertical-spacing-filled(
116
- $with-label-padding, $no-label-padding);
117
- }
118
- }
@@ -1,40 +0,0 @@
1
- // Top spacing of the form-field outline. MDC does not have a variable for this
2
- // and just hard-codes it into their styles.
3
- $mat-form-field-outline-top-spacing: 12px;
4
-
5
- // Infix stretches to fit the container, but naturally wants to be this wide. We set
6
- // this in order to have a consistent natural size for the various types of controls
7
- // that can go in a form field.
8
- $mat-form-field-default-infix-width: 180px !default;
9
-
10
- // Minimum amount of space between start and end hints in the subscript. MDC does not
11
- // have built-in support for hints.
12
- $mat-form-field-hint-min-space: 1em !default;
13
-
14
- // Vertical spacing of the text-field if there is no label. MDC hard-codes the spacing
15
- // into their styles, but their spacing variables would not work for our form-field
16
- // structure anyway. This is because MDC's input elements are larger than the text, and
17
- // their padding variables are calculated with respect to the vertical empty space of the
18
- // inputs. We take the explicit numbers provided by the Material Design specification.
19
- // https://material.io/components/text-fields/#specs
20
-
21
- // Vertical spacing of the text-field if there is a label. MDC hard-codes the spacing into
22
- // their styles, but their spacing variables would not work for our form-field structure anyway.
23
- // This is because MDC's alignment depends on the input element to expand to full infix height.
24
- // We allow for arbitrary form controls and support dynamic height, so we manage the control
25
- // infix alignment through padding on the infix that works for any control. We manually measure
26
- // spacing as provided by the Material Design specification. The outlined dimensions in the
27
- // spec section do not match with the text fields shown in the overview or the ones implemented
28
- // by MDC. Note that we need to account for the input box offset. See above for more context.
29
- $mat-form-field-with-label-input-padding-top: 24px;
30
- $mat-form-field-with-label-input-padding-bottom: 8px;
31
-
32
- // Vertical spacing of the text-field if there is no label. We manually measure the
33
- // spacing in the specs. See comment above for padding for text fields with label. The
34
- // same reasoning applies to the padding for text fields without label.
35
- $mat-form-field-no-label-padding-bottom: 16px;
36
- $mat-form-field-no-label-padding-top: 16px;
37
-
38
- // The amount of padding between the icon prefix/suffix and the infix.
39
- // This assumes that the icon will be a 24px square with 12px padding.
40
- $mat-form-field-icon-prefix-infix-padding: 4px;