@engie-group/fluid-design-system-angular
Version:
Fluid Design System Angular
63 lines (54 loc) • 1.38 kB
text/typescript
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { SpinnerSize, SpinnerVariant } from './spinner.model';
export class SpinnerComponent {
/**
* @ignore
*/
private spinnerClassName = 'nj-spinner';
/**
* Spinner variant
*/
variant: SpinnerVariant = 'normal';
/**
* Spinner size
*/
size: SpinnerSize = 'md';
/**
* Whether to render the content of the spinner,
* the wrapper of the component beeing always rendered
* to make the live region work properly.
*/
isLoading: boolean;
/**
* Whether the spinner is rendered as a block (<div>) or an inline (<span>) element.
*/
isBlock?: boolean = true;
constructor() {}
/**
* @ignore
*/
getSpinnerVariantClass(): string {
if (!this.variant || this.variant === 'normal') {
return '';
}
return `${this.spinnerClassName}--${this.variant}`;
}
/**
* @ignore
*/
getSpinnerSizeClass(): string {
if (!this.size) {
return '';
}
return `${this.spinnerClassName}--${this.size}`;
}
}