-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2606 from abpframework/feature/toast-component
feat(theme-shared): new toast and confirmation components
- Loading branch information
Showing
28 changed files
with
727 additions
and
367 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
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
56 changes: 0 additions & 56 deletions
56
npm/ng-packs/packages/theme-shared/src/lib/abstracts/toaster.ts
This file was deleted.
Oops, something went wrong.
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
17 changes: 17 additions & 0 deletions
17
npm/ng-packs/packages/theme-shared/src/lib/animations/toast.animations.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,17 @@ | ||
import { animate, query, style, transition, trigger } from '@angular/animations'; | ||
|
||
export const toastInOut = trigger('toastInOut', [ | ||
transition('* <=> *', [ | ||
query( | ||
':enter', | ||
[ | ||
style({ opacity: 0, transform: 'translateY(20px)' }), | ||
animate('350ms ease', style({ opacity: 1, transform: 'translateY(0)' })), | ||
], | ||
{ optional: true }, | ||
), | ||
query(':leave', animate('450ms ease', style({ opacity: 0 })), { | ||
optional: true, | ||
}), | ||
]), | ||
]); |
34 changes: 34 additions & 0 deletions
34
...g-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class="confirmation show" *ngIf="visible"> | ||
<div class="confirmation-backdrop"></div> | ||
<div class="confirmation-dialog"> | ||
<div class="icon-container" [ngClass]="data.severity" *ngIf="data.severity"> | ||
<i class="fa icon" [ngClass]="iconClass"></i> | ||
</div> | ||
<div class="content"> | ||
<h1 class="title" *ngIf="data.title"> | ||
{{ data.title | abpLocalization: data.options?.titleLocalizationParams }} | ||
</h1> | ||
<p class="message" *ngIf="data.message"> | ||
{{ data.message | abpLocalization: data.options?.messageLocalizationParams }} | ||
</p> | ||
</div> | ||
<div class="footer"> | ||
<button | ||
id="cancel" | ||
class="confirmation-button confirmation-button-reject" | ||
*ngIf="!data?.options?.hideCancelBtn" | ||
(click)="close(reject)" | ||
> | ||
{{ data.options?.cancelText || 'AbpUi::Cancel' | abpLocalization }} | ||
</button> | ||
<button | ||
id="confirm" | ||
class="confirmation-button confirmation-button-approve" | ||
*ngIf="!data?.options?.hideYesBtn" | ||
(click)="close(confirm)" | ||
> | ||
{{ data.options?.yesText || 'AbpUi::Yes' | abpLocalization }} | ||
</button> | ||
</div> | ||
</div> | ||
</div> |
120 changes: 120 additions & 0 deletions
120
...g-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss
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,120 @@ | ||
.confirmation { | ||
position: fixed; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
display: none; | ||
place-items: center; | ||
z-index: 1060; | ||
&.show { | ||
display: grid; | ||
} | ||
.confirmation-backdrop { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100vw; | ||
height: 100vh; | ||
background-color: rgba(#000, 0.7); | ||
z-index: 1061 !important; | ||
} | ||
.confirmation-dialog { | ||
display: flex; | ||
flex-direction: column; | ||
margin: 20px auto; | ||
padding: 0; | ||
border: none; | ||
border-radius: 10px; | ||
min-width: 450px; | ||
min-height: 300px; | ||
background-color: #fff; | ||
box-shadow: 0 0 10px -5px rgba(#000, 0.5); | ||
z-index: 1062 !important; | ||
.icon-container { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin: 0 0 10px 0; | ||
padding: 20px; | ||
.icon { | ||
width: 100px; | ||
height: 100px; | ||
stroke-width: 1; | ||
fill: #fff; | ||
font-size: 80px; | ||
text-align: center; | ||
} | ||
&.neutral .icon { | ||
} | ||
&.info .icon { | ||
stroke: #2f96b4; | ||
color: #2f96b4; | ||
} | ||
&.success .icon { | ||
stroke: #51a351; | ||
color: #51a351; | ||
} | ||
&.warning .icon { | ||
stroke: #f89406; | ||
color: #f89406; | ||
} | ||
&.error .icon { | ||
stroke: #bd362f; | ||
color: #bd362f; | ||
} | ||
} | ||
.content { | ||
flex-grow: 1; | ||
display: block; | ||
.title { | ||
display: block; | ||
margin: 0; | ||
padding: 0; | ||
font-size: 27px; | ||
font-weight: 600; | ||
text-align: center; | ||
} | ||
.message { | ||
display: block; | ||
margin: 10px auto; | ||
padding: 0; | ||
color: #777; | ||
font-size: 16px; | ||
font-weight: 400; | ||
text-align: center; | ||
} | ||
} | ||
.footer { | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
margin: 10px 0 0 0; | ||
padding: 20px; | ||
width: 100%; | ||
.confirmation-button { | ||
display: inline-block; | ||
margin: 0px 5px; | ||
padding: 10px 20px; | ||
border: none; | ||
border-radius: 6px; | ||
color: #777; | ||
font-size: 14px; | ||
font-weight: 600; | ||
background-color: #eee; | ||
&:hover { | ||
background-color: darken(#eee, 5); | ||
} | ||
&-reject { | ||
} | ||
&-approve { | ||
background-color: #2f96b4; | ||
color: #fff; | ||
&:hover { | ||
background-color: darken(#2f96b4, 5); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.