@angular/material 12.2.5 → 12.2.9

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 (105) hide show
  1. package/badge/badge.d.ts +15 -14
  2. package/badge/index.metadata.json +1 -1
  3. package/bundles/material-badge.umd.js +77 -79
  4. package/bundles/material-badge.umd.js.map +1 -1
  5. package/bundles/material-bottom-sheet.umd.js.map +1 -1
  6. package/bundles/material-chips.umd.js +1 -1
  7. package/bundles/material-core.umd.js +7 -17
  8. package/bundles/material-core.umd.js.map +1 -1
  9. package/bundles/material-datepicker.umd.js +1 -1
  10. package/bundles/material-datepicker.umd.js.map +1 -1
  11. package/bundles/material-dialog.umd.js.map +1 -1
  12. package/bundles/material-expansion.umd.js +1 -1
  13. package/bundles/material-form-field.umd.js +1 -1
  14. package/bundles/material-list.umd.js +3 -3
  15. package/bundles/material-menu.umd.js +109 -93
  16. package/bundles/material-menu.umd.js.map +1 -1
  17. package/bundles/material-select.umd.js +3 -1
  18. package/bundles/material-select.umd.js.map +1 -1
  19. package/bundles/material-snack-bar-testing.umd.js +19 -20
  20. package/bundles/material-snack-bar-testing.umd.js.map +1 -1
  21. package/bundles/material-snack-bar.umd.js.map +1 -1
  22. package/bundles/material-stepper.umd.js +7 -3
  23. package/bundles/material-stepper.umd.js.map +1 -1
  24. package/bundles/material-tabs.umd.js +22 -8
  25. package/bundles/material-tabs.umd.js.map +1 -1
  26. package/bundles/material-tooltip.umd.js.map +1 -1
  27. package/chips/index.metadata.json +1 -1
  28. package/core/common-behaviors/common-module.d.ts +0 -4
  29. package/core/index.metadata.json +1 -1
  30. package/core/typography/_typography.scss +7 -2
  31. package/datepicker/_datepicker-theme.scss +1 -4
  32. package/esm2015/badge/badge.js +63 -80
  33. package/esm2015/bottom-sheet/bottom-sheet-ref.js +1 -1
  34. package/esm2015/chips/chip-list.js +1 -1
  35. package/esm2015/core/common-behaviors/common-module.js +4 -13
  36. package/esm2015/core/version.js +1 -1
  37. package/esm2015/datepicker/date-range-input.js +2 -2
  38. package/esm2015/dialog/dialog-ref.js +1 -1
  39. package/esm2015/expansion/expansion-panel-header.js +1 -1
  40. package/esm2015/form-field/form-field.js +1 -1
  41. package/esm2015/list/list.js +2 -2
  42. package/esm2015/list/selection-list.js +1 -1
  43. package/esm2015/menu/menu-content.js +16 -11
  44. package/esm2015/menu/menu-module.js +10 -20
  45. package/esm2015/menu/menu-trigger.js +33 -21
  46. package/esm2015/menu/public-api.js +2 -2
  47. package/esm2015/select/select.js +4 -2
  48. package/esm2015/snack-bar/snack-bar-container.js +1 -1
  49. package/esm2015/snack-bar/snack-bar-ref.js +1 -1
  50. package/esm2015/snack-bar/testing/snack-bar-harness.js +20 -21
  51. package/esm2015/stepper/step-header.js +3 -3
  52. package/esm2015/stepper/stepper-intl.js +5 -1
  53. package/esm2015/stepper/stepper.js +1 -1
  54. package/esm2015/tabs/public-api.js +2 -2
  55. package/esm2015/tabs/tab-label.js +16 -2
  56. package/esm2015/tabs/tab.js +9 -8
  57. package/esm2015/tooltip/tooltip.js +1 -1
  58. package/expansion/index.metadata.json +1 -1
  59. package/fesm2015/badge.js +62 -79
  60. package/fesm2015/badge.js.map +1 -1
  61. package/fesm2015/bottom-sheet.js.map +1 -1
  62. package/fesm2015/chips.js +1 -1
  63. package/fesm2015/core.js +4 -14
  64. package/fesm2015/core.js.map +1 -1
  65. package/fesm2015/datepicker.js +1 -1
  66. package/fesm2015/datepicker.js.map +1 -1
  67. package/fesm2015/dialog.js.map +1 -1
  68. package/fesm2015/expansion.js +1 -1
  69. package/fesm2015/form-field.js +1 -1
  70. package/fesm2015/list.js +3 -3
  71. package/fesm2015/menu.js +57 -50
  72. package/fesm2015/menu.js.map +1 -1
  73. package/fesm2015/select.js +3 -1
  74. package/fesm2015/select.js.map +1 -1
  75. package/fesm2015/snack-bar/testing.js +19 -20
  76. package/fesm2015/snack-bar/testing.js.map +1 -1
  77. package/fesm2015/snack-bar.js.map +1 -1
  78. package/fesm2015/stepper.js +7 -3
  79. package/fesm2015/stepper.js.map +1 -1
  80. package/fesm2015/tabs.js +23 -8
  81. package/fesm2015/tabs.js.map +1 -1
  82. package/fesm2015/tooltip.js.map +1 -1
  83. package/form-field/index.metadata.json +1 -1
  84. package/list/index.metadata.json +1 -1
  85. package/menu/index.metadata.json +1 -1
  86. package/menu/menu-content.d.ts +6 -4
  87. package/menu/menu-module.d.ts +0 -6
  88. package/menu/menu-trigger.d.ts +7 -2
  89. package/menu/public-api.d.ts +1 -1
  90. package/package.json +2 -2
  91. package/prebuilt-themes/deeppurple-amber.css +1 -1
  92. package/prebuilt-themes/indigo-pink.css +1 -1
  93. package/prebuilt-themes/pink-bluegrey.css +1 -1
  94. package/prebuilt-themes/purple-green.css +1 -1
  95. package/schematics/ng-add/index.js +1 -1
  96. package/schematics/ng-add/index.mjs +1 -1
  97. package/select/index.metadata.json +1 -1
  98. package/snack-bar/testing/snack-bar-harness.d.ts +8 -9
  99. package/stepper/index.metadata.json +1 -1
  100. package/stepper/stepper-intl.d.ts +4 -0
  101. package/tabs/index.metadata.json +1 -1
  102. package/tabs/public-api.d.ts +1 -1
  103. package/tabs/tab-label.d.ts +8 -1
  104. package/tabs/tab.d.ts +1 -1
  105. package/tooltip/tooltip.d.ts +2 -2
