@angular/material 11.1.2 → 11.2.2

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 (199) hide show
  1. package/_theming.scss +162 -155
  2. package/autocomplete/_autocomplete-theme.import.scss +2 -0
  3. package/autocomplete/autocomplete.d.ts +1 -1
  4. package/badge/_badge-theme.import.scss +5 -0
  5. package/bottom-sheet/_bottom-sheet-theme.import.scss +4 -0
  6. package/bottom-sheet/bottom-sheet-container.d.ts +2 -0
  7. package/bottom-sheet/index.metadata.json +1 -1
  8. package/bundles/material-autocomplete.umd.js.map +1 -1
  9. package/bundles/material-bottom-sheet.umd.js +11 -3
  10. package/bundles/material-bottom-sheet.umd.js.map +1 -1
  11. package/bundles/material-bottom-sheet.umd.min.js +1 -1
  12. package/bundles/material-bottom-sheet.umd.min.js.map +1 -1
  13. package/bundles/material-core.umd.js +3 -3
  14. package/bundles/material-core.umd.js.map +1 -1
  15. package/bundles/material-core.umd.min.js +3 -3
  16. package/bundles/material-core.umd.min.js.map +1 -1
  17. package/bundles/material-datepicker.umd.js +21 -2
  18. package/bundles/material-datepicker.umd.js.map +1 -1
  19. package/bundles/material-datepicker.umd.min.js +1 -1
  20. package/bundles/material-datepicker.umd.min.js.map +1 -1
  21. package/bundles/material-form-field-testing.umd.js +137 -140
  22. package/bundles/material-form-field-testing.umd.js.map +1 -1
  23. package/bundles/material-form-field-testing.umd.min.js +3 -3
  24. package/bundles/material-form-field-testing.umd.min.js.map +1 -1
  25. package/bundles/material-form-field.umd.js +1 -1
  26. package/bundles/material-form-field.umd.min.js +1 -1
  27. package/bundles/material-form-field.umd.min.js.map +1 -1
  28. package/bundles/material-input.umd.js +4 -2
  29. package/bundles/material-input.umd.js.map +1 -1
  30. package/bundles/material-input.umd.min.js +1 -1
  31. package/bundles/material-input.umd.min.js.map +1 -1
  32. package/bundles/material-menu.umd.js +2 -2
  33. package/bundles/material-menu.umd.js.map +1 -1
  34. package/bundles/material-menu.umd.min.js +1 -1
  35. package/bundles/material-menu.umd.min.js.map +1 -1
  36. package/bundles/material-select.umd.js +8 -2
  37. package/bundles/material-select.umd.js.map +1 -1
  38. package/bundles/material-select.umd.min.js +5 -5
  39. package/bundles/material-select.umd.min.js.map +1 -1
  40. package/bundles/material-slide-toggle-testing.umd.js +60 -51
  41. package/bundles/material-slide-toggle-testing.umd.js.map +1 -1
  42. package/bundles/material-slide-toggle-testing.umd.min.js +2 -2
  43. package/bundles/material-slide-toggle-testing.umd.min.js.map +1 -1
  44. package/bundles/material-sort.umd.js +11 -3
  45. package/bundles/material-sort.umd.js.map +1 -1
  46. package/bundles/material-sort.umd.min.js +3 -3
  47. package/bundles/material-sort.umd.min.js.map +1 -1
  48. package/bundles/material-stepper.umd.js +6 -2
  49. package/bundles/material-stepper.umd.js.map +1 -1
  50. package/bundles/material-stepper.umd.min.js +1 -1
  51. package/bundles/material-stepper.umd.min.js.map +1 -1
  52. package/bundles/material-tabs.umd.js +8 -2
  53. package/bundles/material-tabs.umd.js.map +1 -1
  54. package/bundles/material-tabs.umd.min.js +4 -4
  55. package/bundles/material-tabs.umd.min.js.map +1 -1
  56. package/bundles/material-tooltip-testing.umd.js +44 -16
  57. package/bundles/material-tooltip-testing.umd.js.map +1 -1
  58. package/bundles/material-tooltip-testing.umd.min.js +1 -1
  59. package/bundles/material-tooltip-testing.umd.min.js.map +1 -1
  60. package/button/_button-base.import.scss +4 -0
  61. package/button/_button-theme.import.scss +3 -0
  62. package/button-toggle/_button-toggle-theme.import.scss +6 -0
  63. package/button-toggle/_button-toggle-variables.import.scss +1 -0
  64. package/card/_card-theme.import.scss +4 -0
  65. package/checkbox/_checkbox-theme.import.scss +3 -0
  66. package/chips/_chips-theme.import.scss +4 -0
  67. package/core/_core.import.scss +10 -0
  68. package/core/color/_all-color.import.scss +3 -0
  69. package/core/density/private/_all-density.import.scss +9 -0
  70. package/core/density/private/_compatibility.import.scss +1 -0
  71. package/core/focus-indicators/_focus-indicators.import.scss +3 -0
  72. package/core/index.metadata.json +1 -1
  73. package/core/option/_optgroup-theme.import.scss +4 -0
  74. package/core/option/_option-theme.import.scss +4 -0
  75. package/core/ripple/_ripple.import.scss +3 -0
  76. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.import.scss +2 -0
  77. package/core/style/_button-common.import.scss +2 -0
  78. package/core/style/_checkbox-common.import.scss +2 -0
  79. package/core/style/_elevation.import.scss +2 -0
  80. package/core/style/_form-common.import.scss +2 -0
  81. package/core/style/_layout-common.import.scss +1 -0
  82. package/core/style/_list-common.import.scss +1 -0
  83. package/core/style/_menu-common.import.scss +5 -0
  84. package/core/style/_private.import.scss +2 -0
  85. package/core/style/_variables.import.scss +1 -0
  86. package/core/style/_vendor-prefixes.import.scss +1 -0
  87. package/core/theming/_all-theme.import.scss +37 -0
  88. package/core/theming/_palette.import.scss +1 -0
  89. package/core/theming/_theming.import.scss +2 -0
  90. package/core/theming/_theming.scss +7 -4
  91. package/core/typography/_all-typography.import.scss +38 -0
  92. package/core/typography/_typography-utils.import.scss +1 -0
  93. package/core/typography/_typography.import.scss +2 -0
  94. package/datepicker/_datepicker-theme.import.scss +4 -0
  95. package/datepicker/datepicker-base.d.ts +9 -0
  96. package/datepicker/index.metadata.json +1 -1
  97. package/dialog/_dialog-theme.import.scss +4 -0
  98. package/divider/_divider-offset.import.scss +1 -0
  99. package/divider/_divider-theme.import.scss +3 -0
  100. package/esm2015/autocomplete/autocomplete.js +1 -1
  101. package/esm2015/bottom-sheet/bottom-sheet-container.js +12 -4
  102. package/esm2015/core/common-behaviors/common-module.js +1 -1
  103. package/esm2015/core/option/optgroup.js +2 -2
  104. package/esm2015/core/version.js +1 -1
  105. package/esm2015/datepicker/datepicker-base.js +13 -2
  106. package/esm2015/datepicker/datepicker-toggle.js +6 -2
  107. package/esm2015/form-field/form-field.js +1 -1
  108. package/esm2015/form-field/testing/form-field-harness.js +68 -76
  109. package/esm2015/input/input.js +5 -3
  110. package/esm2015/menu/menu-trigger.js +2 -2
  111. package/esm2015/menu/menu.js +1 -1
  112. package/esm2015/select/select.js +9 -3
  113. package/esm2015/slide-toggle/testing/slide-toggle-harness.js +29 -24
  114. package/esm2015/sort/sort.js +12 -5
  115. package/esm2015/stepper/stepper-animations.js +7 -3
  116. package/esm2015/tabs/tab-body.js +2 -2
  117. package/esm2015/tabs/tab-group.js +8 -2
  118. package/esm2015/tooltip/testing/tooltip-harness.js +14 -2
  119. package/expansion/_expansion-mixins.import.scss +1 -0
  120. package/expansion/_expansion-theme.import.scss +6 -0
  121. package/expansion/_expansion-variables.import.scss +1 -0
  122. package/fesm2015/autocomplete.js.map +1 -1
  123. package/fesm2015/bottom-sheet.js +11 -3
  124. package/fesm2015/bottom-sheet.js.map +1 -1
  125. package/fesm2015/core.js +3 -3
  126. package/fesm2015/core.js.map +1 -1
  127. package/fesm2015/datepicker.js +17 -2
  128. package/fesm2015/datepicker.js.map +1 -1
  129. package/fesm2015/form-field/testing.js +69 -77
  130. package/fesm2015/form-field/testing.js.map +1 -1
  131. package/fesm2015/form-field.js +1 -1
  132. package/fesm2015/input.js +4 -2
  133. package/fesm2015/input.js.map +1 -1
  134. package/fesm2015/menu.js +2 -2
  135. package/fesm2015/menu.js.map +1 -1
  136. package/fesm2015/select.js +8 -2
  137. package/fesm2015/select.js.map +1 -1
  138. package/fesm2015/slide-toggle/testing.js +29 -24
  139. package/fesm2015/slide-toggle/testing.js.map +1 -1
  140. package/fesm2015/sort.js +12 -5
  141. package/fesm2015/sort.js.map +1 -1
  142. package/fesm2015/stepper.js +6 -2
  143. package/fesm2015/stepper.js.map +1 -1
  144. package/fesm2015/tabs.js +8 -2
  145. package/fesm2015/tabs.js.map +1 -1
  146. package/fesm2015/tooltip/testing.js +13 -1
  147. package/fesm2015/tooltip/testing.js.map +1 -1
  148. package/form-field/_form-field-fill-theme.import.scss +5 -0
  149. package/form-field/_form-field-legacy-theme.import.scss +5 -0
  150. package/form-field/_form-field-outline-theme.import.scss +5 -0
  151. package/form-field/_form-field-standard-theme.import.scss +5 -0
  152. package/form-field/_form-field-theme.import.scss +9 -0
  153. package/form-field/index.metadata.json +1 -1
  154. package/form-field/testing/form-field-harness.d.ts +47 -32
  155. package/grid-list/_grid-list-theme.import.scss +5 -0
  156. package/icon/_icon-theme.import.scss +2 -0
  157. package/input/_input-theme.import.scss +6 -0
  158. package/input/index.metadata.json +1 -1
  159. package/list/_list-theme.import.scss +5 -0
  160. package/menu/_menu-theme.import.scss +4 -0
  161. package/menu/index.metadata.json +1 -1
  162. package/package.json +2 -2
  163. package/paginator/_paginator-theme.import.scss +5 -0
  164. package/paginator/_paginator-variables.import.scss +1 -0
  165. package/prebuilt-themes/deeppurple-amber.css +1 -1
  166. package/prebuilt-themes/indigo-pink.css +1 -1
  167. package/prebuilt-themes/pink-bluegrey.css +1 -1
  168. package/prebuilt-themes/purple-green.css +1 -1
  169. package/progress-bar/_progress-bar-theme.import.scss +3 -0
  170. package/progress-spinner/_progress-spinner-theme.import.scss +3 -0
  171. package/radio/_radio-theme.import.scss +4 -0
  172. package/schematics/ng-add/index.js +1 -1
  173. package/select/_select-theme.import.scss +5 -0
  174. package/select/index.metadata.json +1 -1
  175. package/select/select.d.ts +1 -1
  176. package/sidenav/_sidenav-theme.import.scss +3 -0
  177. package/slide-toggle/_slide-toggle-theme.import.scss +4 -0
  178. package/slide-toggle/testing/slide-toggle-harness.d.ts +19 -15
  179. package/slider/_slider-theme.import.scss +4 -0
  180. package/snack-bar/_snack-bar-theme.import.scss +4 -0
  181. package/sort/_sort-theme.import.scss +2 -0
  182. package/sort/index.metadata.json +1 -1
  183. package/sort/sort.d.ts +10 -1
  184. package/stepper/_stepper-theme.import.scss +5 -0
  185. package/stepper/_stepper-variables.import.scss +1 -0
  186. package/stepper/index.metadata.json +1 -1
  187. package/table/_table-flex-styles.import.scss +1 -0
  188. package/table/_table-flex-styles.scss +72 -0
  189. package/table/_table-theme.import.scss +4 -0
  190. package/tabs/_tabs-common.import.scss +4 -0
  191. package/tabs/_tabs-theme.import.scss +4 -0
  192. package/tabs/_tabs-theme.scss +3 -1
  193. package/tabs/index.metadata.json +1 -1
  194. package/tabs/tab-group.d.ts +3 -0
  195. package/toolbar/_toolbar-theme.import.scss +6 -0
  196. package/toolbar/_toolbar-variables.import.scss +1 -0
  197. package/tooltip/_tooltip-theme.import.scss +4 -0
  198. package/tree/_tree-theme.import.scss +4 -0
  199. package/tree/_tree-variables.import.scss +1 -0
