@angular/material 12.2.4 → 12.2.8

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 (103) hide show
  1. package/autocomplete/index.metadata.json +1 -1
  2. package/badge/badge.d.ts +15 -14
  3. package/badge/index.metadata.json +1 -1
  4. package/bundles/material-autocomplete.umd.js +4 -2
  5. package/bundles/material-autocomplete.umd.js.map +1 -1
  6. package/bundles/material-badge.umd.js +77 -79
  7. package/bundles/material-badge.umd.js.map +1 -1
  8. package/bundles/material-button-testing.umd.js +1 -9
  9. package/bundles/material-button-testing.umd.js.map +1 -1
  10. package/bundles/material-chips.umd.js +4 -2
  11. package/bundles/material-chips.umd.js.map +1 -1
  12. package/bundles/material-core.umd.js +7 -17
  13. package/bundles/material-core.umd.js.map +1 -1
  14. package/bundles/material-datepicker.umd.js +1 -1
  15. package/bundles/material-datepicker.umd.js.map +1 -1
  16. package/bundles/material-expansion.umd.js +1 -1
  17. package/bundles/material-form-field.umd.js +1 -1
  18. package/bundles/material-list.umd.js +3 -3
  19. package/bundles/material-menu.umd.js +109 -93
  20. package/bundles/material-menu.umd.js.map +1 -1
  21. package/bundles/material-select.umd.js +3 -1
  22. package/bundles/material-select.umd.js.map +1 -1
  23. package/bundles/material-snack-bar-testing.umd.js +19 -20
  24. package/bundles/material-snack-bar-testing.umd.js.map +1 -1
  25. package/bundles/material-stepper.umd.js +2 -2
  26. package/bundles/material-tabs.umd.js +22 -8
  27. package/bundles/material-tabs.umd.js.map +1 -1
  28. package/chips/index.metadata.json +1 -1
  29. package/core/common-behaviors/common-module.d.ts +0 -4
  30. package/core/index.metadata.json +1 -1
  31. package/core/typography/_typography.scss +7 -2
  32. package/datepicker/_datepicker-theme.scss +1 -4
  33. package/esm2015/autocomplete/autocomplete-trigger.js +2 -2
  34. package/esm2015/autocomplete/autocomplete.js +4 -2
  35. package/esm2015/badge/badge.js +63 -80
  36. package/esm2015/button/testing/button-harness.js +3 -10
  37. package/esm2015/chips/chip-list.js +5 -3
  38. package/esm2015/core/common-behaviors/common-module.js +4 -13
  39. package/esm2015/core/version.js +1 -1
  40. package/esm2015/datepicker/date-range-input.js +2 -2
  41. package/esm2015/expansion/expansion-panel-header.js +1 -1
  42. package/esm2015/form-field/form-field.js +1 -1
  43. package/esm2015/list/list.js +2 -2
  44. package/esm2015/list/selection-list.js +1 -1
  45. package/esm2015/menu/menu-content.js +16 -11
  46. package/esm2015/menu/menu-module.js +10 -20
  47. package/esm2015/menu/menu-trigger.js +33 -21
  48. package/esm2015/menu/public-api.js +2 -2
  49. package/esm2015/select/select.js +4 -2
  50. package/esm2015/snack-bar/testing/snack-bar-harness.js +20 -21
  51. package/esm2015/stepper/step-header.js +1 -1
  52. package/esm2015/stepper/stepper.js +1 -1
  53. package/esm2015/tabs/public-api.js +2 -2
  54. package/esm2015/tabs/tab-group.js +1 -1
  55. package/esm2015/tabs/tab-label.js +16 -2
  56. package/esm2015/tabs/tab.js +9 -8
  57. package/expansion/index.metadata.json +1 -1
  58. package/fesm2015/autocomplete.js +4 -2
  59. package/fesm2015/autocomplete.js.map +1 -1
  60. package/fesm2015/badge.js +62 -79
  61. package/fesm2015/badge.js.map +1 -1
  62. package/fesm2015/button/testing.js +2 -9
  63. package/fesm2015/button/testing.js.map +1 -1
  64. package/fesm2015/chips.js +4 -2
  65. package/fesm2015/chips.js.map +1 -1
  66. package/fesm2015/core.js +4 -14
  67. package/fesm2015/core.js.map +1 -1
  68. package/fesm2015/datepicker.js +1 -1
  69. package/fesm2015/datepicker.js.map +1 -1
  70. package/fesm2015/expansion.js +1 -1
  71. package/fesm2015/form-field.js +1 -1
  72. package/fesm2015/list.js +3 -3
  73. package/fesm2015/menu.js +57 -50
  74. package/fesm2015/menu.js.map +1 -1
  75. package/fesm2015/select.js +3 -1
  76. package/fesm2015/select.js.map +1 -1
  77. package/fesm2015/snack-bar/testing.js +19 -20
  78. package/fesm2015/snack-bar/testing.js.map +1 -1
  79. package/fesm2015/stepper.js +2 -2
  80. package/fesm2015/tabs.js +23 -8
  81. package/fesm2015/tabs.js.map +1 -1
  82. package/form-field/index.metadata.json +1 -1
  83. package/list/index.metadata.json +1 -1
  84. package/menu/index.metadata.json +1 -1
  85. package/menu/menu-content.d.ts +6 -4
  86. package/menu/menu-module.d.ts +0 -6
  87. package/menu/menu-trigger.d.ts +7 -2
  88. package/menu/public-api.d.ts +1 -1
  89. package/package.json +2 -2
  90. package/prebuilt-themes/deeppurple-amber.css +1 -1
  91. package/prebuilt-themes/indigo-pink.css +1 -1
  92. package/prebuilt-themes/pink-bluegrey.css +1 -1
  93. package/prebuilt-themes/purple-green.css +1 -1
  94. package/schematics/ng-add/index.js +1 -1
  95. package/schematics/ng-add/index.mjs +1 -1
  96. package/select/index.metadata.json +1 -1
  97. package/snack-bar/testing/snack-bar-harness.d.ts +8 -9
  98. package/stepper/index.metadata.json +1 -1
  99. package/tabs/index.metadata.json +1 -1
  100. package/tabs/public-api.d.ts +1 -1
  101. package/tabs/tab-group.d.ts +1 -1
  102. package/tabs/tab-label.d.ts +8 -1
  103. package/tabs/tab.d.ts +1 -1
