@angular/material 12.2.0-rc.0 → 12.2.3
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/bundles/material-checkbox.umd.js +1 -1
- package/bundles/material-checkbox.umd.js.map +1 -1
- package/bundles/material-core.umd.js +15 -14
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.js +51 -8
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-expansion.umd.js +1 -1
- package/bundles/material-expansion.umd.js.map +1 -1
- package/bundles/material-stepper.umd.js +1 -1
- package/bundles/material-stepper.umd.js.map +1 -1
- package/bundles/material-tabs.umd.js +1 -1
- package/checkbox/index.metadata.json +1 -1
- package/core/common-behaviors/common-module.d.ts +2 -2
- package/core/index.metadata.json +1 -1
- package/core/theming/_theming.scss +3 -1
- package/datepicker/index.metadata.json +1 -1
- package/datepicker/month-view.d.ts +6 -0
- package/datepicker/multi-year-view.d.ts +4 -0
- package/datepicker/year-view.d.ts +4 -0
- package/esm2015/checkbox/checkbox.js +2 -2
- package/esm2015/core/common-behaviors/common-module.js +15 -14
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/calendar-body.js +2 -2
- package/esm2015/datepicker/month-view.js +21 -4
- package/esm2015/datepicker/multi-year-view.js +16 -3
- package/esm2015/datepicker/year-view.js +16 -3
- package/esm2015/expansion/expansion-panel.js +2 -2
- package/esm2015/stepper/stepper.js +2 -2
- package/esm2015/tabs/tab-group.js +1 -1
- package/expansion/expansion-panel.d.ts +1 -1
- package/fesm2015/checkbox.js +1 -1
- package/fesm2015/checkbox.js.map +1 -1
- package/fesm2015/core.js +15 -14
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker.js +51 -8
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/expansion.js +1 -1
- package/fesm2015/expansion.js.map +1 -1
- package/fesm2015/stepper.js +1 -1
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/tabs.js +1 -1
- package/package.json +3 -6
- 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/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/stepper/_stepper-theme.scss +6 -1
- package/stepper/index.metadata.json +1 -1
- package/tabs/index.metadata.json +1 -1
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
MatCalendarBody.decorators = [
|
|
336
336
|
{ type: i0.Component, args: [{
|
|
337
337
|
selector: '[mat-calendar-body]',
|
|
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
|
|
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 This cell is purely decorative, but we can't put `aria-hidden` or `role=\"presentation\"` on it,\n because it throws off the week days for the rest of the row on NVDA. The aspect ratio of the\n table cells is maintained by setting the top and bottom padding as a percentage of the width\n (a variant of the trick described here: https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\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
341
|
},
|
|
@@ -1105,9 +1105,13 @@
|
|
|
1105
1105
|
break;
|
|
1106
1106
|
case keycodes.ENTER:
|
|
1107
1107
|
case keycodes.SPACE:
|
|
1108
|
-
|
|
1109
|
-
|
|
1108
|
+
this._selectionKeyPressed = true;
|
|
1109
|
+
if (this._canSelect(this._activeDate)) {
|
|
1110
1110
|
// Prevent unexpected default actions such as form submission.
|
|
1111
|
+
// Note that we only prevent the default action here while the selection happens in
|
|
1112
|
+
// `keyup` below. We can't do the selection here, because it can cause the calendar to
|
|
1113
|
+
// reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`
|
|
1114
|
+
// because it's too late (see #23305).
|
|
1111
1115
|
event.preventDefault();
|
|
1112
1116
|
}
|
|
1113
1117
|
return;
|
|
@@ -1132,6 +1136,15 @@
|
|
|
1132
1136
|
// Prevent unexpected default actions such as form submission.
|
|
1133
1137
|
event.preventDefault();
|
|
1134
1138
|
};
|
|
1139
|
+
/** Handles keyup events on the calendar body when calendar is in month view. */
|
|
1140
|
+
MatMonthView.prototype._handleCalendarBodyKeyup = function (event) {
|
|
1141
|
+
if (event.keyCode === keycodes.SPACE || event.keyCode === keycodes.ENTER) {
|
|
1142
|
+
if (this._selectionKeyPressed && this._canSelect(this._activeDate)) {
|
|
1143
|
+
this._dateSelected({ value: this._dateAdapter.getDate(this._activeDate), event: event });
|
|
1144
|
+
}
|
|
1145
|
+
this._selectionKeyPressed = false;
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1135
1148
|
/** Initializes this month view. */
|
|
1136
1149
|
MatMonthView.prototype._init = function () {
|
|
1137
1150
|
this._setRanges(this.selected);
|
|
@@ -1247,12 +1260,16 @@
|
|
|
1247
1260
|
this._comparisonRangeStart = this._getCellCompareValue(this.comparisonStart);
|
|
1248
1261
|
this._comparisonRangeEnd = this._getCellCompareValue(this.comparisonEnd);
|
|
1249
1262
|
};
|
|
1263
|
+
/** Gets whether a date can be selected in the month view. */
|
|
1264
|
+
MatMonthView.prototype._canSelect = function (date) {
|
|
1265
|
+
return !this.dateFilter || this.dateFilter(date);
|
|
1266
|
+
};
|
|
1250
1267
|
return MatMonthView;
|
|
1251
1268
|
}());
|
|
1252
1269
|
MatMonthView.decorators = [
|
|
1253
1270
|
{ type: i0.Component, args: [{
|
|
1254
1271
|
selector: 'mat-month-view',
|
|
1255
|
-
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",
|
|
1272
|
+
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 (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
|
|
1256
1273
|
exportAs: 'matMonthView',
|
|
1257
1274
|
encapsulation: i0.ViewEncapsulation.None,
|
|
1258
1275
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -1428,7 +1445,11 @@
|
|
|
1428
1445
|
break;
|
|
1429
1446
|
case keycodes.ENTER:
|
|
1430
1447
|
case keycodes.SPACE:
|
|
1431
|
-
|
|
1448
|
+
// Note that we only prevent the default action here while the selection happens in
|
|
1449
|
+
// `keyup` below. We can't do the selection here, because it can cause the calendar to
|
|
1450
|
+
// reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`
|
|
1451
|
+
// because it's too late (see #23305).
|
|
1452
|
+
this._selectionKeyPressed = true;
|
|
1432
1453
|
break;
|
|
1433
1454
|
default:
|
|
1434
1455
|
// Don't prevent default or focus active cell on keys that we don't explicitly handle.
|
|
@@ -1441,6 +1462,15 @@
|
|
|
1441
1462
|
// Prevent unexpected default actions such as form submission.
|
|
1442
1463
|
event.preventDefault();
|
|
1443
1464
|
};
|
|
1465
|
+
/** Handles keyup events on the calendar body when calendar is in multi-year view. */
|
|
1466
|
+
MatMultiYearView.prototype._handleCalendarBodyKeyup = function (event) {
|
|
1467
|
+
if (event.keyCode === keycodes.SPACE || event.keyCode === keycodes.ENTER) {
|
|
1468
|
+
if (this._selectionKeyPressed) {
|
|
1469
|
+
this._yearSelected({ value: this._dateAdapter.getYear(this._activeDate), event: event });
|
|
1470
|
+
}
|
|
1471
|
+
this._selectionKeyPressed = false;
|
|
1472
|
+
}
|
|
1473
|
+
};
|
|
1444
1474
|
MatMultiYearView.prototype._getActiveCell = function () {
|
|
1445
1475
|
return getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);
|
|
1446
1476
|
};
|
|
@@ -1498,7 +1528,7 @@
|
|
|
1498
1528
|
MatMultiYearView.decorators = [
|
|
1499
1529
|
{ type: i0.Component, args: [{
|
|
1500
1530
|
selector: 'mat-multi-year-view',
|
|
1501
|
-
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",
|
|
1531
|
+
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 (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
|
|
1502
1532
|
exportAs: 'matMultiYearView',
|
|
1503
1533
|
encapsulation: i0.ViewEncapsulation.None,
|
|
1504
1534
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -1691,7 +1721,11 @@
|
|
|
1691
1721
|
break;
|
|
1692
1722
|
case keycodes.ENTER:
|
|
1693
1723
|
case keycodes.SPACE:
|
|
1694
|
-
|
|
1724
|
+
// Note that we only prevent the default action here while the selection happens in
|
|
1725
|
+
// `keyup` below. We can't do the selection here, because it can cause the calendar to
|
|
1726
|
+
// reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`
|
|
1727
|
+
// because it's too late (see #23305).
|
|
1728
|
+
this._selectionKeyPressed = true;
|
|
1695
1729
|
break;
|
|
1696
1730
|
default:
|
|
1697
1731
|
// Don't prevent default or focus active cell on keys that we don't explicitly handle.
|
|
@@ -1704,6 +1738,15 @@
|
|
|
1704
1738
|
// Prevent unexpected default actions such as form submission.
|
|
1705
1739
|
event.preventDefault();
|
|
1706
1740
|
};
|
|
1741
|
+
/** Handles keyup events on the calendar body when calendar is in year view. */
|
|
1742
|
+
MatYearView.prototype._handleCalendarBodyKeyup = function (event) {
|
|
1743
|
+
if (event.keyCode === keycodes.SPACE || event.keyCode === keycodes.ENTER) {
|
|
1744
|
+
if (this._selectionKeyPressed) {
|
|
1745
|
+
this._monthSelected({ value: this._dateAdapter.getMonth(this._activeDate), event: event });
|
|
1746
|
+
}
|
|
1747
|
+
this._selectionKeyPressed = false;
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1707
1750
|
/** Initializes this year view. */
|
|
1708
1751
|
MatYearView.prototype._init = function () {
|
|
1709
1752
|
var _this = this;
|
|
@@ -1797,7 +1840,7 @@
|
|
|
1797
1840
|
MatYearView.decorators = [
|
|
1798
1841
|
{ type: i0.Component, args: [{
|
|
1799
1842
|
selector: 'mat-year-view',
|
|
1800
|
-
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",
|
|
1843
|
+
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 (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n",
|
|
1801
1844
|
exportAs: 'matYearView',
|
|
1802
1845
|
encapsulation: i0.ViewEncapsulation.None,
|
|
1803
1846
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|