Skip to content

Commit 5bee1a4

Browse files
devversiontinayuangao
authored andcommitted
feat: expose version object in releases (#4962)
* In releases there will be a constant called `VERSION` that holds the current version of the installed package (material or cdk) * This is similar as for every @angular package like core, forms, compiler. Add accessibility demo page for grid list .
1 parent 3bfe7f0 commit 5bee1a4

File tree

6 files changed

+82
-0
lines changed

6 files changed

+82
-0
lines changed

src/demo-app/a11y/a11y-module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {DemoMaterialModule} from '../demo-material-module';
66
import {AccessibilityHome, AccessibilityDemo} from './a11y';
77
import {ButtonAccessibilityDemo} from './button/button-a11y';
88
import {CheckboxAccessibilityDemo} from './checkbox/checkbox-a11y';
9+
import {GridListAccessibilityDemo} from './grid-list/grid-list-a11y';
910

1011
@NgModule({
1112
imports: [
@@ -28,6 +29,7 @@ export class AccessibilityRoutingModule {}
2829
AccessibilityHome,
2930
ButtonAccessibilityDemo,
3031
CheckboxAccessibilityDemo,
32+
GridListAccessibilityDemo,
3133
]
3234
})
3335
export class AccessibilityDemoModule {}

src/demo-app/a11y/a11y.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ export class AccessibilityDemo {
1919
{name: 'Home', route: '.'},
2020
{name: 'Button', route: 'button'},
2121
{name: 'Checkbox', route: 'checkbox'},
22+
{name: 'Grid list', route: 'grid-list'},
2223
];
2324
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<section>
2+
<h2>Fixed-height grid list</h2>
3+
<md-grid-list [cols]="fixedCols" [rowHeight]="fixedRowHeight">
4+
<md-grid-tile *ngFor="let tile of tiles" [colspan]="tile.cols" [rowspan]="tile.rows"
5+
[style.background]="tile.color">
6+
{{tile.text}}
7+
</md-grid-tile>
8+
</md-grid-list>
9+
</section>
10+
11+
<section>
12+
<h2>Ratio-height grid list</h2>
13+
<md-grid-list cols="2" [rowHeight]="ratio" gutterSize="4px">
14+
<md-grid-tile *ngFor="let tile of tiles" [style.background]="'lightblue'">
15+
{{tile.text}}
16+
</md-grid-tile>
17+
</md-grid-list>
18+
</section>
19+
20+
<section>
21+
<h2>Fit-height grid list</h2>
22+
<md-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
23+
[style.height]="fitListHeight">
24+
<md-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
25+
{{tile.text}}
26+
</md-grid-tile>
27+
</md-grid-list>
28+
</section>
29+
30+
<section>
31+
<h2>Grid list with header and footer</h2>
32+
<md-grid-list cols="3" rowHeight="200px">
33+
<md-grid-tile *ngFor="let dog of dogs">
34+
<md-grid-tile-header>{{dog.name}}</md-grid-tile-header>
35+
<img [alt]="dog.name" src="https://material.angularjs.org/material2_assets/ngconf/{{dog.name}}.png">
36+
<md-grid-tile-footer>
37+
<span md-line>Human: {{dog.human}}</span>
38+
<md-icon>star_border</md-icon>
39+
</md-grid-tile-footer>
40+
</md-grid-tile>
41+
</md-grid-list>
42+
</section>

src/demo-app/a11y/grid-list/grid-list-a11y.scss

Whitespace-only changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import {Component} from '@angular/core';
2+
3+
interface Dog {
4+
name: string;
5+
human: string;
6+
}
7+
@Component({
8+
moduleId: module.id,
9+
selector: 'grid-list-a11y',
10+
templateUrl: 'grid-list-a11y.html',
11+
styleUrls: ['grid-list-a11y.css'],
12+
})
13+
export class GridListAccessibilityDemo {
14+
dogs: Dog[] = [
15+
{ name: 'Porter', human: 'Kara' },
16+
{ name: 'Mal', human: 'Jeremy' },
17+
{ name: 'Koby', human: 'Igor' },
18+
{ name: 'Razzle', human: 'Ward' },
19+
{ name: 'Molly', human: 'Rob' },
20+
{ name: 'Husi', human: 'Matias' },
21+
];
22+
23+
tiles = [
24+
{text: 'One', cols: 3, rows: 1, color: 'lightblue'},
25+
{text: 'Two', cols: 1, rows: 2, color: 'lightgreen'},
26+
{text: 'Three', cols: 1, rows: 1, color: 'lightpink'},
27+
{text: 'Four', cols: 2, rows: 1, color: '#DDBDF1'},
28+
];
29+
30+
fixedCols = 4;
31+
fixedRowHeight = 100;
32+
ratioGutter = 1;
33+
fitListHeight = '400px';
34+
ratio = '4:1';
35+
}

src/demo-app/a11y/routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {Routes} from '@angular/router';
22
import {ButtonAccessibilityDemo} from './button/button-a11y';
33
import {CheckboxAccessibilityDemo} from './checkbox/checkbox-a11y';
4+
import {GridListAccessibilityDemo} from './grid-list/grid-list-a11y';
45
import {AccessibilityHome} from './a11y';
56

67
export const ACCESSIBILITY_DEMO_ROUTES: Routes = [
78
{path: '', component: AccessibilityHome},
89
{path: 'button', component: ButtonAccessibilityDemo},
910
{path: 'checkbox', component: CheckboxAccessibilityDemo},
11+
{path: 'grid-list', component: GridListAccessibilityDemo},
1012
];

0 commit comments

Comments
 (0)