-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(igxBanner): refactor banner, tests WIP
- Loading branch information
1 parent
15bcdf2
commit 96bea1b
Showing
6 changed files
with
99 additions
and
93 deletions.
There are no files selected for viewing
28 changes: 15 additions & 13 deletions
28
projects/igniteui-angular/src/lib/banner/banner.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,25 +1,27 @@ | ||
<igx-expansion-panel #expansionPanel (onCollapsed)="onExpansionPanelClose($event)" (onExpanded)="onExpansionPanelOpen($event)" [collapsed]="collapsed"> | ||
<igx-expansion-panel #expansionPanel (onCollapsed)="onExpansionPanelClose()" (onExpanded)="onExpansionPanelOpen()" | ||
[collapsed]="collapsed"> | ||
<igx-expansion-panel-body> | ||
<div class="igx-banner" *ngIf="useDefaultTemplate"> | ||
<div class="igx-banner"> | ||
<div class="igx-banner__message"> | ||
<div class="igx-banner__illustration"> | ||
<igx-icon *ngIf="icon" fontSet="material">{{icon}}</igx-icon> | ||
<div *ngIf="bannerIcon" class="igx-banner__illustration"> | ||
<ng-content select="igx-icon"></ng-content> | ||
</div> | ||
<span class="igx-banner__text"> | ||
{{message}} | ||
<ng-content></ng-content> | ||
</span> | ||
</div> | ||
<div class="igx-banner__actions"> | ||
<div class="igx-banner__row"> | ||
<button igxButton="flat" igxRipple #dismissButton *ngIf="dismissButtonText" (click)="dismiss()"> | ||
{{dismissButtonText}} | ||
</button> | ||
<button igxButton="flat" igxRipple #confirmButton *ngIf="confirmButtonText" (click)="confirm()"> | ||
{{confirmButtonText}} | ||
</button> | ||
<ng-container *ngIf="useDefaultTemplate"> | ||
<button igxButton="flat" igxRipple (click)="close()"> | ||
Dismiss | ||
</button> | ||
</ng-container> | ||
<ng-container *ngIf="!useDefaultTemplate"> | ||
<ng-content select="igx-banner-actions"></ng-content> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</div> | ||
<ng-content *ngIf="!useDefaultTemplate"></ng-content> | ||
</igx-expansion-panel-body> | ||
</igx-expansion-panel> | ||
</igx-expansion-panel> |
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
8 changes: 8 additions & 0 deletions
8
projects/igniteui-angular/src/lib/banner/banner.directives.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Directive } from '@angular/core'; | ||
|
||
// tslint:disable:directive-selector | ||
@Directive({ | ||
selector: 'igx-banner-actions' | ||
}) | ||
export class IgxBannerActionsDirective { | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
<div class="sample-wrapper"> | ||
<igx-banner #bannerNoSafeConnection message="Your connections is not private!" icon="lock" [dismissButtonText]="'Reload!!'" | ||
[confirmButtonText]="'Advanced'" (onOpen)="onOpen($event)" (onClose)="onClose($event)" (onButtonClick)="onButtonClick($event)"> | ||
<igx-banner #bannerNoSafeConnection (onOpen)="onOpen($event)" (onClose)="onClose($event)"> | ||
Your connections is not private! | ||
<igx-icon>lock</igx-icon> | ||
</igx-banner> | ||
<igx-banner #bannerCookies (onOpen)="onOpen($event)" (onClose)="onClose($event)" (onButtonClick)="onButtonClick($event)"> | ||
<div style="width: 100%;"> | ||
<h5 style="text-align: center">YOUR COOKIES SETTINGS</h5> | ||
<hr> | ||
<span>We asks you to accept cookies for performance, social media and advertising purpose. To get more | ||
information click on 'more information' button</span> | ||
<span>Do you accept these cookies and the processing of personal data involved?</span> | ||
<section class="sample-column"> | ||
<button igxButton="flat" igxRipple (click)="moreInfo()">MORE INFORMATION</button> | ||
<button igxButton="flat" igxRipple (click)="accept()">YES, I ACCEPT</button> | ||
</section> | ||
</div> | ||
|
||
<igx-banner #bannerCookies (onOpen)="onOpen($event)" (onClose)="onClose($event)"> | ||
<igx-icon>settings</igx-icon> | ||
<h5 style="text-align: center">YOUR COOKIES SETTINGS</h5> | ||
<hr> | ||
<span>We asks you to accept cookies for performance, social media and advertising purpose. To get more | ||
information click on 'more information' button</span> | ||
<span>Do you accept these cookies and the processing of personal data involved?</span> | ||
<igx-banner-actions> | ||
<button igxButton="flat" igxRipple (click)="moreInfo($event)">MORE INFORMATION</button> | ||
<button igxButton="flat" igxRipple (click)="accept($event)">YES, I ACCEPT</button> | ||
</igx-banner-actions> | ||
</igx-banner> | ||
<app-page-header title="Banner"> | ||
Allows the user to add banners to the application. | ||
</app-page-header> | ||
<div class="sample-content"> | ||
<section class="sample-column"> | ||
<button igxButton="flat" igxRipple (click)="toggle()">Toggle</button> | ||
<button igxButton="raised" igxRipple (click)="toggleCustomBanner($event)">Toggle Cookies Banner</button> | ||
</section> | ||
</div> | ||
</div> |
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