Skip to content

Commit 1f8390d

Browse files
devversionandrewseguin
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 846899d commit 1f8390d

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
@@ -7,6 +7,7 @@ import {DemoMaterialModule} from '../demo-material-module';
77
import {AccessibilityHome, AccessibilityDemo} from './a11y';
88
import {ButtonAccessibilityDemo} from './button/button-a11y';
99
import {CheckboxAccessibilityDemo} from './checkbox/checkbox-a11y';
10+
import {GridListAccessibilityDemo} from './grid-list/grid-list-a11y';
1011
import {RadioAccessibilityDemo} from './radio/radio-a11y';
1112

1213
@NgModule({
@@ -32,6 +33,7 @@ export class AccessibilityRoutingModule {}
3233
AccessibilityHome,
3334
ButtonAccessibilityDemo,
3435
CheckboxAccessibilityDemo,
36+
GridListAccessibilityDemo,
3537
RadioAccessibilityDemo,
3638
]
3739
})

src/demo-app/a11y/a11y.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ 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
{name: 'Radio buttons', route: 'radio'},
2324
];
2425
}
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,12 +1,14 @@
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 {RadioAccessibilityDemo} from './radio/radio-a11y';
56
import {AccessibilityHome} from './a11y';
67

78
export const ACCESSIBILITY_DEMO_ROUTES: Routes = [
89
{path: '', component: AccessibilityHome},
910
{path: 'button', component: ButtonAccessibilityDemo},
1011
{path: 'checkbox', component: CheckboxAccessibilityDemo},
12+
{path: 'grid-list', component: GridListAccessibilityDemo},
1113
{path: 'radio', component: RadioAccessibilityDemo},
1214
];

0 commit comments

Comments
 (0)