coreui-angular-ex-dev
Version:
CoreUI Components Library for Angular
42 lines (39 loc) • 1.26 kB
text/typescript
import { Component, HostBinding, Input } from '@angular/core';
export class ModalDialogComponent {
/**
* Align the modal in the center or top of the screen.
* @type {'top' | 'center'}
*/
alignment?: 'top' | 'center';
/**
* Set modal to covers the entire user viewport.
* @type {boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'}
*/
fullscreen?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
/**
* Does the modal dialog itself scroll, or does the whole dialog scroll within the window.
* @type boolean
*/
scrollable?: boolean;
/**
* Size the component small, large, or extra large.
*/
size?: 'sm' | 'lg' | 'xl';
get hostClasses(): any {
return {
'modal-dialog': true,
'modal-dialog-centered': this.alignment === 'center',
'modal-fullscreen': this.fullscreen === true,
[`modal-fullscreen-${this.fullscreen}-down`]: this.fullscreen,
'modal-dialog-scrollable': this.scrollable,
[`modal-${this.size}`]: this.size
};
}
}