File tree Expand file tree Collapse file tree 9 files changed +101
-2
lines changed
dev-app/connected-overlay Expand file tree Collapse file tree 9 files changed +101
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ ALL_EXAMPLES = [
56
56
"//src/components-examples/cdk/drag-drop" ,
57
57
"//src/components-examples/cdk/clipboard" ,
58
58
"//src/components-examples/cdk/a11y" ,
59
+ "//src/components-examples/cdk/overlay" ,
59
60
"//src/components-examples/cdk-experimental/popover-edit" ,
60
61
]
61
62
Original file line number Diff line number Diff line change
1
+ load ("//tools:defaults.bzl" , "ng_module" )
2
+
3
+ package (default_visibility = ["//visibility:public" ])
4
+
5
+ ng_module (
6
+ name = "overlay" ,
7
+ srcs = glob (["**/*.ts" ]),
8
+ assets = glob ([
9
+ "**/*.html" ,
10
+ "**/*.css" ,
11
+ ]),
12
+ module_name = "@angular/components-examples/cdk/overlay" ,
13
+ deps = [
14
+ "//src/cdk/overlay" ,
15
+ ],
16
+ )
17
+
18
+ filegroup (
19
+ name = "source-files" ,
20
+ srcs = glob ([
21
+ "**/*.html" ,
22
+ "**/*.css" ,
23
+ "**/*.ts" ,
24
+ ]),
25
+ )
Original file line number Diff line number Diff line change
1
+ .example-list {
2
+ width : 100px ;
3
+ border : solid 1px # ccc ;
4
+ border-radius : 5px ;
5
+ background : # fff ;
6
+ text-align : center;
7
+ padding : 10px ;
8
+ margin : 0 ;
9
+ }
10
+
11
+ .example-list > li {
12
+ list-style-type : none;
13
+ border-bottom : solid 1px # 8b8b8b ;
14
+ padding : 8px 0 ;
15
+ }
16
+
17
+ .example-list > li : last-child {
18
+ border-bottom : none;
19
+ }
Original file line number Diff line number Diff line change
1
+ <!-- This button triggers the overlay and is it's origin -->
2
+ < button (click) ="isOpen = !isOpen " type ="button " cdkOverlayOrigin #trigger ="cdkOverlayOrigin ">
3
+ {{isOpen ? "Close" : "Open"}}
4
+ </ button >
5
+
6
+ <!-- This template displays the overlay content and is connected to the button -->
7
+ < ng-template
8
+ cdkConnectedOverlay
9
+ [cdkConnectedOverlayOrigin] ="trigger "
10
+ [cdkConnectedOverlayOpen] ="isOpen "
11
+ >
12
+ < ul class ="example-list ">
13
+ < li > Item 1</ li >
14
+ < li > Item 2</ li >
15
+ < li > Item 3</ li >
16
+ </ ul >
17
+ </ ng-template >
Original file line number Diff line number Diff line change
1
+ import { Component } from '@angular/core' ;
2
+
3
+ /**
4
+ * @title Overlay basic example
5
+ */
6
+ @Component ( {
7
+ selector : 'cdk-overlay-basic-example' ,
8
+ templateUrl : './cdk-overlay-basic-example.html' ,
9
+ styleUrls : [ './cdk-overlay-basic-example.css' ] ,
10
+ } )
11
+ export class CdkOverlayBasicExample {
12
+ isOpen = false ;
13
+ }
Original file line number Diff line number Diff line change
1
+ import { NgModule } from '@angular/core' ;
2
+ import { OverlayModule } from '@angular/cdk/overlay' ;
3
+
4
+ import { CdkOverlayBasicExample } from './cdk-overlay-basic/cdk-overlay-basic-example' ;
5
+
6
+ export { CdkOverlayBasicExample } ;
7
+
8
+ const EXAMPLES = [ CdkOverlayBasicExample ] ;
9
+
10
+ @NgModule ( {
11
+ imports : [ OverlayModule ] ,
12
+ declarations : EXAMPLES ,
13
+ exports : EXAMPLES ,
14
+ entryComponents : EXAMPLES ,
15
+ } )
16
+ export class CdkOverlayExamplesModule { }
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ ng_module(
13
13
"//src/cdk/bidi" ,
14
14
"//src/cdk/overlay" ,
15
15
"//src/cdk/portal" ,
16
+ "//src/components-examples/cdk/overlay" ,
16
17
"//src/material/button" ,
17
18
"//src/material/checkbox" ,
18
19
"//src/material/radio" ,
Original file line number Diff line number Diff line change @@ -14,10 +14,13 @@ import {MatButtonModule} from '@angular/material/button';
14
14
import { MatCheckboxModule } from '@angular/material/checkbox' ;
15
15
import { MatRadioModule } from '@angular/material/radio' ;
16
16
import { RouterModule } from '@angular/router' ;
17
+ import { CdkOverlayExamplesModule } from '@angular/components-examples/cdk/overlay' ;
18
+
17
19
import { ConnectedOverlayDemo } from './connected-overlay-demo' ;
18
20
19
21
@NgModule ( {
20
22
imports : [
23
+ CdkOverlayExamplesModule ,
21
24
CommonModule ,
22
25
FormsModule ,
23
26
MatButtonModule ,
@@ -28,5 +31,4 @@ import {ConnectedOverlayDemo} from './connected-overlay-demo';
28
31
] ,
29
32
declarations : [ ConnectedOverlayDemo ] ,
30
33
} )
31
- export class ConnectedOverlayDemoModule {
32
- }
34
+ export class ConnectedOverlayDemoModule { }
Original file line number Diff line number Diff line change
1
+ < h3 > Basic overlay</ h3 >
2
+ < cdk-overlay-basic-example > </ cdk-overlay-basic-example >
3
+
1
4
< div style ="height: 500px "> </ div >
2
5
6
+ < h3 > Debug Overlay</ h3 >
7
+
3
8
< div class ="demo-options-connected-overlay mat-typography ">
4
9
< div >
5
10
< h2 > Origin X</ h2 >
You can’t perform that action at this time.
0 commit comments