@angular/material 12.1.0-rc.0 → 12.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 (53) hide show
  1. package/badge/_badge-theme.scss +64 -45
  2. package/bundles/material-core.umd.js +9 -7
  3. package/bundles/material-core.umd.js.map +1 -1
  4. package/bundles/material-datepicker.umd.js +11 -19
  5. package/bundles/material-datepicker.umd.js.map +1 -1
  6. package/bundles/material-radio.umd.js +12 -13
  7. package/bundles/material-radio.umd.js.map +1 -1
  8. package/bundles/material-slide-toggle.umd.js +1 -1
  9. package/bundles/material-tabs.umd.js +6 -0
  10. package/bundles/material-tabs.umd.js.map +1 -1
  11. package/bundles/material-tooltip.umd.js +7 -0
  12. package/bundles/material-tooltip.umd.js.map +1 -1
  13. package/core/common-behaviors/error-state.d.ts +5 -1
  14. package/core/index.metadata.json +1 -1
  15. package/datepicker/index.metadata.json +1 -1
  16. package/esm2015/core/common-behaviors/common-module.js +1 -1
  17. package/esm2015/core/common-behaviors/error-state.js +8 -6
  18. package/esm2015/core/version.js +1 -1
  19. package/esm2015/datepicker/calendar-body.js +1 -3
  20. package/esm2015/datepicker/calendar.js +6 -14
  21. package/esm2015/datepicker/date-range-input.js +4 -2
  22. package/esm2015/datepicker/month-view.js +2 -2
  23. package/esm2015/datepicker/multi-year-view.js +2 -2
  24. package/esm2015/datepicker/year-view.js +2 -2
  25. package/esm2015/radio/radio.js +13 -14
  26. package/esm2015/slide-toggle/slide-toggle.js +1 -1
  27. package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +7 -1
  28. package/esm2015/tooltip/tooltip.js +8 -1
  29. package/fesm2015/core.js +9 -7
  30. package/fesm2015/core.js.map +1 -1
  31. package/fesm2015/datepicker.js +11 -19
  32. package/fesm2015/datepicker.js.map +1 -1
  33. package/fesm2015/radio.js +12 -13
  34. package/fesm2015/radio.js.map +1 -1
  35. package/fesm2015/slide-toggle.js +1 -1
  36. package/fesm2015/tabs.js +6 -0
  37. package/fesm2015/tabs.js.map +1 -1
  38. package/fesm2015/tooltip.js +7 -0
  39. package/fesm2015/tooltip.js.map +1 -1
  40. package/package.json +2 -2
  41. package/prebuilt-themes/deeppurple-amber.css +1 -1
  42. package/prebuilt-themes/indigo-pink.css +1 -1
  43. package/prebuilt-themes/pink-bluegrey.css +1 -1
  44. package/prebuilt-themes/purple-green.css +1 -1
  45. package/radio/index.metadata.json +1 -1
  46. package/radio/radio.d.ts +2 -5
  47. package/schematics/ng-add/index.js +1 -1
  48. package/schematics/ng-add/index.mjs +1 -1
  49. package/slide-toggle/index.metadata.json +1 -1
  50. package/tabs/index.metadata.json +1 -1
  51. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +1 -0
  52. package/tooltip/index.metadata.json +1 -1
  53. package/tooltip/tooltip.d.ts +6 -0
@@ -15,6 +15,7 @@ $font-weight: 600;
15
15
  $default-size: 22px !default;
16
16
  $small-size: $default-size - 6;
17
17
  $large-size: $default-size + 6;
18
+ $_badge-structure-emitted: false !default;
18
19
 
19
20
  // Mixin for building offset given different sizes
20
21
  @mixin _badge-size($size) {
@@ -94,6 +95,57 @@ $large-size: $default-size + 6;
94
95
  // stylelint-enable
95
96
  }
96
97
 
98
+ // Structural styles for the badge. They have to be included as a part of the theme,
99
+ // because the badge is a directive and we have no other way of attaching styles to it.
100
+ @mixin _badge-structure {
101
+ .mat-badge {
102
+ position: relative;
103
+ }
104
+
105
+ .mat-badge-hidden {
106
+ .mat-badge-content {
107
+ display: none;
108
+ }
109
+ }
110
+
111
+ .mat-badge-content {
112
+ position: absolute;
113
+ text-align: center;
114
+ display: inline-block;
115
+ border-radius: 50%;
116
+ transition: transform 200ms ease-in-out;
117
+ transform: scale(0.6);
118
+ overflow: hidden;
119
+ white-space: nowrap;
120
+ text-overflow: ellipsis;
121
+ pointer-events: none;
122
+ }
123
+
124
+ .ng-animate-disabled .mat-badge-content,
125
+ .mat-badge-content._mat-animation-noopable {
126
+ transition: none;
127
+ }
128
+
129
+ // The active class is added after the element is added
130
+ // so it can animate scale to default
131
+ .mat-badge-content.mat-badge-active {
132
+ // Scale to `none` instead of `1` to avoid blurry text in some browsers.
133
+ transform: none;
134
+ }
135
+
136
+ .mat-badge-small {
137
+ @include _badge-size($small-size);
138
+ }
139
+
140
+ .mat-badge-medium {
141
+ @include _badge-size($default-size);
142
+ }
143
+
144
+ .mat-badge-large {
145
+ @include _badge-size($large-size);
146
+ }
147
+ }
148
+
97
149
  @mixin color($config-or-theme) {
98
150
  $config: theming.get-color-config($config-or-theme);
99
151
  $accent: map.get($config, accent);
@@ -126,16 +178,6 @@ $large-size: $default-size + 6;
126
178
  }
