-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(igxExpansionPanel): update styles, remove wrappers, adjust tests, …
- Loading branch information
1 parent
b9d5cbb
commit 688fbda
Showing
6 changed files
with
76 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 22 additions & 6 deletions
28
projects/igniteui-angular/src/lib/expansion-panel/expansion-panel-body.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,34 @@ | ||
import { Component, HostBinding, Inject, forwardRef, ElementRef } from '@angular/core'; | ||
import { Component, HostBinding, Inject, forwardRef, ElementRef, Input } from '@angular/core'; | ||
import { IgxExpansionPanelComponent } from './expansion-panel.component'; | ||
|
||
@Component({ | ||
// tslint:disable-next-line:directive-selector | ||
selector: 'igx-expansion-panel-body', | ||
template: `<div style="display:flex"> | ||
<ng-content></ng-content> | ||
</div>` | ||
template: ` | ||
<ng-content></ng-content>` | ||
}) | ||
export class IgxExpansionPanelBodyComponent { | ||
constructor(@Inject(forwardRef(() => IgxExpansionPanelComponent)) | ||
public panel: IgxExpansionPanelComponent, public element: ElementRef) { | ||
} | ||
@HostBinding('class.igx-expansion-panel__header-body') | ||
public cssClass = `igx-expansion-panel__header-body`; | ||
@HostBinding('class.igx-expansion-panel__body') | ||
public cssClass = `igx-expansion-panel__body`; | ||
public _title = ''; | ||
|
||
@Input() | ||
@HostBinding('attr.aria-label') | ||
public label = this.panel.id + '-region'; | ||
|
||
@Input() | ||
@HostBinding('attr.aria-labelledby') | ||
public get labelledBy(): string { | ||
return this.panel.title ? this.panel.title.id : this._title; | ||
} | ||
public set labelledBy(val: string) { | ||
this._title = val; | ||
} | ||
|
||
@Input() | ||
@HostBinding('attr.role') | ||
public role = 'region'; | ||
} |
6 changes: 2 additions & 4 deletions
6
projects/igniteui-angular/src/lib/expansion-panel/expansion-panel.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
|
||
<ng-content select="igx-expansion-panel-header"></ng-content> | ||
<div #collapseBody [attr.aria-labelledby] = "labelledby" [attr.role] = "'region'" | ||
[attr.aria-label] = "label || id + '-region'"> | ||
<ng-content *ngIf="!collapsed" select="igx-expansion-panel-body"></ng-content> | ||
</div> | ||
<ng-content *ngIf="!collapsed" select="igx-expansion-panel-body"></ng-content> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters