Skip to content

Commit 05d07c7

Browse files
authored
build(material-experimental/menubar): add material menubar skeleton and dev-app (#20084)
Add the material-experimental/menubar component skeletons and the accompanying dev app and its configuration.
1 parent 2980b07 commit 05d07c7

20 files changed

+186
-0
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
/src/material-experimental/mdc-table/** @andrewseguin
120120
/src/material-experimental/mdc-theming/** @mmalerba
121121
/src/material-experimental/mdc-typography/** @mmalerba
122+
/src/material-experimental/menubar/** @jelbourn @andy9775
122123
/src/material-experimental/popover-edit/** @kseamon @andrewseguin
123124

124125
# CDK experimental package
@@ -185,6 +186,7 @@
185186
/src/dev-app/mdc-table/** @andrewseguin
186187
/src/dev-app/mdc-tabs/** @crisbeto
187188
/src/dev-app/menu/** @crisbeto
189+
/src/dev-app/menubar/** @jelbourn @andy9775
188190
/src/dev-app/overlay/** @jelbourn @crisbeto
189191
/src/dev-app/paginator/** @andrewseguin
190192
/src/dev-app/platform/** @jelbourn @devversion

src/dev-app/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ ng_module(
6262
"//src/dev-app/mdc-table",
6363
"//src/dev-app/mdc-tabs",
6464
"//src/dev-app/menu",
65+
"//src/dev-app/menubar",
6566
"//src/dev-app/paginator",
6667
"//src/dev-app/platform",
6768
"//src/dev-app/popover-edit",

src/dev-app/dev-app/dev-app-layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export class DevAppLayout {
5050
{name: 'List', route: '/list'},
5151
{name: 'Live Announcer', route: '/live-announcer'},
5252
{name: 'Menu', route: '/menu'},
53+
{name: 'Menubar', route: '/menubar'},
5354
{name: 'Paginator', route: '/paginator'},
5455
{name: 'Platform', route: '/platform'},
5556
{name: 'Popover Edit', route: '/popover-edit'},

src/dev-app/dev-app/routes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ export const DEV_APP_ROUTES: Routes = [
6565
path: 'live-announcer',
6666
loadChildren: 'live-announcer/live-announcer-demo-module#LiveAnnouncerDemoModule'
6767
},
68+
{
69+
path: 'menubar',
70+
loadChildren: 'menubar/mat-menubar-demo-module#MatMenuBarDemoModule'
71+
},
6872
{path: 'mdc-button', loadChildren: 'mdc-button/mdc-button-demo-module#MdcButtonDemoModule'},
6973
{path: 'mdc-card', loadChildren: 'mdc-card/mdc-card-demo-module#MdcCardDemoModule'},
7074
{

src/dev-app/menubar/BUILD.bazel

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("//tools:defaults.bzl", "ng_module")
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
ng_module(
6+
name = "menubar",
7+
srcs = glob(["**/*.ts"]),
8+
assets = [
9+
"mat-menubar-demo.html",
10+
],
11+
deps = [
12+
"//src/material-experimental/menubar",
13+
"@npm//@angular/router",
14+
],
15+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {NgModule} from '@angular/core';
10+
import {RouterModule} from '@angular/router';
11+
import {MatMenuBarModule} from '@angular/material-experimental/menubar';
12+
import {MatMenuBarDemo} from './mat-menubar-demo';
13+
14+
@NgModule({
15+
imports: [MatMenuBarModule, RouterModule.forChild([{path: '', component: MatMenuBarDemo}])],
16+
declarations: [MatMenuBarDemo],
17+
})
18+
export class MatMenuBarDemoModule {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<mat-menubar>
2+
<mat-menubar-item>File</mat-menubar-item>
3+
<mat-menubar-item>Edit</mat-menubar-item>
4+
<mat-menubar-item>View</mat-menubar-item>
5+
</mat-menubar>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Component} from '@angular/core';
10+
11+
@Component({
12+
templateUrl: 'mat-menubar-demo.html',
13+
})
14+
export class MatMenuBarDemo {}

src/material-experimental/config.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ entryPoints = [
2727
"mdc-snack-bar",
2828
"mdc-table",
2929
"mdc-tabs",
30+
"menubar",
3031
"popover-edit",
3132
]
3233

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
load("//tools:defaults.bzl", "ng_module", "sass_binary", "sass_library")
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
ng_module(
6+
name = "menubar",
7+
srcs = glob(
8+
["**/*.ts"],
9+
exclude = ["**/*.spec.ts"],
10+
),
11+
assets = [
12+
":menubar.css",
13+
":menubar-item.css",
14+
] + glob(["**/*.html"]),
15+
module_name = "@angular/material-experimental/menubar",
16+
deps = [
17+
"@npm//@angular/core",
18+
],
19+
)
20+
21+
sass_library(
22+
name = "menubar_scss_lib",
23+
srcs = glob(["**/_*.scss"]),
24+
)
25+
26+
sass_binary(
27+
name = "menubar_scss",
28+
src = "menubar.scss",
29+
)
30+
31+
sass_binary(
32+
name = "menubar_item_scss",
33+
src = "menubar-item.scss",
34+
)
35+
36+
filegroup(
37+
name = "source-files",
38+
srcs = glob(["**/*.ts"]),
39+
)

src/material-experimental/menubar/_menubar-theme.scss

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
export * from './public-api';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<ng-content></ng-content>

src/material-experimental/menubar/menubar-item.scss

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Component, ViewEncapsulation, ChangeDetectionStrategy} from '@angular/core';
10+
11+
/**
12+
* A material design MenubarItem adhering to the functionality of CdkMenuItem and
13+
* CdkMenuItemTrigger. Its main purpose is to trigger menus and it lives inside of
14+
* MatMenubar.
15+
*/
16+
@Component({
17+
selector: 'mat-menubar-item',
18+
exportAs: 'matMenubarItem',
19+
templateUrl: 'menubar-item.html',
20+
styleUrls: ['menubar-item.css'],
21+
encapsulation: ViewEncapsulation.None,
22+
changeDetection: ChangeDetectionStrategy.OnPush,
23+
})
24+
export class MatMenuBarItem {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {NgModule} from '@angular/core';
10+
import {MatMenuBar} from './menubar';
11+
import {MatMenuBarItem} from './menubar-item';
12+
13+
@NgModule({
14+
exports: [MatMenuBar, MatMenuBarItem],
15+
declarations: [MatMenuBar, MatMenuBarItem],
16+
})
17+
export class MatMenuBarModule {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<ng-content></ng-content>

src/material-experimental/menubar/menubar.scss

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Component, ViewEncapsulation, ChangeDetectionStrategy} from '@angular/core';
10+
11+
/**
12+
* A material design Menubar adhering to the functionality of CdkMenuBar. MatMenubar
13+
* should contain MatMenubarItems which trigger their own sub-menus.
14+
*/
15+
@Component({
16+
selector: 'mat-menubar',
17+
exportAs: 'matMenubar',
18+
templateUrl: 'menubar.html',
19+
styleUrls: ['menubar.css'],
20+
encapsulation: ViewEncapsulation.None,
21+
changeDetection: ChangeDetectionStrategy.OnPush,
22+
})
23+
export class MatMenuBar {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
export * from './menubar';
10+
export * from './menubar-item';
11+
export * from './menubar-module';

0 commit comments

Comments
 (0)