@angular/material 12.2.2 → 12.2.6
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/autocomplete/index.metadata.json +1 -1
- package/bundles/material-autocomplete.umd.js +4 -2
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-button-testing.umd.js +1 -9
- package/bundles/material-button-testing.umd.js.map +1 -1
- package/bundles/material-chips.umd.js +4 -2
- package/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-core.umd.js +2 -2
- 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-form-field.umd.js +1 -1
- package/bundles/material-menu.umd.js +109 -93
- package/bundles/material-menu.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.map +1 -1
- package/chips/index.metadata.json +1 -1
- package/core/index.metadata.json +1 -1
- package/datepicker/_datepicker-theme.scss +1 -4
- 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/autocomplete/autocomplete-trigger.js +2 -2
- package/esm2015/autocomplete/autocomplete.js +4 -2
- package/esm2015/button/testing/button-harness.js +3 -10
- package/esm2015/chips/chip-list.js +5 -3
- package/esm2015/core/common-behaviors/common-module.js +1 -1
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/date-range-input.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/form-field/form-field.js +1 -1
- package/esm2015/menu/menu-content.js +16 -11
- package/esm2015/menu/menu-module.js +10 -20
- package/esm2015/menu/menu-trigger.js +33 -21
- package/esm2015/menu/public-api.js +2 -2
- package/esm2015/stepper/stepper.js +2 -2
- package/esm2015/tabs/tab-group.js +1 -1
- package/fesm2015/autocomplete.js +4 -2
- package/fesm2015/autocomplete.js.map +1 -1
- package/fesm2015/button/testing.js +2 -9
- package/fesm2015/button/testing.js.map +1 -1
- package/fesm2015/chips.js +4 -2
- package/fesm2015/chips.js.map +1 -1
- package/fesm2015/core.js +2 -2
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker.js +51 -8
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/form-field.js +1 -1
- package/fesm2015/menu.js +57 -50
- package/fesm2015/menu.js.map +1 -1
- package/fesm2015/stepper.js +1 -1
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/tabs.js.map +1 -1
- package/form-field/index.metadata.json +1 -1
- package/menu/index.metadata.json +1 -1
- package/menu/menu-content.d.ts +6 -4
- package/menu/menu-module.d.ts +0 -6
- package/menu/menu-trigger.d.ts +7 -2
- package/menu/public-api.d.ts +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/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/_tabs-theme.scss +1 -1
- package/tabs/tab-group.d.ts +1 -1
package/fesm2015/datepicker.js
CHANGED
|
@@ -754,9 +754,13 @@ class MatMonthView {
|
|
|
754
754
|
break;
|
|
755
755
|
case ENTER:
|
|
756
756
|
case SPACE:
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
this._selectionKeyPressed = true;
|
|
758
|
+
if (this._canSelect(this._activeDate)) {
|
|
759
759
|
// Prevent unexpected default actions such as form submission.
|
|
760
|
+
// Note that we only prevent the default action here while the selection happens in
|
|
761
|
+
// `keyup` below. We can't do the selection here, because it can cause the calendar to
|
|
762
|
+
// reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`
|
|
763
|
+
// because it's too late (see #23305).
|
|
760
764
|
event.preventDefault();
|
|
761
765
|
}
|
|
762
766
|
return;
|
|
@@ -781,6 +785,15 @@ class MatMonthView {
|
|
|
781
785
|
// Prevent unexpected default actions such as form submission.
|
|
782
786
|
event.preventDefault();
|
|
783
787
|
}
|
|
788
|
+
/** Handles keyup events on the calendar body when calendar is in month view. */
|
|
789
|
+
_handleCalendarBodyKeyup(event) {
|
|
790
|
+
if (event.keyCode === SPACE || event.keyCode === ENTER) {
|
|
791
|
+
if (this._selectionKeyPressed && this._canSelect(this._activeDate)) {
|
|
792
|
+
this._dateSelected({ value: this._dateAdapter.getDate(this._activeDate), event });
|
|
793
|
+
}
|
|
794
|
+
this._selectionKeyPressed = false;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
784
797
|
/** Initializes this month view. */
|
|
785
798
|
_init() {
|
|
786
799
|
this._setRanges(this.selected);
|
|
@@ -895,11 +908,15 @@ class MatMonthView {
|
|
|
895
908
|
this._comparisonRangeStart = this._getCellCompareValue(this.comparisonStart);
|
|
896
909
|
this._comparisonRangeEnd = this._getCellCompareValue(this.comparisonEnd);
|
|
897
910
|
}
|
|
911
|
+
/** Gets whether a date can be selected in the month view. */
|
|
912
|
+
_canSelect(date) {
|
|
913
|
+
return !this.dateFilter || this.dateFilter(date);
|
|
914
|
+
}
|
|
898
915
|
}
|
|
899
916
|
MatMonthView.decorators = [
|
|
900
917
|
{ type: Component, args: [{
|
|
901
918
|
selector: 'mat-month-view',
|
|
902
|
-
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",
|
|
919
|
+
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",
|
|
903
920
|
exportAs: 'matMonthView',
|
|
904
921
|
encapsulation: ViewEncapsulation.None,
|
|
905
922
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
@@ -1057,7 +1074,11 @@ class MatMultiYearView {
|
|
|
1057
1074
|
break;
|
|
1058
1075
|
case ENTER:
|
|
1059
1076
|
case SPACE:
|
|
1060
|
-
|
|
1077
|
+
// Note that we only prevent the default action here while the selection happens in
|
|
1078
|
+
// `keyup` below. We can't do the selection here, because it can cause the calendar to
|
|
1079
|
+
// reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`
|
|
1080
|
+
// because it's too late (see #23305).
|
|
1081
|
+
this._selectionKeyPressed = true;
|
|
1061
1082
|
break;
|
|
1062
1083
|
default:
|
|
1063
1084
|
// Don't prevent default or focus active cell on keys that we don't explicitly handle.
|
|
@@ -1070,6 +1091,15 @@ class MatMultiYearView {
|
|
|
1070
1091
|
// Prevent unexpected default actions such as form submission.
|
|
1071
1092
|
event.preventDefault();
|
|
1072
1093
|
}
|
|
1094
|
+
/** Handles keyup events on the calendar body when calendar is in multi-year view. */
|
|
1095
|
+
_handleCalendarBodyKeyup(event) {
|
|
1096
|
+
if (event.keyCode === SPACE || event.keyCode === ENTER) {
|
|
1097
|
+
if (this._selectionKeyPressed) {
|
|
1098
|
+
this._yearSelected({ value: this._dateAdapter.getYear(this._activeDate), event });
|
|
1099
|
+
}
|
|
1100
|
+
this._selectionKeyPressed = false;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1073
1103
|
_getActiveCell() {
|
|
1074
1104
|
return getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);
|
|
1075
1105
|
}
|
|
@@ -1126,7 +1156,7 @@ class MatMultiYearView {
|
|
|
1126
1156
|
MatMultiYearView.decorators = [
|
|
1127
1157
|
{ type: Component, args: [{
|
|
1128
1158
|
selector: 'mat-multi-year-view',
|
|
1129
|
-
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",
|
|
1159
|
+
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",
|
|
1130
1160
|
exportAs: 'matMultiYearView',
|
|
1131
1161
|
encapsulation: ViewEncapsulation.None,
|
|
1132
1162
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
@@ -1302,7 +1332,11 @@ class MatYearView {
|
|
|
1302
1332
|
break;
|
|
1303
1333
|
case ENTER:
|
|
1304
1334
|
case SPACE:
|
|
1305
|
-
|
|
1335
|
+
// Note that we only prevent the default action here while the selection happens in
|
|
1336
|
+
// `keyup` below. We can't do the selection here, because it can cause the calendar to
|
|
1337
|
+
// reopen if focus is restored immediately. We also can't call `preventDefault` on `keyup`
|
|
1338
|
+
// because it's too late (see #23305).
|
|
1339
|
+
this._selectionKeyPressed = true;
|
|
1306
1340
|
break;
|
|
1307
1341
|
default:
|
|
1308
1342
|
// Don't prevent default or focus active cell on keys that we don't explicitly handle.
|
|
@@ -1315,6 +1349,15 @@ class MatYearView {
|
|
|
1315
1349
|
// Prevent unexpected default actions such as form submission.
|
|
1316
1350
|
event.preventDefault();
|
|
1317
1351
|
}
|
|
1352
|
+
/** Handles keyup events on the calendar body when calendar is in year view. */
|
|
1353
|
+
_handleCalendarBodyKeyup(event) {
|
|
1354
|
+
if (event.keyCode === SPACE || event.keyCode === ENTER) {
|
|
1355
|
+
if (this._selectionKeyPressed) {
|
|
1356
|
+
this._monthSelected({ value: this._dateAdapter.getMonth(this._activeDate), event });
|
|
1357
|
+
}
|
|
1358
|
+
this._selectionKeyPressed = false;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1318
1361
|
/** Initializes this year view. */
|
|
1319
1362
|
_init() {
|
|
1320
1363
|
this._setSelectedMonth(this.selected);
|
|
@@ -1406,7 +1449,7 @@ class MatYearView {
|
|
|
1406
1449
|
MatYearView.decorators = [
|
|
1407
1450
|
{ type: Component, args: [{
|
|
1408
1451
|
selector: 'mat-year-view',
|
|
1409
|
-
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",
|
|
1452
|
+
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",
|
|
1410
1453
|
exportAs: 'matYearView',
|
|
1411
1454
|
encapsulation: ViewEncapsulation.None,
|
|
1412
1455
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
@@ -3226,7 +3269,7 @@ class MatDateRangeInput {
|
|
|
3226
3269
|
if (_formField === null || _formField === void 0 ? void 0 : _formField._elementRef.nativeElement.classList.contains('mat-mdc-form-field')) {
|
|
3227
3270
|
const classList = _elementRef.nativeElement.classList;
|
|
3228
3271
|
classList.add('mat-mdc-input-element');
|
|
3229
|
-
classList.add('mat-mdc-form-field-control');
|
|
3272
|
+
classList.add('mat-mdc-form-field-input-control');
|
|
3230
3273
|
}
|
|
3231
3274
|
// TODO(crisbeto): remove `as any` after #18206 lands.
|
|
3232
3275
|
this.ngControl = control;
|