@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
@@ -338,8 +338,6 @@
338
338
  template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td class=\"mat-calendar-body-label\"\n [attr.colspan]=\"numCols\"\n [style.paddingTop]=\"_cellPadding\"\n [style.paddingBottom]=\"_cellPadding\">\n {{label}}\n </td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n aria-hidden=\"true\"\n class=\"mat-calendar-body-label\"\n [attr.colspan]=\"_firstRowOffset\"\n [style.paddingTop]=\"_cellPadding\"\n [style.paddingBottom]=\"_cellPadding\">\n {{_firstRowOffset >= labelMinRequiredCells ? label : ''}}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mat-calendar-body-cell\"\n [ngClass]=\"item.cssClasses\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [class.mat-calendar-body-disabled]=\"!item.enabled\"\n [class.mat-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mat-calendar-body-range-start]=\"_isRangeStart(item.compareValue)\"\n [class.mat-calendar-body-range-end]=\"_isRangeEnd(item.compareValue)\"\n [class.mat-calendar-body-in-range]=\"_isInRange(item.compareValue)\"\n [class.mat-calendar-body-comparison-bridge-start]=\"_isComparisonBridgeStart(item.compareValue, rowIndex, colIndex)\"\n [class.mat-calendar-body-comparison-bridge-end]=\"_isComparisonBridgeEnd(item.compareValue, rowIndex, colIndex)\"\n [class.mat-calendar-body-comparison-start]=\"_isComparisonStart(item.compareValue)\"\n [class.mat-calendar-body-comparison-end]=\"_isComparisonEnd(item.compareValue)\"\n [class.mat-calendar-body-in-comparison-range]=\"_isInComparisonRange(item.compareValue)\"\n [class.mat-calendar-body-preview-start]=\"_isPreviewStart(item.compareValue)\"\n [class.mat-calendar-body-preview-end]=\"_isPreviewEnd(item.compareValue)\"\n [class.mat-calendar-body-in-preview]=\"_isInPreview(item.compareValue)\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n [attr.aria-selected]=\"_isSelected(item.compareValue)\"\n (click)=\"_cellClicked(item, $event)\"\n [style.width]=\"_cellWidth\"\n [style.paddingTop]=\"_cellPadding\"\n [style.paddingBottom]=\"_cellPadding\">\n <div class=\"mat-calendar-body-cell-content mat-focus-indicator\"\n [class.mat-calendar-body-selected]=\"_isSelected(item.compareValue)\"\n [class.mat-calendar-body-comparison-identical]=\"_isComparisonIdentical(item.compareValue)\"\n [class.mat-calendar-body-today]=\"todayValue === item.compareValue\">\n {{item.displayValue}}\n </div>\n <div class=\"mat-calendar-body-cell-preview\"></div>\n </td>\n</tr>\n",
339
339
  host: {
340
340
  'class': 'mat-calendar-body',
341
- 'role': 'grid',
342
- 'aria-readonly': 'true'
343
341
  },
344
342
  exportAs: 'matCalendarBody',
345
343
  encapsulation: i0.ViewEncapsulation.None,