@@ -382,24 +382,14 @@
382
382
  */
383
383
  var transformMenu = matMenuAnimations.transformMenu;
384
384
 
385
- /**
386
- * @license
387
- * Copyright Google LLC All Rights Reserved.
388
- *
389
- * Use of this source code is governed by an MIT-style license that can be
390
- * found in the LICENSE file at https://angular.io/license
391
- */
392
385
  /**
393
386
  * Injection token that can be used to reference instances of `MatMenuContent`. It serves
394
387
  * as alternative token to the actual `MatMenuContent` class which could cause unnecessary
395
388
  * retention of the class and its directive metadata.
396
389
  */
397
390
  var MAT_MENU_CONTENT = new core.InjectionToken('MatMenuContent');
398
- /**
399
- * Menu content that will be rendered lazily once the menu is opened.
400
- */
401
- var MatMenuContent = /** @class */ (function () {
402
- function MatMenuContent(_template, _componentFactoryResolver, _appRef, _injector, _viewContainerRef, _document, _changeDetectorRef) {
391
+ var _MatMenuContentBase = /** @class */ (function () {
392
+ function _MatMenuContentBase(_template, _componentFactoryResolver, _appRef, _injector, _viewContainerRef, _document, _changeDetectorRef) {
403
393
  this._template = _template;
404
394
  this._componentFactoryResolver = _componentFactoryResolver;
405
395
  this._appRef = _appRef;
@@ -414,7 +404,7 @@
414
404
  * Attaches the content with a particular context.
415
405
  * @docs-private
416
406
  */
417
- MatMenuContent.prototype.attach = function (context) {
407
+ _MatMenuContentBase.prototype.attach = function (context) {
418
408
  if (context === void 0) { context = {}; }
419
409
  if (!this._portal) {
420
410
  this._portal = new portal.TemplatePortal(this._template, this._viewContainerRef);
@@ -444,25 +434,22 @@
444
434
  * Detaches the content.
445
435
  * @docs-private
446
436
  */
447
- MatMenuContent.prototype.detach = function () {
437
+ _MatMenuContentBase.prototype.detach = function () {
448
438
  if (this._portal.isAttached) {
449
439
  this._portal.detach();
450
440
  }
451
441
  };
452
- MatMenuContent.prototype.ngOnDestroy = function () {
442
+ _MatMenuContentBase.prototype.ngOnDestroy = function () {
453
443
  if (this._outlet) {
454
444
  this._outlet.dispose();
455
445
  }
456
446
  };
457
- return MatMenuContent;
447
+ return _MatMenuContentBase;
458
448
  }());
459
- MatMenuContent.decorators = [
460
- { type: core.Directive, args: [{
461
- selector: 'ng-template[matMenuContent]',
462
- providers: [{ provide: MAT_MENU_CONTENT, useExisting: MatMenuContent }],
463
- },] }
449
+ _MatMenuContentBase.decorators = [
450
+ { type: core.Directive }
464
451
  ];
465
- MatMenuContent.ctorParameters = function () { return [
452
+ _MatMenuContentBase.ctorParameters = function () { return [
466
453
  { type: core.TemplateRef },
467
454
  { type: core.ComponentFactoryResolver },
468
455
  { type: core.ApplicationRef },
@@ -471,6 +458,22 @@
471
458
  { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
472
459
  { type: core.ChangeDetectorRef }
473
460
  ]; };
461
+ /**
462
+ * Menu content that will be rendered lazily once the menu is opened.
463
+ */
464
+ var MatMenuContent = /** @class */ (function (_super) {
465
+ __extends(MatMenuContent, _super);
466
+ function MatMenuContent() {
467
+ return _super !== null && _super.apply(this, arguments) || this;
468
+ }
469
+ return MatMenuContent;
470
+ }(_MatMenuContentBase));
471
+ MatMenuContent.decorators = [
472
+ { type: core.Directive, args: [{
473
+ selector: 'ng-template[matMenuContent]',
474
+ providers: [{ provide: MAT_MENU_CONTENT, useExisting: MatMenuContent }],
475
+ },] }
476
+ ];
474
477
 
475
478
  /**
476
479
  * @license
@@ -1099,9 +1102,8 @@
1099
1102
  /** Options for binding a passive event listener. */
1100
1103
  var passiveEventListenerOptions = platform.normalizePassiveListenerOptions({ passive: true });
1101
1104
  // TODO(andrewseguin): Remove the kebab versions in favor of camelCased attribute selectors
1102
- /** Directive applied to an element that should trigger a `mat-menu`. */
1103
- var MatMenuTrigger = /** @class */ (function () {
1104
- function MatMenuTrigger(_overlay, _element, _viewContainerRef, scrollStrategy, parentMenu,
1105
+ var _MatMenuTriggerBase = /** @class */ (function () {
1106
+ function _MatMenuTriggerBase(_overlay, _element, _viewContainerRef, scrollStrategy, parentMenu,
1105
1107
  // `MatMenuTrigger` is commonly used in combination with a `MatMenuItem`.
1106
1108
  // tslint:disable-next-line: lightweight-tokens
1107
1109
  _menuItemInstance, _dir,
@@ -1132,6 +1134,7 @@
1132
1134
  // Tracking input type is necessary so it's possible to only auto-focus
1133
1135
  // the first item of the list when the menu is opened via the keyboard
1134
1136
  this._openedBy = undefined;
1137
+ this._ariaHaspopup = true;
1135
1138
  /**
1136
1139
  * Whether focus should be restored when the menu is closed.
1137
1140
  * Note that disabling this option can have accessibility implications
@@ -1163,7 +1166,21 @@
1163
1166
  _menuItemInstance._triggersSubmenu = this.triggersSubmenu();
1164
1167
  }
1165
1168
  }
1166
- Object.defineProperty(MatMenuTrigger.prototype, "_deprecatedMatMenuTriggerFor", {
1169
+ Object.defineProperty(_MatMenuTriggerBase.prototype, "_ariaExpanded", {
1170
+ get: function () {
1171
+ return this.menuOpen || null;
1172
+ },
1173
+ enumerable: false,
1174
+ configurable: true
1175
+ });
1176
+ Object.defineProperty(_MatMenuTriggerBase.prototype, "_ariaControl", {
1177
+ get: function () {
1178
+ return this.menuOpen ? this.menu.panelId : null;
1179
+ },
1180
+ enumerable: false,
1181
+ configurable: true
1182
+ });
1183
+ Object.defineProperty(_MatMenuTriggerBase.prototype, "_deprecatedMatMenuTriggerFor", {
1167
1184
  /**
1168
1185
  * @deprecated
1169
1186
  * @breaking-change 8.0.0
@@ -1175,7 +1192,7 @@
1175
1192
  enumerable: false,
1176
1193
  configurable: true
1177
1194
  });
1178
- Object.defineProperty(MatMenuTrigger.prototype, "menu", {
1195
+ Object.defineProperty(_MatMenuTriggerBase.prototype, "menu", {
1179
1196
  /** References the menu instance that the trigger is associated with. */
1180
1197
  get: function () { return this._menu; },
1181
1198
  set: function (menu) {
@@ -1201,11 +1218,11 @@
1201
1218
  enumerable: false,
1202
1219
  configurable: true
1203
1220
  });
1204
- MatMenuTrigger.prototype.ngAfterContentInit = function () {
1221
+ _MatMenuTriggerBase.prototype.ngAfterContentInit = function () {
1205
1222
  this._checkMenu();
1206
1223
  this._handleHover();
1207
1224
  };
1208
- MatMenuTrigger.prototype.ngOnDestroy = function () {
1225
+ _MatMenuTriggerBase.prototype.ngOnDestroy = function () {
1209
1226
  if (this._overlayRef) {
1210
1227
  this._overlayRef.dispose();
1211
1228
  this._overlayRef = null;
@@ -1215,7 +1232,7 @@
1215
1232
  this._closingActionsSubscription.unsubscribe();
1216
1233
  this._hoverSubscription.unsubscribe();
1217
1234
  };
1218
- Object.defineProperty(MatMenuTrigger.prototype, "menuOpen", {
1235
+ Object.defineProperty(_MatMenuTriggerBase.prototype, "menuOpen", {
1219
1236
  /** Whether the menu is open. */
1220
1237
  get: function () {
1221
1238
  return this._menuOpen;
@@ -1223,7 +1240,7 @@
1223
1240
  enumerable: false,
1224
1241
  configurable: true
1225
1242
  });
1226
- Object.defineProperty(MatMenuTrigger.prototype, "dir", {
1243
+ Object.defineProperty(_MatMenuTriggerBase.prototype, "dir", {
1227
1244
  /** The text direction of the containing app. */
1228
1245
  get: function () {
1229
1246
  return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
@@ -1232,15 +1249,15 @@
1232
1249
  configurable: true
1233
1250
  });
1234
1251
  /** Whether the menu triggers a sub-menu or a top-level one. */
1235
- MatMenuTrigger.prototype.triggersSubmenu = function () {
1252
+ _MatMenuTriggerBase.prototype.triggersSubmenu = function () {
1236
1253
  return !!(this._menuItemInstance && this._parentMaterialMenu);
1237
1254
  };
1238
1255
  /** Toggles the menu between the open and closed states. */
1239
- MatMenuTrigger.prototype.toggleMenu = function () {
1256
+ _MatMenuTriggerBase.prototype.toggleMenu = function () {
1240
1257
  return this._menuOpen ? this.closeMenu() : this.openMenu();
1241
1258
  };
1242
1259
  /** Opens the menu. */
1243
- MatMenuTrigger.prototype.openMenu = function () {
1260
+ _MatMenuTriggerBase.prototype.openMenu = function () {
1244
1261
  var _this = this;
1245
1262
  if (this._menuOpen) {
1246
1263
  return;
@@ -1262,14 +1279,14 @@
1262
1279
  }
1263
1280
  };
1264
1281
  /** Closes the menu. */
1265
- MatMenuTrigger.prototype.closeMenu = function () {
1282
+ _MatMenuTriggerBase.prototype.closeMenu = function () {
1266
1283
  this.menu.close.emit();
1267
1284
  };
1268
1285
  /**
1269
1286
  * Focuses the menu trigger.
1270
1287
  * @param origin Source of the menu trigger's focus.
1271
1288
  */
1272
- MatMenuTrigger.prototype.focus = function (origin, options) {
1289
+ _MatMenuTriggerBase.prototype.focus = function (origin, options) {
1273
1290
  if (this._focusMonitor && origin) {
1274
1291
  this._focusMonitor.focusVia(this._element, origin, options);
1275
1292
  }
@@ -1280,12 +1297,12 @@
1280
1297
  /**
1281
1298
  * Updates the position of the menu to ensure that it fits all options within the viewport.
1282
1299
  */
1283
- MatMenuTrigger.prototype.updatePosition = function () {
1300
+ _MatMenuTriggerBase.prototype.updatePosition = function () {
1284
1301
  var _a;
1285
1302
  (_a = this._overlayRef) === null || _a === void 0 ? void 0 : _a.updatePosition();
1286
1303
  };
1287
1304
  /** Closes the menu and does the necessary cleanup. */
1288
- MatMenuTrigger.prototype._destroyMenu = function (reason) {
1305
+ _MatMenuTriggerBase.prototype._destroyMenu = function (reason) {
1289
1306
  var _this = this;
1290
1307
  if (!this._overlayRef || !this.menuOpen) {
1291
1308
  return;
@@ -1330,7 +1347,7 @@
1330
1347
  * This method sets the menu state to open and focuses the first item if
1331
1348
  * the menu was opened via the keyboard.
1332
1349
  */
1333
- MatMenuTrigger.prototype._initMenu = function () {
1350
+ _MatMenuTriggerBase.prototype._initMenu = function () {
1334
1351
  this.menu.parentMenu = this.triggersSubmenu() ? this._parentMaterialMenu : undefined;
1335
1352
  this.menu.direction = this.dir;
1336
1353
  this._setMenuElevation();
@@ -1338,7 +1355,7 @@
1338
1355
  this._setIsMenuOpen(true);
1339
1356
  };
1340
1357
  /** Updates the menu elevation based on the amount of parent menus that it has. */
1341
- MatMenuTrigger.prototype._setMenuElevation = function () {
1358
+ _MatMenuTriggerBase.prototype._setMenuElevation = function () {
1342
1359
  if (this.menu.setElevation) {
1343
1360
  var depth = 0;
1344
1361
  var parentMenu = this.menu.parentMenu;
@@ -1350,7 +1367,7 @@
1350
1367
  }
1351
1368
  };
1352
1369
  // set state rather than toggle to support triggers sharing a menu
1353
- MatMenuTrigger.prototype._setIsMenuOpen = function (isOpen) {
1370
+ _MatMenuTriggerBase.prototype._setIsMenuOpen = function (isOpen) {
1354
1371
  this._menuOpen = isOpen;
1355
1372
  this._menuOpen ? this.menuOpened.emit() : this.menuClosed.emit();
1356
1373
  if (this.triggersSubmenu()) {
@@ -1361,7 +1378,7 @@
1361
1378
  * This method checks that a valid instance of MatMenu has been passed into
1362
1379
  * matMenuTriggerFor. If not, an exception is thrown.
1363
1380
  */
1364
- MatMenuTrigger.prototype._checkMenu = function () {
1381
+ _MatMenuTriggerBase.prototype._checkMenu = function () {
1365
1382
  if (!this.menu && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1366
1383
  throwMatMenuMissingError();
1367
1384
  }
@@ -1370,7 +1387,7 @@
1370
1387
  * This method creates the overlay from the provided menu's template and saves its
1371
1388
  * OverlayRef so that it can be attached to the DOM when openMenu is called.
1372
1389
  */
1373
- MatMenuTrigger.prototype._createOverlay = function () {
1390
+ _MatMenuTriggerBase.prototype._createOverlay = function () {
1374
1391
  if (!this._overlayRef) {
1375
1392
  var config = this._getOverlayConfig();
1376
1393
  this._subscribeToPositions(config.positionStrategy);
@@ -1386,7 +1403,7 @@
1386
1403
  * This method builds the configuration object needed to create the overlay, the OverlayState.
1387
1404
  * @returns OverlayConfig
1388
1405
  */
1389
- MatMenuTrigger.prototype._getOverlayConfig = function () {
1406
+ _MatMenuTriggerBase.prototype._getOverlayConfig = function () {
1390
1407
  return new overlay.OverlayConfig({
1391
1408
  positionStrategy: this._overlay.position()
1392
1409
  .flexibleConnectedTo(this._element)
@@ -1404,7 +1421,7 @@
1404
1421
  * on the menu based on the new position. This ensures the animation origin is always
1405
1422
  * correct, even if a fallback position is used for the overlay.
1406
1423
  */
1407
- MatMenuTrigger.prototype._subscribeToPositions = function (position) {
1424
+ _MatMenuTriggerBase.prototype._subscribeToPositions = function (position) {
1408
1425
  var _this = this;
1409
1426
  if (this.menu.setPositionClasses) {
1410
1427
  position.positionChanges.subscribe(function (change) {
@@ -1419,7 +1436,7 @@
1419
1436
  * so the overlay connects with the trigger correctly.
1420
1437
  * @param positionStrategy Strategy whose position to update.
1421
1438
  */
1422
- MatMenuTrigger.prototype._setPosition = function (positionStrategy) {
1439
+ _MatMenuTriggerBase.prototype._setPosition = function (positionStrategy) {
1423
1440
  var _b = __read(this.menu.xPosition === 'before' ? ['end', 'start'] : ['start', 'end'], 2), originX = _b[0], originFallbackX = _b[1];
1424
1441
  var _c = __read(this.menu.yPosition === 'above' ? ['bottom', 'top'] : ['top', 'bottom'], 2), overlayY = _c[0], overlayFallbackY = _c[1];
1425
1442
  var _d = __read([overlayY, overlayFallbackY], 2), originY = _d[0], originFallbackY = _d[1];
@@ -1456,7 +1473,7 @@
1456
1473
  ]);
1457
1474
  };
1458
1475
  /** Returns a stream that emits whenever an action that should close the menu occurs. */
1459
- MatMenuTrigger.prototype._menuClosingActions = function () {
1476
+ _MatMenuTriggerBase.prototype._menuClosingActions = function () {
1460
1477
  var _this = this;
1461
1478
  var backdrop = this._overlayRef.backdropClick();
1462
1479
  var detachments = this._overlayRef.detachments();
@@ -1465,7 +1482,7 @@
1465
1482
  return rxjs.merge(backdrop, parentClose, hover, detachments);
1466
1483
  };
1467
1484
  /** Handles mouse presses on the trigger. */
1468
- MatMenuTrigger.prototype._handleMousedown = function (event) {
1485
+ _MatMenuTriggerBase.prototype._handleMousedown = function (event) {
1469
1486
  if (!a11y.isFakeMousedownFromScreenReader(event)) {
1470
1487
  // Since right or middle button clicks won't trigger the `click` event,
1471
1488
  // we shouldn't consider the menu as opened by mouse in those cases.
@@ -1479,7 +1496,7 @@
1479
1496
  }
1480
1497
  };
1481
1498
  /** Handles key presses on the trigger. */
1482
- MatMenuTrigger.prototype._handleKeydown = function (event) {
1499
+ _MatMenuTriggerBase.prototype._handleKeydown = function (event) {
1483
1500
  var keyCode = event.keyCode;
1484
1501
  // Pressing enter on the trigger will trigger the click handler later.
1485
1502
  if (keyCode === keycodes.ENTER || keyCode === keycodes.SPACE) {
@@ -1492,7 +1509,7 @@
1492
1509
  }
1493
1510
  };
1494
1511
  /** Handles click events on the trigger. */
1495
- MatMenuTrigger.prototype._handleClick = function (event) {
1512
+ _MatMenuTriggerBase.prototype._handleClick = function (event) {
1496
1513
  if (this.triggersSubmenu()) {
1497
1514
  // Stop event propagation to avoid closing the parent menu.
1498
1515
  event.stopPropagation();
@@ -1503,7 +1520,7 @@
1503
1520
  }
1504
1521
  };
1505
1522
  /** Handles the cases where the user hovers over the trigger. */
1506
- MatMenuTrigger.prototype._handleHover = function () {
1523
+ _MatMenuTriggerBase.prototype._handleHover = function () {
1507
1524
  var _this = this;
1508
1525
  // Subscribe to changes in the hovered item in order to toggle the panel.
1509
1526
  if (!this.triggersSubmenu() || !this._parentMaterialMenu) {
@@ -1532,7 +1549,7 @@
1532
1549
  });
1533
1550
  };
1534
1551
  /** Gets the portal that should be attached to the overlay. */
1535
- MatMenuTrigger.prototype._getPortal = function () {
1552
+ _MatMenuTriggerBase.prototype._getPortal = function () {
1536
1553
  // Note that we can avoid this check by keeping the portal on the menu panel.
1537
1554
  // While it would be cleaner, we'd have to introduce another required method on
1538
1555
  // `MatMenuPanel`, making it harder to consume.
@@ -1541,24 +1558,12 @@
1541
1558
  }
1542
1559
  return this._portal;
1543
1560
  };
1544
- return MatMenuTrigger;
1561
+ return _MatMenuTriggerBase;
1545
1562
  }());
1546
- MatMenuTrigger.decorators = [
1547
- { type: core.Directive, args: [{
1548
- selector: "[mat-menu-trigger-for], [matMenuTriggerFor]",
1549
- host: {
1550
- 'class': 'mat-menu-trigger',
1551
- 'aria-haspopup': 'true',
1552
- '[attr.aria-expanded]': 'menuOpen || null',
1553
- '[attr.aria-controls]': 'menuOpen ? menu.panelId : null',
1554
- '(mousedown)': '_handleMousedown($event)',
1555
- '(keydown)': '_handleKeydown($event)',
1556
- '(click)': '_handleClick($event)',
1557
- },
1558
- exportAs: 'matMenuTrigger'
1559
- },] }
1563
+ _MatMenuTriggerBase.decorators = [
1564
+ { type: core.Directive }
1560
1565
  ];
1561
- MatMenuTrigger.ctorParameters = function () { return [
1566
+ _MatMenuTriggerBase.ctorParameters = function () { return [
1562
1567
  { type: overlay.Overlay },
1563
1568
  { type: core.ElementRef },
1564
1569
  { type: core.ViewContainerRef },
@@ -1568,7 +1573,10 @@
1568
1573
  { type: bidi.Directionality, decorators: [{ type: core.Optional }] },
1569
1574
  { type: a11y.FocusMonitor }
1570
1575
  ]; };
1571
- MatMenuTrigger.propDecorators = {
1576
+ _MatMenuTriggerBase.propDecorators = {
1577
+ _ariaExpanded: [{ type: core.HostBinding, args: ['attr.aria-expanded',] }],
1578
+ _ariaControl: [{ type: core.HostBinding, args: ['attr.aria-controls',] }],
1579
+ _ariaHaspopup: [{ type: core.HostBinding, args: ['attr.aria-haspopup',] }],
1572
1580
  _deprecatedMatMenuTriggerFor: [{ type: core.Input, args: ['mat-menu-trigger-for',] }],
1573
1581
  menu: [{ type: core.Input, args: ['matMenuTriggerFor',] }],
1574
1582
  menuData: [{ type: core.Input, args: ['matMenuTriggerData',] }],
@@ -1576,8 +1584,28 @@
1576
1584
  menuOpened: [{ type: core.Output }],
1577
1585
  onMenuOpen: [{ type: core.Output }],
1578
1586
  menuClosed: [{ type: core.Output }],
1579
- onMenuClose: [{ type: core.Output }]
1587
+ onMenuClose: [{ type: core.Output }],
1588
+ _handleMousedown: [{ type: core.HostListener, args: ['mousedown', ['$event'],] }],
1589
+ _handleKeydown: [{ type: core.HostListener, args: ['keydown', ['$event'],] }],
1590
+ _handleClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
1580
1591
  };
1592
+ /** Directive applied to an element that should trigger a `mat-menu`. */
1593
+ var MatMenuTrigger = /** @class */ (function (_super) {
1594
+ __extends(MatMenuTrigger, _super);
1595
+ function MatMenuTrigger() {
1596
+ return _super !== null && _super.apply(this, arguments) || this;
1597
+ }
1598
+ return MatMenuTrigger;
1599
+ }(_MatMenuTriggerBase));
1600
+ MatMenuTrigger.decorators = [
1601
+ { type: core.Directive, args: [{
1602
+ selector: "[mat-menu-trigger-for], [matMenuTriggerFor]",
1603
+ host: {
1604
+ 'class': 'mat-menu-trigger',
1605
+ },
1606
+ exportAs: 'matMenuTrigger'
1607
+ },] }
1608
+ ];
1581
1609
 
1582
1610
  /**
1583
1611
  * @license
@@ -1586,25 +1614,6 @@
1586
1614
  * Use of this source code is governed by an MIT-style license that can be
1587
1615
  * found in the LICENSE file at https://angular.io/license
1588
1616
  */
1589
- /**
1590
- * Used by both the current `MatMenuModule` and the MDC `MatMenuModule`
1591
- * to declare the menu-related directives.
1592
- */
1593
- var _MatMenuDirectivesModule = /** @class */ (function () {
1594
- function _MatMenuDirectivesModule() {
1595
- }
1596
- return _MatMenuDirectivesModule;
1597
- }());
1598
- _MatMenuDirectivesModule.decorators = [
1599
- { type: core.NgModule, args: [{
1600
- exports: [MatMenuTrigger, MatMenuContent, core$1.MatCommonModule],
1601
- declarations: [
1602
- MatMenuTrigger,
1603
- MatMenuContent,
1604
- ],
1605
- providers: [MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER]
1606
- },] }
1607
- ];
1608
1617
  var MatMenuModule = /** @class */ (function () {
1609
1618
  function MatMenuModule() {
1610
1619
  }
@@ -1617,10 +1626,16 @@
1617
1626
  core$1.MatCommonModule,
1618
1627
  core$1.MatRippleModule,
1619
1628
  overlay.OverlayModule,
1620
- _MatMenuDirectivesModule,
1621
1629
  ],
1622
- exports: [scrolling.CdkScrollableModule, core$1.MatCommonModule, MatMenu, MatMenuItem, _MatMenuDirectivesModule],
1623
- declarations: [MatMenu, MatMenuItem],
1630
+ exports: [
1631
+ scrolling.CdkScrollableModule,
1632
+ core$1.MatCommonModule,
1633
+ MatMenu,
1634
+ MatMenuItem,
1635
+ MatMenuTrigger,
1636
+ MatMenuContent
1637
+ ],
1638
+ declarations: [MatMenu, MatMenuItem, MatMenuTrigger, MatMenuContent],
1624
1639
  providers: [MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER]
1625
1640
  },] }
1626
1641
  ];
@@ -1647,7 +1662,8 @@
1647
1662
  exports.MatMenuModule = MatMenuModule;
1648
1663
  exports.MatMenuTrigger = MatMenuTrigger;
1649
1664
  exports._MatMenuBase = _MatMenuBase;
1650
- exports._MatMenuDirectivesModule = _MatMenuDirectivesModule;
1665
+ exports._MatMenuContentBase = _MatMenuContentBase;
1666
+ exports._MatMenuTriggerBase = _MatMenuTriggerBase;
1651
1667
  exports.fadeInItems = fadeInItems;
1652
1668
  exports.matMenuAnimations = matMenuAnimations;
1653
1669
  exports.transformMenu = transformMenu;