127
179
  }
128
180
 
129
- .mat-badge {
130
- position: relative;
131
- }
132
-
133
- .mat-badge-hidden {
134
- .mat-badge-content {
135
- display: none;
136
- }
137
- }
138
-
139
181
  .mat-badge-disabled {
140
182
  .mat-badge-content {
141
183
  $app-background: theming.get-color-from-palette($background, 'background');
@@ -157,41 +199,6 @@ $large-size: $default-size + 6;
157
199
  color: theming.get-color-from-palette($foreground, disabled-text);
158
200
  }
159
201
  }
160
-
161
- .mat-badge-content {
162
- position: absolute;
163
- text-align: center;
164
- display: inline-block;
165
- border-radius: 50%;
166
- transition: transform 200ms ease-in-out;
167
- transform: scale(0.6);
168
- overflow: hidden;
169
- white-space: nowrap;
170
- text-overflow: ellipsis;
171
- pointer-events: none;
172
- }
173
-
174
- .ng-animate-disabled .mat-badge-content,
175
- .mat-badge-content._mat-animation-noopable {
176
- transition: none;
177
- }
178
-
179
- // The active class is added after the element is added
180
- // so it can animate scale to default
181
- .mat-badge-content.mat-badge-active {
182
- // Scale to `none` instead of `1` to avoid blurry text in some browsers.
183
- transform: none;
184
- }
185
-
186
- .mat-badge-small {
187
- @include _badge-size($small-size);
188
- }
189
- .mat-badge-medium {
190
- @include _badge-size($default-size);
191
- }
192
- .mat-badge-large {
193
- @include _badge-size($large-size);
194
- }
195
202
  }
196
203
 
197
204
  @mixin typography($config-or-theme) {
@@ -222,6 +229,18 @@ $large-size: $default-size + 6;
222
229
  $density: theming.get-density-config($theme);
223
230
  $typography: theming.get-typography-config($theme);
224
231
 
232
+ // Try to reduce the number of times that the structural styles are emitted.
233
+ @if not $_badge-structure-emitted {
234
+ @include _badge-structure;
235
+
236
+ // Only flip the flag if the mixin is included at the top level. Otherwise the first
237
+ // inclusion might be inside of a theme class which will exclude the structural styles
238
+ // from all other themes.
239
+ @if not & {
240
+ $_badge-structure-emitted: true !global;
241
+ }
242
+ }
243
+
225
244
  @if $color != null {
226
245
  @include color($color);
227
246
  }
@@ -34,7 +34,7 @@
34
34
  * found in the LICENSE file at https://angular.io/license
35
35
  */
36
36
  /** Current version of Angular Material. */
37
- var VERSION$1 = new i0.Version('12.1.0-rc.0');
37
+ var VERSION$1 = new i0.Version('12.1.0');
38
38
 
39
39
  /**
40
40
  * @license
@@ -74,7 +74,7 @@
74
74
  // i.e. avoid core to depend on the @angular/material primary entry-point
75
75
  // Can be removed once the Material primary entry-point no longer
76
76
  // re-exports all secondary entry-points
77
- var VERSION = new i0.Version('12.1.0-rc.0');
77
+ var VERSION = new i0.Version('12.1.0');
78
78
  /** @docs-private */
79
79
  function MATERIAL_SANITY_CHECKS_FACTORY() {
80
80
  return true;
@@ -615,15 +615,17 @@
615
615
  args[_i] = arguments[_i];
616
616
  }
617
617
  var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
618
+ // This class member exists as an interop with `MatFormFieldControl` which expects
619
+ // a public `stateChanges` observable to emit whenever the form field should be updated.
620
+ // The description is not specifically mentioning the error state, as classes using this
621
+ // mixin can/should emit an event in other cases too.
622
+ /** Emits whenever the component state changes. */
623
+ _this.stateChanges = new rxjs.Subject();
618
624
  /** Whether the component is in an error state. */
619
625
  _this.errorState = false;
620
- /**
621
- * Stream that emits whenever the state of the input changes such that the wrapping
622
- * `MatFormField` needs to run change detection.
623
- */
624
- _this.stateChanges = new rxjs.Subject();
625
626
  return _this;
626
627
  }
628
+ /** Updates the error state based on the provided error state matcher. */
627
629
  class_1.prototype.updateErrorState = function () {
628
630
  var oldState = this.errorState;
629
631
  var parent = this._parentFormGroup || this._parentForm;