@angular/material-experimental 14.0.2 → 14.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 (54) 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-form-field/directives/notched-outline.mjs +10 -7
  9. package/esm2020/mdc-form-field/form-field.mjs +6 -11
  10. package/esm2020/mdc-paginator/paginator.mjs +2 -2
  11. package/esm2020/version.mjs +1 -1
  12. package/fesm2015/material-experimental.mjs +1 -1
  13. package/fesm2015/material-experimental.mjs.map +1 -1
  14. package/fesm2015/mdc-button.mjs +16 -20
  15. package/fesm2015/mdc-button.mjs.map +1 -1
  16. package/fesm2015/mdc-checkbox.mjs +2 -2
  17. package/fesm2015/mdc-checkbox.mjs.map +1 -1
  18. package/fesm2015/mdc-chips.mjs +2 -2
  19. package/fesm2015/mdc-chips.mjs.map +1 -1
  20. package/fesm2015/mdc-core.mjs +2 -2
  21. package/fesm2015/mdc-core.mjs.map +1 -1
  22. package/fesm2015/mdc-form-field.mjs +14 -16
  23. package/fesm2015/mdc-form-field.mjs.map +1 -1
  24. package/fesm2015/mdc-paginator.mjs +2 -2
  25. package/fesm2015/mdc-paginator.mjs.map +1 -1
  26. package/fesm2020/material-experimental.mjs +1 -1
  27. package/fesm2020/material-experimental.mjs.map +1 -1
  28. package/fesm2020/mdc-button.mjs +16 -20
  29. package/fesm2020/mdc-button.mjs.map +1 -1
  30. package/fesm2020/mdc-checkbox.mjs +2 -2
  31. package/fesm2020/mdc-checkbox.mjs.map +1 -1
  32. package/fesm2020/mdc-chips.mjs +2 -2
  33. package/fesm2020/mdc-chips.mjs.map +1 -1
  34. package/fesm2020/mdc-core.mjs +2 -2
  35. package/fesm2020/mdc-core.mjs.map +1 -1
  36. package/fesm2020/mdc-form-field.mjs +14 -16
  37. package/fesm2020/mdc-form-field.mjs.map +1 -1
  38. package/fesm2020/mdc-paginator.mjs +2 -2
  39. package/fesm2020/mdc-paginator.mjs.map +1 -1
  40. package/mdc-button/_button-theme-private.scss +2 -1
  41. package/mdc-button/index.d.ts +1 -5
  42. package/mdc-checkbox/_checkbox-theme.scss +7 -1
  43. package/mdc-core/mdc-helpers/_mdc-helpers.scss +8 -0
  44. package/mdc-core/theming/prebuilt/deeppurple-amber.css +1 -1
  45. package/mdc-core/theming/prebuilt/indigo-pink.css +1 -1
  46. package/mdc-core/theming/prebuilt/pink-bluegrey.css +1 -1
  47. package/mdc-core/theming/prebuilt/purple-green.css +1 -1
  48. package/mdc-form-field/_form-field-density.scss +2 -1
  49. package/mdc-form-field/_form-field-theme.scss +25 -1
  50. package/mdc-form-field/index.d.ts +5 -5
  51. package/mdc-paginator/_paginator-theme.scss +15 -1
  52. package/mdc-radio/_radio-theme.scss +7 -1
  53. package/mdc-slide-toggle/_slide-toggle-theme.scss +6 -0
  54. package/package.json +3 -3
@@ -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. */
@@ -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
  }
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/material-experimental",
3
- "version": "14.0.2",
3
+ "version": "14.0.5",
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.2",
429
+ "@angular/cdk": "14.0.5",
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.2"
434
+ "@angular/material": "14.0.5"
435
435
  },
436
436
  "dependencies": {
437
437
  "tslib": "^2.3.0",