@@ -1248,7 +1246,7 @@
1248
1246
  MatMonthView.decorators = [
1249
1247
  { type: i0.Component, args: [{
1250
1248
  selector: 'mat-month-view',
1251
- template: "<table class=\"mat-calendar-table\" role=\"presentation\">\n <thead class=\"mat-calendar-table-header\">\n <tr>\n <th scope=\"col\" *ngFor=\"let day of _weekdays\" [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n </tr>\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"7\" aria-hidden=\"true\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_monthLabel\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [startValue]=\"_rangeStart!\"\n [endValue]=\"_rangeEnd!\"\n [comparisonStart]=\"_comparisonRangeStart\"\n [comparisonEnd]=\"_comparisonRangeEnd\"\n [previewStart]=\"_previewStart\"\n [previewEnd]=\"_previewEnd\"\n [isRange]=\"_isRange\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"_dateAdapter.getDate(activeDate) - 1\"\n (selectedValueChange)=\"_dateSelected($event)\"\n (previewChange)=\"_previewChanged($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
1249
+ template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead class=\"mat-calendar-table-header\">\n <tr>\n <!-- For the day-of-the-week column header, we use an `<abbr>` element because VoiceOver\n ignores the `aria-label`. ChromeVox, however, does not read the full name\n for the `<abbr>`, so we still set `aria-label` on the header element. -->\n <th scope=\"col\" *ngFor=\"let day of _weekdays\" [attr.aria-label]=\"day.long\">\n <abbr class=\"mat-calendar-abbr\" [attr.title]=\"day.long\">{{day.narrow}}</abbr>\n </th>\n </tr>\n <tr><th aria-hidden=\"true\" class=\"mat-calendar-table-header-divider\" colspan=\"7\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_monthLabel\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [startValue]=\"_rangeStart!\"\n [endValue]=\"_rangeEnd!\"\n [comparisonStart]=\"_comparisonRangeStart\"\n [comparisonEnd]=\"_comparisonRangeEnd\"\n [previewStart]=\"_previewStart\"\n [previewEnd]=\"_previewEnd\"\n [isRange]=\"_isRange\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"_dateAdapter.getDate(activeDate) - 1\"\n (selectedValueChange)=\"_dateSelected($event)\"\n (previewChange)=\"_previewChanged($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
1252
1250
  exportAs: 'matMonthView',
1253
1251
  encapsulation: i0.ViewEncapsulation.None,
1254
1252
  changeDetection: i0.ChangeDetectionStrategy.OnPush
@@ -1494,7 +1492,7 @@
1494
1492
  MatMultiYearView.decorators = [
1495
1493
  { type: i0.Component, args: [{
1496
1494
  selector: 'mat-multi-year-view',
1497
- template: "<table class=\"mat-calendar-table\" role=\"presentation\">\n <thead class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [rows]=\"_years\"\n [todayValue]=\"_todayYear\"\n [startValue]=\"_selectedYear!\"\n [endValue]=\"_selectedYear!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_getActiveCell()\"\n (selectedValueChange)=\"_yearSelected($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
1495
+ template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [rows]=\"_years\"\n [todayValue]=\"_todayYear\"\n [startValue]=\"_selectedYear!\"\n [endValue]=\"_selectedYear!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_getActiveCell()\"\n (selectedValueChange)=\"_yearSelected($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
1498
1496
  exportAs: 'matMultiYearView',
1499
1497
  encapsulation: i0.ViewEncapsulation.None,
1500
1498
  changeDetection: i0.ChangeDetectionStrategy.OnPush
@@ -1793,7 +1791,7 @@
1793
1791
  MatYearView.decorators = [
1794
1792
  { type: i0.Component, args: [{
1795
1793
  selector: 'mat-year-view',
1796
- template: "<table class=\"mat-calendar-table\" role=\"presentation\">\n <thead class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [startValue]=\"_selectedMonth!\"\n [endValue]=\"_selectedMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_dateAdapter.getMonth(activeDate)\"\n (selectedValueChange)=\"_monthSelected($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
1794
+ template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [startValue]=\"_selectedMonth!\"\n [endValue]=\"_selectedMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_dateAdapter.getMonth(activeDate)\"\n (selectedValueChange)=\"_monthSelected($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
1797
1795
  exportAs: 'matYearView',
1798
1796
  encapsulation: i0.ViewEncapsulation.None,
1799
1797
  changeDetection: i0.ChangeDetectionStrategy.OnPush
@@ -2107,18 +2105,7 @@
2107
2105
  };
2108
2106
  /** Updates today's date after an update of the active date */
2109
2107
  MatCalendar.prototype.updateTodaysDate = function () {
2110
- var currentView = this.currentView;
2111
- var view;
2112
- if (currentView === 'month') {
2113
- view = this.monthView;
2114
- }
2115
- else if (currentView === 'year') {
2116
- view = this.yearView;
2117
- }
2118
- else {
2119
- view = this.multiYearView;
2120
- }
2121
- view._init();
2108
+ this._getCurrentViewComponent()._init();
2122
2109
  };
2123
2110
  /** Handles date selection in the month view. */
2124
2111
  MatCalendar.prototype._dateSelected = function (event) {
@@ -2144,6 +2131,9 @@
2144
2131
  };
2145
2132
  /** Returns the component instance that corresponds to the current calendar view. */
2146
2133
  MatCalendar.prototype._getCurrentViewComponent = function () {
2134
+ // The return type is explicitly written as a union to ensure that the Closure compiler does
2135
+ // not optimize calls to _init(). Without the explict return type, TypeScript narrows it to
2136
+ // only the first component type. See https://github.com/angular/components/issues/22996.
2147
2137
  return this.monthView || this.yearView || this.multiYearView;
2148
2138
  };
2149
2139
  return MatCalendar;
@@ -2159,7 +2149,7 @@
2159
2149
  encapsulation: i0.ViewEncapsulation.None,
2160
2150
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
2161
2151
  providers: [MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER],
2162
- styles: [".mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:none}.mat-calendar-controls{display:flex;margin:5% calc(33% / 7 - 16px)}.mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0}.mat-calendar-arrow{display:inline-block;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top-width:5px;border-top-style:solid;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-calendar-previous-button::after,.mat-calendar-next-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:\"\";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:\"\";position:absolute;top:0;left:-8px;right:-8px;height:1px}\n"]
2152
+ styles: [".mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:none}.mat-calendar-controls{display:flex;margin:5% calc(33% / 7 - 16px)}.mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0}.mat-calendar-arrow{display:inline-block;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top-width:5px;border-top-style:solid;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-calendar-previous-button::after,.mat-calendar-next-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:\"\";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:\"\";position:absolute;top:0;left:-8px;right:-8px;height:1px}.mat-calendar-abbr{text-decoration:none}\n"]
2163
2153
  },] }
2164
2154
  ];
2165
2155
  MatCalendar.ctorParameters = function () { return [
@@ -3734,7 +3724,9 @@
3734
3724
  // The datepicker module can be used both with MDC and non-MDC form fields. We have
3735
3725
  // to conditionally add the MDC input class so that the range picker looks correctly.
3736
3726
  if (_formField === null || _formField === void 0 ? void 0 : _formField._elementRef.nativeElement.classList.contains('mat-mdc-form-field')) {
3737
- _elementRef.nativeElement.classList.add('mat-mdc-input-element');
3727
+ var classList = _elementRef.nativeElement.classList;
3728
+ classList.add('mat-mdc-input-element');
3729
+ classList.add('mat-mdc-form-field-control');
3738
3730
  }
3739
3731
  // TODO(crisbeto): remove `as any` after #18206 lands.
3740
3732
  this.ngControl = control;