@@ -142,7 +142,7 @@ MatStepHeader.decorators = [
142
142
  },
143
143
  encapsulation: ViewEncapsulation.None,
144
144
  changeDetection: ChangeDetectionStrategy.OnPush,
145
- styles: [".mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:transparent}.mat-step-optional,.mat-step-sub-label-error{font-size:12px}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative}.mat-step-icon-content,.mat-step-icon .mat-icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}\n"]
145
+ styles: [".mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:transparent}.cdk-high-contrast-active .mat-step-header{outline:solid 1px}.cdk-high-contrast-active .mat-step-header.cdk-keyboard-focused,.cdk-high-contrast-active .mat-step-header.cdk-program-focused{outline:solid 3px}.cdk-high-contrast-active .mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.mat-step-optional,.mat-step-sub-label-error{font-size:12px}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative}.mat-step-icon-content,.mat-step-icon .mat-icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}\n"]
146
146
  },] }
147
147
  ];
148
148
  MatStepHeader.ctorParameters = () => [
@@ -403,7 +403,7 @@ MatStepper.decorators = [
403
403
  ],
404
404
  encapsulation: ViewEncapsulation.None,
405
405
  changeDetection: ChangeDetectionStrategy.OnPush,
406
- styles: [".mat-stepper-vertical,.mat-stepper-horizontal{display:block}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:\"\";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content[aria-expanded=false]{height:0;overflow:hidden}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:\"\";position:absolute;left:0;border-left-width:1px;border-left-style:solid}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}\n"]
406
+ styles: [".mat-stepper-vertical,.mat-stepper-horizontal{display:block}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:\"\";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content[aria-expanded=false]{height:0;overflow:hidden}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.cdk-high-contrast-active .mat-horizontal-content-container{outline:solid 1px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}.cdk-high-contrast-active .mat-vertical-content-container{outline:solid 1px}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:\"\";position:absolute;left:0;border-left-width:1px;border-left-style:solid}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}\n"]
407
407
  },] }
408
408
  ];
409
409
  MatStepper.ctorParameters = () => [
package/fesm2015/tabs.js CHANGED
@@ -2,7 +2,7 @@ import { FocusKeyManager, FocusMonitor, A11yModule } from '@angular/cdk/a11y';
2
2
  import { ObserversModule } from '@angular/cdk/observers';
3
3
  import { CdkPortal, TemplatePortal, CdkPortalOutlet, PortalModule } from '@angular/cdk/portal';
4
4
  import { DOCUMENT, CommonModule } from '@angular/common';
5
- import { InjectionToken, Directive, ElementRef, NgZone, Inject, Optional, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewContainerRef, ContentChild, ViewChild, Input, ComponentFactoryResolver, forwardRef, EventEmitter, ChangeDetectorRef, Output, QueryList, ContentChildren, Attribute, NgModule } from '@angular/core';
5
+ import { InjectionToken, Directive, ElementRef, NgZone, Inject, Optional, TemplateRef, ViewContainerRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ContentChild, ViewChild, Input, ComponentFactoryResolver, forwardRef, EventEmitter, ChangeDetectorRef, Output, QueryList, ContentChildren, Attribute, NgModule } from '@angular/core';
6
6
  import { mixinDisabled, mixinColor, mixinDisableRipple, mixinTabIndex, MAT_RIPPLE_GLOBAL_OPTIONS, RippleRenderer, MatCommonModule, MatRippleModule } from '@angular/material/core';
7
7
  import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
8
8
  import { Subject, Subscription, merge, fromEvent, of, timer } from 'rxjs';
@@ -142,8 +142,17 @@ MatTabContent.ctorParameters = () => [
142
142
  * retention of the class and its directive metadata.
143
143
  */
144
144
  const MAT_TAB_LABEL = new InjectionToken('MatTabLabel');
145
+ /**
146
+ * Used to provide a tab label to a tab without causing a circular dependency.
147
+ * @docs-private
148
+ */
149
+ const MAT_TAB = new InjectionToken('MAT_TAB');
145
150
  /** Used to flag tab labels for use with the portal directive */
146
151
  class MatTabLabel extends CdkPortal {
152
+ constructor(templateRef, viewContainerRef, _closestTab) {
153
+ super(templateRef, viewContainerRef);
154
+ this._closestTab = _closestTab;
155
+ }
147
156
  }
148
157
  MatTabLabel.decorators = [
149
158
  { type: Directive, args: [{
@@ -151,6 +160,11 @@ MatTabLabel.decorators = [
151
160
  providers: [{ provide: MAT_TAB_LABEL, useExisting: MatTabLabel }],
152
161
  },] }
153
162
  ];
163
+ MatTabLabel.ctorParameters = () => [
164
+ { type: TemplateRef },
165
+ { type: ViewContainerRef },
166
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_TAB,] }, { type: Optional }] }
167
+ ];
154
168
 
