@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.
- package/badge/_badge-theme.scss +64 -45
- package/bundles/material-core.umd.js +9 -7
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.js +11 -19
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-radio.umd.js +12 -13
- package/bundles/material-radio.umd.js.map +1 -1
- package/bundles/material-slide-toggle.umd.js +1 -1
- package/bundles/material-tabs.umd.js +6 -0
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tooltip.umd.js +7 -0
- package/bundles/material-tooltip.umd.js.map +1 -1
- package/core/common-behaviors/error-state.d.ts +5 -1
- package/core/index.metadata.json +1 -1
- package/datepicker/index.metadata.json +1 -1
- package/esm2015/core/common-behaviors/common-module.js +1 -1
- package/esm2015/core/common-behaviors/error-state.js +8 -6
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/calendar-body.js +1 -3
- package/esm2015/datepicker/calendar.js +6 -14
- package/esm2015/datepicker/date-range-input.js +4 -2
- package/esm2015/datepicker/month-view.js +2 -2
- package/esm2015/datepicker/multi-year-view.js +2 -2
- package/esm2015/datepicker/year-view.js +2 -2
- package/esm2015/radio/radio.js +13 -14
- package/esm2015/slide-toggle/slide-toggle.js +1 -1
- package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +7 -1
- package/esm2015/tooltip/tooltip.js +8 -1
- package/fesm2015/core.js +9 -7
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker.js +11 -19
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/radio.js +12 -13
- package/fesm2015/radio.js.map +1 -1
- package/fesm2015/slide-toggle.js +1 -1
- package/fesm2015/tabs.js +6 -0
- package/fesm2015/tabs.js.map +1 -1
- package/fesm2015/tooltip.js +7 -0
- package/fesm2015/tooltip.js.map +1 -1
- package/package.json +2 -2
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/radio/index.metadata.json +1 -1
- package/radio/radio.d.ts +2 -5
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/slide-toggle/index.metadata.json +1 -1
- package/tabs/index.metadata.json +1 -1
- package/tabs/tab-nav-bar/tab-nav-bar.d.ts +1 -0
- package/tooltip/index.metadata.json +1 -1
- 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=\"
|
|
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=\"
|
|
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=\"
|
|
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
|
-
|
|
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
|
|
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;
|