@@ -1952,6 +1952,7 @@ class MatDatepickerBase {
1952
1952
  this.xPosition = 'start';
1953
1953
  /** Preferred position of the datepicker in the Y axis. */
1954
1954
  this.yPosition = 'below';
1955
+ this._restoreFocus = true;
1955
1956
  /**
1956
1957
  * Emits selected year in multiyear view.
1957
1958
  * This doesn't imply a change on the selected date.
@@ -2021,6 +2022,15 @@ class MatDatepickerBase {
2021
2022
  this.stateChanges.next(undefined);
2022
2023
  }
2023
2024
  }
2025
+ /**
2026
+ * Whether to restore focus to the previously-focused element when the calendar is closed.
2027
+ * Note that automatic focus restoration is an accessibility feature and it is recommended that
2028
+ * you provide your own equivalent, if you decide to turn it off.
2029
+ */
2030
+ get restoreFocus() { return this._restoreFocus; }
2031
+ set restoreFocus(value) {
2032
+ this._restoreFocus = coerceBooleanProperty(value);
2033
+ }
2024
2034
  /**
2025
2035
  * Classes to be passed to the date picker panel.
2026
2036
  * Supports string and string array values, similar to `ngClass`.
@@ -2149,7 +2159,7 @@ class MatDatepickerBase {
2149
2159
  this._focusedElementBeforeOpen = null;
2150
2160
  }
2151
2161
  };
2152
- if (this._focusedElementBeforeOpen &&
2162
+ if (this._restoreFocus && this._focusedElementBeforeOpen &&
2153
2163
  typeof this._focusedElementBeforeOpen.focus === 'function') {
2154
2164
  // Because IE moves focus asynchronously, we can't count on it being restored before we've
2155
2165
  // marked the datepicker as closed. If the event fires out of sequence and the element that
@@ -2319,6 +2329,7 @@ MatDatepickerBase.propDecorators = {
2319
2329
  disabled: [{ type: Input }],
2320
2330
  xPosition: [{ type: Input }],
2321
2331
  yPosition: [{ type: Input }],
2332
+ restoreFocus: [{ type: Input }],
2322
2333
  yearSelected: [{ type: Output }],
2323
2334
  monthSelected: [{ type: Output }],
2324
2335
  viewChanged: [{ type: Output }],
@@ -2854,7 +2865,7 @@ class MatDatepickerToggle {
2854
2865
  MatDatepickerToggle.decorators = [
2855
2866
  { type: Component, args: [{
2856
2867
  selector: 'mat-datepicker-toggle',
2857
- template: "<button\n #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <svg\n *ngIf=\"!_customIcon\"\n class=\"mat-datepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"/>\n </svg>\n\n <ng-content select=\"[matDatepickerToggleIcon]\"></ng-content>\n</button>\n",
2868
+ template: "<button\n #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datepicker ? 'dialog' : null\"\n [attr.aria-label]=\"ariaLabel || _intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\">\n\n <svg\n *ngIf=\"!_customIcon\"\n class=\"mat-datepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"/>\n </svg>\n\n <ng-content select=\"[matDatepickerToggleIcon]\"></ng-content>\n</button>\n",
2858
2869
  host: {
2859
2870
  'class': 'mat-datepicker-toggle',
2860
2871
  '[attr.tabindex]': 'null',
@@ -2863,6 +2874,10 @@ MatDatepickerToggle.decorators = [
2863
2874
  '[class.mat-warn]': 'datepicker && datepicker.color === "warn"',
2864
2875
  // Used by the test harness to tie this toggle to its datepicker.
2865
2876
  '[attr.data-mat-calendar]': 'datepicker ? datepicker.id : null',
2877
+ // Bind the `click` on the host, rather than the inner `button`, so that we can call
2878
+ // `stopPropagation` on it without affecting the user's `click` handlers. We need to stop
2879
+ // it so that the input doesn't get focused automatically by the form field (See #21836).
2880
+ '(click)': '_open($event)',
2866
2881
  },
2867
2882
  exportAs: 'matDatepickerToggle',
2868
2883
  encapsulation: ViewEncapsulation.None,