Skip to content

demo(expansion): Add expansion panel accessibility demo page #6703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/demo-app/a11y/a11y-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
DialogNeptuneIFrameDialog,
DialogWelcomeExampleDialog
} from './dialog/dialog-a11y';

import {ExpansionPanelAccessibilityDemo} from './expansion/expansion-a11y';
import {GridListAccessibilityDemo} from './grid-list/grid-list-a11y';
import {RadioAccessibilityDemo} from './radio/radio-a11y';
import {ToolbarAccessibilityDemo} from './toolbar/toolbar-a11y';
Expand Down Expand Up @@ -76,6 +76,7 @@ export class AccessibilityRoutingModule {}
DialogNeptuneExampleDialog,
DialogNeptuneIFrameDialog,
DialogWelcomeExampleDialog,
ExpansionPanelAccessibilityDemo,
GridListAccessibilityDemo,
IconAccessibilityDemo,
InputAccessibilityDemo,
Expand Down
1 change: 1 addition & 0 deletions src/demo-app/a11y/a11y.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class AccessibilityDemo {
{name: 'Chips', route: 'chips'},
{name: 'Datepicker', route: 'datepicker'},
{name: 'Dialog', route: 'dialog'},
{name: 'Expansion panel', route: 'expansion'},
{name: 'Grid list', route: 'grid-list'},
{name: 'Icon', route: 'icon'},
{name: 'Input', route: 'input'},
Expand Down
53 changes: 53 additions & 0 deletions src/demo-app/a11y/expansion/expansion-a11y.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<section class="demo-expansion">
<h2>Siberian Husky</h2>
<p>Single expansion panel</p>
<mat-expansion-panel class="mat-expansion-demo-width" #myPanel>
<mat-expansion-panel-header>
<mat-panel-description>
Dog breed
</mat-panel-description>
<mat-panel-title>Siberian Husky</mat-panel-title>
</mat-expansion-panel-header>
The Siberian Husky is a medium size working dog breed that originated
in north-eastern Siberia, Russia. The breed belongs to the Spitz genetic family.
<mat-action-row>
<button mat-button (click)="myPanel.expanded = false">Cancel</button>
<a mat-button href="https://en.wikipedia.org/wiki/Siberian_Husky" target="_blank">Uncyclopedia</a>
</mat-action-row>
</mat-expansion-panel>
</section>

<section class="demo-expansion">
<h2>Dog breeds</h2>
<p>Multiple expansion panel</p>
<mat-accordion class="mat-expansion-demo-width">
<mat-expansion-panel #panel1 >
<mat-expansion-panel-header>Golden Retriever</mat-expansion-panel-header>
<p>
The Golden Retriever is a large-sized breed of dog bred as gun dogs to retrieve shot
waterfowl such as ducks and upland game birds during hunting and shooting parties, and
were named 'retriever' because of their ability to retrieve shot game undamaged.
Golden Retrievers have an instinctive love of water, and are easy to train to basic
or advanced obedience standards.
</p>
</mat-expansion-panel>
<mat-expansion-panel #panel2 [disabled]="true">
<mat-expansion-panel-header>Beagle</mat-expansion-panel-header>
<p>
The Beagle is a breed of small hound, similar in appearance to the much larger foxhound.
The beagle is a scent hound, developed primarily for hunting hare.
</p>
</mat-expansion-panel>
<mat-expansion-panel #panel3 >
<mat-expansion-panel-header>Dachshund</mat-expansion-panel-header>
<p>
The dachshund is a short-legged, long-bodied, hound-type dog breed. The standard size
dachshund was developed to scent, chase, and flush out badgers and other burrow-dwelling
animals, while the miniature ...
</p>
<mat-action-row>
<button mat-button (click)="panel3.expanded = false">Close</button>
</mat-action-row>
</mat-expansion-panel>
</mat-accordion>
</section>
6 changes: 6 additions & 0 deletions src/demo-app/a11y/expansion/expansion-a11y.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.demo-expansion {
button, a {
margin: 8px;
text-transform: uppercase;
}
}
10 changes: 10 additions & 0 deletions src/demo-app/a11y/expansion/expansion-a11y.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {Component} from '@angular/core';

@Component({
moduleId: module.id,
selector: 'expansion-a11y',
templateUrl: 'expansion-a11y.html',
styleUrls: ['expansion-a11y.css']
})
export class ExpansionPanelAccessibilityDemo {
}
2 changes: 2 additions & 0 deletions src/demo-app/a11y/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {CardAccessibilityDemo} from './card/card-a11y';
import {CheckboxAccessibilityDemo} from './checkbox/checkbox-a11y';
import {ChipsAccessibilityDemo} from './chips/chips-a11y';
import {DialogAccessibilityDemo} from './dialog/dialog-a11y';
import {ExpansionPanelAccessibilityDemo} from './expansion/expansion-a11y';
import {GridListAccessibilityDemo} from './grid-list/grid-list-a11y';
import {RadioAccessibilityDemo} from './radio/radio-a11y';
import {AccessibilityHome} from './a11y';
Expand Down Expand Up @@ -34,6 +35,7 @@ export const ACCESSIBILITY_DEMO_ROUTES: Routes = [
{path: 'chips', component: ChipsAccessibilityDemo},
{path: 'datepicker', component: DatepickerAccessibilityDemo},
{path: 'dialog', component: DialogAccessibilityDemo},
{path: 'expansion', component: ExpansionPanelAccessibilityDemo},
{path: 'grid-list', component: GridListAccessibilityDemo},
{path: 'icon', component: IconAccessibilityDemo},
{path: 'input', component: InputAccessibilityDemo},
Expand Down