@angular/material-experimental 14.0.3 → 14.0.6

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/esm2020/mdc-button/button-base.mjs +1 -3
  2. package/esm2020/mdc-button/button.mjs +5 -5
  3. package/esm2020/mdc-button/fab.mjs +9 -9
  4. package/esm2020/mdc-button/icon-button.mjs +5 -7
  5. package/esm2020/mdc-checkbox/checkbox.mjs +2 -2
  6. package/esm2020/mdc-chips/chip-row.mjs +3 -3
  7. package/esm2020/mdc-core/option/option.mjs +2 -2
  8. package/esm2020/mdc-dialog/dialog-content-directives.mjs +1 -1
  9. package/esm2020/mdc-form-field/directives/notched-outline.mjs +10 -7
  10. package/esm2020/mdc-form-field/form-field.mjs +6 -11
  11. package/esm2020/mdc-list/list-option.mjs +2 -2
  12. package/esm2020/mdc-paginator/paginator.mjs +4 -4
  13. package/esm2020/mdc-slider/slider.mjs +17 -13
  14. package/esm2020/mdc-tabs/tab-header.mjs +2 -2
  15. package/esm2020/mdc-tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
  16. package/esm2020/selection/selection-module.mjs +2 -2
  17. package/esm2020/version.mjs +1 -1
  18. package/fesm2015/material-experimental.mjs +1 -1
  19. package/fesm2015/material-experimental.mjs.map +1 -1
  20. package/fesm2015/mdc-button.mjs +16 -20
  21. package/fesm2015/mdc-button.mjs.map +1 -1
  22. package/fesm2015/mdc-checkbox.mjs +2 -2
  23. package/fesm2015/mdc-checkbox.mjs.map +1 -1
  24. package/fesm2015/mdc-chips.mjs +2 -2
  25. package/fesm2015/mdc-chips.mjs.map +1 -1
  26. package/fesm2015/mdc-core.mjs +2 -2
  27. package/fesm2015/mdc-core.mjs.map +1 -1
  28. package/fesm2015/mdc-dialog.mjs.map +1 -1
  29. package/fesm2015/mdc-form-field.mjs +14 -16
  30. package/fesm2015/mdc-form-field.mjs.map +1 -1
  31. package/fesm2015/mdc-list.mjs +1 -1
  32. package/fesm2015/mdc-list.mjs.map +1 -1
  33. package/fesm2015/mdc-paginator.mjs +3 -3
  34. package/fesm2015/mdc-paginator.mjs.map +1 -1
  35. package/fesm2015/mdc-slider.mjs +17 -12
  36. package/fesm2015/mdc-slider.mjs.map +1 -1
  37. package/fesm2015/mdc-tabs.mjs +4 -4
  38. package/fesm2015/mdc-tabs.mjs.map +1 -1
  39. package/fesm2015/selection.mjs.map +1 -1
  40. package/fesm2020/material-experimental.mjs +1 -1
  41. package/fesm2020/material-experimental.mjs.map +1 -1
  42. package/fesm2020/mdc-button.mjs +16 -20
  43. package/fesm2020/mdc-button.mjs.map +1 -1
  44. package/fesm2020/mdc-checkbox.mjs +2 -2
  45. package/fesm2020/mdc-checkbox.mjs.map +1 -1
  46. package/fesm2020/mdc-chips.mjs +2 -2
  47. package/fesm2020/mdc-chips.mjs.map +1 -1
  48. package/fesm2020/mdc-core.mjs +2 -2
  49. package/fesm2020/mdc-core.mjs.map +1 -1
  50. package/fesm2020/mdc-dialog.mjs.map +1 -1
  51. package/fesm2020/mdc-form-field.mjs +14 -16
  52. package/fesm2020/mdc-form-field.mjs.map +1 -1
  53. package/fesm2020/mdc-list.mjs +1 -1
  54. package/fesm2020/mdc-list.mjs.map +1 -1
  55. package/fesm2020/mdc-paginator.mjs +3 -3
  56. package/fesm2020/mdc-paginator.mjs.map +1 -1
  57. package/fesm2020/mdc-slider.mjs +16 -12
  58. package/fesm2020/mdc-slider.mjs.map +1 -1
  59. package/fesm2020/mdc-tabs.mjs +4 -4
  60. package/fesm2020/mdc-tabs.mjs.map +1 -1
  61. package/fesm2020/selection.mjs.map +1 -1
  62. package/mdc-button/_button-theme-private.scss +2 -1
  63. package/mdc-button/index.d.ts +1 -5
  64. package/mdc-checkbox/_checkbox-theme.scss +7 -1
  65. package/mdc-core/mdc-helpers/_mdc-helpers.scss +8 -0
  66. package/mdc-core/theming/prebuilt/deeppurple-amber.css +1 -1
  67. package/mdc-core/theming/prebuilt/indigo-pink.css +1 -1
  68. package/mdc-core/theming/prebuilt/pink-bluegrey.css +1 -1
  69. package/mdc-core/theming/prebuilt/purple-green.css +1 -1
  70. package/mdc-dialog/index.d.ts +1 -1
  71. package/mdc-form-field/_form-field-density.scss +2 -1
  72. package/mdc-form-field/_form-field-theme.scss +25 -1
  73. package/mdc-form-field/index.d.ts +5 -5
  74. package/mdc-list/index.d.ts +1 -1
  75. package/mdc-paginator/_paginator-theme.scss +15 -1
  76. package/mdc-paginator/index.d.ts +1 -1
  77. package/mdc-radio/_radio-theme.scss +7 -1
  78. package/mdc-slide-toggle/_slide-toggle-theme.scss +6 -0
  79. package/mdc-slider/index.d.ts +4 -0
  80. package/mdc-tabs/_tabs-common.scss +5 -2
  81. package/package.json +3 -3
