mirror of https://github.com/abpframework/abp.git
5 changed files with 90 additions and 69 deletions
@ -1,79 +1,74 @@ |
|||||
import { animate, animation, style } from '@angular/animations'; |
import { animate, animation, style } from '@angular/animations'; |
||||
|
|
||||
export const fadeIn = animation( |
export const fadeIn = animation([style({ opacity: '0' }), animate('{{ time}} {{ easing }}', style({ opacity: '1' }))], { |
||||
[style({ opacity: '0', display: '{{ display }}' }), animate('{{ time}} {{ easing }}', style({ opacity: '1' }))], |
params: { time: '350ms', easing: 'ease' }, |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block' } } |
}); |
||||
); |
|
||||
|
|
||||
export const fadeOut = animation( |
export const fadeOut = animation( |
||||
[ |
[style({ opacity: '1' }), animate('{{ time}} {{ easing }}', style({ opacity: '0' }))], |
||||
style({ opacity: '1' }), |
{ params: { time: '350ms', easing: 'ease' } }, |
||||
animate('{{ time}} {{ easing }}', style({ opacity: '0' })), |
|
||||
style({ opacity: '0', display: 'none' }) |
|
||||
], |
|
||||
{ params: { time: '350ms', easing: 'ease' } } |
|
||||
); |
); |
||||
|
|
||||
export const fadeInDown = animation( |
export const fadeInDown = animation( |
||||
[ |
[ |
||||
style({ opacity: '0', display: '{{ display }}', transform: '{{ transform }} translateY(-20px)' }), |
style({ opacity: '0', transform: '{{ transform }} translateY(-20px)' }), |
||||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })) |
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })), |
||||
], |
], |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
||||
); |
); |
||||
|
|
||||
export const fadeInUp = animation( |
export const fadeInUp = animation( |
||||
[ |
[ |
||||
style({ opacity: '0', display: '{{ display }}', transform: '{{ transform }} translateY(20px)' }), |
style({ opacity: '0', transform: '{{ transform }} translateY(20px)' }), |
||||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })) |
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })), |
||||
], |
], |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
||||
); |
); |
||||
|
|
||||
export const fadeInLeft = animation( |
export const fadeInLeft = animation( |
||||
[ |
[ |
||||
style({ opacity: '0', display: '{{ display }}', transform: '{{ transform }} translateX(20px)' }), |
style({ opacity: '0', transform: '{{ transform }} translateX(20px)' }), |
||||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })) |
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })), |
||||
], |
], |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
||||
); |
); |
||||
|
|
||||
export const fadeInRight = animation( |
export const fadeInRight = animation( |
||||
[ |
[ |
||||
style({ opacity: '0', display: '{{ display }}', transform: '{{ transform }} translateX(-20px)' }), |
style({ opacity: '0', transform: '{{ transform }} translateX(-20px)' }), |
||||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })) |
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })), |
||||
], |
], |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
||||
); |
); |
||||
|
|
||||
export const fadeOutDown = animation( |
export const fadeOutDown = animation( |
||||
[ |
[ |
||||
style({ opacity: '1', display: '{{ display }}', transform: '{{ transform }} translateY(0)' }), |
style({ opacity: '1', transform: '{{ transform }} translateY(0)' }), |
||||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(20px)' })) |
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(20px)' })), |
||||
], |
], |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
||||
); |
); |
||||
|
|
||||
export const fadeOutUp = animation( |
export const fadeOutUp = animation( |
||||
[ |
[ |
||||
style({ opacity: '1', display: '{{ display }}', transform: '{{ transform }} translateY(0)' }), |
style({ opacity: '1', transform: '{{ transform }} translateY(0)' }), |
||||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(-20px)' })) |
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(-20px)' })), |
||||
], |
], |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
||||
); |
); |
||||
|
|
||||
export const fadeOutLeft = animation( |
export const fadeOutLeft = animation( |
||||
[ |
[ |
||||
style({ opacity: '1', display: '{{ display }}', transform: '{{ transform }} translateX(0)' }), |
style({ opacity: '1', transform: '{{ transform }} translateX(0)' }), |
||||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(20px)' })) |
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(20px)' })), |
||||
], |
], |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
||||
); |
); |
||||
|
|
||||
export const fadeOutRight = animation( |
export const fadeOutRight = animation( |
||||
[ |
[ |
||||
style({ opacity: '1', display: '{{ display }}', transform: '{{ transform }} translateX(0)' }), |
style({ opacity: '1', transform: '{{ transform }} translateX(0)' }), |
||||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(-20px)' })) |
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(-20px)' })), |
||||
], |
], |
||||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
||||
); |
); |
||||
|
|||||
@ -1,14 +1,12 @@ |
|||||
import { trigger, state, style, transition, useAnimation } from '@angular/animations'; |
import { transition, trigger, useAnimation } from '@angular/animations'; |
||||
import { fadeInDown, fadeOut, fadeIn } from '../../animations'; |
import { fadeIn, fadeInDown, fadeOut } from '../../animations/fade.animations'; |
||||
|
|
||||
export const backdropAnimation = trigger('backdrop', [ |
export const backdropAnimation = trigger('backdrop', [ |
||||
state('void', style({ opacity: '0' })), |
transition(':enter', useAnimation(fadeIn)), |
||||
state('*', style({ opacity: '1' })), |
transition(':leave', useAnimation(fadeOut)), |
||||
transition('void => *', useAnimation(fadeIn)), |
|
||||
transition('* => void', useAnimation(fadeOut)) |
|
||||
]); |
]); |
||||
|
|
||||
export const dialogAnimation = trigger('dialog', [ |
export const dialogAnimation = trigger('dialog', [ |
||||
transition('void => *', useAnimation(fadeInDown)), |
transition(':enter', useAnimation(fadeInDown)), |
||||
transition('* => void', useAnimation(fadeOut)) |
transition(':leave', useAnimation(fadeOut)), |
||||
]); |
]); |
||||
|
|||||
@ -1,21 +1,29 @@ |
|||||
<div class="modal {{ modalClass }}" tabindex="-1" role="dialog" *ngIf="visible"> |
<ng-container *ngIf="visible"> |
||||
<div class="modal-backdrop" [@backdrop]="visible" (click)="close()"></div> |
<div class="modal show {{ modalClass }}" tabindex="-1" role="dialog"> |
||||
<div id="abp-modal-dialog" class="modal-dialog modal-{{ size }}" role="document" [@dialog]="visible" #abpModalContent> |
<div class="modal-backdrop" [@backdrop]="isModalOpen" (click)="close()"></div> |
||||
<div id="abp-modal-content" class="modal-content"> |
<div |
||||
<div id="abp-modal-header" class="modal-header"> |
id="abp-modal-dialog" |
||||
<ng-container *ngTemplateOutlet="abpHeader"></ng-container> |
class="modal-dialog modal-{{ size }}" |
||||
|
role="document" |
||||
<button id="abp-modal-close-button" type="button" class="close" aria-label="Close" (click)="close()"> |
[@dialog]="isModalOpen" |
||||
<span aria-hidden="true">×</span> |
#abpModalContent |
||||
</button> |
> |
||||
</div> |
<div id="abp-modal-content" class="modal-content"> |
||||
<div id="abp-modal-body" class="modal-body"> |
<div id="abp-modal-header" class="modal-header"> |
||||
<ng-container *ngTemplateOutlet="abpBody"></ng-container> |
<ng-container *ngTemplateOutlet="abpHeader"></ng-container> |
||||
</div> |
|
||||
<div id="abp-modal-footer" class="modal-footer"> |
<button id="abp-modal-close-button" type="button" class="close" aria-label="Close" (click)="close()"> |
||||
<ng-container *ngTemplateOutlet="abpFooter"></ng-container> |
<span aria-hidden="true">×</span> |
||||
|
</button> |
||||
|
</div> |
||||
|
<div id="abp-modal-body" class="modal-body"> |
||||
|
<ng-container *ngTemplateOutlet="abpBody"></ng-container> |
||||
|
</div> |
||||
|
<div id="abp-modal-footer" class="modal-footer"> |
||||
|
<ng-container *ngTemplateOutlet="abpFooter"></ng-container> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
|
<ng-content></ng-content> |
||||
</div> |
</div> |
||||
<ng-content></ng-content> |
</ng-container> |
||||
</div> |
|
||||
|
|||||
Loading…
Reference in new issue