diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 40456da0d5bd..492a0c6a8224 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -77,6 +77,7 @@ /src/cdk/drag-drop/** @crisbeto /src/cdk/keycodes/** @andrewseguin /src/cdk/layout/** @andrewseguin +/src/cdk/menu/** @mmalerba @crisbeto /src/cdk/observers/** @andrewseguin @crisbeto /src/cdk/overlay/** @jelbourn @crisbeto /src/cdk/platform/** @andrewseguin @devversion @@ -132,7 +133,6 @@ /src/cdk-experimental/* @andrewseguin /src/cdk-experimental/column-resize/** @andrewseguin /src/cdk-experimental/combobox/** @jelbourn -/src/cdk-experimental/menu/** @jelbourn /src/cdk-experimental/popover-edit/** @andrewseguin /src/cdk-experimental/scrolling/** @mmalerba /src/cdk-experimental/table-scroll-container/** @andrewseguin @@ -156,7 +156,6 @@ /src/dev-app/cdk-dialog/** @crisbeto /src/dev-app/cdk-experimental-combobox/** @jelbourn /src/dev-app/cdk-experimental-listbox/** @jelbourn -/src/dev-app/cdk-experimental-menu/** @jelbourn /src/dev-app/checkbox/** @jelbourn @devversion /src/dev-app/chips/** @andrewseguin /src/dev-app/clipboard/** @andrewseguin @@ -178,6 +177,7 @@ /src/dev-app/icon/** @andrewseguin /src/dev-app/input/** @mmalerba /src/dev-app/layout/** @andrewseguin +/src/dev-app/cdk-menu/** @mmalerba @crisbeto /src/dev-app/input-modality/** @jelbourn /src/dev-app/list/** @andrewseguin @crisbeto @devversion /src/dev-app/live-announcer/** @jelbourn diff --git a/.ng-dev/commit-message.ts b/.ng-dev/commit-message.ts index c07dbcb729ba..81b9a7d76151 100644 --- a/.ng-dev/commit-message.ts +++ b/.ng-dev/commit-message.ts @@ -12,7 +12,6 @@ export const commitMessage: CommitMessageConfig = { 'cdk-experimental/column-resize', 'cdk-experimental/combobox', 'cdk-experimental/listbox', - 'cdk-experimental/menu', 'cdk-experimental/popover-edit', 'cdk-experimental/scrolling', 'cdk-experimental/selection', @@ -27,6 +26,7 @@ export const commitMessage: CommitMessageConfig = { 'cdk/drag-drop', 'cdk/keycodes', 'cdk/layout', + 'cdk/menu', 'cdk/observers', 'cdk/overlay', 'cdk/platform', diff --git a/src/cdk-experimental/config.bzl b/src/cdk-experimental/config.bzl index 75c6a265d547..e749bef03d74 100644 --- a/src/cdk-experimental/config.bzl +++ b/src/cdk-experimental/config.bzl @@ -2,7 +2,6 @@ CDK_EXPERIMENTAL_ENTRYPOINTS = [ "column-resize", "combobox", - "menu", "listbox", "popover-edit", "scrolling", diff --git a/src/cdk/config.bzl b/src/cdk/config.bzl index e06687867cd3..2fa32023d757 100644 --- a/src/cdk/config.bzl +++ b/src/cdk/config.bzl @@ -10,6 +10,7 @@ CDK_ENTRYPOINTS = [ "drag-drop", "keycodes", "layout", + "menu", "observers", "overlay", "platform", diff --git a/src/cdk-experimental/menu/BUILD.bazel b/src/cdk/menu/BUILD.bazel similarity index 76% rename from src/cdk-experimental/menu/BUILD.bazel rename to src/cdk/menu/BUILD.bazel index 2846cd3f6bba..34f7208c7ea9 100644 --- a/src/cdk-experimental/menu/BUILD.bazel +++ b/src/cdk/menu/BUILD.bazel @@ -1,4 +1,10 @@ -load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite") +load( + "//tools:defaults.bzl", + "markdown_to_html", + "ng_module", + "ng_test_library", + "ng_web_test_suite", +) package(default_visibility = ["//visibility:public"]) @@ -41,3 +47,13 @@ ng_web_test_suite( name = "unit_tests", deps = [":unit_test_sources"], ) + +markdown_to_html( + name = "overview", + srcs = [":menu.md"], +) + +filegroup( + name = "source-files", + srcs = glob(["**/*.ts"]), +) diff --git a/src/cdk-experimental/menu/context-menu-trigger.spec.ts b/src/cdk/menu/context-menu-trigger.spec.ts similarity index 99% rename from src/cdk-experimental/menu/context-menu-trigger.spec.ts rename to src/cdk/menu/context-menu-trigger.spec.ts index 002b2a7a6a74..387236041ced 100644 --- a/src/cdk-experimental/menu/context-menu-trigger.spec.ts +++ b/src/cdk/menu/context-menu-trigger.spec.ts @@ -3,7 +3,7 @@ import {CdkMenuModule} from './menu-module'; import {TestBed, waitForAsync, ComponentFixture} from '@angular/core/testing'; import {CdkMenu} from './menu'; import {CdkContextMenuTrigger} from './context-menu-trigger'; -import {dispatchKeyboardEvent, dispatchMouseEvent} from '../../cdk/testing/private'; +import {dispatchKeyboardEvent, dispatchMouseEvent} from '@angular/cdk/testing/private'; import {By} from '@angular/platform-browser'; import {CdkMenuItem} from './menu-item'; import {CdkMenuTrigger} from './menu-trigger'; diff --git a/src/cdk-experimental/menu/context-menu-trigger.ts b/src/cdk/menu/context-menu-trigger.ts similarity index 100% rename from src/cdk-experimental/menu/context-menu-trigger.ts rename to src/cdk/menu/context-menu-trigger.ts diff --git a/src/cdk-experimental/menu/index.ts b/src/cdk/menu/index.ts similarity index 100% rename from src/cdk-experimental/menu/index.ts rename to src/cdk/menu/index.ts diff --git a/src/cdk-experimental/menu/menu-aim.ts b/src/cdk/menu/menu-aim.ts similarity index 100% rename from src/cdk-experimental/menu/menu-aim.ts rename to src/cdk/menu/menu-aim.ts diff --git a/src/cdk-experimental/menu/menu-bar.spec.ts b/src/cdk/menu/menu-bar.spec.ts similarity index 100% rename from src/cdk-experimental/menu/menu-bar.spec.ts rename to src/cdk/menu/menu-bar.spec.ts diff --git a/src/cdk-experimental/menu/menu-bar.ts b/src/cdk/menu/menu-bar.ts similarity index 100% rename from src/cdk-experimental/menu/menu-bar.ts rename to src/cdk/menu/menu-bar.ts diff --git a/src/cdk-experimental/menu/menu-base.ts b/src/cdk/menu/menu-base.ts similarity index 100% rename from src/cdk-experimental/menu/menu-base.ts rename to src/cdk/menu/menu-base.ts diff --git a/src/cdk-experimental/menu/menu-errors.ts b/src/cdk/menu/menu-errors.ts similarity index 100% rename from src/cdk-experimental/menu/menu-errors.ts rename to src/cdk/menu/menu-errors.ts diff --git a/src/cdk-experimental/menu/menu-group.spec.ts b/src/cdk/menu/menu-group.spec.ts similarity index 100% rename from src/cdk-experimental/menu/menu-group.spec.ts rename to src/cdk/menu/menu-group.spec.ts diff --git a/src/cdk-experimental/menu/menu-group.ts b/src/cdk/menu/menu-group.ts similarity index 100% rename from src/cdk-experimental/menu/menu-group.ts rename to src/cdk/menu/menu-group.ts diff --git a/src/cdk-experimental/menu/menu-interface.ts b/src/cdk/menu/menu-interface.ts similarity index 100% rename from src/cdk-experimental/menu/menu-interface.ts rename to src/cdk/menu/menu-interface.ts diff --git a/src/cdk-experimental/menu/menu-item-checkbox.spec.ts b/src/cdk/menu/menu-item-checkbox.spec.ts similarity index 97% rename from src/cdk-experimental/menu/menu-item-checkbox.spec.ts rename to src/cdk/menu/menu-item-checkbox.spec.ts index d80f3917f0c9..ef28819e2fbd 100644 --- a/src/cdk-experimental/menu/menu-item-checkbox.spec.ts +++ b/src/cdk/menu/menu-item-checkbox.spec.ts @@ -5,7 +5,7 @@ import {CdkMenuModule} from './menu-module'; import {CdkMenuItemCheckbox} from './menu-item-checkbox'; import {CDK_MENU} from './menu-interface'; import {CdkMenu} from './menu'; -import {MENU_STACK, MenuStack} from '@angular/cdk-experimental/menu/menu-stack'; +import {MENU_STACK, MenuStack} from './menu-stack'; describe('MenuItemCheckbox', () => { let fixture: ComponentFixture; diff --git a/src/cdk-experimental/menu/menu-item-checkbox.ts b/src/cdk/menu/menu-item-checkbox.ts similarity index 100% rename from src/cdk-experimental/menu/menu-item-checkbox.ts rename to src/cdk/menu/menu-item-checkbox.ts diff --git a/src/cdk-experimental/menu/menu-item-radio.spec.ts b/src/cdk/menu/menu-item-radio.spec.ts similarity index 97% rename from src/cdk-experimental/menu/menu-item-radio.spec.ts rename to src/cdk/menu/menu-item-radio.spec.ts index bc39e6c83c8b..b3cf8548ce43 100644 --- a/src/cdk-experimental/menu/menu-item-radio.spec.ts +++ b/src/cdk/menu/menu-item-radio.spec.ts @@ -6,7 +6,7 @@ import {CdkMenuModule} from './menu-module'; import {CdkMenuItemRadio} from './menu-item-radio'; import {CDK_MENU} from './menu-interface'; import {CdkMenu} from './menu'; -import {MENU_STACK, MenuStack} from '@angular/cdk-experimental/menu/menu-stack'; +import {MENU_STACK, MenuStack} from './menu-stack'; describe('MenuItemRadio', () => { let fixture: ComponentFixture; diff --git a/src/cdk-experimental/menu/menu-item-radio.ts b/src/cdk/menu/menu-item-radio.ts similarity index 100% rename from src/cdk-experimental/menu/menu-item-radio.ts rename to src/cdk/menu/menu-item-radio.ts diff --git a/src/cdk-experimental/menu/menu-item-selectable.ts b/src/cdk/menu/menu-item-selectable.ts similarity index 100% rename from src/cdk-experimental/menu/menu-item-selectable.ts rename to src/cdk/menu/menu-item-selectable.ts diff --git a/src/cdk-experimental/menu/menu-item.spec.ts b/src/cdk/menu/menu-item.spec.ts similarity index 98% rename from src/cdk-experimental/menu/menu-item.spec.ts rename to src/cdk/menu/menu-item.spec.ts index 0b9df0997e52..26ccab47de54 100644 --- a/src/cdk-experimental/menu/menu-item.spec.ts +++ b/src/cdk/menu/menu-item.spec.ts @@ -5,7 +5,7 @@ import {CdkMenuModule} from './menu-module'; import {CdkMenuItem} from './menu-item'; import {CDK_MENU} from './menu-interface'; import {CdkMenu} from './menu'; -import {MENU_STACK, MenuStack} from '@angular/cdk-experimental/menu/menu-stack'; +import {MENU_STACK, MenuStack} from './menu-stack'; describe('MenuItem', () => { describe('with no complex inner elements', () => { diff --git a/src/cdk-experimental/menu/menu-item.ts b/src/cdk/menu/menu-item.ts similarity index 100% rename from src/cdk-experimental/menu/menu-item.ts rename to src/cdk/menu/menu-item.ts diff --git a/src/cdk-experimental/menu/menu-module.ts b/src/cdk/menu/menu-module.ts similarity index 100% rename from src/cdk-experimental/menu/menu-module.ts rename to src/cdk/menu/menu-module.ts diff --git a/src/cdk-experimental/menu/menu-stack.spec.ts b/src/cdk/menu/menu-stack.spec.ts similarity index 100% rename from src/cdk-experimental/menu/menu-stack.spec.ts rename to src/cdk/menu/menu-stack.spec.ts diff --git a/src/cdk-experimental/menu/menu-stack.ts b/src/cdk/menu/menu-stack.ts similarity index 100% rename from src/cdk-experimental/menu/menu-stack.ts rename to src/cdk/menu/menu-stack.ts diff --git a/src/cdk-experimental/menu/menu-trigger-base.ts b/src/cdk/menu/menu-trigger-base.ts similarity index 100% rename from src/cdk-experimental/menu/menu-trigger-base.ts rename to src/cdk/menu/menu-trigger-base.ts diff --git a/src/cdk-experimental/menu/menu-trigger.spec.ts b/src/cdk/menu/menu-trigger.spec.ts similarity index 100% rename from src/cdk-experimental/menu/menu-trigger.spec.ts rename to src/cdk/menu/menu-trigger.spec.ts diff --git a/src/cdk-experimental/menu/menu-trigger.ts b/src/cdk/menu/menu-trigger.ts similarity index 100% rename from src/cdk-experimental/menu/menu-trigger.ts rename to src/cdk/menu/menu-trigger.ts diff --git a/src/cdk-experimental/menu/menu.md b/src/cdk/menu/menu.md similarity index 88% rename from src/cdk-experimental/menu/menu.md rename to src/cdk/menu/menu.md index 38d19d2b76e5..a5e7d52cf6e1 100644 --- a/src/cdk-experimental/menu/menu.md +++ b/src/cdk/menu/menu.md @@ -1,13 +1,13 @@ -The `@angular/cdk-experimental/menu` module provides directives to help create custom menu +The `@angular/cdk/menu` module provides directives to help create custom menu interactions based on the [WAI ARIA specification][aria]. -By using `@angular/cdk-experimental/menu` you get all of the expected behaviors for an accessible +By using `@angular/cdk/menu` you get all of the expected behaviors for an accessible experience, including bidi layout support, keyboard interaction, and focus management. All directives apply their associated ARIA roles to their host element. ### Supported ARIA Roles -The directives in `@angular/cdk-experimental/menu` set the appropriate roles on their host element. +The directives in `@angular/cdk/menu` set the appropriate roles on their host element. | Directive | ARIA Role | | ------------------- | ---------------- | @@ -196,9 +196,9 @@ Finally, you can provide state for each item using the `checked` attribute. ### Smart Menu Aim -`@angular/cdk-experimental/menu` intelligently predicts when a user intends to navigate to an open -submenu and prevent premature closeouts. This functionality prevents users from having to hunt -through the open menus in a maze-like fashion to reach their destination. +`@angular/cdk/menu` intelligently predicts when a user intends to navigate to an open submenu and +prevent premature closeouts. This functionality prevents users from having to hunt through the open +menus in a maze-like fashion to reach their destination. ![menu aim diagram][diagram] @@ -214,12 +214,11 @@ detect this intention and will trigger the next menu. ### Accessibility -The set of directives defined in `@angular/cdk-experimental/menu` follow accessibility best -practices as defined in the [ARIA spec][menubar]. Specifically, the menus are aware of left-to-right -and right-to-left layouts and opened appropriately. You should however add any necessary CSS styles. -Menu items should always have meaningful labels, whether through text content, `aria-label`, or -`aria-labelledby`. Finally, keyboard interaction is supported as defined in the [ARIA menubar -keyboard interaction spec][keyboard]. +The set of directives defined in `@angular/cdk/menu` follow accessibility best practices as defined +in the [ARIA spec][menubar]. Specifically, the menus are aware of left-to-right and right-to-left +layouts and opened appropriately. You should however add any necessary CSS styles. Menu items should +always have meaningful labels, whether through text content, `aria-label`, or `aria-labelledby`. +Finally, keyboard interaction is supported as defined in the [ARIA menubar keyboard interaction spec][keyboard]. diff --git a/src/cdk-experimental/menu/menu.spec.ts b/src/cdk/menu/menu.spec.ts similarity index 100% rename from src/cdk-experimental/menu/menu.spec.ts rename to src/cdk/menu/menu.spec.ts diff --git a/src/cdk-experimental/menu/menu.ts b/src/cdk/menu/menu.ts similarity index 100% rename from src/cdk-experimental/menu/menu.ts rename to src/cdk/menu/menu.ts diff --git a/src/cdk-experimental/menu/menuaim.png b/src/cdk/menu/menuaim.png similarity index 100% rename from src/cdk-experimental/menu/menuaim.png rename to src/cdk/menu/menuaim.png diff --git a/src/cdk-experimental/menu/pointer-focus-tracker.spec.ts b/src/cdk/menu/pointer-focus-tracker.spec.ts similarity index 100% rename from src/cdk-experimental/menu/pointer-focus-tracker.spec.ts rename to src/cdk/menu/pointer-focus-tracker.spec.ts diff --git a/src/cdk-experimental/menu/pointer-focus-tracker.ts b/src/cdk/menu/pointer-focus-tracker.ts similarity index 100% rename from src/cdk-experimental/menu/pointer-focus-tracker.ts rename to src/cdk/menu/pointer-focus-tracker.ts diff --git a/src/cdk-experimental/menu/public-api.ts b/src/cdk/menu/public-api.ts similarity index 100% rename from src/cdk-experimental/menu/public-api.ts rename to src/cdk/menu/public-api.ts diff --git a/src/components-examples/cdk-experimental/menu/BUILD.bazel b/src/components-examples/cdk/menu/BUILD.bazel similarity index 91% rename from src/components-examples/cdk-experimental/menu/BUILD.bazel rename to src/components-examples/cdk/menu/BUILD.bazel index 281026ee4444..59cd16525d3b 100644 --- a/src/components-examples/cdk-experimental/menu/BUILD.bazel +++ b/src/components-examples/cdk/menu/BUILD.bazel @@ -10,7 +10,7 @@ ng_module( "**/*.css", ]), deps = [ - "//src/cdk-experimental/menu", + "//src/cdk/menu", "@npm//@angular/forms", ], ) diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-context/cdk-menu-context-example.css b/src/components-examples/cdk/menu/cdk-menu-context/cdk-menu-context-example.css similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-context/cdk-menu-context-example.css rename to src/components-examples/cdk/menu/cdk-menu-context/cdk-menu-context-example.css diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-context/cdk-menu-context-example.html b/src/components-examples/cdk/menu/cdk-menu-context/cdk-menu-context-example.html similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-context/cdk-menu-context-example.html rename to src/components-examples/cdk/menu/cdk-menu-context/cdk-menu-context-example.html diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-context/cdk-menu-context-example.ts b/src/components-examples/cdk/menu/cdk-menu-context/cdk-menu-context-example.ts similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-context/cdk-menu-context-example.ts rename to src/components-examples/cdk/menu/cdk-menu-context/cdk-menu-context-example.ts diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-inline/cdk-menu-inline-example.css b/src/components-examples/cdk/menu/cdk-menu-inline/cdk-menu-inline-example.css similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-inline/cdk-menu-inline-example.css rename to src/components-examples/cdk/menu/cdk-menu-inline/cdk-menu-inline-example.css diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-inline/cdk-menu-inline-example.html b/src/components-examples/cdk/menu/cdk-menu-inline/cdk-menu-inline-example.html similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-inline/cdk-menu-inline-example.html rename to src/components-examples/cdk/menu/cdk-menu-inline/cdk-menu-inline-example.html diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-inline/cdk-menu-inline-example.ts b/src/components-examples/cdk/menu/cdk-menu-inline/cdk-menu-inline-example.ts similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-inline/cdk-menu-inline-example.ts rename to src/components-examples/cdk/menu/cdk-menu-inline/cdk-menu-inline-example.ts diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-menubar/cdk-menu-menubar-example.css b/src/components-examples/cdk/menu/cdk-menu-menubar/cdk-menu-menubar-example.css similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-menubar/cdk-menu-menubar-example.css rename to src/components-examples/cdk/menu/cdk-menu-menubar/cdk-menu-menubar-example.css diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-menubar/cdk-menu-menubar-example.html b/src/components-examples/cdk/menu/cdk-menu-menubar/cdk-menu-menubar-example.html similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-menubar/cdk-menu-menubar-example.html rename to src/components-examples/cdk/menu/cdk-menu-menubar/cdk-menu-menubar-example.html diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-menubar/cdk-menu-menubar-example.ts b/src/components-examples/cdk/menu/cdk-menu-menubar/cdk-menu-menubar-example.ts similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-menubar/cdk-menu-menubar-example.ts rename to src/components-examples/cdk/menu/cdk-menu-menubar/cdk-menu-menubar-example.ts diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.css b/src/components-examples/cdk/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.css similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.css rename to src/components-examples/cdk/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.css diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.html b/src/components-examples/cdk/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.html similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.html rename to src/components-examples/cdk/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.html diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.ts b/src/components-examples/cdk/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.ts similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.ts rename to src/components-examples/cdk/menu/cdk-menu-standalone-menu/cdk-menu-standalone-menu-example.ts diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.css b/src/components-examples/cdk/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.css similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.css rename to src/components-examples/cdk/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.css diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.html b/src/components-examples/cdk/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.html similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.html rename to src/components-examples/cdk/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.html diff --git a/src/components-examples/cdk-experimental/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.ts b/src/components-examples/cdk/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.ts similarity index 100% rename from src/components-examples/cdk-experimental/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.ts rename to src/components-examples/cdk/menu/cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example.ts diff --git a/src/components-examples/cdk-experimental/menu/index.ts b/src/components-examples/cdk/menu/index.ts similarity index 94% rename from src/components-examples/cdk-experimental/menu/index.ts rename to src/components-examples/cdk/menu/index.ts index f37fc6fb93df..b355919d086e 100644 --- a/src/components-examples/cdk-experimental/menu/index.ts +++ b/src/components-examples/cdk/menu/index.ts @@ -1,5 +1,5 @@ import {NgModule} from '@angular/core'; -import {CdkMenuModule} from '@angular/cdk-experimental/menu'; +import {CdkMenuModule} from '@angular/cdk/menu'; import {CdkMenuStandaloneMenuExample} from './cdk-menu-standalone-menu/cdk-menu-standalone-menu-example'; import {CdkMenuStandaloneStatefulMenuExample} from './cdk-menu-standalone-stateful-menu/cdk-menu-standalone-stateful-menu-example'; import {CdkMenuMenubarExample} from './cdk-menu-menubar/cdk-menu-menubar-example'; diff --git a/src/components-examples/config.bzl b/src/components-examples/config.bzl index 909d3aecf7a3..c6958d329372 100644 --- a/src/components-examples/config.bzl +++ b/src/components-examples/config.bzl @@ -54,8 +54,8 @@ ALL_EXAMPLES = [ "//src/components-examples/cdk/clipboard", "//src/components-examples/cdk/a11y", "//src/components-examples/cdk/layout", + "//src/components-examples/cdk/menu", "//src/components-examples/cdk/overlay", - "//src/components-examples/cdk-experimental/menu", "//src/components-examples/cdk-experimental/popover-edit", "//src/components-examples/cdk-experimental/selection", ] diff --git a/src/dev-app/BUILD.bazel b/src/dev-app/BUILD.bazel index 28f7b78cbe8a..85817f905106 100644 --- a/src/dev-app/BUILD.bazel +++ b/src/dev-app/BUILD.bazel @@ -26,7 +26,7 @@ ng_module( "//src/dev-app/cdk-dialog", "//src/dev-app/cdk-experimental-combobox", "//src/dev-app/cdk-experimental-listbox", - "//src/dev-app/cdk-experimental-menu", + "//src/dev-app/cdk-menu", "//src/dev-app/checkbox", "//src/dev-app/chips", "//src/dev-app/clipboard", diff --git a/src/dev-app/cdk-experimental-menu/BUILD.bazel b/src/dev-app/cdk-menu/BUILD.bazel similarity index 67% rename from src/dev-app/cdk-experimental-menu/BUILD.bazel rename to src/dev-app/cdk-menu/BUILD.bazel index b7034d9f5765..8d7d4648f70b 100644 --- a/src/dev-app/cdk-experimental-menu/BUILD.bazel +++ b/src/dev-app/cdk-menu/BUILD.bazel @@ -3,15 +3,15 @@ load("//tools:defaults.bzl", "ng_module") package(default_visibility = ["//visibility:public"]) ng_module( - name = "cdk-experimental-menu", + name = "cdk-menu", srcs = glob(["**/*.ts"]), assets = [ "cdk-menu-demo.html", "cdk-menu-demo.css", ], deps = [ - "//src/cdk-experimental/menu", - "//src/components-examples/cdk-experimental/menu", + "//src/cdk/menu", + "//src/components-examples/cdk/menu", "@npm//@angular/router", ], ) diff --git a/src/dev-app/cdk-experimental-menu/cdk-menu-demo-module.ts b/src/dev-app/cdk-menu/cdk-menu-demo-module.ts similarity index 88% rename from src/dev-app/cdk-experimental-menu/cdk-menu-demo-module.ts rename to src/dev-app/cdk-menu/cdk-menu-demo-module.ts index 93ca63ba31e9..c8e5f661dbc3 100644 --- a/src/dev-app/cdk-experimental-menu/cdk-menu-demo-module.ts +++ b/src/dev-app/cdk-menu/cdk-menu-demo-module.ts @@ -9,8 +9,8 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {RouterModule} from '@angular/router'; -import {CdkMenuModule} from '@angular/cdk-experimental/menu'; -import {CdkMenuExamplesModule} from '@angular/components-examples/cdk-experimental/menu'; +import {CdkMenuModule} from '@angular/cdk/menu'; +import {CdkMenuExamplesModule} from '@angular/components-examples/cdk/menu'; import {CdkMenuDemo} from './cdk-menu-demo'; diff --git a/src/dev-app/cdk-experimental-menu/cdk-menu-demo.css b/src/dev-app/cdk-menu/cdk-menu-demo.css similarity index 100% rename from src/dev-app/cdk-experimental-menu/cdk-menu-demo.css rename to src/dev-app/cdk-menu/cdk-menu-demo.css diff --git a/src/dev-app/cdk-experimental-menu/cdk-menu-demo.html b/src/dev-app/cdk-menu/cdk-menu-demo.html similarity index 100% rename from src/dev-app/cdk-experimental-menu/cdk-menu-demo.html rename to src/dev-app/cdk-menu/cdk-menu-demo.html diff --git a/src/dev-app/cdk-experimental-menu/cdk-menu-demo.ts b/src/dev-app/cdk-menu/cdk-menu-demo.ts similarity index 100% rename from src/dev-app/cdk-experimental-menu/cdk-menu-demo.ts rename to src/dev-app/cdk-menu/cdk-menu-demo.ts diff --git a/src/dev-app/dev-app/dev-app-layout.ts b/src/dev-app/dev-app/dev-app-layout.ts index b1fa09198f83..9e2ce8c137ba 100644 --- a/src/dev-app/dev-app/dev-app-layout.ts +++ b/src/dev-app/dev-app/dev-app-layout.ts @@ -37,9 +37,9 @@ export class DevAppLayout { {name: 'Button', route: '/button'}, {name: 'Card', route: '/card'}, {name: 'CDK Dialog', route: '/cdk-dialog'}, + {name: 'CDK Menu', route: '/cdk-menu'}, {name: 'CDK Experimental Combobox', route: '/cdk-experimental-combobox'}, {name: 'CDK Experimental Listbox', route: '/cdk-experimental-listbox'}, - {name: 'CDK Experimental Menu', route: '/cdk-experimental-menu'}, {name: 'Checkbox', route: '/checkbox'}, {name: 'Chips', route: '/chips'}, {name: 'Clipboard', route: '/clipboard'}, diff --git a/src/dev-app/menubar/BUILD.bazel b/src/dev-app/menubar/BUILD.bazel index 1b2eb34bbf6b..b4524166e076 100644 --- a/src/dev-app/menubar/BUILD.bazel +++ b/src/dev-app/menubar/BUILD.bazel @@ -10,7 +10,7 @@ ng_module( ":mat_menubar_demo_scss", ], deps = [ - "//src/cdk-experimental/menu", + "//src/cdk/menu", "//src/material-experimental/menubar", "@npm//@angular/router", ], diff --git a/src/dev-app/menubar/mat-menubar-demo-module.ts b/src/dev-app/menubar/mat-menubar-demo-module.ts index a1c7b375207e..76f8bcdb2974 100644 --- a/src/dev-app/menubar/mat-menubar-demo-module.ts +++ b/src/dev-app/menubar/mat-menubar-demo-module.ts @@ -9,7 +9,7 @@ import {NgModule} from '@angular/core'; import {RouterModule} from '@angular/router'; import {MatMenuBarModule} from '@angular/material-experimental/menubar'; -import {CdkMenuModule} from '@angular/cdk-experimental/menu'; +import {CdkMenuModule} from '@angular/cdk/menu'; import {MatMenuBarDemo, DemoMenu, DemoMenuItem} from './mat-menubar-demo'; @NgModule({ diff --git a/src/dev-app/menubar/mat-menubar-demo.ts b/src/dev-app/menubar/mat-menubar-demo.ts index 38952cbccd84..503e9b62c42d 100644 --- a/src/dev-app/menubar/mat-menubar-demo.ts +++ b/src/dev-app/menubar/mat-menubar-demo.ts @@ -7,7 +7,7 @@ */ import {Component, ViewEncapsulation} from '@angular/core'; -import {CdkMenu, CdkMenuItem, CdkMenuGroup, CDK_MENU} from '@angular/cdk-experimental/menu'; +import {CdkMenu, CdkMenuItem, CdkMenuGroup, CDK_MENU} from '@angular/cdk/menu'; @Component({ templateUrl: 'mat-menubar-demo.html', diff --git a/src/dev-app/routes.ts b/src/dev-app/routes.ts index 325bd68c17f5..443facc0f2be 100644 --- a/src/dev-app/routes.ts +++ b/src/dev-app/routes.ts @@ -62,9 +62,8 @@ export const DEV_APP_ROUTES: Routes = [ ), }, { - path: 'cdk-experimental-menu', - loadChildren: () => - import('./cdk-experimental-menu/cdk-menu-demo-module').then(m => m.CdkMenuDemoModule), + path: 'cdk-menu', + loadChildren: () => import('./cdk-menu/cdk-menu-demo-module').then(m => m.CdkMenuDemoModule), }, { path: 'checkbox', diff --git a/src/material-experimental/menubar/BUILD.bazel b/src/material-experimental/menubar/BUILD.bazel index 8afaee3c0daa..a4824bb574e0 100644 --- a/src/material-experimental/menubar/BUILD.bazel +++ b/src/material-experimental/menubar/BUILD.bazel @@ -20,7 +20,7 @@ ng_module( ":menubar-item.css", ] + glob(["**/*.html"]), deps = [ - "//src/cdk-experimental/menu", + "//src/cdk/menu", "@npm//@angular/core", ], ) @@ -48,8 +48,8 @@ ng_test_library( ), deps = [ ":menubar", - "//src/cdk-experimental/menu", "//src/cdk/keycodes", + "//src/cdk/menu", "//src/cdk/testing/private", "@npm//@angular/platform-browser", ], diff --git a/src/material-experimental/menubar/menubar-item.spec.ts b/src/material-experimental/menubar/menubar-item.spec.ts index 43f260a88435..b668e11f04d3 100644 --- a/src/material-experimental/menubar/menubar-item.spec.ts +++ b/src/material-experimental/menubar/menubar-item.spec.ts @@ -1,6 +1,6 @@ import {Component, ElementRef, ViewChild} from '@angular/core'; import {ComponentFixture, waitForAsync, TestBed} from '@angular/core/testing'; -import {CdkMenuItem, CdkMenuModule, CdkMenu} from '@angular/cdk-experimental/menu'; +import {CdkMenuItem, CdkMenuModule, CdkMenu} from '@angular/cdk/menu'; import {MatMenuBarItem} from './menubar-item'; import {MatMenuBarModule} from './menubar-module'; diff --git a/src/material-experimental/menubar/menubar-item.ts b/src/material-experimental/menubar/menubar-item.ts index 62eb09bd2779..322a4432c013 100644 --- a/src/material-experimental/menubar/menubar-item.ts +++ b/src/material-experimental/menubar/menubar-item.ts @@ -7,7 +7,7 @@ */ import {Component, ViewEncapsulation, ChangeDetectionStrategy} from '@angular/core'; -import {CdkMenuItem} from '@angular/cdk-experimental/menu'; +import {CdkMenuItem} from '@angular/cdk/menu'; /** Removes all icons from within the given element. */ function removeIcons(element: Element) { diff --git a/src/material-experimental/menubar/menubar-module.ts b/src/material-experimental/menubar/menubar-module.ts index 85d5ed0e8ac4..583d5773a932 100644 --- a/src/material-experimental/menubar/menubar-module.ts +++ b/src/material-experimental/menubar/menubar-module.ts @@ -7,7 +7,7 @@ */ import {NgModule} from '@angular/core'; -import {CdkMenuModule} from '@angular/cdk-experimental/menu'; +import {CdkMenuModule} from '@angular/cdk/menu'; import {MatMenuBar} from './menubar'; import {MatMenuBarItem} from './menubar-item'; diff --git a/src/material-experimental/menubar/menubar.spec.ts b/src/material-experimental/menubar/menubar.spec.ts index 84b088b3b61e..d09c11827e54 100644 --- a/src/material-experimental/menubar/menubar.spec.ts +++ b/src/material-experimental/menubar/menubar.spec.ts @@ -1,6 +1,6 @@ import {Component, ViewChild, ElementRef} from '@angular/core'; import {RIGHT_ARROW} from '@angular/cdk/keycodes'; -import {CdkMenuBar} from '@angular/cdk-experimental/menu'; +import {CdkMenuBar} from '@angular/cdk/menu'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {dispatchKeyboardEvent} from '../../cdk/testing/private'; import {MatMenuBarModule} from './menubar-module'; diff --git a/src/material-experimental/menubar/menubar.ts b/src/material-experimental/menubar/menubar.ts index 0ee5f1c5f33b..14d517304a86 100644 --- a/src/material-experimental/menubar/menubar.ts +++ b/src/material-experimental/menubar/menubar.ts @@ -7,13 +7,7 @@ */ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core'; -import { - CDK_MENU, - CdkMenuBar, - CdkMenuGroup, - MenuStack, - MENU_STACK, -} from '@angular/cdk-experimental/menu'; +import {CDK_MENU, CdkMenuBar, CdkMenuGroup, MenuStack, MENU_STACK} from '@angular/cdk/menu'; /** * A material design Menubar adhering to the functionality of CdkMenuBar. MatMenubar diff --git a/tools/public_api_guard/cdk/menu.md b/tools/public_api_guard/cdk/menu.md new file mode 100644 index 000000000000..ba3083d2f801 --- /dev/null +++ b/tools/public_api_guard/cdk/menu.md @@ -0,0 +1,436 @@ +## API Report File for "components-srcs" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AfterContentInit } from '@angular/core'; +import { BooleanInput } from '@angular/cdk/coercion'; +import { ConnectedPosition } from '@angular/cdk/overlay'; +import { Directionality } from '@angular/cdk/bidi'; +import { ElementRef } from '@angular/core'; +import { EventEmitter } from '@angular/core'; +import { FocusableOption } from '@angular/cdk/a11y'; +import { FocusKeyManager } from '@angular/cdk/a11y'; +import { FocusOrigin } from '@angular/cdk/a11y'; +import * as i0 from '@angular/core'; +import * as i10 from '@angular/cdk/overlay'; +import { InjectionToken } from '@angular/core'; +import { Injector } from '@angular/core'; +import { NgZone } from '@angular/core'; +import { Observable } from 'rxjs'; +import { OnDestroy } from '@angular/core'; +import { Optional } from '@angular/core'; +import { Overlay } from '@angular/cdk/overlay'; +import { OverlayRef } from '@angular/cdk/overlay'; +import { QueryList } from '@angular/core'; +import { Subject } from 'rxjs'; +import { TemplatePortal } from '@angular/cdk/portal'; +import { TemplateRef } from '@angular/core'; +import { UniqueSelectionDispatcher } from '@angular/cdk/collections'; +import { ViewContainerRef } from '@angular/core'; + +// @public +export const CDK_MENU: InjectionToken; + +// @public +export class CdkContextMenuTrigger extends CdkMenuTriggerBase implements OnDestroy { + constructor( + injector: Injector, + viewContainerRef: ViewContainerRef, + _overlay: Overlay, + _contextMenuTracker: ContextMenuTracker, + menuStack: MenuStack, + _directionality?: Directionality | undefined); + close(): void; + get disabled(): boolean; + set disabled(value: BooleanInput); + open(coordinates: ContextMenuCoordinates): void; + _openOnContextMenu(event: MouseEvent): void; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export class CdkMenu extends CdkMenuBase implements AfterContentInit, OnDestroy { + constructor( + elementRef: ElementRef, + ngZone: NgZone, + menuStack: MenuStack, + _parentTrigger?: CdkMenuTriggerBase | undefined, + menuAim?: MenuAim, + dir?: Directionality); + readonly closed: EventEmitter; + _handleKeyEvent(event: KeyboardEvent): void; + readonly isInline: boolean; + // (undocumented) + ngAfterContentInit(): void; + // (undocumented) + ngOnDestroy(): void; + readonly orientation = "vertical"; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export class CdkMenuBar extends CdkMenuBase implements AfterContentInit { + constructor( + elementRef: ElementRef, + ngZone: NgZone, + menuStack: MenuStack, + menuAim?: MenuAim, + dir?: Directionality); + _handleKeyEvent(event: KeyboardEvent): void; + readonly isInline = true; + // (undocumented) + ngAfterContentInit(): void; + readonly orientation = "horizontal"; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export abstract class CdkMenuBase extends CdkMenuGroup implements Menu, AfterContentInit, OnDestroy { + protected constructor( + elementRef: ElementRef, + ngZone: NgZone, + menuStack: MenuStack, + menuAim?: MenuAim | undefined, + dir?: Directionality | undefined); + protected closeOpenMenu(menu: MenuStackItem, options?: { + focusParentTrigger?: boolean; + }): void; + protected readonly destroyed: Subject; + protected readonly dir?: Directionality | undefined; + focusFirstItem(focusOrigin?: FocusOrigin): void; + focusLastItem(focusOrigin?: FocusOrigin): void; + _getTabIndex(): 0 | -1 | null; + id: string; + isInline: boolean; + readonly items: QueryList; + protected keyManager: FocusKeyManager; + protected readonly menuAim?: MenuAim | undefined; + readonly menuStack: MenuStack; + readonly nativeElement: HTMLElement; + // (undocumented) + ngAfterContentInit(): void; + // (undocumented) + ngOnDestroy(): void; + protected ngZone: NgZone; + orientation: 'horizontal' | 'vertical'; + protected pointerTracker?: PointerFocusTracker; + protected triggerItem?: CdkMenuItem; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export class CdkMenuGroup { + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export class CdkMenuItem implements FocusableOption, FocusableElement, Toggler, OnDestroy { + constructor( + _elementRef: ElementRef, + _ngZone: NgZone, + _menuStack: MenuStack, + _parentMenu?: Menu | undefined, + _menuAim?: MenuAim | undefined, + _dir?: Directionality | undefined, + _menuTrigger?: CdkMenuTrigger | undefined); + protected closeOnSpacebarTrigger: boolean; + protected readonly destroyed: Subject; + get disabled(): boolean; + set disabled(value: BooleanInput); + readonly _elementRef: ElementRef; + focus(): void; + getLabel(): string; + getMenu(): Menu | undefined; + getMenuTrigger(): CdkMenuTrigger | undefined; + readonly hasMenu: boolean; + isMenuOpen(): boolean; + // (undocumented) + ngOnDestroy(): void; + _onKeydown(event: KeyboardEvent): void; + _resetTabIndex(): void; + _setTabIndex(event?: MouseEvent): void; + _tabindex: 0 | -1; + trigger(options?: { + keepOpen: boolean; + }): void; + readonly triggered: EventEmitter; + typeaheadLabel: string | null; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export class CdkMenuItemCheckbox extends CdkMenuItemSelectable { + trigger(options?: { + keepOpen: boolean; + }): void; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export class CdkMenuItemRadio extends CdkMenuItemSelectable implements OnDestroy { + constructor( + element: ElementRef, + ngZone: NgZone, + _selectionDispatcher: UniqueSelectionDispatcher, + menuStack: MenuStack, + parentMenu?: Menu, + menuAim?: MenuAim, + dir?: Directionality, + menuTrigger?: CdkMenuTrigger); + // (undocumented) + ngOnDestroy(): void; + trigger(options?: { + keepOpen: boolean; + }): void; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export abstract class CdkMenuItemSelectable extends CdkMenuItem { + get checked(): boolean; + set checked(value: BooleanInput); + protected closeOnSpacebarTrigger: boolean; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export class CdkMenuModule { + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; + // (undocumented) + static ɵinj: i0.ɵɵInjectorDeclaration; + // (undocumented) + static ɵmod: i0.ɵɵNgModuleDeclaration; +} + +// @public +export class CdkMenuTrigger extends CdkMenuTriggerBase implements OnDestroy { + constructor( + injector: Injector, + _elementRef: ElementRef, + viewContainerRef: ViewContainerRef, + _overlay: Overlay, + _ngZone: NgZone, + menuStack: MenuStack, + _parentMenu?: Menu | undefined, + _menuAim?: MenuAim | undefined, + _directionality?: Directionality | undefined); + close(): void; + getMenu(): Menu | undefined; + open(): void; + _setHasFocus(hasFocus: boolean): void; + toggle(): void; + _toggleOnKeydown(event: KeyboardEvent): void; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export abstract class CdkMenuTriggerBase implements OnDestroy { + protected constructor( + injector: Injector, + viewContainerRef: ViewContainerRef, + menuStack: MenuStack); + protected childMenu?: Menu; + readonly closed: EventEmitter; + protected readonly destroyed: Subject; + protected getMenuContentPortal(): TemplatePortal; + protected readonly injector: Injector; + protected isElementInsideMenuStack(element: Element): boolean; + isOpen(): boolean; + menuPosition: ConnectedPosition[]; + protected readonly menuStack: MenuStack; + menuTemplateRef: TemplateRef; + // (undocumented) + ngOnDestroy(): void; + readonly opened: EventEmitter; + protected overlayRef: OverlayRef | null; + registerChildMenu(child: Menu): void; + protected readonly stopOutsideClicksListener: Observable; + protected readonly viewContainerRef: ViewContainerRef; + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export class CdkTargetMenuAim { + // (undocumented) + static ɵdir: i0.ɵɵDirectiveDeclaration; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; +} + +// @public +export interface CloseOptions { + focusNextOnEmpty?: FocusNext; + focusParentTrigger?: boolean; +} + +// @public +export type ContextMenuCoordinates = { + x: number; + y: number; +}; + +// @public +export class ContextMenuTracker { + update(trigger: CdkContextMenuTrigger): void; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; + // (undocumented) + static ɵprov: i0.ɵɵInjectableDeclaration; +} + +// @public +export interface FocusableElement { + _elementRef: ElementRef; +} + +// @public +export const enum FocusNext { + // (undocumented) + currentItem = 2, + // (undocumented) + nextItem = 0, + // (undocumented) + previousItem = 1 +} + +// @public +export interface Menu extends MenuStackItem { + focusFirstItem(focusOrigin: FocusOrigin): void; + focusLastItem(focusOrigin: FocusOrigin): void; + id: string; + nativeElement: HTMLElement; + readonly orientation: 'horizontal' | 'vertical'; +} + +// @public +export const MENU_AIM: InjectionToken; + +// @public +export const MENU_STACK: InjectionToken; + +// @public +export const MENU_TRIGGER: InjectionToken; + +// @public +export interface MenuAim { + initialize(menu: Menu, pointerTracker: PointerFocusTracker): void; + toggle(doToggle: () => void): void; +} + +// @public +export class MenuStack { + close(lastItem: MenuStackItem, options?: CloseOptions): void; + closeAll(options?: CloseOptions): void; + readonly closed: Observable; + closeSubMenuOf(lastItem: MenuStackItem): boolean; + readonly emptied: Observable; + readonly hasFocus: Observable; + hasInlineMenu(): boolean; + readonly id: string; + static inline(orientation: 'vertical' | 'horizontal'): MenuStack; + inlineMenuOrientation(): "vertical" | "horizontal" | null; + isEmpty(): boolean; + length(): number; + peek(): MenuStackItem | undefined; + push(menu: MenuStackItem): void; + setHasFocus(hasFocus: boolean): void; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; + // (undocumented) + static ɵprov: i0.ɵɵInjectableDeclaration; +} + +// @public +export interface MenuStackCloseEvent { + focusParentTrigger?: boolean; + item: MenuStackItem; +} + +// @public +export interface MenuStackItem { + menuStack?: MenuStack; +} + +// @public +export const PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER: (orientation: 'vertical' | 'horizontal') => { + provide: InjectionToken; + deps: Optional[][]; + useFactory: (parentMenuStack?: MenuStack | undefined) => MenuStack; +}; + +// @public +export const PARENT_OR_NEW_MENU_STACK_PROVIDER: { + provide: InjectionToken; + deps: Optional[][]; + useFactory: (parentMenuStack?: MenuStack | undefined) => MenuStack; +}; + +// @public +export class PointerFocusTracker { + constructor( + _items: QueryList); + activeElement?: T; + destroy(): void; + readonly entered: Observable; + readonly exited: Observable; + previousElement?: T; +} + +// @public +export class TargetMenuAim implements MenuAim, OnDestroy { + constructor( + _ngZone: NgZone); + initialize(menu: Menu, pointerTracker: PointerFocusTracker): void; + // (undocumented) + ngOnDestroy(): void; + toggle(doToggle: () => void): void; + // (undocumented) + static ɵfac: i0.ɵɵFactoryDeclaration; + // (undocumented) + static ɵprov: i0.ɵɵInjectableDeclaration; +} + +// @public +export interface Toggler { + getMenu(): Menu | undefined; +} + +// (No @packageDocumentation comment for this package) + +```