@@ -118,7 +118,7 @@ export declare class MatDialogClose implements OnInit, OnChanges {
118
118
  dialogRef: MatDialogRef<any>;
119
119
  private _elementRef;
120
120
  private _dialog;
121
- /** Screenreader label for the button. */
121
+ /** Screen-reader label for the button. */
122
122
  ariaLabel: string;
123
123
  /** Default to "button" to prevents accidental form submits. */
124
124
  type: 'submit' | 'button' | 'reset';
@@ -88,7 +88,8 @@
88
88
  .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded
89
89
  .mdc-floating-label--float-above {
90
90
  --mat-mdc-form-field-label-transform: translateY(
91
- -#{mdc-textfield.get-outlined-label-position-y($height)}) scale(0.75);
91
+ -#{mdc-textfield.get-outlined-label-position-y($height)})
92
+ scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));
92
93
  transform: var(--mat-mdc-form-field-label-transform);
93
94
  }
94
95
 
@@ -58,6 +58,29 @@
58
58
  .mat-mdc-form-field.mat-warn {
59
59
  @include _color-styles(error);
60
60
  }
61
+
62
+ // This fixes an issue where the notch appears to be thicker than the rest of the outline when
63
+ // zoomed in on Chrome. The border inconsistency seems to be some kind of rendering artifact
64
+ // that arises from a combination of the fact that the notch contains text, while the leading
65
+ // and trailing outline do not, combined with the fact that the border is semi-transparent.
66
+ // Experimentally, I discovered that adding a transparent left border fixes the inconsistency.
67
+ // Note: class name is repeated to achieve sufficient specificity over the various MDC states.
68
+ // (hover, focus, etc.)
69
+ // TODO(mmalerba): port this fix into MDC
70
+ .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field {
71
+ &.mat-mdc-form-field .mdc-notched-outline__notch {
72
+ border-left: 1px solid transparent;
73
+ }
74
+ }
75
+
76
+ [dir='rtl'] {
77
+ .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field {
78
+ &.mat-mdc-form-field .mdc-notched-outline__notch {
79
+ border-left: none;
80
+ border-right: 1px solid transparent;
81
+ }
82
+ }
83
+ }
61
84
  }
62
85
  }
63
86
  }
@@ -90,7 +113,8 @@
90
113
  // For the non-upgraded notch label (i.e. when rendered on the server), also
91
114
  // use the correct `body1` typography level.
92
115
  .mdc-floating-label--float-above {
93
- font-size: mdc-typography.get-size(body1) * 0.75;
116
+ font-size: calc(#{
117
+ mdc-typography.get-size(body1)} * var(--mat-mdc-form-field-floating-label-scale, 0.75));
94
118
  }