155
169
  /**
156
170
  * @license
@@ -219,11 +233,11 @@ class MatTab extends _MatTabBase {
219
233
  * @docs-private
220
234
  */
221
235
  _setTemplateLabelInput(value) {
222
- // Only update the templateLabel via query if there is actually
223
- // a MatTabLabel found. This works around an issue where a user may have
224
- // manually set `templateLabel` during creation mode, which would then get clobbered
225
- // by `undefined` when this query resolves.
226
- if (value) {
236
+ // Only update the label if the query managed to find one. This works around an issue where a
237
+ // user may have manually set `templateLabel` during creation mode, which would then get
238
+ // clobbered by `undefined` when the query resolves. Also note that we check that the closest
239
+ // tab matches the current one so that we don't pick up labels from nested tabs.
240
+ if (value && value._closestTab === this) {
227
241
  this._templateLabel = value;
228
242
  }
229
243
  }
@@ -236,7 +250,8 @@ MatTab.decorators = [
236
250
  // tslint:disable-next-line:validate-decorators
237
251
  changeDetection: ChangeDetectionStrategy.Default,
238
252
  encapsulation: ViewEncapsulation.None,
239
- exportAs: 'matTab'
253
+ exportAs: 'matTab',
254
+ providers: [{ provide: MAT_TAB, useExisting: MatTab }]
240
255
  },] }
241
256
  ];
242
257
  MatTab.ctorParameters = () => [
@@ -1742,5 +1757,5 @@ MatTabsModule.decorators = [
1742
1757
  * Generated bundle index. Do not edit.
1743
1758
  */
1744
1759
 
1745
- export { MAT_TABS_CONFIG, MAT_TAB_GROUP, MatInkBar, MatTab, MatTabBody, MatTabBodyPortal, MatTabChangeEvent, MatTabContent, MatTabGroup, MatTabHeader, MatTabLabel, MatTabLabelWrapper, MatTabLink, MatTabNav, MatTabsModule, _MAT_INK_BAR_POSITIONER, _MatTabBodyBase, _MatTabGroupBase, _MatTabHeaderBase, _MatTabLinkBase, _MatTabNavBase, matTabsAnimations, _MAT_INK_BAR_POSITIONER_FACTORY as ɵangular_material_src_material_tabs_tabs_a, MAT_TAB_LABEL as ɵangular_material_src_material_tabs_tabs_b, MAT_TAB_CONTENT as ɵangular_material_src_material_tabs_tabs_c, MatPaginatedTabHeader as ɵangular_material_src_material_tabs_tabs_d };
1760
+ export { MAT_TAB, MAT_TABS_CONFIG, MAT_TAB_GROUP, MatInkBar, MatTab, MatTabBody, MatTabBodyPortal, MatTabChangeEvent, MatTabContent, MatTabGroup, MatTabHeader, MatTabLabel, MatTabLabelWrapper, MatTabLink, MatTabNav, MatTabsModule, _MAT_INK_BAR_POSITIONER, _MatTabBodyBase, _MatTabGroupBase, _MatTabHeaderBase, _MatTabLinkBase, _MatTabNavBase, matTabsAnimations, _MAT_INK_BAR_POSITIONER_FACTORY as ɵangular_material_src_material_tabs_tabs_a, MAT_TAB_LABEL as ɵangular_material_src_material_tabs_tabs_b, MAT_TAB_CONTENT as ɵangular_material_src_material_tabs_tabs_c, MatPaginatedTabHeader as ɵangular_material_src_material_tabs_tabs_d };
1746
1761
  //# sourceMappingURL=tabs.js.map