From 98e6a85eab7ece8b2cfe91f3b6a9c87ab24c85f4 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Fri, 20 Jan 2023 10:11:46 +0100 Subject: [PATCH] refactor(material/menu): expose MenuCloseReason type (#26458) Exposes the `MenuCloseReason` type since it's used in the `closed` event of `MatMenu` which is a public API. Fixes #26416. (cherry picked from commit 0d07ccc7acd3c859fd734b16b1b22b093e4b2f26) --- src/material/menu/public-api.ts | 8 +++++++- tools/public_api_guard/material/menu.md | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/material/menu/public-api.ts b/src/material/menu/public-api.ts index f79665c24380..9f312c406f24 100644 --- a/src/material/menu/public-api.ts +++ b/src/material/menu/public-api.ts @@ -6,7 +6,13 @@ * found in the LICENSE file at https://angular.io/license */ -export {MatMenu, _MatMenuBase, MAT_MENU_DEFAULT_OPTIONS, MatMenuDefaultOptions} from './menu'; +export { + MatMenu, + _MatMenuBase, + MAT_MENU_DEFAULT_OPTIONS, + MatMenuDefaultOptions, + MenuCloseReason, +} from './menu'; export * from './menu-item'; export * from './menu-content'; export { diff --git a/tools/public_api_guard/material/menu.md b/tools/public_api_guard/material/menu.md index f9951de12c52..fb66d7fe6fa8 100644 --- a/tools/public_api_guard/material/menu.md +++ b/tools/public_api_guard/material/menu.md @@ -326,6 +326,9 @@ export abstract class _MatMenuTriggerBase implements AfterContentInit, OnDestroy // @public @deprecated export const MENU_PANEL_TOP_PADDING = 8; +// @public +export type MenuCloseReason = void | 'click' | 'keydown' | 'tab'; + // @public export type MenuPositionX = 'before' | 'after';