95
119
  .mdc-notched-outline--upgraded .mdc-floating-label--float-above {
96
120
  font-size: mdc-typography.get-size(body1);
@@ -192,8 +192,8 @@ export declare class MatFormField implements AfterContentInit, AfterContentCheck
192
192
  readonly _hintLabelId: string;
193
193
  /** State of the mat-hint and mat-error animations. */
194
194
  _subscriptAnimationState: string;
195
- /** Width of the outline notch. */
196
- _outlineNotchWidth: number;
195
+ /** Width of the label element (at scale=1). */
196
+ _labelWidth: number;
197
197
  /** Gets the current form field control */
198
198
  get _control(): MatFormFieldControl<any>;
199
199
  set _control(value: MatFormFieldControl<any>);
@@ -380,15 +380,15 @@ export declare class MatFormFieldModule {
380
380
  declare class MatFormFieldNotchedOutline implements AfterViewInit {
381
381
  private _elementRef;
382
382
  private _ngZone;
383
- /** Width of the notch. */
384
- width: number;
383
+ /** Width of the label (original scale) */
384
+ labelWidth: number;
385
385
  /** Whether the notch should be opened. */
386
386
  open: boolean;
387
387
  constructor(_elementRef: ElementRef<HTMLElement>, _ngZone: NgZone);
388
388
  ngAfterViewInit(): void;
389
389
  _getNotchWidth(): string | null;
390
390
  static ɵfac: i0.ɵɵFactoryDeclaration<MatFormFieldNotchedOutline, never>;
391
- static ɵcmp: i0.ɵɵComponentDeclaration<MatFormFieldNotchedOutline, "div[matFormFieldNotchedOutline]", never, { "width": "matFormFieldNotchedOutlineWidth"; "open": "matFormFieldNotchedOutlineOpen"; }, {}, never, ["*"], false>;
391
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatFormFieldNotchedOutline, "div[matFormFieldNotchedOutline]", never, { "labelWidth": "matFormFieldNotchedOutlineLabelWidth"; "open": "matFormFieldNotchedOutlineOpen"; }, {}, never, ["*"], false>;
392
392
  }
393
393
 
394
394
  /** Hint text to be shown underneath the form field control. */
@@ -364,7 +364,7 @@ export declare class MatListOption extends MatListItemBase implements ListOption
364
364
  * list changed.
365
365
  */
366
366
  _markForCheck(): void;
367
- /** Toggles the option's value based on a user interacion. */
367
+ /** Toggles the option's value based on a user interaction. */
368
368
  _toggleOnInteraction(): void;
369
369
  /** Sets the tabindex of the list option. */
370
370
  _setTabindex(value: number): void;
@@ -1,7 +1,9 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
1
3
  @use '@angular/material' as mat;
2
4
  @use '@material/density' as mdc-density;
3
5
  @use '@material/typography' as mdc-typography;
4
- @use 'sass:map';
6
+ @use '../mdc-form-field/form-field-theme';
5
7
 
6
8
  @use '../mdc-core/mdc-helpers/mdc-helpers';
7
9
  @use './paginator-variables';
@@ -67,6 +69,18 @@
67
69
  $height: mdc-density.prop-value(
68
70
  paginator-variables.$density-config, $density-scale, height);
69
71
 
72
+ .mat-mdc-paginator {
73
+ // We need the form field to be narrower in order to fit into the paginator,
74
+ // so we set its density to be -4 or denser.
75
+ @if ((meta.type-of($density-scale) == 'number' and $density-scale >= -4) or
76
+ $density-scale == maximum) {
77
+ @include form-field-theme.density(-4);
78
+ }
79
+ @else {
80
+ @include form-field-theme.density($density-scale);
81
+ }
82
+ }
83
+
70
84
  .mat-mdc-paginator-container {
71
85
  min-height: $height;
72
86
  }
@@ -36,7 +36,7 @@ export { MAT_PAGINATOR_INTL_PROVIDER_FACTORY }
36
36
  export declare class MatPaginator extends _MatPaginatorBase<MatPaginatorDefaultOptions> {
37
37
  /** If set, styles the "page size" form field with the designated style. */
38
38
  _formFieldAppearance?: MatFormFieldAppearance;
39
- /** ID for the DOM node containing the pagiators's items per page label. */
39
+ /** ID for the DOM node containing the paginator's items per page label. */
40
40
  readonly _pageSizeLabelId: string;
41
41
  constructor(intl: MatPaginatorIntl, changeDetectorRef: ChangeDetectorRef, defaults?: MatPaginatorDefaultOptions);
42
42
  static ɵfac: i0.ɵɵFactoryDeclaration<MatPaginator, [null, null, { optional: true; }]>;
@@ -22,6 +22,7 @@
22
22
  $primary: mat.get-color-from-palette(map.get($config, primary));
23
23
  $accent: mat.get-color-from-palette(map.get($config, accent));
24
24
  $warn: mat.get-color-from-palette(map.get($config, warn));
25
+ $foreground: map.get($config, foreground);
25
26
 
26
27
  @include mdc-helpers.mat-using-mdc-theme($config) {
27
28
  $on-surface: rgba(mdc-theme-color.$on-surface, 0.54);
@@ -47,6 +48,11 @@
47
48
 
48
49
  --mat-mdc-radio-ripple-color: #{mdc-theme-color.prop-value(on-surface)};
49
50
 
51
+ // MDC should set the disabled color on the label, but doesn't, so we do it here instead.
52
+ .mdc-radio--disabled + label {
53
+ color: mat.get-color-from-palette($foreground, disabled-text);
54
+ }
55
+
50
56
  &.mat-primary {
51
57
  @include _color-palette($primary);
52
58
  }
@@ -77,7 +83,7 @@
77
83
  @include mdc-radio-theme.density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
78
84
  }
79
85
 
80
- @if ($density-scale == -2 or $density-scale == 'minimum') {
86
+ @include mdc-helpers.if-touch-targets-unsupported($density-scale) {
81
87
  .mat-mdc-radio-touch-target {
82
88
  display: none;
83
89
  }
@@ -74,6 +74,7 @@
74
74
  $accent: mat.get-color-from-palette(map.get($config, accent));
75
75
  $warn: mat.get-color-from-palette(map.get($config, warn));
76
76
  $is-dark: map.get($config, is-dark);
77
+ $foreground: map.get($config, foreground);
77
78
 
78
79
  @include mdc-helpers.mat-using-mdc-theme($config) {
79
80
  // MDC's switch doesn't support a `color` property. We add support
@@ -82,6 +83,11 @@
82
83
  @include mdc-form-field.core-styles($query: mdc-helpers.$mat-theme-styles-query);
83
84
  @include mdc-switch-theme.theme(_get-theme-base-map($is-dark));
84
85
 
86
+ // MDC should set the disabled color on the label, but doesn't, so we do it here instead.
87
+ .mdc-switch--disabled + label {
88
+ color: mat.get-color-from-palette($foreground, disabled-text);
89
+ }
90
+
85
91
  &.mat-primary {
86
92
  @include mdc-switch-theme.theme(_get-theme-color-map($primary));
87
93
  }
@@ -138,6 +138,8 @@ export declare class MatSlider extends _MatSliderMixinBase implements AfterViewI
138
138
  private _resizeObserver;
139
139
  /** Timeout used to debounce resize listeners. */
140
140
  private _resizeTimer;
141
+ /** Cached dimensions of the host element. */
142
+ private _cachedHostRect;
141
143
  constructor(_ngZone: NgZone, _cdr: ChangeDetectorRef, elementRef: ElementRef<HTMLElement>, _platform: Platform, _globalChangeAndInputListener: GlobalChangeAndInputListener<'input' | 'change'>, document: any, _dir: Directionality, _globalRippleOptions?: RippleGlobalOptions | undefined, animationMode?: string);
142
144
  ngAfterViewInit(): void;
143
145
  ngOnDestroy(): void;
@@ -203,6 +205,8 @@ export declare class MatSlider extends _MatSliderMixinBase implements AfterViewI
203
205
  _getTickMarkClass(tickMark: TickMark): string;
204
206
  /** Whether the slider thumb ripples should be disabled. */
205
207
  _isRippleDisabled(): boolean;
208
+ /** Gets the dimensions of the host element. */
209
+ _getHostDimensions(): DOMRect;
206
210
  /** Starts observing and updating the slider if the host changes its size. */
207
211
  private _observeHostResize;
208
212
  static ɵfac: i0.ɵɵFactoryDeclaration<MatSlider, [null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
@@ -171,8 +171,11 @@ $mat-tab-animation-duration: 500ms !default;
171
171
 
172
172
  // The `span` is in the selector in order to increase the specificity, ensuring
173
173
  // that it's always higher than the selector that declares the transition.
174
- ._mat-animation-noopable span.mdc-tab-indicator__content {
175
- transition: none;
174
+ ._mat-animation-noopable {
175
+ span.mdc-tab-indicator__content,
176
+ span.mdc-tab__text-label {
177
+ transition: none;
178
+ }
176
179
  }
177
180
  }
178
181
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/material-experimental",
3
- "version": "14.0.3",
3
+ "version": "14.0.6",
4
4
  "description": "Experimental components for Angular Material",
5
5
  "repository": {
6
6
  "type": "git",
@@ -426,12 +426,12 @@
426
426
  },
427
427
  "peerDependencies": {
428
428
  "@angular/animations": "^14.0.0 || ^15.0.0",
429
- "@angular/cdk": "14.0.3",
429
+ "@angular/cdk": "14.0.6",
430
430
  "@angular/core": "^14.0.0 || ^15.0.0",
431
431
  "@angular/common": "^14.0.0 || ^15.0.0",
432
432
  "@angular/forms": "^14.0.0 || ^15.0.0",
433
433
  "@angular/platform-browser": "^14.0.0 || ^15.0.0",
434
- "@angular/material": "14.0.3"
434
+ "@angular/material": "14.0.6"
435
435
  },
436
436
  "dependencies": {
437
437
  "tslib": "^2.3.0",